Welcome, Guest. Please Login or Register.  • Help
SMF Underground
+ SHMUP-DEV » SHMUP DEV FORUMS » Assistance
|-+ Another Way to design enemy movements

Pages: [1]   Go Down
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read December 23, 2005, 06:18:26 PM #0
joe

Another Way to design enemy movements

I've never used this technique for a long time, but a few years ago when I worked on a Amiga Shoot'em'Up Game I used an interesting technique to design my enemy attack waves, which I want to share with you:

Instead of using an editor where you can create splines, lines, use math formulas to create your movement I used another approach. I try to describe it step by step on how I created an enemy wave using the editor, after that I will describe the technique behind.

First of all I enter some values, like X-Speed, Y-Speed, Acceleration. These values can be different in each wave.

The I choose a starting point on the screen (this is only important for the editor, the value won't be saved).

Then the Editor changes into record mode, which means it displays me a point. Now I can move this point using the arrow-keys or joystick. Depending on my values (Speed, Acc.) I'm able to create rectangle movements or sine-like movements.

Pressing ESC saves the wave into an array and jumps back into Editor mode.

The data's of the movement will be saved in a big array whereas today I think a linked list would be better. Interesting its that I don't save the real points, but only the keys who have been pressed during a frame.

For example if Y-Speed has the value 4 and Start Y-Point is 0 and then I press KeyDown then the next value who will be saved is the not the new Y-Coordinate (4) but a Bitmask will be saved which can contain the following values (AND relation is possible):

KEY_LEFT (%1000)
KEY_RIGHT (%0100)
KEY_DOWN (%0010)
KEY_UP (%0001)

Of course you can also add to record the Fire-Button, so you can design when each wave should fire at the player, or you can define other keys for various events.

Once you have recorded a wave in the editor you have the possibility (with this technique) to change the acceleration or x-speed value to get a different wave.

Let me know what you think of this approach. Where do you see the advantages and disadvantages.


Jochen Heizmann, Germany
Absolute Blue - Side-Scrolling Shoot'em'up-Game
www.intermediaware.com
Offline  
Read December 23, 2005, 10:00:54 PM #1
Taiphoz

Re: Another Way to design enemy movements

I can go one better than that, I use the mouse, and Paint my path holding the left mouse button down starts recording and a waypoint is dropped 1 a second, then save the path.

Using this method needs a steady hand depending on how many waypoints your path uses, ie how many it drops per second, if your dropping one a second you can have a detailed path and still have nice smooth motion..

Splines are nice but some times they are overkill.


Offline  
Read December 23, 2005, 10:02:25 PM #2
Matt McFarland

Re: Another Way to design enemy movements

I can go one better than that, I use the mouse, and Paint my path holding the left mouse button down starts recording and a waypoint is dropped 1 a second, then save the path.

Using this method needs a steady hand depending on how many waypoints your path uses, ie how many it drops per second, if your dropping one a second you can have a detailed path and still have nice smooth motion..

Splines are nice but some times they are overkill.

That would be awesome if you made a tutorial for that Smiley


<a href="http://www.mattmcfarland.com/flash/myFlashSig.swf" target="_blank">http://www.mattmcfarland.com/flash/myFlashSig.swf</a>
Offline  
Read December 23, 2005, 10:07:59 PM #3
Taiphoz

Re: Another Way to design enemy movements

I might do, I will probably be using this system in the shooter I am designing just now, Its gona be in the same vain as waypoint so the camera angle is going to be weired, and as such the enemy flight paths will have to be customized so that the full path is traveled on screen.

Should be a good game once its done. will be using some of the same models from roids.


Offline  
Read December 23, 2005, 10:12:20 PM #4
joe

Re: Another Way to design enemy movements

Quote
I can go one better than that, I use the mouse, and Paint my path holding the left mouse button down starts recording and a waypoint is dropped 1 a second, then save the path.

First, I had also done it that way, but it was hard to get smooth acceleration and moves, and the waves always didn't move like I wanted them to do. But probably it was only some boring code I used - If I remember right I didn't try it for a long time :-)


Jochen Heizmann, Germany
Absolute Blue - Side-Scrolling Shoot'em'up-Game
www.intermediaware.com
Offline  
Read December 24, 2005, 05:53:28 PM #5
Taiphoz

Re: Another Way to design enemy movements

you should give it another go joe, the best thing about painting a path with a mouse thats dropping waypoints, is that you can if you need to click and drag and move any given waypoint to fine tune the path better.

If your a smart arse like I was at the time you can also add rotation to the waypoints and make your sprites follow the rotation from one waypoint to the next.

I used that to make my enemies turn and dive etc.


Offline  
Read December 25, 2005, 12:06:49 AM #6
Matt McFarland

Re: Another Way to design enemy movements

I would really like to see a tutorial on how to do this, this would be great for everyone!!!   Roll Eyes


<a href="http://www.mattmcfarland.com/flash/myFlashSig.swf" target="_blank">http://www.mattmcfarland.com/flash/myFlashSig.swf</a>
Offline  
Read December 28, 2005, 12:13:21 PM #7
Erebel55

Re: Another Way to design enemy movements

Yeah a tutorial on that would be great. Smiley
Offline  
Read December 28, 2005, 08:15:51 PM #8
denthorq

Re: Another Way to design enemy movements

Use Sin() and Cos() by this it's easier to control enemy movements and tweaking will give you lots of options.


X-Fighter: Dark Empire - Coming 2006 http://www.blitsoft.com
Offline  
Read December 28, 2005, 08:31:51 PM #9
paladin

Re: Another Way to design enemy movements

why not use XML?


needs more particles...
Offline  
Pages: [1]   Go Up
Jump to:  

Page created in 0.453 seconds with 18 queries.