Placing enemies in the map/world

Started by
5 comments, last by Brain 9 years, 1 month ago

Hi!

I am currently creating a space shooter for practicing purposes and I got stuck on how to efficiently place enemies in the map and create a level.

One way is to hard code the enemies' positions on the map but that would obviously take too much time to create new levels and test the gameplay (level of difficulty more precisely).

I could also make random waves throughout the map but I'm considering this, my last resource since it'd be too 'inconsistent'.

Could someone help with some ideas on how to do it?

EDIT: I am using SFML btw (forgot to mention biggrin.png )

Advertisement

Depends on how you're game works, and how your map works. Assuming it's constantly scrolling one direction, then the "location" in the map is really just a time from the beginning of a level. So, you could just have a simple data file (using json, for example), that details when an enemy comes into the map, where it starts from, and possibly other values (it's initial velocity, etc.).

If you're using a map editor (like Tiled), then it should be easy to set locations within the map to place your enemies, and, once they come onto the screen, they become active.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

IMHO this is rather a game design question, instead of how it is achieved.

Do you want a scripted game, such that everytime you play it, you have to fight against the same enemies? Then maybe use a scripting approach (like using Lua, JS, C#, ...). You could also even write your own Game "World"-Editor.

As you mentioned - you could also go the random-Wave path. If this is too 'insconsistent' for you, you could try to parametrize those waves (delay until next wave, change in difficulty / enemy count, ...). You could even merge this idea with the previous idea: fully scripted waves. To test, you could then create an ingame command for reloading the script/level.

For that script you could for example put per-wave parameters separated into a simple text file.

BUT There is a lot more you can do about this. It's your decision.

I hope I could give some helpful ideas :)

Thanks for the quick reply guys!

If you're using a map editor (like Tiled), then it should be easy to set locations within the map to place your enemies, and, once they come onto the screen, they become active.

Well, I am not using any map editor. I could, but that would be just to place enemies


As you mentioned - you could also go the random-Wave path. If this is too 'insconsistent' for you, you could try to parametrize those waves (delay until next wave, change in difficulty / enemy count, ...). You could even merge this idea with the previous idea: fully scripted waves. To test, you could then create an ingame command for reloading the script/level.

For that script you could for example put per-wave parameters separated into a simple text file.

I've been thinking of using json as BeerNutts said, then I just get the elapsed time and place different waves with different combination of enemies. Removing the timed waves and just spawn new waves once the player defeats every enemies in the current one seems a nice approach as well.

The problem is: As you said, this is rather a game design question and that's something that I need to improve...

Well, I am not using any map editor. I could, but that would be just to place enemies


That's a perfectly valid reason to use such an editor. ANY reason is generally a valid reason. One of the big things that separates the pros from the novices in game development is how much time and effort they put into tools, either in finding existing ones, modifying existing ones, or creating whole new ones, and then making sure the tools excels at solving the problems of the game in question.

Sean Middleditch – Game Systems Engineer – Join my team!

Interesting question.

As I've tried to prototype a SHMUP game some time ago I can appreciate some complications.

Is your game something like this?

Personally I haven't found existing editors much of an help - maybe I haven't searched hard enough. The main problem is not much the code but rather figuring out the numbers to put there as enemy patterns must be effectively authored in screen space and easily visualized with full time control for fast iteration/tweaking.

What I would do today: 1) have another googling at tools 2) hack together a HTML5 <canvas> utility to pour out JSON data.

This is in contrast to more static design such as in FPS: I've had no trouble adapting Blender in this case but note enemy movements in this case are very different things. Given the amount of paths, it would be quite inconvenient to pack this data in Blender.

Previously "Krohm"

You might want to read my replies to this thread:

http://www.gamedev.net/topic/664386-creation-of-a-vertical-scrolling-shooter-help/

Here I outlined how I've solved this problem in the past. Hope it helps!

This topic is closed to new replies.

Advertisement