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

New Horizons in Maelstorm (2.8)

KillPhil

Corsair
Storm Modder
Hello mates, long time no see..

I was in the depth on the real life ocean for a long time and hadnt much time for single player games, which resulted in that I didnt play PotC for nearly 4 years (but it always moved into new PCs and harddrives).

I recently gave it a chance again and well - perfect as always.. apart from the terrible land combat system. I played too much of Mordhau to arrange with this clunky system of the past that should just be burried away and forgotten forever.

So, I stumbled across AOP2 / COAS and saw that the fighting system was waaaaay more advanced than the 2003 Storm 2.0 system.. cleary, not as good as you could expect from a new game, but more than enough for a good relaxing single player game.. so I sticked with COAS and tried the GOF 2.0 mod, only to realize that the love to detail in GOF compared to NH is.. well, simply not there. The only thing which really is better than in NH is the accurate World map, but apart from that.. you guys did a whole lot more awesome stuff.

Which ultimately lead me to the conclusion that the perfect game would be NH but with an updated engine - not only because of the combat, but also because a modern i7 9700k is apparently just too much for that old Storm 2.0 and describing the game in Storm 2.0 as unstable would be an understatement.

And then I found it: The Maelstorm engine, and NH ported for the Maelstorm engine..

AND IT WORKS. Well it works to 95%.. some minor bugs that are probably not difficult to eliminate if you know what to do (which I sadly dont really do). But for the rest.. everything of the stuff you modded into NH over the past years, every added script that I tested works. AND it is possible to use the stuff the 2.8 engine offers.

I already read that you are not too happy with the guys who ported that whole stuff and I dont want to convince you to move all the stuff over to maelstorm, but maybe you can do some "sidequest"-coding, for the few things in NH 2.8 that don't work.

There are 3 big things right now which don't work / are not implemented in the porting:

1. The sails always only go full or completely stroke.. battle sails dont work. There is no error log for that but iirc, we had that bug in Storm 2.0 too for some time

EDIT: Haha, found it.. same problem as always, the options-file was somehow corrupted

2. the combat system is right now some sort of mix.. I know, that the controls for parrying / feinting/ heavy attack are there, but I guess because of missing / not defined animations, they dont work (funnily, the swing for hitting multiple enemies works)
(also, there is still the default NH weapon class system - the weapon classes in AOP2 light- medium - heavy would be a lot cooler)

3. the ship-lanterns don't work (pretty sure for the same reason, that they are just not defined in the NH ship models)

So, I know, you guys don't want to look into there too much - but maybe you can help me finding the files / codes I need to look into so I can fix those 3 points maybe by myself.

And well maybe, you are interested nevertheless how NH 2.8 looks and plays like, which I can happily show you
 
I think @pedrwyth did some work on this before as well.

Missing animations are indeed not easily solved.

Adding "lantern" locators to the ship models should be possible though.
Just a lot of work.

Which version of NH do you have in Maelstrom?
 
Well I copied the animations from GOF and they "work" - the game recognizes the different attacks but the limbs / bones / nodes dont match at all. Unfortunally, using models from GOF doesn't really help either. Do you still have animation view around here somewhere? I'll try to fix the nodes / bones myself - other than that it works pretty well.

About the lanterns; I already managed to replace the Wicked Wench / Black Pearl NH model with that of GOF (basically the same just with lantern locators I guess) - it worked without problems but I think I am still missing a script for the lanterns here because they still stay dark. Once I got that worked out, I'll probably just look which models are both in NH and GOF and would replace them, and would just add the locaters for the rest - most simple way imo

its the Build Beta 14 WIP31 from March 16.

Like I said, its pretty much functional and stable, I only encountered a few minor bugs, mostly regarding Icons and the function to catch the nation for the sail-ho messages and national emblems on sails doesnt work (it puts out an error tho, so should be fixable easily)

one major bug is that somehow the transfer goods interface doesnt work at all. Everytime I want to open it either after a boarding or within my fleet, I just get a black screen or a blank background with water, but the interface itself doesnt built up. Sadly, the game apparently doesn't really get that there is something wrong because there is no error.log

A nice side effect is, that some functions from GOF / COAS somehow found their way to NH on their own - e.g. the wind system on the world map works without problems in NH too.

So the porting is really pretty much done. Its just finding and eliminating bugs from the porting, but since most of the time the error.log shows exactly whats wrong, most of the time it shouldn't be too difficult - as you said, just some work.

I guess even new stuff you added in the meantime should work out without much problems since your original code is pretty much untouched in all the files I looked into - just some minor adjustments here and there for the new engine, e.g. that the engine creates the cannonballs in cannon_init.c and not completely in AI_balls.c anymore
 
I think @pedrwyth did some work on this before as well.

I mostly looked at the missing functionality of NH and reporting some of that (most if not all, could have been all of which I reported then got fixed). I wasn't looking at adding from the later games into NH. Some stuff did get added in I believe when it was the simpler way to allow for stuff changed in the later engine. There is a thread on here related to my working through TOSH.

It looks to me like particles.c in locations could be where you need some additional particle effects for the deck lights (there is one for torch_deck which is certainly not in NH). Just guessing I have absolutely no idea what that is for you understand. There was a system that ChezJefry had developed to allow XML files to generate the particle effects (that were in COAS) to allow you to tweak more of them and create missing ones to match better what was in NH if required.
 
Last edited:
Code:
    if(CheckAttribute(Location, "locators.torch_deck"))
    {
        makearef(locator_group, location.locators.torch_deck);
        num = GetAttributesNum(locator_group);
        for(n = 0; n < num; n++)
        {
            locator = GetAttributeN(locator_group, n);
            //Torch_deck_p =
            CreateParticleSystemX("torch",stf(locator.x),stf(locator.y),stf(locator.z),
                stf(locator.vz.x),stf(locator.vz.y),stf(locator.vz.z),0);
            //Trace("Torch_deck created");
        }
    }

This is probably referring to the lanterns on the ship. However, I think there should also be some code somewhere which tells the game which time the lanterns should go active.
 
Well I copied the animations from GOF and they "work" - the game recognizes the different attacks but the limbs / bones / nodes dont match at all. Unfortunally, using models from GOF doesn't really help either. Do you still have animation view around here somewhere? I'll try to fix the nodes / bones myself - other than that it works pretty well.
@Grey Roger or @The Nameless Pirate...?

About the lanterns; I already managed to replace the Wicked Wench / Black Pearl NH model with that of GOF (basically the same just with lantern locators I guess) - it worked without problems but I think I am still missing a script for the lanterns here because they still stay dark.
It is the "fonar_day.gm" and fonar_night.gm" files that do it, if I understand correctly.

its the Build Beta 14 WIP31 from March 16.
"31"? That's an odd number.
Which year?
 
did you manage to get around that bug with the demasted ships that go 100% sail again after entering world map? or is that the new engine that is capable of saving that status?

well in that case I know why the Wicked Wench doesnt light up.. thats one of the GOF models that doesnt have the fonar_night.gm .. will try the Bellona, the GOF model has a fonar_night.gm .. should probably be enough to just copy that file to NH, right?

EDIT: well just tried, even with complete replace of the Bellona model, the lanterns stay dark..
I am pretty sure that the lanterns get controlled additionally through some script

March 2016, that was the year ;)
 
Last edited:
Adding "lantern" locators to the ship models should be possible though.
Just a lot of work.
Yep, it is doable.
I did it for my Black Pearl mod for TEHO, even though this is not on Maelstrom I suppose that it is handled similarly or identically.
But as you said doing this requires a lot of work.
Doing it for one ship is another beast, than doing it for all ships in the game.

Plus if someone where to do something with Maelstrom NH, it would be bringing it up to date.
After that we could start adding lanterns and other stuff not present in Storm Engine 2.

Haven't dabbled with animations myself unfortunately.

It is the "fonar_day.gm" and fonar_night.gm" files that do it, if I understand correctly.
Not always. :no
Sometimes the lantern locators are on the main model.

did you manage to get around that bug with the demasted ships that go 100% sail again after entering world map? or is that the new engine that is capable of saving that status?
I think that it is still there on Storm Engine 2 NH. :unsure

well in that case I know why the Wicked Wench doesnt light up.. thats one of the GOF models that doesnt have the fonar_night.gm .. will try the Bellona, the GOF model has a fonar_night.gm .. should probably be enough to just copy that file to NH, right?
As said above the lantern locators can also be on the main model.
My mod for TEHO is like this.
pearl_night-png.33203

Also in most cases if a ship has a "fonar" model, it won't match in a different ship.

EDIT: well just tried, even with complete replace of the Bellona model, the lanterns stay dark..
I am pretty sure that the lanterns get controlled additionally through some script
If you replaced every file and that was the case then there should indeed something more required.
You have actually made me curious, maybe I should give it a look at some point.

March 2016, that was the year ;)
Yep, that's really outdated.
The Maelstrom version really needs to be brought up to date.
 
Do you have the animation viewer somewhere on your PC? I could happily adjust the nodes myself, if I had the right tool.

Well for the lanterns, like I said we prolly just need the code for them to work, after that its just adding locators to the models or replace models with GOF ones.. also something I can do with the right tool (GMViewer I guess?)
EDIT: if we are already about this: If I am right, and the lanterns really get controlled through a script, then it wouldnt be too difficult to add an abillity to switch off the lanterns again in the dark? Imagine that feature for the Black Pearl with a "stealth" bonus if you do it.. would be so awesome


Well interesting, I think the better memory addressing of the 2.8 engine really helps for some of your scripts to work even better.

I will probably just download the latest NH and see what happens if I try to start that with the Maelstorm engine
 
Do you have the animation viewer somewhere on your PC? I could happily adjust the nodes myself, if I had the right tool.

Well for the lanterns, like I said we prolly just need the code for them to work, after that its just adding locators to the models or replace models with GOF ones.. also something I can do with the right tool (GMViewer I guess?)
I tagged you mainly for access to the tools.
I have attached some useful tools, though to do what you want you will most probably need the Inez Dias Tool.

if we are already about this: If I am right, and the lanterns really get controlled through a script, then it wouldnt be too difficult to add an abillity to switch off the lanterns again in the dark? Imagine that feature for the Black Pearl with a "stealth" bonus if you do it.. would be so awesome
It sure sounds interesting, and maybe it is possible.
Not sure though, I have a faint memory of someone asking about this in the past.

I will probably just download the latest NH and see what happens if I try to start that with the Maelstorm engine
I think that there are some differences, hence why you have to use a different version of NH with Maelstrom.
But I wish you luck anyways. :cheers

Really?
I would've expected the game engine to switch between the two.
Because they have different textures, they can't be shown at the same time.
Yep, but not every model has this I think.
And you can still have the actual lantern locator (where light will be emitted from) on the main model.
 

Attachments

  • Animation View.7z
    1.1 MB · Views: 191
  • GM Viewer.zip
    549.6 KB · Views: 176
  • Inez Dias Tool.rar
    5.7 MB · Views: 179
I think I still have Maya on my HDD somewhere ;)

anyways thanks a lot @The Nameless Pirate , much appreciated!

Well I will just create a new folder within the Maelstorm engine (Chez really did think that out) and will look what happens with the updated code. I already know that some codes must remain from Maelstorm - particullary the cannons_init.c and the internalsettings.h , there is some kind of iScript-Version which must be there, otherwise the engine wont start.

But anyways, I don't intend / think that it will start, I really just want to look how many compile / system / error.log entries are shown to get and give somewhat an idea of how much work would to do to make a 2nd New Horizons Beta Branch for Maelstorm

If you want, I will keep you updated ;)

any idea for the missing / not building interface? What could be the main reasons for an interface to not build up in the storm engine?
 
@The Nameless Pirate

I just got the information from where the lanterns are called exactly: (but unfortunally I dont understand enough from that)

In /PROGRAM/SEA_AI/AIShip.c :

Code:
void Ship_SetLightsOff(ref rCharacter, float fTime, bool bLights, bool bFlares, bool bNow)
{
    SendMessage(rCharacter, "lflll", MSG_SHIP_SETLIGHTSOFF, fTime, bLights, bFlares, bNow);
    rCharacter.Ship.Lights = 0; //fix
}

void Ship_SetLightsAndFlares(ref rCharacter)
{
    if(sti(sea.lights) == 1)
    {
        rCharacter.Ship.Flares = 1;
        rCharacter.Ship.Lights = 1;
    }
    else
    {
        rCharacter.Ship.Flares = 0;
        rCharacter.Ship.Lights = 0;
    }

it gets called 2 times also in AIShips.c and in Locations/locations_loader.c:

Code:
bool Ship_Add2Sea(int iCharacterIndex, bool bFromCoast, string sFantomType)
(I dont want to copy the whole code here, thats quite a bunch in this void)

Code:
void Ship_UpdateParameters()
(also a bunch of code)

and in locations_loader.c:
Code:
void LocLoadShips(ref Location)

Also, there was this piece of code added in WhrWeather.c to the original functions, to let the lanterns update while in 3D:
Code:
    if( Whr_IsDay() != bOldIsDay )
    {
        Whr_ChangeDayNight();
        Event("eChangeDayNight");
        //#20190211-01
        doLightChange = true;
     }
...and later, below in same function

        //#20190211-01
        if(doLightChange && isSeaEnt) {
            ref rChar;
            Sea.Lights = aCurWeather.Lights;
            for(j = 0; j < iNumShips; j++) {
                iCharIdx = Ships[j];
                if (iCharIdx < 0 || iCharIdx >= TOTAL_CHARACTERS) continue;
                rChar = GetCharacter(Ships[j]);
                Ship_SetLightsAndFlares(rChar);
                SendMessage(&characters[iCharIdx], "l", MSG_SHIP_LIGHTSRESET);
            }
        }

Thats all GOF ERA II code, but my guess is, that it should be possible to merge this into the NH code?

I can of course provide all referred files, if someone wants to make an expert look ;)
 
I think I still have Maya on my HDD somewhere ;)
Do you also have the GM plugins?
If not I can upload them.
Oh, and it must be Maya 5.

anyways thanks a lot @The Nameless Pirate , much appreciated!
You are welcome! :cheers

Well I will just create a new folder within the Maelstorm engine (Chez really did think that out) and will look what happens with the updated code. I already know that some codes must remain from Maelstorm - particullary the cannons_init.c and the internalsettings.h , there is some kind of iScript-Version which must be there, otherwise the engine wont start.

But anyways, I don't intend / think that it will start, I really just want to look how many compile / system / error.log entries are shown to get and give somewhat an idea of how much work would to do to make a 2nd New Horizons Beta Branch for Maelstorm
Even if it doesn't work you would at least have tried. ;)

If you want, I will keep you updated ;)
Sure, I really am curious about what will happen.

I just got the information from where the lanterns are called exactly: (but unfortunally I dont understand enough from that)

In /PROGRAM/SEA_AI/AIShip.c :

Code:
void Ship_SetLightsOff(ref rCharacter, float fTime, bool bLights, bool bFlares, bool bNow)
{
SendMessage(rCharacter, "lflll", MSG_SHIP_SETLIGHTSOFF, fTime, bLights, bFlares, bNow);
rCharacter.Ship.Lights = 0; //fix
}

void Ship_SetLightsAndFlares(ref rCharacter)
{
if(sti(sea.lights) == 1)
{
rCharacter.Ship.Flares = 1;
rCharacter.Ship.Lights = 1;
}
else
{
rCharacter.Ship.Flares = 0;
rCharacter.Ship.Lights = 0;
}
it gets called 2 times also in AIShips.c and in Locations/locations_loader.c:

Code:
bool Ship_Add2Sea(int iCharacterIndex, bool bFromCoast, string sFantomType)
(I dont want to copy the whole code here, thats quite a bunch in this void)

Code:
void Ship_UpdateParameters()
(also a bunch of code)

and in locations_loader.c:
Code:
void LocLoadShips(ref Location)
Also, there was this piece of code added in WhrWeather.c to the original functions, to let the lanterns update while in 3D:
Code:
if( Whr_IsDay() != bOldIsDay )
{
Whr_ChangeDayNight();
Event("eChangeDayNight");
//#20190211-01
doLightChange = true;
}
...and later, below in same function

//#20190211-01
if(doLightChange && isSeaEnt) {
ref rChar;
Sea.Lights = aCurWeather.Lights;
for(j = 0; j < iNumShips; j++) {
iCharIdx = Ships[j];
if (iCharIdx < 0 || iCharIdx >= TOTAL_CHARACTERS) continue;
rChar = GetCharacter(Ships[j]);
Ship_SetLightsAndFlares(rChar);
SendMessage(&characters[iCharIdx], "l", MSG_SHIP_LIGHTSRESET);
}
}
Nice, thanks for the info, I may take a look at these files once I get the chance.

Thats all GOF ERA II code, but my guess is, that it should be possible to merge this into the NH code?
Since they run in the same engine I think that it would indeed be possible. :yes
It may need a bit of work, but it should be possible.
 
I just tried a real quick merging, I tried to paste the code in AIShips.c and locations_loader.c (I did let out the weather updates for now) and got the following error in the log:

Code:
COMPILE ERROR - file: sea_ai\AIShip.c; line: 912
Duplicate variable name: rCharacter

I am afraid, don't quite get what this means, I tried to name different variables, but got other errors, and I am quite sure it need to stay rCharacter to work properly


Before I just smash the complete current NH build over the maelstorm engine, it probably would be more interesting, to see, what happens if I just replace the files that got updated since the WIP31, I am sure that a lot files have been touched, but also a lot have been untouched.. Is there any way to find out, which files in particular got changed, without causing too much work?
 
any idea for the missing / not building interface? What could be the main reasons for an interface to not build up in the storm engine?
Could be a very wide variety of reasons...
If there's no error.log, it's bit shooting in the dark.
If I had to do it, I'd swap out the interface with one that does work; then start modifying that to the one it should be; until it stops working.
Then you know what did it.

I just got the information from where the lanterns are called exactly: (but unfortunally I dont understand enough from that)
Ah; makes sense that it would require code on the PROGRAM side as well; and wouldn't just magically start working.

I am afraid, don't quite get what this means
If, in the same function, ref rCharacter is defined and later ref rCharacter is defined again, you'll get that message.

Before I just smash the complete current NH build over the maelstorm engine, it probably would be more interesting, to see, what happens if I just replace the files that got updated since the WIP31, I am sure that a lot files have been touched, but also a lot have been untouched.. Is there any way to find out, which files in particular got changed, without causing too much work?
Make copies of both versions of the PROGRAM and RESOURCE\INI folders, then ask WinMerge to find the differences.
 
Make copies of both versions of the PROGRAM and RESOURCE\INI folders, then ask WinMerge to find the differences.

Not exactly that but I did use winmerge to compare the NH files in Maelstrom (when I was using it but probably unchanged since) and the nearest NH code to that date I had so 31 March 2016 v 27 March 2016 (in storm 2.0) - the version I was using for comparisons of behaviour. That gives roughly the files that had to be altered (or placed elsewhere) when porting back then. Logically the ones with differences are the ones to keep an eye on when winmerging to the latest NH files.
 

Attachments

  • folder compare.7z
    391.2 KB · Views: 176
Not exactly that but I did use winmerge to compare the NH files in Maelstrom (when I was using it but probably unchanged since) and the nearest NH code to that date I had so 31 March 2016 v 27 March 2016 (in storm 2.0) - the version I was using for comparisons of behaviour. That gives roughly the files that had to be altered (or placed elsewhere) when porting back then. Logically the ones with differences are the ones to keep an eye on when winmerging to the latest NH files.
Even better. :onya
 
thanks, @pedrwyth ! ;)

Well I found the error in my merged code.. I forgot a bracket in the 2nd void:drunk

now, the game starts and I think the game tries to actually switch on the lanterns, but cant for the following error:

Code:
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 898
missed attribute: lights
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 898
no rAP data

I dont exactly know where I should define the missing attribute? Also, what exactly means no rAP data?
 
Last edited:
Back
Top