Guest Red Ocktober Posted June 18, 2010 Share Posted June 18, 2010 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 Quote Link to comment Share on other sites More sharing options...
Laurens Posted June 18, 2010 Share Posted June 18, 2010 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 Quote Link to comment Share on other sites More sharing options...
Canardia Posted June 18, 2010 Share Posted June 18, 2010 // 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(); Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted June 18, 2010 Share Posted June 18, 2010 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 Quote Link to comment Share on other sites More sharing options...
Sanctus Posted June 19, 2010 Share Posted June 19, 2010 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. Quote I create the game you play. I create the rulles you will obey. Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 19, 2010 Share Posted June 19, 2010 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 Quote Link to comment Share on other sites More sharing options...
Rick Posted June 19, 2010 Share Posted June 19, 2010 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. Quote Link to comment Share on other sites More sharing options...
Raul Posted June 19, 2010 Share Posted June 19, 2010 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. Quote 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 More sharing options...
Guest Red Ocktober Posted June 19, 2010 Share Posted June 19, 2010 Thanks again guys for all the input... lotsa good stuff to ponder... --Mike Quote Link to comment Share on other sites More sharing options...
Shambler Posted June 20, 2010 Share Posted June 20, 2010 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.