In game, Map menu automatically formed from all blends located in Bueraki/levels folder, except files, that starts with "_" symbol. After selecting, level starts with "Game/Start Game From File" actuator. That's means: 1) level blend file contains everything needed to run in like game, so you can open any level in blender, press P and that's will run this level same way, like it was loaded from menu. 2) You even can put separate game into levels folder, and run in after selecting in game menu. :)
Note, that levels weight is less, than 500kb. That because all data (terrain mesh and props objects instances) is stored in terrains sub-folder. That made for several reasons:
- Level should have two scenes: game scene, and lod scene, but switching between scenes while editing is not comfortable, much faster to work with layers. So in terrain file hi-poly and lo-poly terrains laying in different layers, they grouped, and linked in level file into corresponded scenes "Scene" and "Lod"
- Terrain file can contain extra objects, that not needed for game, like solid terrain for texture baking. It wouldn't be loaded into level file. Also, you can have several versions of one terrain in different level files, like Vastland and Vastland_optimized, second has half as much objects as first one: no dynamic plants and no small grows. But it both referencing to one terrain file, and changing this file will change both levels.
Adding some stuff on existing level
Copy any existing level, rename it, open it. Add some stuff, save. Well done! If you adding something that needs a Lod, add it's lod into Lod scene. Note that:
- You can't move or delete separate existing objects, as they linked into level as one large group. You only can remove whole group.
- Object's you added that way will have no shadow, because it's baked.
Adding new terrain
- Model a terrain, and it's lod. Save it into //levels/terrains folder
- Cut it on square chunks. It's size is depends on mesh density. For Vastland I used 40x40 meters chunks for terrain mesh, and ~225x255 meters chunks for terrain lod.
- Group all terrain objects into group named "terrain", group all lod objects into group named "Lod"
- Create a new blend file, save it into //levels folder with same name. Link terrain and lod groups into it. Add terrain group into default scene, add lod group into scene named "Lod".
- On world panel set gravity to 19.60, Substeps to 2.
- Link unilogic group from /rigs/unilogic.blend add it into default scene. Link unicam_lod object from same file into Lod scene.
- Switch back to default scene before saving.
- Congratulations! your level now playable!
Making new terrain, please, make sure that:
- All objects in Lod scene has no collision. You can check it by enabling physics visualization. All objects in Lod scene must be gray colored.
- Terrain around origin of coordinates is flat and clear. That's were all vehicles will spawn.
- Terrain mesh has no thin and long triangles. Those are really bad for physics.
Using props
Check out Bueraki/props folder for various already existing game objects and it's lods. Use File->Link to link them into your terrain or level file. Select props set file in dialog window, then go to groups. Always link props as a groups. Then press Shift+A, select group instances and add instance, you need.
To quickly create lods for multitude of instances (like trees):
- Select one of them, press Shift+L select Doupligroup. That will select all objects of same prop.
- If you working in terrain file, copy them, place into another layer (M key), remove them from terrain group and add them into lod group.
- If you working in level file, copy them, press ctrl+L, objects to scene -> Lod, ten delete copied objects. Switch to Lod scene.
- Add one lod version of this objects. Select all instances like in pt.1, then shift+select lod version. Press ctrl+L select Doupligroups. All objects will be replaced by lod versions. Delete one lod object you just added.