Advertisement

Worldcraft MAP Files

Started by March 07, 2001 04:40 PM
9 comments, last by ThomW 22 years, 11 months ago
I am a complete moron trying to make a game using Worldcraft version 1.3 MAP files for my game world data. Is there anyone out there who knows of a good programming resource for doing such a thing? I''ve found several good sites with information on the subject (I''ll post links to those later tonight if I have time), but for someone with limited experience working with files in C, it''s an uphill battle. I''m looking for a Dummies Guide or tutorial that will help me on my way. Thanks in advance! Thom Wetzel www.LMNOpc.com
What are you trying to do with the Worldcraft .map files? They''re basically just text files that store vertices for the polygons.

Take notepad out and open some of them up, then just figure out the format of the files (it''s very simple), and just write a function to input them into an array/struct in your program.

Advertisement
By all means post the links! I would also like to use .map files in my program.

Simple!?! By the way, they are points on the planes of the brushes. What you have to do is load that, parse it, and then clip all of the planes in each brush against each other in order to generate the polygon data.
I havent looked at one in a while, so I may very well be wrong,
but doesn''t a .MAP store all the planes that make up a convex hull, rather than actual vertex data?

In which case ThomW will have to write some routine to process the planes into vertex data....

sorry if this is innaccurate!


___________________________________

I used to be indecisive. Now I''m not so sure...
_________________________________I used to be indecisive. Now I'm not so sure...
Here is the beginning of the data in a .map file for one of my Half-Life maps..

{
"classname" "worldspawn"
"wad" "\half-life\valve\halflife.wad"
{
( -512 256 -640 ) ( 960 256 -640 ) ( 960 -832 -640 ) CRETE3_WALL01B 0 0 0 1.000000 1.000000
( -512 -832 -704 ) ( 960 -832 -704 ) ( 960 256 -704 ) CRETE3_WALL01B 0 0 0 1.000000 1.000000
( -512 256 -640 ) ( -512 -832 -640 ) ( -512 -832 -704 ) CRETE3_WALL01B 0 0 0 1.000000 1.000000
( 960 256 -704 ) ( 960 -832 -704 ) ( 960 -832 -640 ) CRETE3_WALL01B 0 0 0 1.000000 1.000000
( 960 256 -640 ) ( -512 256 -640 ) ( -512 256 -704 ) CRETE3_WALL01B 0 0 0 1.000000 1.000000
( 960 -832 -704 ) ( -512 -832 -704 ) ( -512 -832 -640 ) CRETE3_WALL01B 0 0 0 1.000000 1.000000
}
{
( -512 256 -384 ) ( 960 256 -384 ) ( 960 -832 -384 ) ELEV1_DR 0 0 0 1.000000 1.000000
( -512 -832 -448 ) ( 960 -832 -448 ) ( 960 256 -448 ) ELEV1_DR 0 0 0 1.000000 1.000000
( -512 256 -384 ) ( -512 -832 -384 ) ( -512 -832 -448 ) ELEV1_DR 0 0 0 1.000000 1.000000
( 960 256 -448 ) ( 960 -832 -448 ) ( 960 -832 -384 ) ELEV1_DR 0 0 0 1.000000 1.000000
( 960 256 -384 ) ( -512 256 -384 ) ( -512 256 -448 ) ELEV1_DR 0 0 0 1.000000 1.000000
( 960 -832 -448 ) ( -512 -832 -448 ) ( -512 -832 -384 ) ELEV1_DR 0 0 0 1.000000 1.000000
}

I''m sorry, I assumed it was all vertice information.

Advertisement
Check out the bottom of: http://www.geocities.com/SiliconValley/2151/math3d.html
for info on clipping the planes to form vertices. So far I''ve got a converter that does the loading and stuff... but it has a broken clipping algorithm
I''ll have to get round to fixing it sometime...
Protozone
I said earlier that I would post some links to some of the information that I''ve found in my quest, so here goes!

The first link I found is this one on Flipcode.com:
http://www.flipcode.com/tutorials/tut_levedit.shtml
It''s a cool intro to using WC for level editing. There is even a good chunk of the code at the bottom of the page that creates faces from the planes list. There is some good information, but I need some information between ''how to setup WC'' and ''converting plane data to faces''.

The next link that I found, which is actually alluded to in the Flipcode article above, is found on PlanetQuake on the Quake Map Specs in Theory & Practice site. On the left there is a button to a MAP Info page which covers the MAP file structure, explains the coordinate system and some other very useful information.

I''ve found others, but nothing as concrete as the first two.

What I''d love to see is a tutorial on reading in the MAP files, which is difficult to me because I haven''t done a lot of work with file and string handling in C/C++, to actually rendering the data on the screen. Of course, that would probably be one hell of a tutorial!

Thanks for any information anyone can dig up!

Thom Wetzel
www.LMNOpc.com
Try this, http://www.madensoft.com/LevelConverter.zip
It scans all data and convert them into triangles.
Additional items(like lights or selfmade stuff) will convert, too.
Hi. First of all do not use WorldCraft 1.3 (I dont even know if such a version exists) use ver. 3.3. It is much better.

Some time ago Stefan did a great job making a tutorial for loading MAP files. It includes source code:

http://folk.uio.no/stefanha/

Check tutorials section.
Oztan

This topic is closed to new replies.

Advertisement