Jump to content

Huge bug-report


VeTaL
 Share

Recommended Posts

Ragdoll troubles

 

This post is connected with:

 

Soamp's post about yellow boxes

http://www.leadwerks.com/werkspace/topic/3186-blue-and-yellow-boxes/page__pid__29304#entry29304

Marleys Ghost's post about LODs management

http://www.leadwerks.com/werkspace/topic/3129-freeentity/page__p__28720__fromsearch__1#entry28720

 

I wrote this post in some hours, so this is quite serious work.

All tests are done with the LESoldierEntityAndGame entity with updated LUA-script with prototype of ragdoll

But lets start from the very begining:

 

1) What is the yellow box, which is stretching from (0,0,0) ?

1305362047-clip-220kb.jpg

1305362198-clip-221kb.jpg

1305362479-clip-227kb.jpg

 

2) how to force updating bounding box to the size of the model in current frame?

Enemy is dead, but its bbox is still standing as bbox of the first frame

1305364775-clip-61kb.jpg

(the yellow bboxes are annoying, but thie refers to 1 question)

 

3) LOD and animation

While trying to animate only current LOD

Animate(self.model, 
		((AppTime()+self.timeOffset)/1000.0) * class.NTSC_FPS, blend, 
		self.currentAnim-1, 1)

the animation will reset while LOD changing. (When camera if flying closer, the LOD is changes, and animation resets)

 

So, its needed to animate all LODs of the model:

for childId = 1, self.lodCount do
		local child = self.lods[childId]
		Animate(child, --self.model, 
			((AppTime()+self.timeOffset)/1000.0) * class.NTSC_FPS, blend, 
			self.currentAnim-1, 1)
	end

 

4) Number of LODs

Try to add into function object:updateAnimation() next code:

AppLog("CountChildren = "..CountChildren(self.model))

1305367443-clip-210kb.jpg

 

Result (distance is some abstract value, just for beign clean):

when you're close to solider (distance is 1), it shows 4

when the distance is 2, it shows 3 (but this is the number of LODs, its supposed to be a constant!)

1305367288-clip-155kb.jpg

when the distance is 5, it shows it shows 2

1305367317-clip-123kb.jpg

when the distance is more that 10, it shows 1

1305367342-clip-123kb.jpg

when the distance is again closer than 10, its still 1 [!!!]

when the diastance is less then 5, its 1

and finally, if we get closer to the mode, it shows that th number of childern is still 1 [wth?]

1305367377-clip-159kb.jpg

 

4.1) As LODs are lost - we can try to remember them. (but this is looking like hack: i dont think that Josh wanted programer to use LOD in this way)

--count and remember lods
for childId = 1, CountChildren(model) do
	local child = GetChild(model, childId)
	if child:GetClass() == ENTITY_MESH then
		object.lodCount = object.lodCount + 1
		object.lods[object.lodCount] = child
	end
end

1305368574-clip-198kb.jpg

 

In this case, i kill solider:

1305368775-clip-118kb.jpg

1305368915-clip-52kb.jpg

and get this unholy thing:

1305369016-clip-52kb.jpg

 

So, LODs are moving somewhere, idk where.

 

Physics debug:

moment of "death":

1305369216-clip-68kb.jpg

LOD changing after death:

1305369333-clip-78kb.jpg

 

Onr more screenshot without physic debug:

1305369393-clip-62kb.jpg

 

4.2) Okay, now we can try to reset position of LODs after LOD changing.

 

	for childId = 1, self.lodCount do
		local child = self.lods[childId]
		PositionEntity(child, EntityPosition(self.model, 1), 1)
		RotateEntity(child, EntityRotation(self.model, 1), 1)
		UpdateMesh(child)
	end

1305369535-clip-229kb.jpg

 

And we will see the next thing: right after death, there is a huge lag (about 2 seconds), because of updating LODs position.

Now there are no artifacts like before, BUT:

 

As we are close enough, we can see this:

1305369819-clip-70kb.jpg

Yellow box is sratching somewhere

 

As we step back, here is wat you see:

1305369905-clip-66kb.jpg

 

what is bad in this?

1305369971-clip-59kb.jpg

 

Only invisibility of the body:

1305370031-clip-87kb.jpg

+ 2 sec lag during death

 

 

Without debug:

1305370154-clip-74kb.jpg

 

Step back:

1305370202-clip-75kb.jpg

 

 

5) Problem with ball joints. They are not work properly, so i was needed to use hinge joint, which is not good. (see attach)

 

5.1) SetJointCollisionMode doesnt work at all

5.2) SetBallJointLimits doesnt work at all

5.3) joint:SetLimits doesnt work at all

 

PS: i'm too tired, if its needed to upload this report by parts to bugtracker - please, so it somebody else.

 

PPS: i forgot about one more

6) I can't drag created ragdoll body with mouse+shift, but i can drug oildrum.

Test_Ragdoll 2011-05-14 (ball join doesnt work).zip

Working on LeaFAQ :)

Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...