Re: RobotDuel - game for 2 players
Hi,
thanks for the offer Eros, but it seems I don't need any special function now.
I'm afraid I can't release new version this weekend as I wanted, because I got few mad ideas which I would like to introduce and they are little bit time consuming :).
But they could make the fights more intense.
At this time I have included:
+ Your pause code
+ Left-Right rocket launch
+ Few optimizations
Petr
Re: RobotDuel - game for 2 players
Problems !
I'v tested RobotDuel script on computer with 2GHz + Pentium 4 processor, 1 GB RAM and ATi Radeon X600 card. Sadly I can't continue the tests now.
... and I was shocked! The script behaved like a crazy one. After few steps with robot the robot returned back to its original location! Even if I fired rockets they "jumped" back after ~1 second. Also the overheat bars indicated the robots are continuously firing but no rockets/explosions were visible!
Do you have similar terrible experience ? Any ideas ? Could it be done by some spyware/trojan/... running on background ?
Thanks,
Petr
P.S. The game was running about 97 FPS
Re: RobotDuel - game for 2 players
Hi Petr,
spyware/trojan? I'm not sure if they can drive a robot.
Did you changed your module recently? Or mixed some TB module with different version?
May be you are using TB for Win Me in Windows XP box?
Other scripts running in regular way?
Please keep us involved.
Ciao,
Roberto
Re: RobotDuel - game for 2 players
No problems here Petr.
Intel Centrino Duo, WinXP, ATI Mobility Radeon X1600,
Re: RobotDuel - game for 2 players
Hi Roberto and Eros,
thanks both for your replies.
Regarding spyware/trojan/virus suspicion ...
At first it seemed to me some hidden program is pressing the keys and that makes GetAsyncKeyState confused. But it would not explain why the ( periodical! ) robot and rockets position reset occured. It seemed like a calling of InitGame function every 1 second or so. But that would not make rockets jumping back. Or it could be some strange return value ( negative ) from help_CalcFrameRate proc.
I used latest thinBASIC 1.0.10.1 and both official TBGL module 0.1.6 and pretty secret 0.1.7 :) too.
I'm very confused, because it worked without problems on computers from PII 400MHz, Win 98 to Eros NASA One :)
This computer was beetween this configurations, FPS shown were not extreme ( just very high )
I'll try to get on that computer ASAP, or at least navigate test runs of the owner using email.
The other TBGL scripts ran well, EXCEPT TBGL_Fun_SpaceShooterGame.tBasic, which showed me static screen with very weird output. I was also unable to get to the graphic drivers ( ATi Catalyst ) setup on that box. Very strange behaviour.
Thanks,
Petr
Re: RobotDuel - game for 2 players
Hi Petr,
I can start the robot but after fews seconds it reset back.
Game is running on Intel Pentium 4 2.8GHz, ATI RADEON 9200, Windows XP sp2 @77FPS.
Ciao,
Roberto
Re: RobotDuel - game for 2 players
Petr,
I think the problem is related to help_CalcFramerate script function.
If it returns low values (1 to 5 or so) than some strange camera shake plus reset occurs.
It also depends on FPS capacity. On fast video card/computer like mine, script runs at about 140FPS and this problem does not occur or at least it is not so evident.
Ciao
Eros
Re: RobotDuel - game for 2 players
Thanks for the information !,
now comes the paradox :(. My brothers PC ( PII400 MHz, 256MB RAM and nVidia Geforce2 MX 400 64 MB) runs the script at 20 FPS. This is not super, but okay.
Eros runs it at 140 FPS and it runs OK.
Quote:
If it returns low values (1 to 5 or so) than some strange camera shake plus reset occurs.
Yes, then the robots make bigger steps to compensate the speed problems.
But the probematic box runned it at 97 FPS, Roberto's PC runs it at very high 77 FPS too.
This is not "extremely low" framerate and it is between two tested framerates :(
I run it at 50 FPS and no problem occur.
It seems 70 - 100 FPS is dead zone :) But why ? If the queryperformancecounter and queryperformancefrequency would not work, it would mean it would not report logical framerate, but it does.
The only thing which occurs to me is to declare LastTime, ThisTime as QUADs, because Microsoft Win32API help says
Quote:
BOOL QueryPerformanceCounter(
LARGE_INTEGER *lpPerformanceCount // address of current counter value
);
I presume thinBASIC equivalents are wrappers of this API.
So Roberto, if you can, please try to replace the function mentioned by Eros with this corrected:
[code=thinbasic]
'------------------------------------------------------------------
' FPS CONTROL - to get the speed and synchronize animations
'------------------------------------------------------------------
FUNCTION help_CalcFramerate() AS SINGLE
GLOBAL LastTime AS quad
LOCAL ThisTime AS quad
LOCAL FPS AS quad
local Divisor as quad
ThisTime = queryperformancecounter
Divisor = ThisTime-LastTime
if Divisor = 0 then Divisor = queryperformancefrequency
FPS = queryperformancefrequency/Divisor
IF FPS = 0 THEN FPS = 1
LastTime = ThisTime
FUNCTION = FPS
END FUNCTION
[/code]
Thanks,
Petr
Re: RobotDuel - game for 2 players
Ok, I tryed and it working well!
Ciao
Roberto
Re: RobotDuel - game for 2 players
Quote:
Ok, I tryed and it working well!
Yahoo :) Thanks for this message ! I will update the download this night to protect rest of the World from "Terrible mystery of jumping robots" :D
Thanks to you and Eros for suggestions leading to solution of the problem,
Petr
P.S. Eros, when you'll have time, would it be possible to change "Returns: Number" to "Returns: QUAD" in help file for QueryPerformanceCounter and QueryPerformanceFrequency ?
[EDIT] Version 1.6.4 is available for download