ttyborg / unflobtactical

Automatically exported from code.google.com/p/unflobtactical
0 stars 0 forks source link

time delta, asserts, and particles #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Running r578 in debug I hit an assert in BattleScene::ProcessAction, 
battlescene.cpp, line 1570:
GLASSERT( 0 );  // may be okay, but untested.

I continued passed the assert only to hit another assert in 
grinliz::BitArray::IsSet, glbitarray.h, line 64:
GLASSERT( x >= 0 && x < WIDTH );

This was happening because ParticleSystem::DrawQuadParticles was testing a 
particle against the fogOfWar that was outside of the map dimensions, see 
particle.cpp line 539.

I believe what happened was that the time delta became very large because the 
assert froze the game, which the large time delta caused a particle to be moved 
outside of the fogOfWar.

It may be useful to have a clamp on the time delta for when asserts or break 
points occur.

I'm not sure if it is necessary but it may not be a bad idea to either cull 
particles that leave the map or to avoiding checking the fogOfWar if they are 
outside of the map.

Original issue reported on code.google.com by leyland....@gmail.com on 23 Jan 2011 at 5:53

GoogleCodeExporter commented 9 years ago

Original comment by leethoma...@gmail.com on 24 Jan 2011 at 7:21

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Interesting...there is a time delta limiter in Android. It may need to get 
moved to core code.

The BattleScene assert is all out strange.

Original comment by leethoma...@gmail.com on 25 Jan 2011 at 2:51

GoogleCodeExporter commented 9 years ago
Fixed the particle bounds problem. The BattleScene continues to be elusive. If 
re-occurs can edit this bug or enter a new one.

Original comment by leethoma...@gmail.com on 25 Jan 2011 at 3:31

GoogleCodeExporter commented 9 years ago
This bug occurred debugging the windows version, so maybe the time delta issue 
only occurrs on that one. I can reproduce the particle induced bitarray assert 
pretty easy now, by putting a break point in the main loop after getting the 
time delta, and hitting f5 a few times, I can also see the time delta become 
very big.

Original comment by leyland....@gmail.com on 25 Jan 2011 at 4:03

GoogleCodeExporter commented 9 years ago
I fixed the particle bug in 580 (just checked in.) Should tolerate even 
debugging / big deltas. Thanks a bunch! That was a potentially nasty little bug.

Original comment by leethoma...@gmail.com on 25 Jan 2011 at 7:46