• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Improve Performance in 3D Sailing Mode

Select everything that applies to you

  • -- WHERE DID YOU NOTICE ANY REDUCED PERFORMANCE? --

    Votes: 0 0.0%
  • -- WHAT IS THE MOST RECENT MODPACK VERSION WITH THE BEST PERFORMANCE? --

    Votes: 0 0.0%
  • Build 14 Beta 3.1/3.2

    Votes: 0 0.0%

  • Total voters
    17
I can't check this just yet because I have to go to work.
Out of curiosity, what did you change?
 
I can't check this just yet because I have to go to work.
Out of curiosity, what did you change?
I removed some obsolete code concerning nation multipliers for ships. These multipliers where copied to a character each time the ship update function was called, and they where never used from there again. All cases where they needed it they looked in a different way which is just as fast.
 
I removed some obsolete code concerning nation multipliers for ships. These multipliers where copied to a character each time the ship update function was called, and they where never used from there again. All cases where they needed it they looked in a different way which is just as fast.
Nation multipliers? Like the ones at the top of ships_init.c? I'd expect those to be applied to a ship only once and that's the end of it. o_O
 
Nation multipliers? Like the ones at the top of ships_init.c? I'd expect those to be applied to a ship only once and that's the end of it. o_O
That's what I also expected but turned out they didn't. I'm going to look into it more but at least I removed a loop again which was called every millisecond.
 
That's what I also expected but turned out they didn't. I'm going to look into it more but at least I removed a loop again which was called every millisecond.
Code:
  //Seriously why ... -Levis
   /*
   if (SeaCameras.Camera == "SeaDeckCamera" && sti(rCharacter.index) == GetMainCharacterIndex())
   {
     switch (GetTargetPlatform())
     {
       case "xbox":
         aTmpSkill.Accuracy = 1.0;
       break;
       case "pc":
         if(iRealismMode == 0) // 1.03
         {
           aTmpSkill.Accuracy = Clampf(stf(aTmpSkill.Accuracy) + 0.4);
         }
       break;
     }
   }*/
Part of that is to give you a higher accuracy when aiming manually. Which makes very little sense now that auto-fire works from your deck too. :facepalm
 
I am now sailing a Hoy and performance is good. One time sailing into Bonaire the dreaded stuttering hit but otherwise it is smooth. The call or poll that is killing me occurs every 1/2 second and can get so bad the ship stops and starts. This affects everything from the crew walking around to the spyglass to the waves.

On another note I recently bought a new video card and now POTC looks worse than ever. It actually seems that it is more the drivers than the hardware causing this. Frame rates are about the same. Many things are pixelated like it is running in 16 bit mode, but it isn't. I recently found a hardware testing app and it says that while this video card is excellent at 3D it is poor at 2D. It is worse than intel graphics at 2D stuff. It is looking like it is seeing many of the textures in POTC as 2D and making them look bad. This mostly affects characters and some building textures. The water and ships still look great. Just a heads up on this.
 
I am now sailing a Hoy and performance is good. One time sailing into Bonaire the dreaded stuttering hit but otherwise it is smooth. The call or poll that is killing me occurs every 1/2 second and can get so bad the ship stops and starts. This affects everything from the crew walking around to the spyglass to the waves.

On another note I recently bought a new video card and now POTC looks worse than ever. It actually seems that it is more the drivers than the hardware causing this. Frame rates are about the same. Many things are pixelated like it is running in 16 bit mode, but it isn't. I recently found a hardware testing app and it says that while this video card is excellent at 3D it is poor at 2D. It is worse than intel graphics at 2D stuff. It is looking like it is seeing many of the textures in POTC as 2D and making them look bad. This mostly affects characters and some building textures. The water and ships still look great. Just a heads up on this.

Ok thanks for the information. I think what is causing the stutter then and it's on my list to fix. Good to hear is getting better already :D.
 
On another note I recently bought a new video card and now POTC looks worse than ever. It actually seems that it is more the drivers than the hardware causing this. Frame rates are about the same. Many things are pixelated like it is running in 16 bit mode, but it isn't. I recently found a hardware testing app and it says that while this video card is excellent at 3D it is poor at 2D. It is worse than intel graphics at 2D stuff. It is looking like it is seeing many of the textures in POTC as 2D and making them look bad. This mostly affects characters and some building textures. The water and ships still look great. Just a heads up on this.
Do you have any screenshots of that? Now you've got me curious.
 
I only got LOMs before to keep score and to get better ships late in the game. I am no longer concerned about that stuff as I only sail one small ship now.
 
I only got LOMs before to keep score and to get better ships late in the game. I am no longer concerned about that stuff as I only sail one small ship now.
Why are you sailing only one small ship then? Just trying to understand here.
 
Because up until this game I'm playing right now 3.5 could not support even one small ship. Performance was extremely bad even with just one small ship. As in unplayable. Hence the move to GOF2 which plays very well.

This game is doing very well so far. I'm up to level 20 and it is still getting good frame rates.

OTOH, I have tried French, Spanish, and Personal flags at Hispaniola and get sunk with all of them. So that means no Mr. Gibbs or Angelique Moulin for me.
 
I have thrown a fair bit of hopefully-now-useless code out again in this release: http://www.piratesahoy.net/threads/build-14-beta-3-5-internal-wip-for-testing.24817/
Unless I'm very much mistaken, relation updates at sea were actually being done every frame.
Now that should only happen during the first second at sea and after that every time when something actually requires an update (flag changes or surrendering).
Hopefully it has gotten a bit better again now (and nothing weird starts happening because the code I removed was actually needed.... :wp ).
 
Theres a large function called about each second in the shipAI code. I need to rework that one.
Which one is it, do you think?

One way I found that might prove a good testing grounds:
Use console switch(3) to give you a fleet of several high-detail ships and start sailing that around coasts and especially near enemies.
You should definitely notice the lag every 1-2 seconds or so.
 
If I remember right it was this one
Ship_CheckMainCharacter

This function handles multiple things but also handles if you can board to other ships and forts.
It loops trough all ships and forts so here probably is something to gain.
 
If I remember right it was this one
Ship_CheckMainCharacter

This function handles multiple things but also handles if you can board to other ships and forts.
It loops trough all ships and forts so here probably is something to gain.
Ah yes, that is indeed a big function that is called very often. :yes

I wonder if perhaps we can make some sort of "default performance benchmarking case" and test that on different modpack versions.
It used to be much, much better so something that we did on our end made it worse.
Of course it could be the high-detail ships or the error logging, but I suspect it is something else.

But the only way to find out is to do some structured testing with a repeatable scenario.
We tried with the stuff from the opening post, but that only gave us "now it's good, now it's not, now it's good, now it's not" responses on the same game code.
Which doesn't give us any sensible trend at all. :facepalm
 
hmmm...
For now I'm happy if we get better responses but I can see where you are getting at.
As performance seems to be mostly a problem on sea (AI) I sugest we have a reload to an empty sea and spawn X ships for different relations and test the FPS over 10 minutes or so and take an avarage score.
That should give a reliable test I think.

higher detailed ships will defently decrease the performance cause its a higher polycount.
error logging also decreases performance.
besides that a lot of the sea ai calls functions which at first glance don't seem to be aimed at sea ai so if they aren't optimized or have stuff added to them it will inpact performance.
 
I have certainly been trying to reduce the number of AI calls from RefreshBattleinterface and LogInterface.c .
Now the main relations update stuff in RefreshBattleinterface is executed only when the game specifically asks for it.
There is a loop that I think happens every frame that might have called that function too, but I stopped that from checking nation relations.

The checks in LogInterface.c are done every 1-2 game minutes, but there is a setting there to increase that interval.
However, I tested earlier by disabling everything there and it didn't solve the lag I noticed, so I don't think that is the true culprit.
 
Back
Top