Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Level Implimentation Theory

Author
Message
Programmer of Power
19
Years of Service
User Offline
Joined: 22nd Aug 2005
Location: Home
Posted: 20th Nov 2006 22:14
In working on designing a side-scrolling shooter and I want to implement a storyline with levels in a linear fashion.

I have 2 questions:

1) I'm wondering how to go about accessing the next level. Should I make various DBPro files and just call them all from the main file or use subroutines within a main program to access the next level.

2) Is it better to have enemies placed in a predefined spot in a level, coming in set numbers of waves, and if so, how can I set these points? Or is a randomization of enemies more efficient for coding and more fun for playing?

"I will work harder... if you ask me enough times... or give me enough coffee"
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Nov 2006 22:31 Edited at: 20th Nov 2006 22:37
Quote: "Should I make various DBPro files and just call them all from the main file or use subroutines within a main program to access the next level"


I would say neither. You should separate the levels from the game logic.

1. Decide what "features" your game will have, and how you might implement them. Your main game routine should allow all of these features to be executed.

2. Create levels as a separate entity. It might be a simple text file that describes the level in parameters, or a 3D environment with "triggers" placed for certain features.

Now you have engine and levels separated, the game can be expanded ad infinitum. There should never be a need to code specifically for each level. Also, you don't have to have every feature in every level, but the engine will allow this and any other combination.



Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 22nd Nov 2006 00:59 Edited at: 22nd Nov 2006 01:10
After I finish my Pac-Man game, I'm going to move up to Super Mario Bros. BatVink got it, make an engine which will handle tons of features, and have it load files. For example in Super Mario Bros, the jumping, AI, fighting, and pipes work exactly the same, but there's tables of data telling where to put them.

I'd be a good idea to give the levels names like "World 1-1" so the level loading routine can just increment the current level number and load that file.

Keep in mind that when I say make an engine with a ton a features, really put a ton in. If you look in the DS verison of Super Mario Bros, all the enemies and items in all the levels jump or change their direction whenever a certain instrument in the music plays. Now there's some spare development time. I find the instrument playing a good time to jump on the enemies.

About placing the enemies in random locations, it's really your choice. Most games have them in predetermined locations, however; that can make it more or less frustrating in hard levels because you can simply memorize where the enemies are, but if the level gets to long you get this:

Player: "Whew! I finally got to the top of the tower, I just can't figure out how to get past this guy."
Enemy: (gunshots)
Player: "AGHH! Now I've got to do the level all over again! It's so boring, I already know how to get past 10 minutes of easy enemies!"

Im still here
18
Years of Service
User Offline
Joined: 11th May 2006
Location: :noitacoL
Posted: 22nd Nov 2006 05:53
I'm creating a game kind of like that, you could use my idea:
I separated each level into a separate text file and then in the text file I would put a number to represent sublevel(representing different stages in the level or bosses), enemy number, the enemy's type, then it's position. I'd then just read the file as enemies are defeated to show the computer what to do. Once your done with the level, you just load the next file.

five score and seven years ago comes out march 6th. WOOT!
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 22nd Nov 2006 15:53 Edited at: 22nd Nov 2006 15:53
[edit] Nevermind.

Login to post a reply

Server time is: 2024-11-14 01:12:07
Your offset time is: 2024-11-14 01:12:07