Relationship between entities and brushes


(richardmonette) #1

I am currently trying to understand the relationship between entities and the level geometry.

For example, say I have created a func_bobbing entity which (in gtkRadiant) is referring to one brush which is meant to represent the platform and another that is the origin. Having written a very simple entity string extractor I can see that the entity is being written into the BSP as something like:

{
“classname” “func_bobbing”
“origin” “-4 -28 92”
“model” “*1”
}

Obviously this is telling the engine that its a bobbing entity and where its origin is located. More interesting though is the model *1.

I assume this is somehow referring to one of the brushes in the level.

Couple of questions then, how does the engine resolve the relationship between this *1 and the actual brush in the level file? Secondly, if this bobbing functionality moves that brush, or a door for that matter, doesn’t that violate the spatial partitioning of the BSP?

Perhaps entities are just not considered the same way in the spatial partitioning?


(obsidian) #2

This. They are ignored by processes like -vis, etc.


(valkyr) #3

Everything is an entity though - so it’s maybe better to say : entities outside worldspawn.

[QUOTE=richardmonette;210216]More interesting though is the model *1.

I assume this is somehow referring to one of the brushes in the level.

Couple of questions then, how does the engine resolve the relationship between this *1 and the actual brush in the level file?[/quote]

The models are stored in the BSP file in a lump, with references to the brushwork that comprises them (http://www.mralligator.com/q3/#Models) According to that, “model” “*0” is worldspawn…

Perhaps entities are just not considered the same way in the spatial partitioning?

As the link above states, they don’t have a BSP tree, so won’t be considered at all, but are presumably inserted into the map at runtime in a similar way to a misc_gamemodel.


(richardmonette) #4

Huge thanks again guys - got this working now too.


(luciana07) #5

Congrats! This forum is very nice and helpful.