motorsep@Posted: Wed Sep 26, 2012 5:29 am :
I have an entity that inherits func_animate on the map (animated md5 model). When I get too close to it, it disappears. I move away, it appears. I would prefer for it to just be there when I pass through it. Has anyone encountered and resolved similar issue?

Here are the entity's setting:

Image



BloodRayne@Posted: Wed Sep 26, 2012 6:54 am :
I have the exact same issue in Grimm. No clue how to solve it.



Gary@Posted: Wed Sep 26, 2012 7:09 am :
Bounding box problems? LODs set up wrong/corrupt? Are there fade/render distances per entity in Doom3? If so, those values maybe wrong. (Wait, maybe there are no LODs in D3... can't remember)

I'm just guessing, I'm a Source modder. So I'm just saying what ever causes a similar problems...



solarsplace@Posted: Wed Sep 26, 2012 10:35 am :
Hi

I am not 100% sure if this is what you are experiencing exactly but...

EDIT: What I say here is not quite correct. You can in fact use "mins" and "maxs" to set up a basic clip bounding box.

Where you aware that func_animate (idAnimated) does not have code in the SDK to set up a clip model at all.

So you will always be able to walk through it (It may dissapear from view if player is in / on it) unless you bind a func_clipmodel to it, put clip brushes around it or modify the SDK code so that you can enter a simple bounding box clip setup from an entity def if you are using a lot of them like myself and you decide its worth it.

Hope that helps.

Cheers



The Happy Friar@Posted: Wed Sep 26, 2012 1:05 pm :
I did a quick check in game and it looks like idanimated is always used for cinematics... I thought there was some bridges & what not where it wasn't. :?



motorsep@Posted: Wed Sep 26, 2012 3:53 pm :
@solarsplace: care to share your SDK code? :)



solarsplace@Posted: Wed Sep 26, 2012 4:07 pm :
Hi

How could I refuse! - here you go.

Code:
/*
===============
idAnimated::Spawn
================
*/
void idAnimated::Spawn( void ) {
   idStr      animname;
   int         anim2;
   float      wait;
   const char   *joint;

   joint = spawnArgs.GetString( "sound_bone", "origin" );
   soundJoint = animator.GetJointHandle( joint );
   if ( soundJoint == INVALID_JOINT ) {
      gameLocal.Warning( "idAnimated '%s' at (%s): cannot find joint '%s' for sound playback", name.c_str(), GetPhysics()->GetOrigin().ToString(0), joint );
   }

   LoadAF();

   // allow bullets to collide with a combat model
   if ( spawnArgs.GetBool( "combatModel", "0" ) ) {
      combatModel = new idClipModel( modelDefHandle );
   }

   // allow the entity to take damage
   if ( spawnArgs.GetBool( "takeDamage", "0" ) ) {
      fl.takedamage = true;
   }

   blendFrames = 0;

   current_anim_index = 0;
   spawnArgs.GetInt( "num_anims", "0", num_anims );

   blendFrames = spawnArgs.GetInt( "blend_in" );

   animname = spawnArgs.GetString( num_anims ? "anim1" : "anim" );
   if ( !animname.Length() ) {
      anim = 0;
   } else {
      anim = animator.GetAnim( animname );
      if ( !anim ) {
         gameLocal.Error( "idAnimated '%s' at (%s): cannot find anim '%s'", name.c_str(), GetPhysics()->GetOrigin().ToString(0), animname.c_str() );
      }
   }

   if ( spawnArgs.GetBool( "hide" ) ) {
      Hide();

      if ( !num_anims ) {
         blendFrames = 0;
      }
   } else if ( spawnArgs.GetString( "start_anim", "", animname ) ) {
      anim2 = animator.GetAnim( animname );
      if ( !anim2 ) {
         gameLocal.Error( "idAnimated '%s' at (%s): cannot find anim '%s'", name.c_str(), GetPhysics()->GetOrigin().ToString(0), animname.c_str() );
      }
      animator.CycleAnim( ANIMCHANNEL_ALL, anim2, gameLocal.time, 0 );
   } else if ( anim ) {
      // init joints to the first frame of the animation
      animator.SetFrame( ANIMCHANNEL_ALL, anim, 1, gameLocal.time, 0 );      

      if ( !num_anims ) {
         blendFrames = 0;
      }
   }

   spawnArgs.GetFloat( "wait", "-1", wait );

   // **************************************************************
   // **************************************************************
   // *** Solarsplace - 22nd Dec 2011 - Make func_animated solid

   idClipModel *clipModel = NULL;
   idVec3 size;
   idBounds bounds;
   bool setClipModel = false;

   if ( spawnArgs.GetVector( "arx_clip_size", NULL, size ) ) {

      if ( ( size.x < 0.0f ) || ( size.y < 0.0f ) || ( size.z < 0.0f ) ) {
         gameLocal.Error( "idAnimated::Spawn - Invalid size '%s' on entity '%s'", size.ToString(), name.c_str() );
      }

      bounds[0].Set( size.x * -0.5f, size.y * -0.5f, 0.0f );
      bounds[1].Set( size.x * 0.5f, size.y * 0.5f, size.z );
      setClipModel = true;
   }

   if ( setClipModel ) {

      idTraceModel trm;
      trm.SetupBox( bounds );
      clipModel = new idClipModel( trm );
   
      GetPhysics()->SetClipModel( clipModel, 1.0f );
      GetPhysics()->SetContents( CONTENTS_SOLID );
   }

   // **************************************************************
   // **************************************************************

   if ( wait >= 0 ) {
      PostEventSec( &EV_Activate, wait, this );
   }
}


Edit:

Then add a key to your entity in the editor or set up a .def item like this etc:

entityDef myThing {

"inherit" "func_animate"

"arx_clip_size" "8 16 32" // Solarplace - Custom SDK - Make idAnimate have clip model.

"model" "myThing"

etc...



BloodRayne@Posted: Wed Sep 26, 2012 4:17 pm :
I've tested with this extensively before in Grimm.

It's entirely possible to clip a func_animate without code or mapping fuzz like clip/func_clip.

Just add this to the entitydef of the func_animate:
"mins" "size size size"
"maxs" "size size size"

(not to be confused with 'editor_mins' and 'editor_maxs')

Then the engine will clip the func_animate. But that doesn't solve this problem, which also happens with af's.
(attached a shot with g_showEntityInfo option on to show the clip working, the blue box around the flag shows where it clips).

Attachment:
shot00211.jpg
shot00211.jpg [ 320.96 KB | Viewed 38 times ]


It has to do with the origin bone and the way the engine lods a func_animate somehow.
It only happens when you look below a certain angle, e.g. the origin bone of the func_animate falls 'out of view', the engine then clips the entire func_animate.

I can't sit up longer than 5 mins otherwise I'd be experimenting with it further right now, I would like to see what happens when you place the origin bone on the ground.



motorsep@Posted: Wed Sep 26, 2012 4:25 pm :
solarsplace wrote:
Hi
"arx_clip_size" "8 16 32" // Solarplace - Custom SDK - Make idAnimate have clip model.
etc...


Thanks man!

So does that mean collision boundaries are static? What if my models changes its shape and angles and comes out of the set boundaries ?



motorsep@Posted: Wed Sep 26, 2012 4:29 pm :
BloodRayne wrote:
Then the engine will clip the func_animate. But that doesn't solve this problem, which also happens with af's. (attached a shot with g_showEntityInfo option on to show the clip working, the blue box around the flag shows where it clips).


So I suppose clipping origin bone with brushes is a thing to do? My model doesn't disappear under different view angles, only if I get too close to it.



solarsplace@Posted: Wed Sep 26, 2012 4:31 pm :
Hi

Intersting about your func_animate dissapearing. I have these on walls too as wall torches and have never see them dissapear :shock: - how very odd!

About the clip model - I think (but need to check when I get home) that the mins and maxes will not work on an idAnimated object.

The reason I say this is that idEntity from its 'spawn' function makes a call to 'InitDefaultPhysics' which seems to be the only place that 'mins' and 'maxs' are read. However idAnimated has its own 'spawn' method and does not make any call to 'InitDefaultPhysics' to set up any default collision.

Are you sure you have not got one of your special scripts spawning some func_clipmodel?

Anyway - i'l double check later - cant see how its possible from looking at the code right now...

Cheers



BloodRayne@Posted: Wed Sep 26, 2012 4:37 pm :
solarsplace wrote:
Hi

Intersting about your func_animate dissapearing. I have these on walls too as wall torches and have never see them dissapear :shock: - how very odd!

About the clip model - I think (but need to check when I get home) that the mins and maxes will not work on an idAnimated object.

The reason I say this is that idEntity from its 'spawn' function makes a call to 'InitDefaultPhysics' which seems to be the only place that 'mins' and 'maxs' are read. However idAnimated has its own 'spawn' method and does not make any call to 'InitDefaultPhysics' to set up any default collision.

Are you sure you have not got one of your special scripts spawning some func_clipmodel?

Anyway - i'l double check later - cant see how its possible from looking at the code right now...

Cheers

I have it working, no scripting nothing. It must be inheriting from a lower base function or something.
mins/maxs works 100%, no code necessary.



The Happy Friar@Posted: Wed Sep 26, 2012 5:06 pm :
I've been looking at the stock models that use idAnimate and I don't believe it's the origin bone. I can't get one entity in the stock game that uses idAnimate to dissapear (specifically trying with enpro_cin_female & caverns_bridge). I can move all around them, close, far, etc. and they always look as expected.

I've noticed the disappear if I spawn the flag entity or if I use the testmodel+testanim commands, so it's not entity related (as testmodel doesn't need an entitydef to work, just a modeldef or a physical model in a folder, such as a .ase).

I've noticed that with the custom flag I'm testing from motorsep, when the origin isn't in my FOV the flag disappears, then the bones disappear too when the origin bone bounding box leaves my view. That does NOT happen with poppy or the bridge.

You're both doing flags (bloodrayne's pic shows a flag), right? You're both using the vertex-to-md5 exporter?

Maybe it's the exporter. could explain why solarplace doesn't have the issue, he's not using that exporter. I believe I reexported my flag though and it still happened. Maybe a blender 2.6x thing, or a newer exporter thing? I still use 2.49 for the most part.

EDIT: min/max most likely work because the code looks like it also uses idAFEntity_Gibbable.



motorsep@Posted: Wed Sep 26, 2012 5:09 pm :
Are stock entities md5 models or lwo/ase models?



The Happy Friar@Posted: Wed Sep 26, 2012 5:10 pm :
both. items/pickups/movables are ase/lwo & animated are md5.



The Happy Friar@Posted: Wed Sep 26, 2012 5:23 pm :
It's definitely the custom content & not the engine, I put all the d3 pk4 files in to motorsep's engine and everything stock D3 works.



solarsplace@Posted: Wed Sep 26, 2012 5:26 pm :
Hi

I think BR is correct the mins and maxs will generate a clip model, having looked at the code again. Wish I knew that before doing some un-needed custom code - oh well..... one learns from experience.

I forgot that the 'spawn' functions in the SDK are slightly different than usual setup. The 'spawn' method is executed first for idEntity and then in addition the 'spawn' method for each class that inherits from idEntity is called in addition not instead of.

My retarded - sorry for any confusion.

Cheers



motorsep@Posted: Wed Sep 26, 2012 5:40 pm :
The Happy Friar wrote:
It's definitely the custom content & not the engine, I put all the d3 pk4 files in to motorsep's engine and everything stock D3 works.


Can you please specify the map and the model in stock Doom 3 or rather RoE which has func_animate with md5 model?



The Happy Friar@Posted: Wed Sep 26, 2012 6:15 pm :
Like I said, it's just not the func_animate, it also happens with a testModel & testAnim.

I looked @ enpro_cin_female (poppy in game/enpro) & caverns_bridge (map game/caverns2).

the bridge uses the spawnclass "idAnimated" in it's def and poppy inherits cin_base, which itself inherits func_animated and uses the spawnclass "idAnimated", and func_animated uses spawnclass "idAnimated" (don't forget, when you inherit you assume all the properties of the inherited entity and what's changed is what's in your new entityDef).

I took my hitler md5mesh/anim & made a new .def file that's based around caverns_bridge. Long story short, it works just like you'd expect: plays animations w/o disappearing (no collision though).
Attachment:
hitler_anim.zip [1.36 MB]
Downloaded 19 times


Rename it to .pk4 to view it in game: "testmodel hitler_test" "testanim fire" (or walk).



motorsep@Posted: Wed Sep 26, 2012 6:21 pm :
See, you don't inherit func_animate, you simply spawn model with idAnimated spawnclass. That means you don't have that flexibility of messing with your model via triggers (not that the flag needs that).

Here is the video of how the issue looks like: http://www.youtube.com/watch?v=tujS3AkLKkQ



The Happy Friar@Posted: Wed Sep 26, 2012 7:13 pm :
I know what it does.

I checked: testmodel inherits from idAnimated, which func_animate does.

Any entity that calls the class "idAnimated" all have the same functionality, func_animate just sets up defaults. key/values are based on the class not the entityDef.

Either way, it's an asset issue. I have a flag model for Quake 2 I made, maybe later I'll try to port it to D3.



Brain Trepaning@Posted: Wed Sep 26, 2012 7:41 pm :
I used to fix this by moving the placement of the origin bone prior to export from the modeling program. I found when the model's origin point (red spot) in the editor was a few units away from the actual model because I did not build it on 0,0,0, the model would disappear when i got close and the origin bone point was no longer in my FOV.



motorsep@Posted: Wed Sep 26, 2012 8:57 pm :
Ok, I messed with origin bone and I can confirm that disappearance happens when origin bone is out of player's FOV.



The Happy Friar@Posted: Thu Sep 27, 2012 2:50 am :
I took motorsep's flag model ,imported it in to Blender 249 & reexported it and it worked no issues.

The animation files are different for some reason. He used 2.63 with md5exporter I believe, so try using 2.49 to re-export and see if it works.



motorsep@Posted: Thu Sep 27, 2012 10:01 pm :
That I confirm. For whatever reason block of code that generates bounds for each frame isn't working correctly on 2.63.

And that's the only issue with the output. I manually replaced bounds in 2.63 output and the func_animate no longer disappears.



motorsep@Posted: Wed Sep 26, 2012 5:29 am :
I have an entity that inherits func_animate on the map (animated md5 model). When I get too close to it, it disappears. I move away, it appears. I would prefer for it to just be there when I pass through it. Has anyone encountered and resolved similar issue?

Here are the entity's setting:

Image



BloodRayne@Posted: Wed Sep 26, 2012 6:54 am :
I have the exact same issue in Grimm. No clue how to solve it.



Gary@Posted: Wed Sep 26, 2012 7:09 am :
Bounding box problems? LODs set up wrong/corrupt? Are there fade/render distances per entity in Doom3? If so, those values maybe wrong. (Wait, maybe there are no LODs in D3... can't remember)

I'm just guessing, I'm a Source modder. So I'm just saying what ever causes a similar problems...



solarsplace@Posted: Wed Sep 26, 2012 10:35 am :
Hi

I am not 100% sure if this is what you are experiencing exactly but...

EDIT: What I say here is not quite correct. You can in fact use "mins" and "maxs" to set up a basic clip bounding box.

Where you aware that func_animate (idAnimated) does not have code in the SDK to set up a clip model at all.

So you will always be able to walk through it (It may dissapear from view if player is in / on it) unless you bind a func_clipmodel to it, put clip brushes around it or modify the SDK code so that you can enter a simple bounding box clip setup from an entity def if you are using a lot of them like myself and you decide its worth it.

Hope that helps.

Cheers



The Happy Friar@Posted: Wed Sep 26, 2012 1:05 pm :
I did a quick check in game and it looks like idanimated is always used for cinematics... I thought there was some bridges & what not where it wasn't. :?



motorsep@Posted: Wed Sep 26, 2012 3:53 pm :
@solarsplace: care to share your SDK code? :)



solarsplace@Posted: Wed Sep 26, 2012 4:07 pm :
Hi

How could I refuse! - here you go.

Code:
/*
===============
idAnimated::Spawn
================
*/
void idAnimated::Spawn( void ) {
   idStr      animname;
   int         anim2;
   float      wait;
   const char   *joint;

   joint = spawnArgs.GetString( "sound_bone", "origin" );
   soundJoint = animator.GetJointHandle( joint );
   if ( soundJoint == INVALID_JOINT ) {
      gameLocal.Warning( "idAnimated '%s' at (%s): cannot find joint '%s' for sound playback", name.c_str(), GetPhysics()->GetOrigin().ToString(0), joint );
   }

   LoadAF();

   // allow bullets to collide with a combat model
   if ( spawnArgs.GetBool( "combatModel", "0" ) ) {
      combatModel = new idClipModel( modelDefHandle );
   }

   // allow the entity to take damage
   if ( spawnArgs.GetBool( "takeDamage", "0" ) ) {
      fl.takedamage = true;
   }

   blendFrames = 0;

   current_anim_index = 0;
   spawnArgs.GetInt( "num_anims", "0", num_anims );

   blendFrames = spawnArgs.GetInt( "blend_in" );

   animname = spawnArgs.GetString( num_anims ? "anim1" : "anim" );
   if ( !animname.Length() ) {
      anim = 0;
   } else {
      anim = animator.GetAnim( animname );
      if ( !anim ) {
         gameLocal.Error( "idAnimated '%s' at (%s): cannot find anim '%s'", name.c_str(), GetPhysics()->GetOrigin().ToString(0), animname.c_str() );
      }
   }

   if ( spawnArgs.GetBool( "hide" ) ) {
      Hide();

      if ( !num_anims ) {
         blendFrames = 0;
      }
   } else if ( spawnArgs.GetString( "start_anim", "", animname ) ) {
      anim2 = animator.GetAnim( animname );
      if ( !anim2 ) {
         gameLocal.Error( "idAnimated '%s' at (%s): cannot find anim '%s'", name.c_str(), GetPhysics()->GetOrigin().ToString(0), animname.c_str() );
      }
      animator.CycleAnim( ANIMCHANNEL_ALL, anim2, gameLocal.time, 0 );
   } else if ( anim ) {
      // init joints to the first frame of the animation
      animator.SetFrame( ANIMCHANNEL_ALL, anim, 1, gameLocal.time, 0 );      

      if ( !num_anims ) {
         blendFrames = 0;
      }
   }

   spawnArgs.GetFloat( "wait", "-1", wait );

   // **************************************************************
   // **************************************************************
   // *** Solarsplace - 22nd Dec 2011 - Make func_animated solid

   idClipModel *clipModel = NULL;
   idVec3 size;
   idBounds bounds;
   bool setClipModel = false;

   if ( spawnArgs.GetVector( "arx_clip_size", NULL, size ) ) {

      if ( ( size.x < 0.0f ) || ( size.y < 0.0f ) || ( size.z < 0.0f ) ) {
         gameLocal.Error( "idAnimated::Spawn - Invalid size '%s' on entity '%s'", size.ToString(), name.c_str() );
      }

      bounds[0].Set( size.x * -0.5f, size.y * -0.5f, 0.0f );
      bounds[1].Set( size.x * 0.5f, size.y * 0.5f, size.z );
      setClipModel = true;
   }

   if ( setClipModel ) {

      idTraceModel trm;
      trm.SetupBox( bounds );
      clipModel = new idClipModel( trm );
   
      GetPhysics()->SetClipModel( clipModel, 1.0f );
      GetPhysics()->SetContents( CONTENTS_SOLID );
   }

   // **************************************************************
   // **************************************************************

   if ( wait >= 0 ) {
      PostEventSec( &EV_Activate, wait, this );
   }
}


Edit:

Then add a key to your entity in the editor or set up a .def item like this etc:

entityDef myThing {

"inherit" "func_animate"

"arx_clip_size" "8 16 32" // Solarplace - Custom SDK - Make idAnimate have clip model.

"model" "myThing"

etc...



BloodRayne@Posted: Wed Sep 26, 2012 4:17 pm :
I've tested with this extensively before in Grimm.

It's entirely possible to clip a func_animate without code or mapping fuzz like clip/func_clip.

Just add this to the entitydef of the func_animate:
"mins" "size size size"
"maxs" "size size size"

(not to be confused with 'editor_mins' and 'editor_maxs')

Then the engine will clip the func_animate. But that doesn't solve this problem, which also happens with af's.
(attached a shot with g_showEntityInfo option on to show the clip working, the blue box around the flag shows where it clips).

Attachment:
shot00211.jpg
shot00211.jpg [ 320.96 KB | Viewed 38 times ]


It has to do with the origin bone and the way the engine lods a func_animate somehow.
It only happens when you look below a certain angle, e.g. the origin bone of the func_animate falls 'out of view', the engine then clips the entire func_animate.

I can't sit up longer than 5 mins otherwise I'd be experimenting with it further right now, I would like to see what happens when you place the origin bone on the ground.



motorsep@Posted: Wed Sep 26, 2012 4:25 pm :
solarsplace wrote:
Hi
"arx_clip_size" "8 16 32" // Solarplace - Custom SDK - Make idAnimate have clip model.
etc...


Thanks man!

So does that mean collision boundaries are static? What if my models changes its shape and angles and comes out of the set boundaries ?



motorsep@Posted: Wed Sep 26, 2012 4:29 pm :
BloodRayne wrote:
Then the engine will clip the func_animate. But that doesn't solve this problem, which also happens with af's. (attached a shot with g_showEntityInfo option on to show the clip working, the blue box around the flag shows where it clips).


So I suppose clipping origin bone with brushes is a thing to do? My model doesn't disappear under different view angles, only if I get too close to it.



solarsplace@Posted: Wed Sep 26, 2012 4:31 pm :
Hi

Intersting about your func_animate dissapearing. I have these on walls too as wall torches and have never see them dissapear :shock: - how very odd!

About the clip model - I think (but need to check when I get home) that the mins and maxes will not work on an idAnimated object.

The reason I say this is that idEntity from its 'spawn' function makes a call to 'InitDefaultPhysics' which seems to be the only place that 'mins' and 'maxs' are read. However idAnimated has its own 'spawn' method and does not make any call to 'InitDefaultPhysics' to set up any default collision.

Are you sure you have not got one of your special scripts spawning some func_clipmodel?

Anyway - i'l double check later - cant see how its possible from looking at the code right now...

Cheers



BloodRayne@Posted: Wed Sep 26, 2012 4:37 pm :
solarsplace wrote:
Hi

Intersting about your func_animate dissapearing. I have these on walls too as wall torches and have never see them dissapear :shock: - how very odd!

About the clip model - I think (but need to check when I get home) that the mins and maxes will not work on an idAnimated object.

The reason I say this is that idEntity from its 'spawn' function makes a call to 'InitDefaultPhysics' which seems to be the only place that 'mins' and 'maxs' are read. However idAnimated has its own 'spawn' method and does not make any call to 'InitDefaultPhysics' to set up any default collision.

Are you sure you have not got one of your special scripts spawning some func_clipmodel?

Anyway - i'l double check later - cant see how its possible from looking at the code right now...

Cheers

I have it working, no scripting nothing. It must be inheriting from a lower base function or something.
mins/maxs works 100%, no code necessary.



The Happy Friar@Posted: Wed Sep 26, 2012 5:06 pm :
I've been looking at the stock models that use idAnimate and I don't believe it's the origin bone. I can't get one entity in the stock game that uses idAnimate to dissapear (specifically trying with enpro_cin_female & caverns_bridge). I can move all around them, close, far, etc. and they always look as expected.

I've noticed the disappear if I spawn the flag entity or if I use the testmodel+testanim commands, so it's not entity related (as testmodel doesn't need an entitydef to work, just a modeldef or a physical model in a folder, such as a .ase).

I've noticed that with the custom flag I'm testing from motorsep, when the origin isn't in my FOV the flag disappears, then the bones disappear too when the origin bone bounding box leaves my view. That does NOT happen with poppy or the bridge.

You're both doing flags (bloodrayne's pic shows a flag), right? You're both using the vertex-to-md5 exporter?

Maybe it's the exporter. could explain why solarplace doesn't have the issue, he's not using that exporter. I believe I reexported my flag though and it still happened. Maybe a blender 2.6x thing, or a newer exporter thing? I still use 2.49 for the most part.

EDIT: min/max most likely work because the code looks like it also uses idAFEntity_Gibbable.



motorsep@Posted: Wed Sep 26, 2012 5:09 pm :
Are stock entities md5 models or lwo/ase models?



The Happy Friar@Posted: Wed Sep 26, 2012 5:10 pm :
both. items/pickups/movables are ase/lwo & animated are md5.



The Happy Friar@Posted: Wed Sep 26, 2012 5:23 pm :
It's definitely the custom content & not the engine, I put all the d3 pk4 files in to motorsep's engine and everything stock D3 works.



solarsplace@Posted: Wed Sep 26, 2012 5:26 pm :
Hi

I think BR is correct the mins and maxs will generate a clip model, having looked at the code again. Wish I knew that before doing some un-needed custom code - oh well..... one learns from experience.

I forgot that the 'spawn' functions in the SDK are slightly different than usual setup. The 'spawn' method is executed first for idEntity and then in addition the 'spawn' method for each class that inherits from idEntity is called in addition not instead of.

My retarded - sorry for any confusion.

Cheers



motorsep@Posted: Wed Sep 26, 2012 5:40 pm :
The Happy Friar wrote:
It's definitely the custom content & not the engine, I put all the d3 pk4 files in to motorsep's engine and everything stock D3 works.


Can you please specify the map and the model in stock Doom 3 or rather RoE which has func_animate with md5 model?



The Happy Friar@Posted: Wed Sep 26, 2012 6:15 pm :
Like I said, it's just not the func_animate, it also happens with a testModel & testAnim.

I looked @ enpro_cin_female (poppy in game/enpro) & caverns_bridge (map game/caverns2).

the bridge uses the spawnclass "idAnimated" in it's def and poppy inherits cin_base, which itself inherits func_animated and uses the spawnclass "idAnimated", and func_animated uses spawnclass "idAnimated" (don't forget, when you inherit you assume all the properties of the inherited entity and what's changed is what's in your new entityDef).

I took my hitler md5mesh/anim & made a new .def file that's based around caverns_bridge. Long story short, it works just like you'd expect: plays animations w/o disappearing (no collision though).
Attachment:
hitler_anim.zip [1.36 MB]
Downloaded 19 times


Rename it to .pk4 to view it in game: "testmodel hitler_test" "testanim fire" (or walk).



motorsep@Posted: Wed Sep 26, 2012 6:21 pm :
See, you don't inherit func_animate, you simply spawn model with idAnimated spawnclass. That means you don't have that flexibility of messing with your model via triggers (not that the flag needs that).

Here is the video of how the issue looks like: http://www.youtube.com/watch?v=tujS3AkLKkQ



The Happy Friar@Posted: Wed Sep 26, 2012 7:13 pm :
I know what it does.

I checked: testmodel inherits from idAnimated, which func_animate does.

Any entity that calls the class "idAnimated" all have the same functionality, func_animate just sets up defaults. key/values are based on the class not the entityDef.

Either way, it's an asset issue. I have a flag model for Quake 2 I made, maybe later I'll try to port it to D3.



Brain Trepaning@Posted: Wed Sep 26, 2012 7:41 pm :
I used to fix this by moving the placement of the origin bone prior to export from the modeling program. I found when the model's origin point (red spot) in the editor was a few units away from the actual model because I did not build it on 0,0,0, the model would disappear when i got close and the origin bone point was no longer in my FOV.



motorsep@Posted: Wed Sep 26, 2012 8:57 pm :
Ok, I messed with origin bone and I can confirm that disappearance happens when origin bone is out of player's FOV.



The Happy Friar@Posted: Thu Sep 27, 2012 2:50 am :
I took motorsep's flag model ,imported it in to Blender 249 & reexported it and it worked no issues.

The animation files are different for some reason. He used 2.63 with md5exporter I believe, so try using 2.49 to re-export and see if it works.



motorsep@Posted: Thu Sep 27, 2012 10:01 pm :
That I confirm. For whatever reason block of code that generates bounds for each frame isn't working correctly on 2.63.

And that's the only issue with the output. I manually replaced bounds in 2.63 output and the func_animate no longer disappears.