FPS collision detection in a 3D town

Started by
9 comments, last by Atrix256 13 years, 9 months ago
To continue with what kulseran said, making a text file like that for your maps is great because it's human readable, easy to edit, and yeah... you can reload it while the game is running so you dont have to relaunch (as you progress farther in your project, re-launching becomes a longer task)

But hey, something else i might suggest to you for a little bit down the road...

You might think about making your map files into just lua files. I do this in my own game with great success!

For instance part of a map file might look like...

Model = Model_LoadModel("blah.x");
Model_SetPos(Model,24,48,20);
Model_SetRot(Model,0,0,90);

Model = Model_LoadModel("blah2.x");

etc.

Why do i suggest lua?

You can then put a lua function in there called "Tick" (or update or whatever you want) and call that every frame. Now you have game logic that you can put in your map files as well that you can change and reload the map to see.

In my own game I have 2 files to my map file...

blah_geometry.lua - this contains all the loading and positioning of models
blah.lua - this includes blah_geometry.lua and contains all the game logic.

So i tell my game "load blah.lua" and it loads the models and the game logic and starts running it, it's pretty nice.

Also i have a map editor that i made to edit the _geometry.lua files. Saving / loading couldn't be easier.

To load, you just exectute the lua code and it loads all your geometry and sets everything up.

To save, just loop through all your objects and write out commands to the file that will make everything be in it's current state again.

This stuff works really well for me, but may not be something you are much interested in til later on ::shrug::

This topic is closed to new replies.

Advertisement