Page 1 of 2

Normal FPS

Posted: Fri Jan 18, 2008 11:46 am
by Ark
I am wondering what is the normal FPS for OOLITE in my machine.

Usually I have about 66 FPS but every a few seconds this drops below 10FPS without any apparent reason (mainly when I am near a station or during a dogfight). This drop lasts only for half a second but a have a pause in the game (very annoying during a dogfight).

Does anybody knows why this is happening (maybe a lot of oxps) and what is considered to be a good FPS for oolite.

Thank you in advance

Current configuration
Core Duo 2,4 Ghz
1 GB of ram
Nvidia Gforce 7600 GT
Windows Xp sp2

(I am thinking of buying an extra 1 mb module. Do you believe that it would make any difference for oolite)

Posted: Fri Jan 18, 2008 12:36 pm
by another_commander
The short drop in FPS is most likely due to Oolite running through the scripts of the OXPs installed. The more you have, the more noticable it would be. OXPs changing planet descriptions are the most expensive ones, I believe.

I usually get 60FPS on a relatively low-end by today's standards Dell laptop, but this is due to vertical synching being set. Probably this is the case in your situation, too. What is the refresh rate you are running at? Maybe if you don't set V-sunc to on, it will go higher than 66FPS.

Posted: Fri Jan 18, 2008 1:16 pm
by Ark
Thanks another_commander
another_commander wrote:
What is the refresh rate you are running at?
I am running windows at 1024 x 768 x 85 Hertz but in the stderr the refreshRate is 0
2008-01-18 13:16:58.250 oolite.exe[716] [unclassified.MyOpenGLView]: Found mode {Height = 768; RefreshRate = 0; Width = 1024; }
another_commander wrote:
Maybe if you don't set V-sunc to on, it will go higher than 66FPS.
Forgive my ignorance but how I could do that

Posted: Fri Jan 18, 2008 1:40 pm
by Eric Walch
Ark wrote:
Does anybody knows why this is happening (maybe a lot of oxps) and what is considered to be a good FPS for oolite.
Every 10 game seconds the system does an update of all installed scripts. Some scripts take much more time than others. By itself they are using almost no time, but all together it adds up. Other things that take considerable time is adding an entity to the universe. During flight those entities are in majority the remaining parts of an exploding ship in the distance.

Some oxp's add ships without a script. When those ships are added to the universe the total amount of ships is not changed and the performance will probably not change. Other oxp's use a separate script to add ships. Those ships are extra ships in a system. This takes extra control time and it increased the likelihood of combat between pirates and traders. And the more combat, the more calculating is necessary and the more explosions there will be. On one side this combat between other ships is one of the beautiful things in oolite, on the other side you want to witness those fights as payer.

All those things above just happen just as often during dogfight as without fighting, but during fight you notice them more pronounced.

With near a station you probably mean "main station". I only see it there when I also see the planet on screen.

Your frame rate looks low. I have a 0.7 GHz iMac and with around 50 installed OXP's I get usually around the 40 FPS. But your machine is 3 times faster. There are OXP's that use on their own just as much time as 50 others, so amount is not saying everything.

Posted: Fri Jan 18, 2008 1:41 pm
by another_commander
If you are at 85Hz already, probably switching V-sync off won't do any good. V-sync basically matches the refresh rate of the application with the refresh rate of the monitor. Usually, this is the optimal situation. If your application runs at a framerate higher than your monitor, you get an effect called tearing, where a frame has already started being displayed before the previous one has finished. So, it really looks best when V-sync is on.

If you really want to explore V-sync anyway, there should be some related setting in your graphics card control panel. It really depends on the drivers, so I cannot be more specific than that.

Posted: Fri Jan 18, 2008 4:10 pm
by Ark
Eric Walch wrote:
Every 10 game seconds the system does an update of all installed scripts.
Eric I have about 80 oxps installed. Some of them are very big with a huge script and planetinfo plist (Assassins, Galactic navy for example) others just put one more ship in the game.

Now I can see how useful would be if all oxps with scrips will be optimized.
I think very few of the players can fully appreciate what you did in military fiasco and thargoid wars. :)
Optimizing old oxps will be mandatory in the future.





Thanks you for your advice another_commander

It seems that there are 3 settings in nvidia control panel

1.Use the 3G application setting (default)
2.Force ON
3.Force OFF
None of them made any difference (still running oolite in 66 FPS)

What about the refresh rate =0 in the stderr. That one puzzles me for ages (well to be honest for one and a half year).

I still do not understand why oolite is so slow in such a powerful machine. With my control panel open when running oolite I can see that I have 400mb of unused ram and it only consumes 10 to30 % of my processor speed and still have the pauses. Only when I load a saved game my processor runs at full capacity for a second (but that is not a problem – just a little bit strange). So I have to assume that those pauses have to do with the video card.

From what I saw in nvidea control panel there is a tool that you can override the Global 3D settings with the 3G optimum settings for an application when that specific application is running. Of course I will have to find first what are the optimum video card settings (for Gforce 7600 GT) for oolite. But i will give it a try

Again guys, thanks for your replays

Posted: Fri Jan 18, 2008 5:21 pm
by another_commander
Ark wrote:
What about the refresh rate =0 in the stderr. That one puzzles me for ages (well to be honest for one and a half year).
Allow me to offer you some peace of mind: The refresh value is hardcoded to 0 and appears like this on everyone's computer (Windows/Linux). Probably the intention was to use it to strore the refresh, but this did not get implemented at the end for some reason. Maybe it would be good to disable its logging, as it obvioulsy confuses people.
I still do not understand why oolite is so slow in such a powerful machine. With my control panel open when running oolite I can see that I have 400mb of unused ram and it only consumes 10 to30 % of my processor speed and still have the pauses.
Not sure about the pauses, as this could also depend on what else you have running in the background, but what exactly is wrong with running at 66FPS? Surely this should be smooth enough, right?

Posted: Fri Jan 18, 2008 6:27 pm
by Ark
another_commander wrote:
Not sure about the pauses, as this could also depend on what else you have running in the background, but what exactly is wrong with running at 66FPS? Surely this should be smooth enough, right?
My main concern is the pauses. You are right 66 FPS is good enough. I just expected something more with my hardware. I will try to find out what else is running in the background. I have already disable Norton Antivirus auto-protect while running oolite

Thanks again :)

Posted: Fri Jan 18, 2008 8:01 pm
by Eric Walch
Ark wrote:
I think very few of the players can fully appreciate what you did in military fiasco and thargoid wars.
Optimizing old oxps will be mandatory in the future.
And don't forget to mention Ahruman. He is doing the same, but on a more basic level: change the whole scripting system into one that by itself will be faster. On the long run that is a better approach because it is even more selective in witch part of the code it evaluates.

The scripts I now tore apart into segments were segmented into the same main pieces that Java script needs. The bigger a script is, the more important will be the translation. But also the more work will be involved.

And some long ones can be very much shorter in JS. e.g. Galactic navy has over 15000 code lines. (I recently have downloaded a new plist editor were I can give a go to line #. That's how I counted the lines) But 95 % of the lines are duplicate lines that can be replaced by just a few functions in javascript. When you want to do something several times in Legacy script you have to copy it in every time.

Posted: Sat Jan 19, 2008 1:18 am
by matt634
Oh my god, 15000! I need to get a life. Thankful most of the lines are semi-optimized already. Further optimization is planned as Eric has clued me into the the plist editor.

Posted: Sat Jan 19, 2008 6:12 am
by davcefai
Apart from the reasons given above you need to look at what else is running on your machine. Those processes also use clock cycles.

I find that when Firefox is up it sometimes, but not always, contributes to the pauses. Yesterday I found that gconfd, which I do not need, managed to get auto-loaded and and was causing stutters every ~5sec. (This is on Linux BTW).

I suggest that you use task manager to see what's running and cautiously try to remove stuff you don't think you need. Even something using, say, 2% of CPU time can have a major effect on Oolite (or any game) when it competes for resources.

Posted: Sat Jan 19, 2008 4:26 pm
by Liquidator
I see this behaviour very consistently when I am shooting at a target from the RandomHits.oxp. I normally have between 50 and 100 fps, but the moment I fire my laser at the target the framerates drop below 10 if I stop shooting the framerates often often increase to normal (until I start shooting again).

Anyone else seen this?

I am running 1.70 on a G5 iMac with >50 oxp's.

Posted: Sat Jan 19, 2008 5:20 pm
by LittleBear
This will be fixed for V.1.1. Random Hits uses the scriptactiononTarget command for the victim to check who is attacking him and whether the player is about. Unfortunatley a side effect of scriptactionTarget is everytime the command is executed ALL the installed scripts are checked. This means on Random Hits V1.0 when you and the mark are within scanner range of each other 20,000 lines of code from random hits are checked serveral times a second. If Random Hits was the only OXP installed this is not too bad. (You might drop 5/6 FPS whilst fighting the mark). But if you have every OXP installed, then about 550,000 lines of code are checked serval times a second. This is BAD and slows down Oolite a lot. V1.1 of Random Hits uses Java and just checks (by running 6 lines of code) when the mark dies or his pod is captured. This is much quicker, as rather than checking 550,000 lines of code 8 times a second, Oolite only need to check 6 lines of code on the victims death. However, I can't release V1.1 until the Supreme Grand Admiral gets back and explains how to use the "whom" function!

See the Scripters Cover thread here if you are interested in the code explanation. Basically if I can get the Java Script working, fighting a mark would use no more system time than fighting any other ship.

https://bb.oolite.space/viewtopic.ph ... &start=105

The problem is not so much the lines of code being checked, it that they are being checked so often.

I didn't pick this up before releasing as although I had 50 odd ship OXPs installed I didn't have any of the mission OXPs installed (having completed them). Its the mission OXPs that cause the slowdown as they are the ones that have big scripts. That said the real problem is me forcing Oolite to check them all so often.

Posted: Sun Jan 20, 2008 6:24 pm
by Ark
After playing oolite with the taskmanager open for 2 days now i am defenetly sure that those pauses have nothing to do with prossesor speed. I have them even with 8% CPU usage. - just for the record. It has to be something else.

Posted: Sat Feb 16, 2008 11:46 am
by Ark
I had a problem with my internet connection so I was away from the forums.

After upgrading my memory from 1GB to 2GB the pauses are far less frequent. It seems that there must be a connection of memory with the number of oxps that have a lot of textures (Dr Nils PutYourAdHere, Assassins, Sungs textures etc).
So upgrading your memory really helps but do not eliminate them completely.

I have also found that I have significant delays
1.In the system that a black monk monastery is present.
2.When a NPC creates a wormhole (I think this has the longest duration)
3.When Ixian ships are present in the system.
4.When something explodes far away.