change levels

Blitz3D Forums/Blitz3D Programming/change levels

Rook Zimbabwe(Posted 2004) [#1]
I have been trying to figure out how to efficently change levels in my game.

This would involve loading a new mesh and placing new monsters and powerups and deleting the old one.

My primary concern is speed.

Can I load new levels and meshs from a function call?
-RZ


Rambus(Posted 2004) [#2]
I have a freemap function that free's everything specific to the map I was just on, then I simply load the new map (from a function I made called loadmap(name)). Takes 1-3 secounds depending on the map size that it's loading.

so.. yes you can load maps from functions, I would give you my code but it's specific to the map format and setup my game has.


Rook Zimbabwe(Posted 2004) [#3]
Hmmm the names of your functions are intriguing.

I have a trigger element that shows then hides a building... using that building as a portal to transition from outdoor to indoor. Then I hide all the junk on the outdoor map.

SO I suppose I just have to load the new map and...

-RZ


aCiD2(Posted 2004) [#4]
Rook, is this 3d? What type of game, are you attempting a portal system? You need to be more specific :)


Rook Zimbabwe(Posted 2004) [#5]
Sorry, it is 3D. Actually I have the portal system working I am just trying to understand how to load and unload levels if I make a multi-level FPS.


Rambus(Posted 2004) [#6]
store everything in a type structure then go through it freeing all the ent's and deleting the types.


Warren(Posted 2004) [#7]
Yeah, basically if you want to control when things are deleted, you need to keep track of them.

When the current level is over, free everything you've tracked and load new things for the next level.


Rook Zimbabwe(Posted 2004) [#8]
I was concerned about time lag. But I have converted a lot of my meshes to B3D so that becomes less of a problem.
-RZ


John Blackledge(Posted 2004) [#9]
Is there any problem with memory defragmentation using this method?