Worldspawn: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎Entity Description: Removed dead links)
No edit summary
Line 1: Line 1:
{{base_brush}}
{{toc-right}}


== Entity Description ==
'''Worldspawn''' (or just "the world") is the single entity that stores the noninteractive parts of a map, alongside some global configuration options. In other words:
A single '''worldspawn''' Entity is present on every map. It represents all world brushes. It also stores general information about the map and can be edited via the ''Map Properties...'' option in the ''Edit'' menu in [[Hammer]].
[[Constraint]]s can be assigned to this object (by not specifying any name for the object in question). Any damage sustained from suicide, falling damage, or [[Wikipedia:Asphyxiation|asphyxiation]] is set to be caused by <code>worldspawn</code>.


Technically: {{map_properties}}
* [[Brush]]es
* [[prop_static|Static props]]
* Map name, [[skybox]], [[context]]s... {{tip|Access these properties in Hammer with <code>Main menu > Edit > Map properties...</code>}}


{{brushmodel}}
Some other notes:


It must also be noted that if you constrain the world and another object, and set No Collision between the two, then the object will sink out of the map.
*[[Wikipedia:Highlander (film)|There can only be one.]] Fortunately, since Hammer doesn't allow worldspawn to be created directly it's very difficult for this rule to be broken.
*Damage from the environment (and [[kill]]) is attributed to the world.
*[[Constraint]]s can be assigned to worldspawn by not specifying a name for their subject/target, but the results are rarely desirable.


In code it is represented by class CWorld, defined in world.cpp.
== See also ==


* See also [[Skybox]] and [[Sky List]]
* <code>[[CWorld]]</code>
* [[Skybox]]


== Additional "Map Property" Entities ==
=== Related entities ===
There are also a few "Map Property Entities" which should have only one instance per BSP map, and whose properties apply to the whole map. Multiple instances of these entities within a map may cause errors. Note that these Entities' keyvalues can change during gameplay via the [[Inputs and Outputs]] System, just like the Worldspawn's ''ResponseContext'' inputs ...
 
* Skybox related:
There are a few other 'map property' entities which should not have more than one instance in a map. They are:
** [[env_fog_controller]]
 
** [[light_environment]]
;Skybox
** [[shadow_control]]
: [[env_fog_controller]]
** [[env_sun]] (more than one?)
: [[light_environment]]
** [[sky_camera]] (unique location)
: [[shadow_control]]
* Map Optimisation:
: [[env_sun]] ({{todo|actually, multiple suns might be allowable}})
** [[game_ragdoll_manager]]
: [[sky_camera]] (unique location)
** [[game_weapon_manager]]
; Optimisation
** [[game_gib_manager]]
: [[game_ragdoll_manager]]
** [[water_lod_control]]
: [[game_weapon_manager]]
* Abstract:
: [[game_gib_manager]]
** [[game_end]]
: [[water_lod_control]]
** [[info_intermission]] (unique location)
; Logic
** [[info_player_start]] (unique location)
: [[game_end]]
** [[logic_auto]]
: [[info_intermission]] (unique location)
** [[env_global]]
: [[env_global]]
** and of course [[worldspawn]] itself.


== Keyvalues ==
== Keyvalues ==
; <code>message <[[string]]></code>
: Map's description / title. Doesn't seem to be used anywhere any more.
; <code>skyname <sky material prefix></code>
: [[Skybox]] material. See  [[Sky List]].
; <code>chaptertitle <string></code>
: Chapter Title that appears on screen when this level starts.
; <code>startdark <[[bool]]></code>
: Fades the map in {{bug|The fade is carried out every time the map loads, including when loading from a saved game. Use [[env_fade]] instead.}}
; <code>gametitle <bool></code>
: Should the game's title appear on-screen when the map starts?
; <code>newunit <bool></code>
: Used to clear out saved data of previous maps, which reduces saves' filesize. Only enable if the player cannot return to any previous map.
; <code>maxoccludeearea <[[float]]></code>
: Prevents occlusion testing for entities that take up more than X% of the screen.
; <code>minoccluderarea <float></code>
: Prevents this occluder from being used if it takes up less than X% of the screen.
; <code>maxpropscreenwidth <float></code>
: Number of pixels wide at which all props in the level start to fade (-1 = use <code>fademaxdist</code>). This number is ignored if the prop has a specific fade distance specified.
; <code>minpropscreenwidth <float></code>
: Minimum number of pixels wide at which the prop is visible (0 = don't fade out). This number is ignored if the prop has a specific fade distance specified.
; <code>{{ep1 add|detailvbsp}} <file></code>
: [[Detail.vbsp]] file to use for creating detail props. Must be located in game root.
; <code>{{ep1 add|detailmaterial}} <material></code>
: Detail material file
; <code>coldworld <bool></code>
: If set, [[Day of Defeat: Source]] player models will emit breath particles from their mouth [[attachment]]s. No effect elsewhere.
* {{kv responsecontext}}
* {{kv responsecontext}}
* '''message'''
: <string> Map Description / Title
* '''skyname'''
: <string> [[Skybox]] Texture Name. See also [[Sky List]].
* '''chaptertitle'''
: <string> Chapter Title that appears on screen when this level starts.
* '''startdark'''
: {{boolean}} Level Fade In
* '''gametitle'''
: {{boolean}} Game Title should appear on screen when this level starts.
* '''newunit'''
: {{boolean}} Used to clear out <code>savegame</code> data of previous levels to keep the <code>savegame</code> size as small as possible. Only set it to Yes if the player cannot return to any previous levels
* '''maxoccludeearea'''
: <float> Prevents occlusion testing for entities that take up more than X% of the screen.
* '''minoccluderarea'''
: <float> Prevents this occluder from being used if it takes up less than X% of the screen.
* '''maxpropscreenwidth'''
: <float> Number of pixels wide at which all props in the level start to fade (-1 = use <code>fademaxdist</code>). This number is ignored if the prop has a specific fade distance specified.
* '''minpropscreenwidth'''
: <float> Minimum number of pixels wide at which the prop is visible (0 = don't fade out). This number is ignored if the prop has a specific fade distance specified.
* '''{{ep1 add|detailvbsp}}'''
: <filename> Detail.vbsp file to use for emitting detail props (found in directory <code><root>/modname</code>). Used only for the compiler
* '''{{ep1 add|detailmaterial}}'''
: <material> Detail material file
===[[Day of Defeat: Source]]===
* '''coldworld'''
: {{boolean}} If set, players will emit breath particles from their mouth attachments.


== Inputs ==
== Inputs ==
* {{i responsecontext}}
* {{i responsecontext}}
[[Category:Entities]]

Revision as of 15:56, 14 January 2009

Worldspawn (or just "the world") is the single entity that stores the noninteractive parts of a map, alongside some global configuration options. In other words:

Some other notes:

  • There can only be one. Fortunately, since Hammer doesn't allow worldspawn to be created directly it's very difficult for this rule to be broken.
  • Damage from the environment (and kill) is attributed to the world.
  • Constraints can be assigned to worldspawn by not specifying a name for their subject/target, but the results are rarely desirable.

See also

Related entities

There are a few other 'map property' entities which should not have more than one instance in a map. They are:

Skybox
env_fog_controller
light_environment
shadow_control
env_sun (
Todo: actually, multiple suns might be allowable
)
sky_camera (unique location)
Optimisation
game_ragdoll_manager
game_weapon_manager
game_gib_manager
water_lod_control
Logic
game_end
info_intermission (unique location)
env_global

Keyvalues

message <string>
Map's description / title. Doesn't seem to be used anywhere any more.
skyname <sky material prefix>
Skybox material. See Sky List.
chaptertitle <string>
Chapter Title that appears on screen when this level starts.
startdark <bool>
Fades the map in
Icon-Bug.pngBug:The fade is carried out every time the map loads, including when loading from a saved game. Use env_fade instead.  [todo tested in ?]
gametitle <bool>
Should the game's title appear on-screen when the map starts?
newunit <bool>
Used to clear out saved data of previous maps, which reduces saves' filesize. Only enable if the player cannot return to any previous map.
maxoccludeearea <float>
Prevents occlusion testing for entities that take up more than X% of the screen.
minoccluderarea <float>
Prevents this occluder from being used if it takes up less than X% of the screen.
maxpropscreenwidth <float>
Number of pixels wide at which all props in the level start to fade (-1 = use fademaxdist). This number is ignored if the prop has a specific fade distance specified.
minpropscreenwidth <float>
Minimum number of pixels wide at which the prop is visible (0 = don't fade out). This number is ignored if the prop has a specific fade distance specified.
Template:Ep1 add <file>
Detail.vbsp file to use for creating detail props. Must be located in game root.
Template:Ep1 add <material>
Detail material file
coldworld <bool>
If set, Day of Defeat: Source player models will emit breath particles from their mouth attachments. No effect elsewhere.

Inputs