I am making a top down shooter.

Enemies will come in waves and attack in many different patterns (i.e. wave of 10 enemies flying in a elliptic curves, or a huge boss floating and shooting at you, etc.).

I'm thinking of 2 solutions:

  1. Design paths using an animation tool
  2. Hard-code paths

For the first solution, I think it will be faster to create the paths since I will be able to see them in the tool, but is it performant? There will be hundreds of flying patterns in my game.

I've also heard of BulletML, but looks like it's more for bullet-hell shmups, and there's no visual editor to design the patterns easily.

Are there other solutions to design path patterns for non-bullet-hell shmups which I haven't considered?

What are the pros/cons of each solution?

  • \$\begingroup\$ There is no "best way" to do anything on any field. Any opinion you get would just be that, an opinion. Why don't you go with the one you feel would work best for you? \$\endgroup\$ – Panda Pajama Jun 18 '14 at 9:44
  • \$\begingroup\$ As Panda Pajama said, asking for "Best way" seems like asking for opinions, which is no no here. Modify your question to be more like "Is there algorithm for path/flying patterns" or something like that. \$\endgroup\$ – Katu Jun 18 '14 at 10:42
  • \$\begingroup\$ I understand that there are many solutions for my problem. Why not let me know your opinions? I'm not trolling or starting a flame war or anything. Just let me know what you think is good. That may be a helpful hint that I can try. I think StackOverFlow and StackExchange have become too stricted. I have receive only 1 helpful answer, but TOO MANY requests for editing my question, for putting it on hold etc. \$\endgroup\$ – g8minhquan Jun 25 '14 at 9:16

This is a job for scripting, and any kind of tool you use should produce some kind of script. Since we happen to be talking about Unity, that could be C#, JS, or even Boo.

Assuming there is no general tool for pathing (and there are, Simple Waypoint System being one example), you can build one yourself:

  1. Write a few paths by hand and take note of the parts that could be parameterized.
  2. Rewrite your example code in a way that you'll be able to fill in the parameters (like a more complicated mad lib)
  3. Create data structures to hold/save/open that information.
  4. Test that the data structures can fill in the blanks - this will become a "compile" button in your tool.
  5. Create an interface to display/modify the paths.

You can then attach the behaviours produced by the tool to your objects.

It might be a bit of work up front, but if you're sure that you'll need to make hundreds of paths then it will be worth it in terms of making changes later.

| improve this answer | |
  • \$\begingroup\$ After some time trying, I recommend that using assets like Simple Waypoint System will greatly help you design movement paths. \$\endgroup\$ – g8minhquan Jul 27 '15 at 6:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.