• 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!

Solved Extra time compression after closing interface screens

jsv

Freebooter
Storm Modder
If you open, say, map screen while using time compression, then after you close it the game starts to run thrice as fast than before. Removing 3.0 multiplier in Start_InterfaceDoExit() (INTERFACE/interface.c) solves the problem, but I have no idea why that multiplier is here in the first place and if its removal is going to break something elsewhere. :)
 
Once you are used to it, a quick tap on "G" and then "R" is all it takes. No idea why it does it in the first place tho.
 
It was still on my list to find out why it is there. Let me know if you find anything strange. I'm interested in knowing.
 
Welcome to the Modders team, mate! :cheers

Good catch on this one too. I had been wondering why this happened and found it really quite annoying whenever I get round to playing.
Sure, it doesn't do much harm and can be easily reset. But that doesn't make it right.

I've got no clue why that code is there. Doesn't seem to be doing anything sensible as far as I can tell.
Probably a left-over from the old system where both R and G could be used for speeding up and slowing down. Before I simplified it.

Removing the entire section seems to work fine:
Code:
/*   if(IsPerkIntoList("TimeSpeed"))
   {
     // NK basetime 05-04-25 -->
     ref PChar = GetMainCharacter();
     float basetime = 1.0;
     if(CheckAttribute(PChar,"basetime")) basetime = stf(PChar.basetime);

     SetTimeScale(sti(PChar.basetime));
     // NK <--
   }*/
That maintains the same timescale you had before the interface opened. If wanted, we could change this to always reset to normal timescale upon closing an interface.

While I was at it, I have been able to address various other strange timescale events. This is what is being done now:

- Timescale stays active, INCLUDING the icon on location reloads
This allows you to keep doing fast running across an island without having to re-enable the Time Compression after each reload.

- Timescale is reset to 1.0 on closing dialogs
This is to allow you some time if, for example, the dialog triggered an enemy attack.

- Timescale is reset to 1.0 on reloads to sea; this INCLUDES reloads to other islands using DirectSail and (probably) also any DirectEncounters
Again, this allows you the chance to assess the situation you find yourself in.

- Timescale is reset to 1.0 every time you encounter anything drifting in the water.
This allows you to use Time Compression while still maintaining the chance to avoid any mines or logs in the water.

- Timescale is reset to 1.0 on every Load Game to allow you to "get your bearings again".
Imagine being on 30x compression, then saving while in/near a fight/battle.
Next time you load, you'd otherwise get blown to bits before you even know what's going on.

- Already previously done: Timescale is reset to 1.0 when boarding initiates.

Can anyone think of any other timescale-related things that should be taken care of to prevent confusion/frustration/unnecessary button mashing?

All the above will be in a future modpack update; at the moment I have no unmodified PROGRAM folder accessible to WinMerge against though.
 
Holy CRAP, there is a LOT of time-related code in the game. With the timescales being changed back and forth several times in a row, which is completely useless.
I wonder if that may have been contributing to game instability as well. Can't have been helping in any case.
Let's reduce that, shall we....? :rolleyes:

At the moment, I'm going through all the code and removing the timescale changes that I don't know are necessary.
We can always put some back later on, but at least things will have been cleaned up for a change. :facepalm

Can anyone test the Pause button (defaults to the actual Pause button on the keyboard) and see if that one still works?
It doesn't open for me straight away anymore. But I don't know if that is something I broke or was already broken.
Is there even any need for it?

Edit: Well, whatever is the case, the pause menu is proper messed up in my game.
Now it only displays on location reloads. I'm in half a mind to just get rid of it altogether.
If you really DO want to pause, just open up the main menu. :shrug
 
Last edited:
Also, at the moment we've got the following time scales available: 1x, 3x, 10x and 30x.
Do those increments sound good? We could easily add more or remove some or change the values or something.
 
Just reading this.

I never use the P button and just hit F1 when I want to stop the game. All the other things sound good except that while it is better, 30X still isn't quite right. The clock still seems to run slow so I still use 10X when just sailing along.
 
Indeed 30x does tend to get quite "out of control". Ships often go spinning like mad too, though that might be an Arcade Game Mode thing.
We could add a 20x step inbetween and see if that works better.

What is up with the clock again? I keep getting confused. o_O

I never use the P button and just hit F1 when I want to stop the game.
My point exactly. :cheeky
 
The clock seems to run faster in 10X time than in 30X time, or sometimes it seems to run just a little bit faster, not 3 times faster.
 
Welcome to the Modders team, mate! :cheers
Thanks. :cheers

Can anyone think of any other timescale-related things that should be taken care of to prevent confusion/frustration/unnecessary button mashing?
Well, there should be a place in the code where party icons start flashing red (land combat triggered). Slowing down there would be nice, especially if we're going to be running at 20x all around banditos-infested islands :)

When sailing:
  • The ship is in irons as a result of weather change.
  • Crew morale plummets as a result of consuming too much rum. Well, actually this should be "there is an interesting log message", but other interesting messages I can think of seem to be covered by your other changes. OTH, if there is a way to make the speed at which log messages fade independent of time compression (that is, prevent the messages from disappearing instantly at 30x), that would be a welcome change.
 
When changing from land to sea or the other way around it should be set to 1 again.
Moved this thread to the brainsstorming
 
Well, there should be a place in the code where party icons start flashing red (land combat triggered). Slowing down there would be nice, especially if we're going to be running at 20x all around banditos-infested islands :)
Interesting thought. I'm trying something to see if I can make that work.

The ship is in irons as a result of weather change.
I think I can put that in with the SAIL_LUFFING_SOUNDS . We'll see how that works.

Crew morale plummets as a result of consuming too much rum.
That one is easily done, I think.

OTH, if there is a way to make the speed at which log messages fade independent of time compression (that is, prevent the messages from disappearing instantly at 30x), that would be a welcome change.
This is the code that sets the speed of log messages in PROGRAM\BATTLE_INTERFACE\LogInterface.c:
Code:
  ILog.Log.speed = 0.1; //0.05     // LDH this is the scroll speed after the log fades - 03Jan09
   ILog.Log.color_speed = 0.01; //0.02   // LDH this is the speed at which the log fades - 03Jan09
To get the effect you want, we would have to make it inversely dependent on timescale.
 
To get the effect you want, we would have to make it inversely dependent on timescale.
HA! Seems to be working!

I hope that this won't cause too much cluttering though, since you do get log messages at a greater speed.
 
All the above proposed updates are included in attached file for testing purposes.
Let me know if anything doesn't quite work the way you'd like it yet.

Additional stuff:
- Morale loss due to too much money is noted in the Questbook as well
- Loading screen tips disabled in Woodes Rogers storyline
- Pause button functionality removed: That was a lot of complicated coding with no purpose

Levis, if you can, could you please do a WinMerge on this stuff and check if you see anything "odd"?

Well, there should be a place in the code where party icons start flashing red (land combat triggered). Slowing down there would be nice, especially if we're going to be running at 20x all around banditos-infested islands :)
I set it up so it doesn't slow down when enemies are in the location, but only when an enemy draws his blade, eg. is near to you.
This allowed me to put it together with the code for Realistic Game Mode, making it easier to realise.

I didn't test the slow down on "caught in irons" myself. It should work, but might have an unwanted side-effect,
namely that you can't speed up time when that happens. That might be annoying. But testing will have to tell us if this is an improvement or not.
 

Attachments

  • TimeScaleUpdate.zip
    664.5 KB · Views: 453
Last edited:
Moved this thread to the brainsstorming
By the way, usually I keep any "open" issues on the main POTC Build Mod forum and when they are marked as Solved, I "file" them on Build Beta & Brainstorming.
Doesn't make 100% sense, but it allows to use the POTC Build Mod forum as some sort of To-Do list of sorts.
Up to you though whether you find that useful or not.
 
I personally like it better if they are in the troubleshoot or brainstorm forum so the main folder is a bit clean and that can be used for things like the ship recognation guide. But I can see your point to. If you say opened things in the mail folder is better we can do that.

I'm not able to look at this in the next few days (see modder availablity to see why).

Edit: That's a lot of changes :p.
 
So, is the extra time compression after closing interface screen gone now? - with the patch from post #16 by Sire Pieter.
 
So, is the extra time compression after closing interface screen gone now? - with the patch from post #16 by Sire Pieter.
Of course! That's what this all started out with. Additionally, I did a lot of other work to reduce needless timescale-related annoyances.
And cleaned up some of the code too.

Edit: That's a lot of changes :p.
Indeed. Though most of it is to remove code that, as far as I understand, wasn't actually good for much of anything.
 
Back
Top