The Purpose of the Theme Column in Levels.txt + Object Stuff

Post here for all aspects of map making and level design. Click here to visit the Keep's official map site, Diabolic Cartography.

Moderator: Paul Siramy

0
No votes
 
Total votes: 0

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains

Hand-picked

The Purpose of the Theme Column in Levels.txt + Object Stuff

Post by Nefarius » Wed Oct 24, 2007 10:32 am

This one was quite a mystery for a while, and it's essentially useless so to speak, because it seams to have been abandoned in the middle of coding.

It is related to object generation, and is executed before the game attempts to add objects via ObjGroup. Probably to push some hardcoded things on and change the way objects are spawned.

Now, it's not 1 column, it is a bitmask.


It fills an array of 7 function indexes depending on which bits are set:

0x00000001 -> func1
0x00000002 -> func2
0x00000004 -> func3
0x00000008 -> func4
0x00000010 -> func5
0x00000020 -> func6
0x00000040 -> func7

Then it rolls a rand between 0 and nArrayItems - 1 and attempts to call this function.

Here is what the functions do (I didn't intensively test)

func1 = always returns TRUE (does nothing)
func2 = tries to spawn barrels
func3 = does nothing, this is NULL
func4 = long compliated thing I didn't bother to check, probably spawns something
func5 = tries to spawn armor stands
func6 = tries to spawn weapon racks
func7 = like func6

Example for the barrel spawning one: album_page.php?pic_id=2614

...

And something extra, if you wonder how density in ObjGroup.txt works, its the number of interations of the loop spawning objects in the room. Based on a formula:

nObjects = ((room_w_subtiles*room_h_subtiles)/128*density)/256

Note that density > 128 will make the game assert.

The amount of objects spawned is however much smaller then this will make you think. The minimum distance between two objects is 6 subtiles (for the normal populatefn, #3).
Last edited by Nefarius on Wed Oct 24, 2007 11:06 pm, edited 4 times in total.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

Return to “Map Editing”