View Issue Details

IDProjectCategoryView StatusLast Update
0003912The Dark ModCodingpublic11.06.2016 12:49
ReporterSpringheel Assigned ToSteveL  
PrioritynormalSeveritynormalReproducibilityhave not tried
Status resolvedResolutionfixed 
Product VersionTDM 2.03 
Target VersionTDM 2.04Fixed in VersionTDM 2.04 
Summary0003912: LOD problems with custom "model" spawnarg
DescriptionMappers have had the option in the past of using a specific AI entityDef and changing the "model" spawnarg to make it look different:

"I wanted a bullder archer, so what I did was use the model "tdm_ai_builderguard_lesser" on a "atdm:ai_citywatch_archer" entity, in 2.02 this works."

With LOD this is no longer possible, since the LOD stages will still point to the old model type.

I think Steve's solution might be best, since this will be a rare occurrence: "We might have to disable LOD for any AI whose model has been fiddled with if there's not a cleverer solution. "
TagsNo tags attached.
Attached Files
lodmodelrule.map (9,498 bytes)   
Version 2
// entity 0
{
"classname" "worldspawn"
"editor_drLastCameraPos" "226.6 -298.28 105.138"
"editor_drLastCameraAngle" "-7.5 82.2 0"
"editor_drMapPos1" "622.965 891.597 194.506"
"editor_drMapAngle1" "0 4.7 0"
"editor_drMapPos2" "856 856 194.506"
"editor_drMapAngle2" "0 -88.6028 0"
"editor_drMapPos3" "832 264 194.506"
"editor_drMapAngle3" "0 82.1467 0"
"editor_drMapPos4" "462.987 512.708 197.518"
"editor_drMapAngle4" "-2.8 151.047 0"
"editor_drMapPos5" "395.633 301.73 201.855"
"editor_drMapAngle5" "-2.6 187.447 0"
"editor_drMapPos6" "406.528 296.563 56.6098"
"editor_drMapAngle6" "-4 187.247 0"
"editor_drMapPos7" "952.822 285.005 1366.04"
"editor_drMapAngle7" "-74.8 149.373 0"
"editor_drMapPos8" "976 424 320"
"editor_drMapAngle8" "-3 15.3467 0"
"editor_drMapPos9" "409.146 547.464 392.83"
"editor_drMapAngle9" "-16.8 284.947 0"
// primitive 0
{
brushDef3
{
( 0 0 1 -208 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -816 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -576 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -64 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 1
{
brushDef3
{
( 0 0 1 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -832 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 0 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -576 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 816 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 2
{
brushDef3
{
( 0 1 0 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -816 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 -16 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -576 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -64 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 1 0 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 3
{
brushDef3
{
( 0 0 1 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -816 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 0 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -592 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -64 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 576 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 4
{
brushDef3
{
( 0 0 1 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 0 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -576 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -80 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 64 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 5
{
brushDef3
{
( 0 0 1 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 -208 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -64 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -816 ) ( ( 0.01302083302289248 0 -3.541666507720947 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 0 ) ( ( 0.01302083302289248 0 -3.541666507720947 ) ( 0 0.01302083302289248 0.5208333134651184 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 6
{
brushDef3
{
( 0 0 -1 144 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( 0 -1 0 64 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( 1 0 0 -544 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( 0 0 1 -160 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( 0 1 0 -144 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( -1 0 0 448 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
}
}
}
// entity 1
{
"classname" "atdm:ambient_world"
"name" "ambient_world"
"_color" "0.22 0.22 0.22"
"light_center" "0 0 0"
"light_radius" "832 944 320"
"nodiffuse" "0"
"noshadows" "0"
"nospecular" "0"
"origin" "-32 0 160"
"parallel" "0"
"texture" "lights/ambientlightnfo"
}
// entity 2
{
"classname" "info_player_start"
"name" "info_player_start_1"
"angle" "90"
"origin" "117 -162 0"
}
// entity 3
{
"classname" "light"
"name" "light_1"
"_color" "0.21 0.17 0.04"
"light_center" "0 0 0"
"light_radius" "960 848 320"
"nodiffuse" "0"
"noshadows" "0"
"nospecular" "0"
"origin" "0 32 160"
"parallel" "0"
"texture" "lights/biground1"
}
// entity 4
{
"classname" "atdm:ai_builder_guard"
"name" "model_BBB_default"
"origin" "-1.21166 126.789 0.0218201"
"rotation" "0 -1 0 1 0 0 0 0 1"
"team" "0"
}
// entity 5
{
"classname" "atdm:ai_builder_guard"
"name" "model_CBB_0_only"
"model" "tdm_ai_citywatch"
"origin" "94.788 126.789 0.0218201"
"rotation" "0 -1 0 1 0 0 0 0 1"
"team" "0"
}
// entity 6
{
"classname" "atdm:ai_builder_guard"
"name" "model_CBC_02"
"model" "tdm_ai_citywatch"
"model_lod_2" "tdm_ai_citywatch"
"origin" "190.788 126.789 0.0218201"
"rotation" "0 -1 0 1 0 0 0 0 1"
"team" "0"
}
// entity 7
{
"classname" "atdm:ai_builder_guard"
"name" "model_CBBC_4thAdded"
"model" "tdm_ai_citywatch"
"model_lod_4" "tdm_ai_citywatch"
"origin" "286.788 126.789 0.0218201"
"rotation" "0 -1 0 1 0 0 0 0 1"
"team" "0"
}
// entity 8
{
"classname" "func_static"
"name" "func_static_1"
"model" "func_static_1"
"origin" "704 136 32"
"hide_distance" "100"
// primitive 0
{
brushDef3
{
( 0 0 1 -16 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( 0 1 0 -8 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( 1 0 0 -32 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( 0 0 -1 -16 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( 0 -1 0 -8 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( -1 0 0 -32 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
}
}
}
// entity 9
{
"classname" "func_static"
"name" "func_static_2"
"model" "func_static_2"
"origin" "496 104 136"
"hide_distance" "100"
// primitive 0
{
brushDef3
{
( 0 0 -1 -8 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/darkmod/weather/rain_heavy" 0 0 0
( 0 -1 0 -40 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( 1 0 0 -48 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( 0 0 1 -8 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( 0 1 0 -40 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
( -1 0 0 -48 ) ( ( 0.015625 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/carpet/rugs/ornate_red_tan02" 0 0 0
}
}
}
lodmodelrule.map (9,498 bytes)   

Relationships

has duplicate 0004303 closedSteveL hide_distance not hiding entities (without an LOD model set) 

Activities

SteveL

SteveL

15.11.2014 16:44

reporter   ~0007131

@Springheel: If you decide you want LOD disabling for AI with a new model, just assign me the issue. I can't think of any other way but you know the setup much better than I do. Disabling it in the game gode would be trivial -- AI already have the "no_lod" spawnarg which sets an on/off switch for LOD.
Springheel

Springheel

15.11.2014 19:32

administrator   ~0007134

Last edited: 15.11.2014 19:33

I think that's the way to go. It won't be a performance issue since very few AI will be affected. The only issue I'll have to double-check is to make sure that all the old "model" spawnargs still refer to an actual modelDef. If not we can always add a legacy version.

SteveL

SteveL

18.11.2014 20:23

reporter   ~0007142

I'm not sure what that means. Am I ok to go ahead and suppress LOD if there's a "model" spawnarg, or shall I wait for confirmation from you? If there's an extra condition to check, let me know.
Springheel

Springheel

21.11.2014 16:03

administrator   ~0007154

"Am I ok to go ahead and suppress LOD if there's a "model" spawnarg"

Yep.
SteveL

SteveL

23.11.2014 10:20

reporter   ~0007160

The rule:
If the mapper overrides the "model" spawnarg but doesn't override any "model_lod" spawnargs, we disable LOD on the entity.

If the mapper overrides at least one "model_lod" spawnarg too, that shows they have it in hand so we don't disable LOD on the entity.

That should fix maps with a changed model, without the mapper having to do anything, while still letting Biker have a builder archer with LOD if he wants to add the extra LOD models too.
SteveL

SteveL

23.11.2014 10:25

reporter   ~0007161

Tried to wikify this info, but the wiki is read only?? I'll query it in the forum
SteveL

SteveL

23.11.2014 10:28

reporter   ~0007162

Committed at rev 6170

Entity.cpp

That's just the code. I'll do new binaries later when I've commited soft particles.
grayman

grayman

26.07.2015 19:52

viewer   ~0007668

The solution doesn't handle the case where a func_static has no default model in its entityDef.

For example, this causes func_statics that only use a 'hide_distance' (like weather patches) to stop working.
SteveL

SteveL

29.07.2015 17:04

reporter   ~0007671

The fix above was to allow LOD models to be added to existing AI without breaking maps where the mapper had overridden the default model. We don't want Builder archers who're based on a City Guard archer with model and vocals overriden, to turn back into a city guard when the player gets further away. So LOD gets disabled where the default model is overridden, unless the mapper has specified LOD models too.

Fixed by checking whether LOD was inherited before disabling it. We don't need to disable it where it wasn't set up in the first place.

That was in fact the original plan. I've been able to leave my original comment in place unamended:
// Disable LOD if the LOD settings came with the entity def but the mapper has overridden the model
// without updating any LOD models # 3912

But the code checked only for the overriden model. It omitted to check whether LOD had been inherited :-/
SteveL

SteveL

29.07.2015 17:06

reporter   ~0007672

at rev 6522

game/Entity.cpp
SteveL

SteveL

29.07.2015 17:16

reporter   ~0007673

Last edited: 29.07.2015 17:16

In the attached test map, all 4 guards in the line are TDM 2.03 Builder guards with 3 LOD stages.

The 1st guard on the left has default spawnargs, = 3 active LOD stages.

Guard 2 has his default model changed to City Guard, but no LOD models specified. LOD should be disabled on him.

Guard 3 has his default model and his most distant model changed to City Guard, but LOD stage 2 is ignored. He should change to a Builder at medium distances.

Guard 4 has a non-existent LOD stage 4 model override. There's no LOD stage 4, but that setting should be enough to stop LOD being disabled, and to make him change back to a Builder at all but close distances.

Further down the line, the floating carpet square should rain on you when you stand under it. A weather particle with hide_distance only set.

Last up, when you get into the corner beyond the line up, another chunk of floating carpet should appear. A FS with hide_distance only set.

Issue History

Date Modified Username Field Change
14.11.2014 22:06 Springheel New Issue
14.11.2014 22:06 Springheel Target Version => TDM 2.03
15.11.2014 16:44 SteveL Note Added: 0007131
15.11.2014 19:32 Springheel Note Added: 0007134
15.11.2014 19:33 Springheel Note Edited: 0007134
15.11.2014 19:33 Springheel Assigned To => SteveL
15.11.2014 19:33 Springheel Status new => assigned
18.11.2014 20:23 SteveL Note Added: 0007142
21.11.2014 07:25 SteveL Status assigned => feedback
21.11.2014 16:03 Springheel Note Added: 0007154
21.11.2014 16:03 Springheel Status feedback => assigned
23.11.2014 10:20 SteveL Note Added: 0007160
23.11.2014 10:25 SteveL Note Added: 0007161
23.11.2014 10:28 SteveL Note Added: 0007162
23.11.2014 10:28 SteveL Status assigned => resolved
23.11.2014 10:28 SteveL Fixed in Version => TDM 2.03
23.11.2014 10:28 SteveL Resolution open => fixed
26.07.2015 19:52 grayman Note Added: 0007668
26.07.2015 19:52 grayman Status resolved => assigned
26.07.2015 19:52 grayman Fixed in Version TDM 2.03 =>
26.07.2015 19:52 grayman Target Version TDM 2.03 => TDM 2.04
29.07.2015 17:04 SteveL Note Added: 0007671
29.07.2015 17:06 SteveL Note Added: 0007672
29.07.2015 17:16 SteveL Note Added: 0007673
29.07.2015 17:16 SteveL Note Edited: 0007673
29.07.2015 17:17 SteveL File Added: lodmodelrule.map
29.07.2015 17:19 SteveL Status assigned => resolved
29.07.2015 17:19 SteveL Fixed in Version => TDM 2.04
11.06.2016 12:49 SteveL Relationship added has duplicate 0004303