Results 1 to 11 of 11
  1. #1

    Question: levels

    Hello. I have question about levels. I already know how to load new game levels (scenes) from blend files. It's very handy for game creation. But what if i would like to prevent player skiping level just by launchuing another one from my levels directory. Game is fun when it's challenging but if player can skip difficult place in level just by launching next one it's not that cool.
    So question is: is there a way in BGE (using blend files as levels) to force player finish one level before he can move to next one? Maybe somehow "lock" 2_level.blend, 3_level.blend etc, before player finished 1_level.blend. So he can't just skip 1_level.blend and open *_level.blend in blender.



  2. #2
    Member Nicholas_A's Avatar
    Join Date
    Oct 2014
    Location
    own.worldPosition
    Posts
    1,133
    At the end of the level, have a sensor object. When the player collides with it, load the next level.
    My website | My YouTube channel | My Blendswap profile | My Discord Server

    I sell custom logos for $5 (among other things). Check them out!



  3. #3
    Member JustinBarrett's Avatar
    Join Date
    Jul 2009
    Location
    Trier(near), Germany
    Posts
    2,292
    you can make a property I guess, when the player completes a task it increments...say from 0...then when they complete level 1's task it adds 1...then the colider looks for that property(should now be 1) and if it matches the player can proceed...there are a million ways to do this. I'm not sure if you understand what I mean...but hopefully you do.
    "The crows seem to be calling my name." Thought Kaw.
    Myrlea, "The Shepherd's Quest" formerly "Valiant" [project]



  4. #4
    I would recommend using the "Save" feature in blender to store info about players progress in the game.
    Example save file:
    Level 1: 289 (score or checkpoint or something)
    Level 2: 144
    Level 3: -1
    Level 4: -1

    You can have a script at the end of your level that sets the score for the next level to 0. In each level you can load the score for that level and check if its 0 or above, if its not then quit the game.

    Edit:
    Also when distributing the game to non Blender users you can just change the filename from level2.blend to level2 and most of them wont do the digging to find out that Blender can open the file.

    If your game is based on tiles or tilesets you can store the level as a encrypted text file and load it with python to reconstruct the level during a loading screen.
    Last edited by Josip Kladaric; 14-Jan-18 at 10:07.



  5. #5
    Originally Posted by Nicholas_A View Post
    At the end of the level, have a sensor object. When the player collides with it, load the next level.
    Yeah but what can prevent player just skip entire level and load next level from blend files, where levels are placed. Say player get stuck on first level and instead trying to complete first level he will just load blend file contaning level 2 and so on.

    Originally Posted by JustinBarrett View Post
    you can make a property I guess, when the player completes a task it increments...say from 0...then when they complete level 1's task it adds 1...then the colider looks for that property(should now be 1) and if it matches the player can proceed...there are a million ways to do this. I'm not sure if you understand what I mean...but hopefully you do.
    Thank you for help. I guess i understand what are you saying. So if player has 0 property he won't be able to start game on level 2 untill player object will get property 1. But what will stop one just to change this property to 1 inside blender (editing blend files) and start level 2 without completing level 1?


    Originally Posted by Josip Kladaric View Post
    I would recommend using the "Save" feature in blender to store info about players progress in the game.
    Example save file:
    Level 1: 289 (score or checkpoint or something)
    Level 2: 144
    Level 3: -1
    Level 4: -1

    You can have a script at the end of your level that sets the score for the next level to 0. In each level you can load the score for that level and check if its 0 or above, if its not then quit the game.

    Edit:
    Also when distributing the game to non Blender users you can just change the filename from level2.blend to level2 and most of them wont do the digging to find out that Blender can open the file.

    If your game is based on tiles or tilesets you can store the level as a encrypted text file and load it with python to reconstruct the level during a loading screen.
    Thank you for your advice. I will take a look at save feature with scripts that saving game progress. Tho my knowleges of scripting is very poor. I'm still very newbie in BGE and especiall in Python programming. But I am learning.
    Last edited by CYNIC78; 14-Jan-18 at 10:58.



  6. #6
    Originally Posted by CYNIC78 View Post
    But what will stop one just to change this property to 1 inside blender (editing blend files) and start level 2 without completing level 1?
    Nothing, but nothing stops you on any game neither from editing the saves. Only encryption and obfuscation can prevent an user from editing a save file, and they're not really effective neither (you can just download a save from someone else).



  7. #7
    Member BluePrintRandom's Avatar
    Join Date
    Jul 2008
    Location
    NoCal Usa
    Posts
    18,513
    online server and stream global data from a host.

    no server,
    no level.
    Break it and remake it - Wrectified
    If you cut off a head, the hydra grows back two.
    "headless upbge"



  8. #8
    Originally Posted by elmeunick9 View Post
    Nothing, but nothing stops you on any game neither from editing the saves. Only encryption and obfuscation can prevent an user from editing a save file, and they're not really effective neither (you can just download a save from someone else).
    Yeah, but efforts to decrypt files or finding save files(for small unfamous game) would be harder than just to complete level and pass to next one. And in case if level files are so easy to edit\open it's easier for player just to skip difficult place and load level he want.



  9. #9
    Moderator Monster's Avatar
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    13,734
    I recommend to think about what JustinBarrett and Josip Kladarik suggested.

    You will need some sort of save/load system as the Game Actuator completely unload any game data including python modules. This means your level files need to load the saved status, extract the current level and if the level does not match load the correct blend from the file.

    Due to the dynamic nature of that behavior you will need Python for implementation.



  10. #10
    Originally Posted by Monster View Post
    I recommend to think about what JustinBarrett and Josip Kladarik suggested.

    You will need some sort of save/load system as the Game Actuator completely unload any game data including python modules. This means your level files need to load the saved status, extract the current level and if the level does not match load the correct blend from the file.

    Due to the dynamic nature of that behavior you will need Python for implementation.
    Thank you for help. Definitly I should learn Python not only for save-load system but for any other fancy features. I begun to watch some simple tutorials about Python scripting in BGE, and even wrote few primitive scripts which are working to my surprise. :-)



  11. #11
    Member JustinBarrett's Avatar
    Join Date
    Jul 2009
    Location
    Trier(near), Germany
    Posts
    2,292
    Monster also brings up a good point....if your player changes levels he will not maintain any changes from the old level....thus the need to save and load data when changing levels.
    "The crows seem to be calling my name." Thought Kaw.
    Myrlea, "The Shepherd's Quest" formerly "Valiant" [project]



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •