Sign in to follow this  
Methius

Level loading, events, and layout

Recommended Posts

Hello. So, I'm working on a game right now which will be a 2D side-view platformer (think Mario w/events, or Cave Story), and as such it will need a solid level system for appropriate gameplay. I've so far found out quite some info regarding how levels work (camera positions, moving characters, tiling), but I'm still feeling kind of lost. Up to now, I've read about using XML to store level information, then using the application to generate them when needed. While this seems like a good option, I'd very much prefer to encrypt the files and hide them from users (they don't even have to be XML since it's just a convention). What's more, once the levels are in separate files, I'm totally lost as to how to generate events and other triggers such as cutscenes. I'd appreciate any suggestions regarding all this; I do know pretty much all the basic-to-intermediate stuff about programming, but game prog. logic still baffles me quite a bit. Thus, directions or general advice on how a game level's structure should be made are very welcome.

Share this post


Link to post
Share on other sites
Im going to say it, and I know many more likely will.

If you have the raw programming skill, but havent made a game yet, make tetris. Then pong, then breakout. Then go from there. I tried to resist, and in the end put the project I wanted to make on hold, figured out tetris, and everything just made more sense, it seemed alot less overwhelming.

Those 3 games will teach you ALOT. They might seem trivial, but people (many people) are going to tell you to start very simple, and with good reason.

(NOTE: you have no idea how to do the things you want to, because you have never done them before. Nothing is laid out for you, you need to generate everything yourself. Even with tetris and whatnot in you bag of tricks, things like event driven games are going to take alot of time to code, and even more to make work correctly. Its all about practice, and Im assuming that you didnt learn to ride a motorcycle in heavy trafic before learning how to ride a bike in your back yard or a field or something, so why would a game be any different?)

Share this post


Link to post
Share on other sites
I actually have some experience on game programming. I have (rather successfully) made a basic top-view 2D online shooter, and back in the days I made some stuff with Game Maker and RPGmaker.

I'm aware of how game menus should work, how game states are processed, and how game actions can be triggered to produce a continuous flow, even if my practical experience is not that extensive.

What I asked in the first post was pretty specific. Again, what I would like to know is what's an effective model for loading levels and coupling them up with events and phases of the game. I know how I can generate, or even save games by having tiles and outputting them to an XML file, and I also have worked a lot with the concept of switches, which define if certain events have been fulfilled or not.

The question here, is how do people combine these two systems up to produce a rather expandable game engine?


EDIT: I probably should mention, this is for my senior project course in college.

Share this post


Link to post
Share on other sites
What helped me a lot for this was my background as a level-designer. You could take a look at the level-design tools of other games to get some inspiration.

A common approach is to store entities and their properties in a level file: things like player start positions, enemy spawn points, route nodes, trigger areas, etc. The game can then construct the various entities while parsing the level file. I think this aspect isn't too hard to grasp, but if you're unsure about something, feel free to ask.

The second part is how these entities communicate. In a top-down shooter, you probably won't have to deal with that, but once certain in-game events need to affect other elements (button opens door, etc.), you'll need to think about this. In Half-Life, this was pretty basic: some entities could 'trigger' other entities (every entity could be given a name). For example, a trigger area would trigger it's target entity whenever the player entered it. If that target was a door, it would open, or close, depending on it's current state. In many games, that's as complex as it needs to be, but sometimes you may want to send more specific signals, or take another approach.


The best approach depends on what your game needs, but I think the above approach should be good to go for you. Just don't make it any more complex than it needs to be. :)

Share this post


Link to post
Share on other sites
I agree with the above poster that simpler is better maybe just write down on paper all you need to have stored in level files and what will be interacting with other aspects of your game. Maybe by programming sample level loaders or maybe level making tools for your game you can solve your problem but keep it very simple and just what you need.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this