PDA

View Full Version : GPF with AirDogs and TB 1.6.0.4



Michael Hartlef
15-04-2008, 18:29
Hi Eros and Petr,

since 1.6.0.4 AirDogs crashes with a GPF once you shot your enemy down with the fith shot. Any idea?

Cheers
Michael

ErosOlmi
15-04-2008, 18:39
Hi Michael,

I'm just recompiling the full project in order to release thinBasic version 1.6.0.5
Once I've finished I will check if something from my side.

Is the latest AirDogs game version the one online at http://community.thinbasic.com/index.php?topic=1159.0 ?

Ciao
Eros

Michael Hartlef
15-04-2008, 18:46
Not the latest but same effect.

Michael Hartlef
15-04-2008, 18:52
I checked if it was something in TBGL that had changed but no, must be something else. 1.6.0.4 is a no no for Airdogs right now. :)

Petr Schreiber
15-04-2008, 20:43
I confirm the same problem,
checking where the problem is :-[

Problem seems to be in CheckIt procedure with parameters(2, 1) when the shots reach 5...
But if I uncomment the code between IF and ELSE, the problem is still here, so very odd.


Petr

Michael Hartlef
15-04-2008, 21:54
IT'S weird, credits don't show either. Mmmh, I really have to go over the source.

ErosOlmi
15-04-2008, 22:01
I'm also checking.
There is something wrong in parsing I think.

Michael Hartlef
15-04-2008, 22:23
Ok, TBGL_PrintBMP only works when TBGL_RENDERMATRIX3D is set.

ErosOlmi
15-04-2008, 22:37
What does it mean?
Did you find the GPF reason or the credit screen problem?

Michael Hartlef
15-04-2008, 22:46
Teh credit screen problem. GPF is still there.

Petr Schreiber
15-04-2008, 22:47
Ok, TBGL_PrintBMP only works when TBGL_RENDERMATRIX3D is set.


Yes, that is true. I will add it to the help file.
But that should not be the problem I think.

TBGL_RENDERMATRIX3D is default, and older versions called it every little period of time ( which was dangerous ).
So in cases where you use both TBGL_RENDERMATRIX2D and TBGL_RENDERMATRIX3D it is better to specify it explicitly.


Petr

ErosOlmi
15-04-2008, 22:58
Ok, thanks.

I've isolated GPF but still not found the reason. Long long night this night!

Michael Hartlef
15-04-2008, 23:02
Don't stress yourself over it. Get some sleep. It can wait. I go to bed now. See you all tommorow.

Petr Schreiber
15-04-2008, 23:14
Good night,

this is tricky bug, but old proverb say "Better hunt bug in the early morning, that in the late night" :P
So ... lets give the bug some sleep and before it will wake up we will catch it to the box and fire out to outerspace :)


Bye,
Petr

ErosOlmi
16-04-2008, 08:49
I will try today to go on on this.
As you already found, the problem is "ChechIt" SUB and exactly in:


'...
if player(t).damage >= 5 then '--- (A)
'... (B)
else (C)

for i = 1 to 2
if player(i).damage > 0 then
for j =1 to %maxShots
if fxSmoke(i,j).sSize <= 0 and j<=player(i).damage then
'...
end if
next
end if
next '---(D)

end if '---(E)
'...


What happen is that when "IF" in (A) valuate to TRUE, code in (B) is correctly executed. But when parsing cursor reach "ELSE" in (C), instead of making a jump to "END IF" in (E) it jumps to "NEXT" at (D). This break internal parsing rules generating the GPF.

I still didn't find the reasons why this happening.
There is something in the code inside the "FOR i = 1 TO 2" that is not parsed correctly or confuse the parser or, better, there is a bug.

ErosOlmi
16-04-2008, 10:55
Mike,

searching for this GPF requires a lot of time. It can even require I will need to change a lot of the thinBasic Core parser.
I've a temp work around that is to change the ending part of CheckIt SUB in the following way:


'...
else
'for i = 1 to 2
i = 1
if player(i).damage > 0 then
for j = 1 to %maxShots
if fxSmoke(i,j).sSize <= 0 and j <= player(i).damage then
fxSmoke(i,j).x = player(i).x
fxSmoke(i,j).y = player(i).y
fxSmoke(i,j).dir = rnd(1,359)
fxSmoke(i,j).minSize = 0.1
fxSmoke(i,j).maxSize = rnd(4,8)/10
fxSmoke(i,j).speed = 0.03 * 60/fpscount
fxSmoke(i,j).sSize = 0.1
fxSmoke(i,j).img = %fxsmoke1
end if
next
end if
i = 2
if player(i).damage > 0 then
for j = 1 to %maxShots
if fxSmoke(i,j).sSize <= 0 and j <= player(i).damage then
fxSmoke(i,j).x = player(i).x
fxSmoke(i,j).y = player(i).y
fxSmoke(i,j).dir = rnd(1,359)
fxSmoke(i,j).minSize = 0.1
fxSmoke(i,j).maxSize = rnd(4,8)/10
fxSmoke(i,j).speed = 0.03 * 60/fpscount
fxSmoke(i,j).sSize = 0.1
fxSmoke(i,j).img = %fxsmoke1
end if
next
end if
'next

end if

end sub

Mainly this is to avoid nested FOR in nested IF statement.
I will work as much as I can on this matter in the next days and in the meantime I will release thinBasic preview version 1.6.0.5

Please excuse me for this but this is something unexpected in thinBasic stability process.
Eros

ErosOlmi
16-04-2008, 17:16
Michael,

I've going deeper in this problem. Forget work around I mentioned before.
Problematic line seems the following in CheckHit SUB:

if fxSmoke(i,j).sSize <= 0 then 'and j <= player(i).damage then

Please change it in the following way:

define a local variable in CheckHit SUB: dim tDamage as double
change problematic above line to:
tDamage = player(i).damage
if fxSmoke(i,j).sSize <= 0 and j <= tDamage then



I'm not able to give a fix right now.
I was able to isolate the problem in a little script that have the same GPF. This should give me more chance to get the GPF.

Michael Hartlef
18-04-2008, 18:15
No problem Eros,

thanks for the work around.

Cheers
Michael

ErosOlmi
18-04-2008, 18:20
I will work more on this during week-end.
All the rest is stopped till I will have a solution for this GPF.

ErosOlmi
20-04-2008, 22:57
Michael,

I've found and fixed the problem. As expected an extremely stupid matter.
Now I have to recover all the temporary changes I've applied to thinBasic Core engine during the discovery process >:(
But it should finally work.

Very soon a new thinCore.dll

Ciao
Eros

ErosOlmi
20-04-2008, 23:27
Ok, I should have fixed and cleared all.
Attached a thinCore.dll that should fix AirDog problem (and others)

Please let me know if all is OK.

Ciao
Eros

kryton9
21-04-2008, 00:42
All seems working well here. I hear and see everything fine in 2 player mode.

Petr Schreiber
21-04-2008, 09:23
Thanks Eros,

and congraulations for slaying the bug!
Here the script runs great again.


Petr

Michael Hartlef
21-04-2008, 21:48
Yes, everything works well here. Thanks Eros for squishing the bug.