Jump to content

Multi Level Games - How Would You Implement...


Guest Red Ocktober
 Share

Recommended Posts

Guest Red Ocktober

just a short discussion on how you guys who are making multi level (mission) games planning on implementing em...

 

how will you implement the the level change... persist the different states load a new scene,

 

or... have each level as a self contained game, and load each level as a new game which loads the state data from the previous one...

 

or, som other way...

 

 

thx...

 

--Mike

Link to comment
Share on other sites

My system is modeled after the XNA Game State Management sample. I have a GameScreen class that in the constructor requires a mapname. The GameScreen then continues to load the specified level. If the level is over then I pop the GameScreen from a stack of Screens and push a screen with post-game statistics. When the player continues I just create a new GameScreen with a different mapname.

 

http://creators.xna.com/en-US/samples/gamestatemanagement

Link to comment
Share on other sites

	// Do common stuff here
game.Update();
game.Render();

if(1==gamelevel)
{
	// Do level 1 specific stuff here
}
else
if(2==gamelevel)
{
	// Do level 2 specific stuff here
}

// Do common stuff here
gui.Draw();
game.Flip();

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Guest Red Ocktober

thx for the replies guys...

 

interesting read about the those xna people took... thx Luarens for the link...

 

i'm still up in the air about how i'll do it... first gotta get the basic engine running again...

 

--Mike

Link to comment
Share on other sites

Here is my style of multi-level games:

 

Type Tapp
Global ResX:int 
Global ResY:int
Global Depth:int
Global FullScreen:Byte
Global game:TGame

Function Start()
End Function

Function Run()
End Function

Function LoadConfig()
End Function

Function SaveConfig()
End Function

Function LoadResources()
End Function
End Type

Type TGame
Field screen:TScreen

Method Initialize()
End Method

Method Draw()
End Method

Method Update()
End Method()
End Type

Type TScreen
Field elementList:TList 'by element I mean GUI objects
Field objectList:TList 'Basically everything that can be updated/Drawn
Field World:TWorld
Field Camera:TCamera


Method Initialize()
End Method

Method Draw() abstract
Method Update() abstract
End Type

Type TGameScreen extends TScreen
Field Level:TLevel
Field player:TPlayer

Method Draw()
End Method 

Method Update()
End Method 
End Method

Type TLevel
Field basePivot:TPivot
'A lot of other info about the level'

Function Load:TLevel(path:string)
End Function 
End Type

 

I hope this gives you an idea.

Basically that's why I'm saying people shouldn't start big projects before doing at least one normal casual game where they can learn these things.

I create the game you play. I create the rulles you will obey.

Link to comment
Share on other sites

At the moment I work in so called modes.

 

mode 0 = starting the game (any pre game stuff like intro movie etc.)

mode 1 = main menu

mode 2 = loading levels

mode 3 = Ingame menu

mode 4 = ingame FPS camera

mode 5 = flying camera

 

I use worls and levels for organising levels.


  •  
  • world1_level1
  • world1_level2
  • world1_level3
  • world2_level1
  • world2_level2

Link to comment
Share on other sites

I use a "portal" object in each map. When the player touches this invisible portal (trigger) it tells the main code the name of the next map to load. This portal object is placed in the map via the Editor and has a property for next map name. The code for loading a new map is in my main exe and not Lua. Kind of like HL did it. Z is 4 Zombies uses this and a criteria system to open a door that leads to the portal. When all victims/hostages are saved, if triggers a door to open automatically. Behind the door is the portal trigger to load the next map.

Link to comment
Share on other sites

At the moment I work in so called modes.

 

mode 0 = starting the game (any pre game stuff like intro movie etc.)

mode 1 = main menu

mode 2 = loading levels

mode 3 = Ingame menu

mode 4 = ingame FPS camera

mode 5 = flying camera

 

I use worls and levels for organising levels.


  •  
  • world1_level1
  • world1_level2
  • world1_level3
  • world2_level1
  • world2_level2

 

I use something similar to this.

i5 2.7Ghz, GTS 450, 8GB Ram, Win7 x64; Win8 x64

rvlgames.com - my games

RVL Games Facebook Page, YouTube Channel

 

Blitzmax :)

Link to comment
Share on other sites

I suppose it depends on the type of game.

 

If the player has attributes which are carried through each level, e.g. fps or rpg, then you might want to preserve the player entity,controller and other stats in a single object and delete everything else.

 

If the player starts from scratch each level, e.g. magic carpet, then you could just delete everything and start afresh each level by loading a new scene/terrain etc. and creating a new player.

 

If the new level uses a different terrain than the last then ditch the terrain otherwise keep it in memory to save loading it again.

 

This could also involve all assets for maximum speed of level loading.

 

i.e.

 

Tag all assets to be deleted...

 

Parse through all of the assets needed by the new level ( or the save game you want to load )...

 

If you find a currently loaded asset you need in the new level then reposition it and unmark it for deletion...

 

If you don't find the asset then load it from disk...

 

Once you have completed building the new level delete all assets which are still marked for deletion.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...