Well, Someone the other day wanted a simple setup for an open world game that dynamically loads whatever the player is near. So I made one!
-----------------------------------------------------------------------------------------------
What it does: Dynamically loads and frees blend files that are near the player based on a naming scheme (a 3x3 grid around the player)
What it does not do: Manage saves/loads of world sections - if you do something, move away and come back, it will probably be undone.
If the player moves to fast, sections of world may not have loaded in time. So as the game creator: make the tiles big enough the player can’t cross them really fast, but small enough to load fast.
Read the readme in the zip file for more information.
i got bored making colored tiles for the world sections, so it’s 5x5 with some gaps, I see no reason why this couldn’t be 1000x1000, and there’s no problem with gaps in places ie: water so you don’t have to have the underwater sections. Just use the names to represent where you want the pieces to be loaded.
Things to consider doing later (probably won’t unless someone really asks for it):
Load things in a 5x5 grid around the player to minimize the probability of the player seeing the edge.
Prevent the player moving to within viewing range of the edge using invisible collision walls
World Wrapping
I made line 3 PLAYER_OBJECT = ‘active_camera’.And i get this error.
I am using 2.73.
Blender Game Engine Started
Loading chunk (0, 1)
Loading chunk (0, 0)
Loading chunk (2, -1)
Warning: Unable to open 'C:\Users\barbara\Desktop\Open World Template\World Sections\world_2_-1.blend': No such file or directory
Continuing anyway. Hopefully it is the edge of the world!
Loading chunk (2, 1)
Loading chunk (2, 0)
Loading chunk (0, -1)
Loading chunk (1, 0)
Loading chunk (1, -1)
Warning: Unable to open 'C:\Users\barbara\Desktop\Open World Template\World Sections\world_1_-1.blend': No such file or directory
Continuing anyway. Hopefully it is the edge of the world!
Loading chunk (1, 1)
Blender Game Engine Finished
I did not know you had to move around the ground planes in the areas they should be.This does not dynamically load and free the terrains.It loads them all at ounce from each blend.I was expecting more than this.
No, it dynamically loads and frees them. It loads a 3x3 grid around the player. Anything outside that is freed from memory.
Check the code. See the function called ‘remove.’ Add a print statement next to the libfree, and you’ll see that stuff is being loaded and freed from memory as the player moves.
It is not freeing.Nothing is disappearing when the player moves away.Here is your openworld template back with my modifications.I got rid of the errors in the console.