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.
The nature of OXP on frame rate...
Moderators: winston, another_commander
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
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!
Just a thought.
Well spotted btw, that must have been some serious digging in to the code!
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
- pagroove
- ---- E L I T E ----
- Posts: 3035
- Joined: Wed Feb 21, 2007 11:52 pm
- Location: On a famous planet
Very good bug Squashing
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
https://bb.oolite.space/viewtopic.php?f=4&t=13709
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
https://bb.oolite.space/viewtopic.php?f=4&t=13709
- Lestradae
- ---- E L I T E ----
- Posts: 3095
- Joined: Tue Apr 17, 2007 10:30 pm
- Location: Vienna, Austria
!
Had this problem. Looking forward to its disappearance now. Good work!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.
-
- Quite Grand Sub-Admiral
- Posts: 6682
- Joined: Wed Feb 28, 2007 7:54 am
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.
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.