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

Need Help Mystery Bugs (Sailcloth Multiplication & Random Fire)

Cerez

Baroness of the High Seas
Storm Modder
Has anyone (in the long history of the Sea Dogs series) manage to figure out (and fix) the long-standing and mysterious sailcloth multiplication bug? Is this a bug in the engine or in the game code?

Also, is the random appearance of hovering bonfires on water (without ships) after a battle a bug exclusive to CT, or does it appear in the other games as well? Does anyone know a way to fix it?
 
Has anyone (in the long history of the Sea Dogs series) manage to figure out (and fix) the long-standing and mysterious sailcloth multiplication bug? Is this a bug in the
I know nothing about that specific bug.
But my first impression is that very much most likely, it sounds like a game code bug.
As far as I know, the game engine itself doesn't handle the goods.

Also, is the random appearance of hovering bonfires on water (without ships) after a battle a bug exclusive to CT, or does it appear in the other games as well? Does anyone know a way to fix it?
Also doesn't sound familiar.
Does sound closer to a game engine bug though.
 
Thanks Pieter. I'll do some more digging into the goods counting system in the game later, and see if I can resolve this long-standing mystery.

I have no idea what to do with the fires, though. I think you may be right about them being a game engine bug. Digging in the game code produced nothing for me -- the fires are created when they are supposed to be created, on the surfaces of ships. From what I gather, they are actually fires that were lit during the battle on sunken ships, but either the game or the game engine makes them not clear and they reappear active after a battle has finished. It's not game-breaking, nor atrociously annoying, but it's very peculiar... Entering land or worldmap mode does clear them.
 
I have no idea what to do with the fires, though. I think you may be right about them being a game engine bug. Digging in the game code produced nothing for me -- the fires are created when they are supposed to be created, on the surfaces of ships. From what I gather, they are actually fires that were lit during the battle on sunken ships, but either the game or the game engine makes them not clear and they reappear active after a battle has finished. It's not game-breaking, nor atrociously annoying, but it's very peculiar... Entering land or worldmap mode does clear them.

It is not an engine problem, but a script problem. I remember this exact problem when working with Modder01 on his CT and I fixed it for that version. However, I don't remember specifically where the problem was...probably AIShip.c.

Grab that version and find all the 'fireplace' instances...and perhaps particles too, then compare all the code. That's what I did; I compared all the places for those elements between the non-working CT and COAS to find what was different.
 
Thanks @ChezJfrey. That's good news! I'll have a look into that. :yes The fireplace generation seemed fine, but I haven't compared the particles code.
 
@ChezJfrey, are you sure you've fixed this in HIS? The only difference in related game code I can find is this:
Code:
<            if(frnd() < 0.3 ) CreateParticleSystem("smoke",stf(locator.x),stf(locator.y),stf(locator.z),-1.57,0,0,0);
---
>            if(frnd() < 0.3 ) CreateParticleSystem("smoke",stf(locator.x),stf(locator.y),stf(locator.z),0.0,0.0,0.0,0);

However, AFAIK, @Modder01's release of HIS is built upon the 2.8 engine, not 2.5. I'm starting to be confident that this is an engine bug.
 
Last edited:
@ChezJfrey, are you sure you've fixed this in HIS? The only difference in related game code I can find is this:
Code:
<            if(frnd() < 0.3 ) CreateParticleSystem("smoke",stf(locator.x),stf(locator.y),stf(locator.z),-1.57,0,0,0);
---
>            if(frnd() < 0.3 ) CreateParticleSystem("smoke",stf(locator.x),stf(locator.y),stf(locator.z),0.0,0.0,0.0,0);

However, AFAIK, @Modder01's release of HIS is built upon the 2.8 engine, not 2.5. I'm starting to be confident that this is an engine bug.

I am positive it is not an engine issue. When I first used CT script code, with Modder01, using the 2.8 engine, it had the exact same problem and I did nothing in the engine to fix it; everything was script modifications.

When you ransack a ship and go back to sea, or ships are sunk, you have a bunch of random fires on the water, correct? That is the same problem I saw and it turns out those fires on the water are in the exact spot the fire started on the ship, though of course the ship has moved since then.

I seem to remember two instances of the same event for 'fireactivation' in AIShip.c, and some other code that needed rearranged about fireplaces in AIShip.c. Also rearranged some of the Init/Create/Delete particles in the ransack screen, cabin.c, abordage, boarding, sea.c, etc. There were a number of things, and I don't remember specifically what solved it, but by trying to match COAS as closely as possible in the order and placement of those functions, it fixed it.
 
This is beginning to sound a bit familiar.
In PotC, sometimes in the boarding scenes, there are still particle effects and sails visible from 3D Sailing Mode.
 
In PotC, sometimes in the boarding scenes, there are still particle effects and sails visible from 3D Sailing Mode.

Sounds like a very similar programming mistake (failing to clear all created entities), but not quite the same problem.

Thanks for your help, Chez, your words are inspiring. That is indeed the problem. I've resolved to get to the bottom of this. I will compare the every file line by line between COAS and CT if I have to! This wonderfully crafted game suffers so much from obvious and dodgy programming mistakes and incomplete implementations that it makes me want to cry... The poor thing... :(

What I want to know is who crafted/modeled the world and characters for this game, and who designed/crafted the weather scenes? They're absolutely beautiful! <3 They are what keeps me working at patching this game and fixing all its bugs.
 
Well, after spending another day messing around with this, and trying every piece of code that was supposed to do SOMETHING to clear these renegade fire instances, I'm forced to conclude, after all, that this is indeed an engine bug with the 2.5 version of the Storm Engine. It may have been fixed in 2.8, though I'm not convinced that it was until I see proof of it...

Specifically instructing the engine to clear them all (for every ship) does not make them disappear.

I'm curious whether POTC has this same problem.

Edit:

Oh, and apologies @ChezJfrey, I realised today that I was looking at the old Historical Immersion (Super)Mod's code, not the version you and @Modder01 have worked on. I've found the code you were speaking of (based on the newly added "ClearAllFire" function in COAS), but it doesn't actually accomplish anything (for some unexplained reason) in CT.
 
Last edited:
I'm curious whether POTC has this same problem.
The only thing I remember is that one during boarding.
But I think what happened there is that the 3D Sailing scene is kept in memory and (accidentally) displayed during the boarding scene.
Usually you wouldn't notice that, except when you happened to be near the 3D Sailing scene's (0,0,0) coordinates when the boarding started.
As you said though, that sounds like a different issue altogether.
 
Oh, and apologies @ChezJfrey, I realised today that I was looking at the old Historical Immersion (Super)Mod's code, not the version you and @Modder01 have worked on. I've found the code you were speaking of (based on the newly added "ClearAllFire" function in COAS), but it doesn't actually accomplish anything (for some unexplained reason) in CT.

There are also two instances of an event set, that might have something to do with it: SHIP_LOAD_SHIPACTIVATEFIREPLACE. Perhaps because of the duplicate, it might somehow still preserve things. Like I said, I can't remember exactly what it was, but make sure you whack the dupe. It might have also been the order of some of those clear/pause particle calls, the particle instantiation in locations/particles, and that ClearAllFire is firing int the correct spot. Sorry I can't remember all the details, but again, I'm sure it can be solved by comparison of script, because that was what corrected it. Unfortunately, it is tedious and since I can't remember specifically, you will have to endure the same tedium...search all fire, torch, and particle words in the script and compare the relevant code to a working copy, like COAS....though you are a bit luckier in that you can compare to Modder01 version, which will be more similar code and should be a little easier for comparison.
 
There are also two instances of an event set, that might have something to do with it: SHIP_LOAD_SHIPACTIVATEFIREPLACE. Perhaps because of the duplicate, it might somehow still preserve things. Like I said, I can't remember exactly what it was, but make sure you whack the dupe.

Yes, I've noticed that, and disabled the second declaration straight away. It was a "tiredness" mistake/oversight by the original developers, although it does nothing in effect to the game. Declaring an event association twice in succession is no different to declaring it only once in terms of how the program will interpret it.

It might have also been the order of some of those clear/pause particle calls ... and that ClearAllFire is firing int the correct spot.

Yes, I've made sure to add all those (over-abundant) clear particle calls as well as all the instances of the "ClearAllFire" call in the same spots as COAS has it in the code. Still no effect...

...the particle instantiation in locations/particles...

This peaked my interest -- this I haven't done. What changes may be required to "locations/particles.c"?

This is one tough cookie. Thanks for you help with it, by the way. :cheers Based on what I'm going through, I can tell that this would have been a nightmare to debug the first time around for you... :bonaparte
 
Last edited:
Hi everyone.
I just wanted to check if someone has found a way, or a clue to fix this bug finally?
Thanks in advance!
 
Back
Top