Skip to main content
gamedev.net
🔒 Locked

Objects Memory Image

Started by Sarge 3 replies 150+ views
Original Post
Sarge
Sarge
Hello, I''m actually writing a 3D-Engine. I developed a simple script language which describes a map. You can for example build a map in milkshape3d and convert this file into my map file. My engine reads this map file and creates the necessary objects. Example: somewhere in the file is something written like this Vertex;0;1;2; the engine now creates a vertex with x = 0; y = 1; z = 2; and adds this vertex to a vector. vector.push_back (VERTEX (0, 1, 2)); What I want to do is to create all objects (vertices, polygons etc.) in memory and then write this memory block to a file like an image (imagefile). So when I want to load the map next time I don''t have to reinterpret the ascii file instead I would just load the image file and would have access to all previously created objects. I hope I explained made my problem clear enough. Thanks in advance Sarge
Sarge
Sarge
Hi Ap,
thx for your answer.
I had the header idea already. The prolem is how to write a vector to a file in one step.

I could write each item of the vector to my file and store the number of written items in my header sure. On the other hand I could try t owrite the whole vector to my file but I dunno if this is possible. I''m just playing around with it.


What I try to do is a snapshot of my data memory and write that snapshot to a file.

Greetings
Sarge
daerid
daerid
As long as you have an efficient parser, and a unified way of representing objects via text (e.g: a base class with the required functionality), using text files shouldn''t really be a problem.

The Torque Game Engine has one of the best scripting engines I''ve ever seen, and all it''s game objects can be represented in script. That includes players, enemies, maps, etc...

Even the whole GUI is done in script. AND it''s fast as hell, too: everything''s compiled down to byte-code.
daerid@gmail.com
Sarge
Sarge
Hi daerid,
yes you are right. Actually my engine compiles a huuge map and if I say huge I mean huge in a few seconds.
(loading textures etc. is another story)

I read that map build for games like Quake3 have to be compiled first. But now I read that all what is meant by compiling is to convert the map to a BSP tree conform structure and to create the BSP tree. (am I right with this?)

So I decided to stick to my ascii script language for now.

But maybe someone has a better idea or knows the answer to my original post?

Greetings
Sarge

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.