SEED: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Tels (talk | contribs)
add intro, add some links and fix "floor" spawnarg
Tels (talk | contribs)
fix spawnarg description
Line 22: Line 22:
* Now create the entities that you want to appear. Entities that use the [[LOD]] system should be prefered.
* Now create the entities that you want to appear. Entities that use the [[LOD]] system should be prefered.
* Link each entity from the LODE entity by selecting first the LODE, then the entity, and then press {{CTRL}}+{{Key|K}}.
* Link each entity from the LODE entity by selecting first the LODE, then the entity, and then press {{CTRL}}+{{Key|K}}.
* Put the entities at the hight you want them to appear. Alternatively, give the LODE entity the spawnarg '''"lode_floor" "1"''', this will cause it to floor all entities automatically. The latter also works with dynamically created terrain or terrain consisting of irregular heights like when it was made from patches.
* Put the entities at the hight you want them to appear. Alternatively, give the entity (that you placed and the LODE targets) the spawnarg '''"lode_floor" "1"''', this will cause the LODE to floor all entities of this class automatically. This flooring also works with dynamically created terrain or terrain consisting of irregular heights like when it was made from patches.


{{clear}}
{{clear}}

Revision as of 19:34, 28 June 2010

Introduction

The new and improved LOD System for TDM v1.03 lets you place entities in your map that reduce their own complexity when being far away from the player. However, there are still two huge drawbacks to this technique:

  • manually placing thousands of entities is very tedious and error prone
  • 3000 entities "thinking" (deciding what LOD they have) takes about 7% of performance, even when they are not visible
  • The overall entity limit of 8192 entities - even if only ever 100 entities are visible to the player, you would not be able to create a forest with 10000 objects (trees, treestumps, flower patches and rocks etc.)

So there needs to be a way to dynamically only create the needed entities - and remove any no longer entities completely from the gameworld. Of course, if nec., the formerly existing entities need to be recreated. In addition, we want some way to randomly place entities without having to specify their position/rotation for each entity.

The new LODE provides exactly this.

How to use

A LODE entity in the editor
An entity targeted by the LODE
  • In DarkRadiant, create a brush the size of the area you want to cover
  • With that brush still selected, Click the right mouse button and select Create entity and select Darkmod/Info/atdm:lode
Note:
If you want to resize the LODE entity after creating it, select it with SHIFT + Click the left mouse button and press TAB to select the brush, then resize it normally.
  • Now create the entities that you want to appear. Entities that use the LOD system should be prefered.
  • Link each entity from the LODE entity by selecting first the LODE, then the entity, and then press CTRL+K.
  • Put the entities at the hight you want them to appear. Alternatively, give the entity (that you placed and the LODE targets) the spawnarg "lode_floor" "1", this will cause the LODE to floor all entities of this class automatically. This flooring also works with dynamically created terrain or terrain consisting of irregular heights like when it was made from patches.

Section not complete yet.

Script events

There exist a few script events that can be used either from scripts, or by setting up a trigger that links to an atdm:target_callobjectfunction with the spawnarg call set to one of the script functions below:

Deactivate()

Deactivates the thinking of this LODE. Spawned entities stay where they are.

Activate()

Activates the LODE (e.g. it starts to think) again. If nec., the LODE will also spawn and unhide any entities that it needs.

CullAll()

Removes all entities under control of this LODE from the game. Only useful if either the player is very far away, or if you have called Deactivate() before - otherwise the entities might be spawned again in the next frame.

See also