Question about level programming

Started by
3 comments, last by Pattyfatieo 12 years, 6 months ago
Hello fellow community, I am a hobby programmer and have decided to try and make a 2d side scroller in XNA & C#. the problem that I have is how in general ate levels created? Ist it all programmatically, does this mean I need to create a level maker and register every position of every objects ? Or is every level in a game created using random numbers? Or is there another solution?

Thank you very much! Cheers

Pattyfatieo
Advertisement
Depends on the game, but most side scrollers use level editors.
"I will personally burn everything I've made to the fucking ground if I think I can catch them in the flames."
~ Gabe
"I don't mean to rush you but you are keeping two civilizations waiting!"
~ Cavil, BSG.
"If it's really important to you that other people follow your True Brace Style, it just indicates you're inexperienced. Go find something productive to do."
[size=2]~ Bregma

"Well, you're not alone.


There's a club for people like that. It's called Everybody and we meet at the bar[size=2].

"

[size=2]~

[size=1]Antheus
Side scrollers should write streaming data from a file to a round buffer that is used as a circle to avoid moving data.
To save space in a desert or ocean, run length encoding can be used to compress levels.

The solid world should be a 2D tile array so that detecting collisions does not have to check against every tile in the world.
Only things that are moving should store positions but they are created and destroyed when needed.

A level editor can be fun for the player but without randomly generated levels, you will only have a few hours before you must play the same levels again.
In case that you want to play the same random level again, use a deterministic random generator with a userdefined seed.
Have a look at something like http://www.mapeditor.org/

Free software, people have said nice things about it; defn saves you writing your own.

If you have your heart set on writing your own, you could just write something that reads text files and (say) beautifies the output.

So # means put a ladder section here, % is earth, O is a rock _ means a thin grass cover, etc. The loader could pick randomly one of several variants for each of the tiles.

Then you can edit the levels in emacs or visual studio or something.
Thank you very much for the replies ! Did indeed help :)

This topic is closed to new replies.

Advertisement