The nature of OXP on frame rate...

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6626
Joined: Wed Feb 28, 2007 7:54 am

Post 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.
User avatar
dalek501
Deadly
Deadly
Posts: 185
Joined: Sat May 17, 2008 10:47 am
Contact:

Post by dalek501 »

Thats great news, and potentially much cheaper!

Thanks for all your work! :D
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post 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!
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
CaptKev
---- E L I T E ----
---- E L I T E ----
Posts: 519
Joined: Fri Jan 26, 2007 3:21 pm
Location: Shropshire, UK

Post by CaptKev »

excellent work another_commander, another bug squished. 8)
Download Fighter HUD, Stingray and System Redux from the EliteWiki
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

Great work another_commander.

You really are doing some good work for this community, thanks!
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3035
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Post by pagroove »

Very good bug Squashing :D
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
https://bb.oolite.space/viewtopic.php?f=4&t=13709
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

!

Post 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
krombart
Competent
Competent
Posts: 52
Joined: Tue May 20, 2008 9:25 am

Post by krombart »

Hey COOL!

But maybe you could give us a patch for oolite-dev-1.71.2 for this really annoying bug?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6626
Joined: Wed Feb 28, 2007 7:54 am

Post 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.
Post Reply