Page 1 of 2

Aircraft in infinite loop

Posted: 10 Jan 2007, 11:01
by Sneaksie
I had a problem with original Wz2100, then with GPL version.
It's my first time playthrough, so i played original version at first with videos. When i started the final mission in 3d campaign, game (original) crashed. It crashed any time i've tried.
Then i've downloaded latest free version and copied save to new installation. It loaded (cool!), with no cutscenes though, of course. But there is another problem - i've noticed that one VTOL circled around it's helipad infinitely, trying to land. Oh well, i've loaded units into transport and send them to final mission against Nexus. Then i discovered a much more serious problem - transport circling in the same fashion around LZ, trying to fly away. No transport flying away - no reinforcements, no reinforcements - mission impossible, because it's pretty tough. I could build the base here, but it's impossible to build factories in a transport mission. I've tried to copy the savegame to old, 1.10 Warzone, but the game crushed while loading with error about something 'Campaign load', no wonder though.

All suggestions are welcomed, because i really want to get close to this Nexus thing after all this long war:)

Re: Aircraft in infinite loop

Posted: 10 Jan 2007, 11:12
by lav_coyote25
when vtols circle the landing pad - ctrl - or ctrl plus  - will slow or speed up the game play - may help with this problem with the transport as well unless there is something blocking the landing pad...like enemy units.

dont forget to reset the speed to normal afterwards,,,, ;D

Re: Aircraft in infinite loop

Posted: 29 Mar 2007, 16:37
by The Noid
I also have the vtol circling the landing pad problem very, very often. It's highly annoying because the circling vtol seems to inhibit the rest of the ctrl-group it is in from leaving the pad. If I redirect the circling vtol, the rest of the group instantly takes of to continue their attack, but while the stuck one is circling, the others just sit there...

It sucks having to baby-sit your landing vtols when there's plenty of other things that require attention. :(

Re: Aircraft in infinite loop

Posted: 29 Mar 2007, 17:53
by lav_coyote25
through trial and error i have observed this also and have arrived at a sort of solution to that problem

Python Project Heavy Body + vtol + weapon = an aircraft that 99 percent of the time will not exibit that behavoiur...

it does once in a while not land ... it will circle the landing pad very tightly... so to the devs...why do these vtols do that??


keep in mind the ctrl - to slow the game down untill it lands and the ctrl + to reset the speed back to normal.

;D

Re: Aircraft in infinite loop

Posted: 29 Mar 2007, 18:15
by kage
definite bug... anything that exhibits different behavior at a different game speed cannot be anything but a bug.

Re: Aircraft in infinite loop

Posted: 31 Mar 2007, 20:51
by The Noid
Well, I don't know c, but I know plenty of other languages, so I figured I might as well fetch svn and have a look in the code.

The reason the behavior changes at different game speeds is in the function moveCalcTurn in move.c where the turn-per-game-frame is calculated:

Code: Select all

	change = (baseTurn* rate);		// constant rate so we can use a normal mult
	if(change < FRACTCONST(1,1))
	{
		change = FRACTCONST(1,1);	// HACK to solve issue of when framerate so high
	}						// that integer angle to turn per frame is less than 1
On fast computers, the framerate is always so high that the amount of turn-per-frame is lower then 1 degree, meaning it gets set to 1 degree.

A circling VTOL has the problem that it can't turn fast enough. It's actually turning faster then it's supposed to, because nothing can turn slower then 1º per frame, but it's movement speed and it's turning rate send it in circles.
So when you slow down the game speed, you get even more game-frames/second, so the turning speed of the VTOL increases and it's able to break the circle and land.

How did it get in that circle in the first place? Because it can't turn slower then 1º/frame. It's supposed to fly away from the pad, notice the pad is behind it, and turn on the spot. But it's forced to turn faster then it's supposed to, meaning it doesn't actually fly away from the pad, and ends up circling it.

I guess this minimum turning rate of 1º/game-frame makes every unit turn too fast. The two ways I can think of to fix this is change the movement angle from an int to a float (or some other type that allows decimals), but that's out of my current c-coding-skills. Or limit the game-fps to something closer to the intended value (if the game-fps and graphics-fps are uncoupled).

I guess this thread should be moved to bug-reporting

Re: Aircraft in infinite loop

Posted: 01 Apr 2007, 06:29
by lav_coyote25
the thing is - this "bug" or "feature" has been with us since the very begining  = 1999. 

i believe ( but dont have the proof of the old forums pages) that this is one of the oldest known bugs/features. ;D

Re: Aircraft in infinite loop

Posted: 01 Apr 2007, 14:11
by The Noid
Yeah, but the faster PC's become, the more noticeable it gets. Eventually all units will turn on the spot...

How is this handled in multiplayer? Does the turning rate of your vehicles depend on the speed of the PC of the game-starter? Or on the speed of the "slowest" player's?

How difficult would it be to change the direction-angle to a float?

Re: Aircraft in infinite loop

Posted: 01 Apr 2007, 17:31
by Watermelon
The Noid wrote: Yeah, but the faster PC's become, the more noticeable it gets. Eventually all units will turn on the spot...

How is this handled in multiplayer? Does the turning rate of your vehicles depend on the speed of the PC of the game-starter? Or on the speed of the "slowest" player's?

How difficult would it be to change the direction-angle to a float?
It shouldnt be hard to change the direction and motion dir of a droid to float from sint,but I am not sure if the direction will be able to return float when calculating direction(orientation) and dir(motion direction).

Everyone has their own 'copy' of game in a multiplayer,the game just tries to synchronize the differences between different 'copies' of game of different players with different PC speed...

Re: Aircraft in infinite loop

Posted: 07 Apr 2007, 13:08
by The Noid
I figured I'd just give it a shot, and, as my first attempt at C, change the direction to FRACT. And it seems it worked. Units turn at the correct speed, regardless of the gamespeed. VTOL's land beautifully. Saving and loading works, loading old savegames doesn't work at the moment as I haven't looked into that yet. I guess I'll have to define a new savegame version.

I haven't tested multiplayer, only Skirmish.
Patch to SVN attached.

Re: Aircraft in infinite loop

Posted: 10 Apr 2007, 21:52
by Hatsjoe
The Noid wrote: I figured I'd just give it a shot, and, as my first attempt at C, change the direction to FRACT. And it seems it worked. Units turn at the correct speed, regardless of the gamespeed. VTOL's land beautifully. Saving and loading works, loading old savegames doesn't work at the moment as I haven't looked into that yet. I guess I'll have to define a new savegame version.

I haven't tested multiplayer, only Skirmish.
Patch to SVN attached.
Whoohooooooh!
Now someone put it in 2.0.7 !!!

Re: Aircraft in infinite loop

Posted: 10 Apr 2007, 22:07
by DevUrandom
Yes, that one is missing.
You can increase the chance for a quick inclusion greatly if you use floats instead of FRACTs, since they were only used for the float-less PlayStation and are going to be removed.

Re: Aircraft in infinite loop

Posted: 11 Apr 2007, 10:44
by Giel
DevUrandom wrote: Yes, that one is missing.
You can increase the chance for a quick inclusion greatly if you use floats instead of FRACTs, since they were only used for the float-less PlayStation and are going to be removed.
Also sending in a patch that uses only repository paths might help. (I.e. warzone/src/warcam.c does not exist in the repository: src/warcam.c does)

Re: Aircraft in infinite loop

Posted: 11 Apr 2007, 12:13
by The Noid
Sure, no problem.
I'll make an updated patch this evening.

Re: Aircraft in infinite loop

Posted: 11 Apr 2007, 15:53
by DevUrandom
Giel wrote: Also sending in a patch that uses only repository paths might help. (I.e. warzone/src/warcam.c does not exist in the repository: src/warcam.c does)
The -p parameter of patch helps here...