Page 3 of 3

Posted: Mon Jun 02, 2008 8:53 am
by another_commander
Just a little update on the frame rate situation in Oolite. Those of you (PC users mainly) who have witnessed occasional 5-20 seconds frame rate drops, with FPS dropping from 60 to 20 or 21, will be pleased to know that the cause of these delays has been found and hopefully dealt with for 1.72.

The hiccups were happening whenever a trader ship was trying to execute a hyperspace exit. In the exitingTraderAI, the ship is instructed to execute hyperspace exit on every AI update, when in the EXIT_SYSTEM state. When close to the station, this fails, but as soon as it has built enough distance, it makes the jump. The problem is that until it jumps out, it tries to generate system information for all the planets in the current galaxy, in order to locate the ones within jump range. This would happen on every frame. Ouch, too expensive.

Now the required nearby system information is cached, so it is calculated only once. Subsequent calls on each frame will just read the cached information instead of regenerating it, until the ship makes the jump. First tests indicate zero FPS drops.

Posted: Mon Jun 02, 2008 8:57 am
by dalek501
Thats great news, and potentially much cheaper!

Thanks for all your work! :D

Posted: Mon Jun 02, 2008 9:07 am
by DaddyHoggy
That's interesting. Perhaps that might also explain why YAH sometimes causes in game glitches/freezes/huge drops in fps - since the AD-X screens are huge I'm sure I read in a thread last year that they may impact on the distance you need to be away before a ship can initiate a hyperspace jump.

Just a thought.

Well spotted btw, that must have been some serious digging in to the code!

Posted: Mon Jun 02, 2008 9:08 am
by CaptKev
excellent work another_commander, another bug squished. 8)

Posted: Tue Jun 03, 2008 7:11 am
by TGHC
Great work another_commander.

You really are doing some good work for this community, thanks!

Posted: Tue Jun 03, 2008 5:39 pm
by pagroove
Very good bug Squashing :D

!

Posted: Tue Jun 03, 2008 6:08 pm
by Lestradae
Those of you (PC users mainly) who have witnessed occasional 5-20 seconds frame rate drops, with FPS dropping from 60 to 20 or 21, will be pleased to know that the cause of these delays has been found and hopefully dealt with for 1.72.
Had this problem. Looking forward to its disappearance now. Good work! :D

Posted: Wed Jun 04, 2008 5:22 pm
by krombart
Hey COOL!

But maybe you could give us a patch for oolite-dev-1.71.2 for this really annoying bug?

Posted: Thu Jun 05, 2008 6:29 am
by another_commander
The "fix" is scheduled to go in for 1.72 only at the moment. The reason for this (and also the reason for the word "fix" being in quotes) is that it is not really a fix, it is an optimization and, as such, it does not warrant itself being included in a possible future bug-fix-only update.

If you want this included in the game, you will have to build from source for now. Just go to the page with the trunk code for ShipEntityAI.m, copy the entire - (void)performHyperSpaceExitReplace:(BOOL)replace method and replace the method of the same name in your copy of the 1.71.2 code. Then rebuild.

Apologies for making this difficult, but the source tarball at Berlios has to reflect at all times the exact state of the executable that it represents, so I don't think we can just patch it up without making a new release.