Ritualistic Forums

Go Back   Ritualistic Forums > Ritual Entertainment Games > SiN, SiN Steam & Wages of Sin

Reply
 
Thread Tools Display Modes
Old 04-17-1999, 12:40 AM   #1
tiglari
Regular
 
Join Date: Jan 1999
Location: Canberra ACT Australia
Posts: 82
Default could someone send me a little map

(.map file, not .bsp) consisting of just a room with a player-start and a little water brush on the floor, like a puddle to splash in.

The reason is that I get the impression that brushes with water textures should work like water, since they have +water in the .swl, but Sined (seems to, on my semi-functional installation) writes them with a +water field.

However my Quark-generated maps with water brushes don't work like water unless I give them a +water specification on their faces, so I suspect that I'm screwing something up somewhere; having a simple Sined map with a water brush would help sort it it.

Thanks very much
tiglari is offline   Reply With Quote
Old 04-17-1999, 12:41 AM   #2
tiglari
Regular
 
Join Date: Jan 1999
Location: Canberra ACT Australia
Posts: 82
Default Re: could someone send me a little map

Ooops, email address:

tiglari@hexenworld.com
tiglari is offline   Reply With Quote
Old 04-17-1999, 02:09 AM   #3
BlindTypist
Veteran
 
Join Date: Mar 1999
Location: NY, NY
Posts: 450
Default Re: could someone send me a little map

For the most part, a SinEd map only contains a flag setting if it deters from the default setting in the *.swl file.

Since the water textures already have the water flag set, it is not necessary for SinEd to add the flag in the *.map file.

I have no idea what happens if both are set, since SinEd won't do both.

When SinEd references a surface texture, the structure looks somewhat like this, in ascii:

WaterBase/wa_ocean 0 0 0.00 1 1

WaterBase/wa_ocean -the texture name
0 -Horizontal shift in pixels
0 -Verticall shift in pixels
0.00 -texture rotation
1 -percentage
1 -percentage

Additional flags that are NOT the default *.swl settings are added next:

+Mask +Ladder -Water

This is followed by a bunch of dimensional and coordinate data.

The weirdest thing I find about this entire structure, is all the data is stored as strings and use a space as a seperator. Data is stored in this fashion until the map is compressed. Of course its easy to read like this, but I find it peculiar. Is there a reason for this data structure?

I'm sure you already knew all this, especially since most of it is the same as Quake2. And as you can tell, I don't program for a living, I just kind of dabble in it.

If you still need a map file, I can generate one. Don't expect this texure alone to make a brush into water, though. The texture only makes the player go into swim mode and generate splashing sounds. Once you dive under, it doesn't look like water.



BlindTypist is offline   Reply With Quote
Old 04-17-1999, 02:25 AM   #4
BlindTypist
Veteran
 
Join Date: Mar 1999
Location: NY, NY
Posts: 450
Default Re: could someone send me a little map

I just remembered Eutectic made a file already. You can download it here:
www.ritualistic.com/node/downloads/waves.zip
BlindTypist is offline   Reply With Quote
Old 04-17-1999, 10:50 AM   #5
eutectic
Fanboy
 
Join Date: Jan 1999
Posts: 844
Default Re: could someone send me a little map

Everything BlindTypist said is correct. I'd like to add a few things here in the hope to help clarify a few things.

tiglari:

"However my Quark-generated maps with water brushes don't work like water unless I give them a +water specification on their faces, so I suspect that I'm screwing something up somewhere"

I have no idea what you implemented in Quark to fill the role of surf inspector but in SinEd, when you select a water texture and hit S, the water flag is already set meaning that the setting, like BT mentionned is already in the SWL texture's internal settings. So if I assume that if you made some kind of surf inspector in Quark, select a water texture and you don't see the water flag already set, it's because somehow Quark doesn't "read" the texture's data structure properly or leaves something behind. Could be a minor detail.

BlindTypist:

"When SinEd references a surface texture, the structure looks somewhat like this, in ascii:"

WaterBase/wa_ocean 0 0 0.00 1 1

WaterBase/wa_ocean -the texture name
0 -Horizontal shift in pixels
0 -Verticall shift in pixels
0.00 -texture rotation
1 -percentage
1 -percentage

Yes, the first line represents what you will see if you open the map file with a text editor. The map file is indeed just an ASCII text file. When you compile it into a .bsp, it becomes a binary file (bsp stands for Binary Space Partition BTW ).

Just a little rectification on your description above. The last 2 figures in the line are:

WaterBase/wa_ocean -the texture name
0 -Horizontal shift in pixels
0 -Verticall shift in pixels
0.00 -texture rotation
1 - horizontal scale
1 - vertical scale

tiglari:

Now if you notice in the line:

WaterBase/wa_ocean 0 0 0.00 1 1

there is no +water at the end because the water surf property is a SWL default and doesn't need to be added to the texture. If you would remove the water flag in Sined and saved your map, you would see:

WaterBase/wa_ocean 0 0 0.00 1 1 -water

The data in the map file is basically saying:

"Use this SWL texture but uncheck the water flag."

When you set a flag that's not default for that texture (warp for example), you see:

WaterBase/wa_ocean 0 0 0.00 1 1 +warping

"Use this SWL texture but also check the water flag."

A surface file contains similar lines. So let's you made a map named tig.map and created a surface file named tig.txt or tig.srf (the file extension doesn't matter as long as it's an ASCII file, I like .srf personally) and set your map's worldspawn "surfacefile" key to the path and name of that .srf file which contains the following line:

WaterBase/wa_ocean 0 0 0.00 1 1 -water

When you open the map in SinEd, the editor browses the value of worldspawn's "surfacefile" key, reads the path/name of the surface file, opens it, reads the info in contains and modifies the flags for the texture names it contains when you load them in the texture selection window. Thus if you load and select WaterBase/wa_ocean, you will see that the water flag is NOT set. It's the surface file that unchecked it.

Of course, when you compile the map, QBSP3 will also read the value of worldspawn's "surfacefile" key and use that for compilation.

Hope this helps clear up things for you Tiglari

Now back to BlindTypist:

"The weirdest thing I find about this entire structure, is all the data is stored as strings and use a space as a seperator. Data is stored in this fashion until the map is compressed. Of course its easy to read like this, but I find it peculiar. Is there a reason for this data structure?"

Yes. And you're right about it being essentially the same as Quake2 and even Quake1 (except for the surf properties). The basic data structure for a brush definition in a map file is as follows:

Let's take a 6 face brush like a cube for example:

// brush 8
{
( -29 224 104 ) ( -29 224 89 ) ( -24 224 89 ) metalworks/dualrail1 155 16 0.00 1 1
( -24 -224 80 ) ( -24 -224 104 ) ( -24 -168 104 ) metalworks/dualrail1 91 16 0.00 1 1
( -29 -224 89 ) ( -29 -224 104 ) ( -24 -224 104 ) metalworks/dualrail1 155 16 0.00 1 1
( -28 -224 104 ) ( -28 -224 89 ) ( -28 -168 89 ) metalworks/dualrail1 91 16 0.00 1 1
( -36 -151 104 ) ( -28 -150 104 ) ( -27 -214 104 ) metalworks/dualrail1 0 -18 90.00 1 1
( -11 -248 89 ) ( -10 -183 89 ) ( -19 -183 89 ) metalworks/dualrail1 0 -18 90.00 1 1
}

First the "// brush 8" is a comment line, the QBSP3 compiler ignores it but SinEd looks for it when you use the "find brush" feature.

Now if you notice (don't know how this will look in the message body), there are 6 lines, one for each brush face. Each line defines a plane in 3D space. The solid is the volume contained within the intersection of those 6 non-coplanar planes (hope this doesn't sound too complicated ). Coplanar means they don't coincide in space, IOW, different planes.

If we look at one line in particular:

( -29 224 104 ) ( -29 224 89 ) ( -24 224 89 ) metalworks/dualrail1 155 16 0.00 1 1

The 3 sets of values in parentheses are simply XYZ coordinates in space. From those 3 points, the plane is defined for the position and orientation of the brush face.

For example, take the room you're in right now, let's say you can suspend 3 points anywhere you want in mid-air.

Then if you had a perfectly flat and rigid large sheet of thin cardboard and tried to orient and position that sheet so all 3 points would intersect with it, you would find that there's only one way you can position and orient the sheet for this to occur. That's why 3 points can be used to define a plane in 3D space

Additional info on the bsp file (in case you're not asleep yet ):

The bsp file is in fact a hybrid: part binary and part ASCII. If you open it with a text editor (Wordpad for Eg) and scroll towards the end, you will see there's a section with the complete list of entities in your map formatted as such:

{
"angle" "270"
"origin" "-96 208 0"
"classname" "info_player_start"
}

Every listed entity contains all the key values you set in the editor for it. That's for fixed size entities. For variable size entities (brush based) such as scriptobjects, this is what you see:

{
"model" "*14"
"origin" "-196 -160 138"
"targetname" "box2"
"classname" "func_scriptobject"
}

But... why "model" "*14" ? This entity is brush based and not model based right?

Well, yes but the brushes from which this entity is made is compiled into a solid called bspmodel or b-model for short. "*14" is a sequence number, a reference to one or several compiled solids. It says "use the model *14 for this entity".

Where is "model *14"? It's in the compiled binary portion of the file and thus unreadable by humans. So before you compile the map, this is what it looks like in the map file:

// entity 15
{
"classname" "func_scriptobject"
"targetname" "box2"
// brush 0
{
( -208 -160 128 ) ( -192 -160 128 ) ( -192 -152 128 ) warehouse/wl_crate(reforced) 44 32 0.00 -0.312500 0.312500 +nonlit
( -192 -152 148 ) ( -192 -160 148 ) ( -208 -160 148 ) warehouse/wl_crate(reforced) 44 32 0.00 -0.312500 0.312500 +nonlit
( -184 -150 138 ) ( -200 -150 138 ) ( -200 -150 122 ) warehouse/wl_crate(reforced) 44 25 0.00 -0.312500 0.312500 +nonlit
( -206 -152 138 ) ( -206 -160 138 ) ( -206 -160 122 ) warehouse/wl_crate(reforced) 32 25 0.00 -0.312500 0.312500 +nonlit
( -208 -170 138 ) ( -192 -170 138 ) ( -192 -170 122 ) warehouse/wl_crate(reforced) 44 25 0.00 -0.312500 0.312500 +nonlit
( -186 -160 138 ) ( -186 -152 138 ) ( -186 -152 122 ) warehouse/wl_crate(reforced) 32 25 0.00 -0.312500 0.312500 +nonlit
}
}

The brush definition is replaced by the b-model reference number "*14". In this example, the scriptobject is made with a single brush but solid entities can be made with as many brushes as you want.

Sleep well

------------------
The Node
www.ritualistic.com/node

The official Sin entities and scripting reference site
eutectic is offline   Reply With Quote
Old 04-17-1999, 05:22 PM   #6
Chronos
Regular
 
Join Date: Mar 1999
Location: NL
Posts: 77
Default Re: could someone send me a little map

Eutectic: how do you produce such long messages????????????

Only reading them costs me 1/2 an hour

------------------
Da Chronos
da_chronos@geocities.com
-------------------------
[Sinnerz from Hell] rule!
http://sfh.gamepoint.net
(sux )
Chronos is offline   Reply With Quote
Old 04-17-1999, 08:22 PM   #7
tiglari
Regular
 
Join Date: Jan 1999
Location: Canberra ACT Australia
Posts: 82
Default Re: could someone send me a little map

Thanks! I was writing the maps correctly, but had the texture files set up wrong for qbsp. But reading in waves.map turned up one bug, I imagine more will be revealed by other example maps ...

The flags format does strike me as a bit de trop, but it probably is essential for the use of texture default files to diddle properties for all the textures in the map.
tiglari is offline   Reply With Quote
Old 04-17-1999, 08:42 PM   #8
BlindTypist
Veteran
 
Join Date: Mar 1999
Location: NY, NY
Posts: 450
Default Re: could someone send me a little map

I'm glad SOMEONE understood what I was trying to say. I wrote that late last night and feared it wouldn't make much sense. I'm glad Eutectic filled in some of the missing pieces.

Glad Eutectic also fixed my error in regard to the

1 - horizontal scale
1 - vertical scale

both of which are percentages. I guess I was falling asleep while writing that one.

BlindTypist is offline   Reply With Quote
Old 04-17-1999, 10:44 PM   #9
BlindTypist
Veteran
 
Join Date: Mar 1999
Location: NY, NY
Posts: 450
Default Re: could someone send me a little map

One other thing worth mentioning is the SurfaceFile. The SurfaceFile WILL NOT set flags that are already set in the SWL file.
So if the SWL file has the water flag set, the SurfaceFile won't have +water.

Let's say you have a light texture that you are tired of changing the brightness everytime you add the texture to a brush. You want the texture to emit a brightess of 10000 (pretty bright), so in the Surf Inspector you change the "Direct Value" from 0 to 10000, and click "Set Default". THIS DOESN'T CHANGE THE SWL FILE IN ANY WAY. It writes an entry to the SurfaceFile (Sample.txt in this case) and might look like this:

generic/light/li_spot3 date 924408648 direct 10000.0

Now all the surfaces in your map with this texture will emit a brightness of 10000 by default. (once compiled of course).

Now wait, lets say 10000 is too bright. Lets make it 5000. So in the Surf Inspector you change "Direct Value" to 5000 and click "Set Default". Now all your surfaces with this default texture will reflect this new value.

The SurfaceFile doesn't contain a NEW line, instead the OLD line was changed, and looks like this:

generic/light/li_spot3 date 924409263 direct 5000.0

Now, lets say you don't want this texture to emit light at all (for whatever reason). Back to the Surf Inspector, you change "Direct Value" to 0 and click "Set Default". Now the attributes are the same as the original SWL file.

But there is no longer an entry in the SurfaceFile. The same thing will happen if you change a flag like water. If there are no differences between the SurfaceFile entry and the SWL settings, then the entry is omitted from the SurfaceFile.

Just thought I'd add this bit of info, in case you didn't know. Besides, it gives me an excuse to write about this useful feature.

To restore the original SWL settings, click "Restore From SWL" in the Surf Inspector. Then, you MUST click "Set Default" for the settings to be fully restored.

BlindTypist is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:47 PM.


Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.