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

Baltimore Steam Propulsion Laboratory

Press Numpad [+] to increase engine power and Numpad [-] to decrease engine power. Numpad [*] sets power to zero

In Patch 7, the steamships don't use fuel. If you install my further update, they'll use planks: http://www.pyratesahoy.com/build/b14_b2_wip/pb_code_2011-11-17.exe
I do want to add coal into the game, but need interface pictures made for that.
 
k, thanks, also, how exactly do you want us to mess with the values? Not exactly sure how a real steamship works...
 
So far it seems pretty good to me, I'll obviously keep testing, but I honestly think right now, our biggest issue is to get icons for coal and make sure that good is only introduced in the master and commander and hornblower storylines, they haven't caused any GA on my end and in my opinion, the steam engines don't give too unfair of an advantage since they're naturally hard to find anyways. If you want my opinion on anything else about the ships, feel free to ask

EDIT: Sorry, I know I double-posted...
 
One thing I know is really dodgy is that you achieve your highest speed when using no sails at all, which makes no sense.
 
True, I have noticed the more I use it that when on it's own, the steam engine does seem to be somewhat powerful. Also, should we adjust the turn-rate to a lower value since the engines add a ton of weight to the ship? Idk, just saying... Also, a glitch I noticed is that randomly on non-steam ships, even in eras where there are no steamships, is that you'll still have the engine thing pop up right below the compass as if you were actually using a steam ship, idk how to fix that...
 
True, I have noticed the more I use it that when on it's own, the steam engine does seem to be somewhat powerful.
Yeps; at the moment, it seems there's three settings:
1. No sails and full power = highest speed, but worst manoeuvring
2. Half sails and full power = lower speed and best manoeuvring
3. Full sails and full power = medium speed and medium manoeuvring

Also, should we adjust the turn-rate to a lower value since the engines add a ton of weight to the ship?
If I recall, the Willemstad Builders' Trials did adjust the steamships to be at least heavier than their normal counterparts.

Also, a glitch I noticed is that randomly on non-steam ships, even in eras where there are no steamships, is that you'll still have the engine thing pop up right below the compass as if you were actually using a steam ship, idk how to fix that...
Good catch, mate! I noticed that as well when messing around with the Pearl and have got it fixed now; I had some code in the wrong spot. :facepalm
 
On the upside, I've taken it into battle and haven't noticed any beeps or GA.If we change anything as of right now, than I think it should be just making the engine a tiny bit less powerful.
 
The problem is that assuming a constant maximum power output (coded as impulse), the obtained speed depends on the sails with no sails yielding the highest speed.
We'd probably have to decrease the power output when no sails are used to compensate for this bizarre behaviour of the game engine and make the ship behave the way physics tell us it should. :facepalm
 
hmm, can you tell me where some of the code is in the files? Give me something to start with? Never modded anything before, so I'll need some hand-holding to start out with if you know what I mean.
 
PROGRAM\SEA_AI\AIShip.c contains the code that actually makes the steam engine work:
Code:
	// PB: Steam Ships -->
if(SteamShip(rCharacter))
{
if(!IsMainCharacter(rCharacter))
{
switch(sti(rCharacter.LastSailState))
{
case 0:
rCharacter.Ship.Power = 0;
break;
case 1:
rCharacter.Ship.Power = 50;
break;
case 2:
rCharacter.Ship.Power = 100;
break;
}
}
if(GetCargoGoods(rCharacter, GOOD_PLANKS) > 0 || !IsMainCharacter(rCharacter))
{
ref MyShipType = GetShipByType(GetCharacterShipType(rCharacter));
aref arship; makearef(arship, rCharacter.ship);
float PowerScalar = stf(GetAttribute(rCharacter,"Ship.Power"))/100;
float SpeedRateScalar = stf(GetLocalShipAttrib(arship, MyShipType, "SpeedRate"))/10
float DamageScalar = makefloat(GetCurrentShipHP(rCharacter)) / makefloat(GetCharacterShipHP(rCharacter));
// THIS LINE MAKES THE "ENGINE" WORK FOR REAL; everything after the = sign is the calculation of the power output
rCharacter.Ship.Impulse.Rotate.z = 0.2 * PowerScalar * SpeedRateScalar * DamageScalar;

fX = 0; fY = 0; fZ = 0;
if(CheckAttribute(rCharacter,"Ship.pos.x")) fX=stf(rCharacter.Ship.pos.x);
if(CheckAttribute(rCharacter,"Ship.pos.y")) fY=stf(rCharacter.Ship.pos.y);
if(CheckAttribute(rCharacter,"Ship.pos.z")) fZ=stf(rCharacter.Ship.pos.z);

if(fX != 0 && fY != 0 && fZ != 0)	StackSteam(rCharacter, makeint(abs(stf(GetAttribute(rCharacter,"Ship.Power")))/12.5));
}
}
// PB: Steam Ships <--
Then the behind-the-scenes steamship code is in PROGRAM\NK.c, but that shouldn't need much changing; that's mainly where the added particle effects are as well as the fuel consumption.
PROGRAM\Ships\ships_init.c contains the stats for all the ships in the game and is therefore also relevant, of course.

See if you can make any sense of this stuff; you don't have to understand everything in there (I don't either!), but anything you DO understand allows you to mess around with that part. :cheeky
 
actually, I get what about 90% of that means, problem is if we want to change certain values, we'll need to go into other files most likely, like if we want to change the fuel source or what not, plus, unless each steam frigate has pretty much the same stats, than we may have to change them individually too, I'll get working on this as soon as I can, but note that this will be a busy week for me and I may not get much done if anything.
 
At the moment, we've got three steamships: US_Steamfrigate, RN_Steamfrigate and FR_Steamfrigate. They're all three the same with the same stats, so that at least keeps things somewhat simple.
I don't expect we'll be getting any different steamships any time soon, so as long as we can balance this type correctly, we should be all set for some time to come.

Changing the fuel source will be very easy once we get coal into the game. All I need to do that is the interface picture for it and then I can sort that one out easily.
I could do it without the interface picture as well, but that would just look lame.

Anyway, you can have a look at those other two files I mentioned and see if you can make heads or tails of that. :doff
 
well, let's not mess with the NK file unless we have to, the AIship seems to be what really effects the behavior of the engines, and our best bet is there, like I said, no promises from me as of this week, but I'll do my best.

EDIT: if you come up with anything that might make the ships more realistic, post them on here, as will I
 
I was thinking of adding a factor in that line of code that decreases the impulse by a certain amount if LastSailState is 0 (eg. sails furled).
 
Code:
			float SailCompensation = 1.0;
if(sti(rCharacter.LastSailState) == 0)	SailCompensation = 0.5;
rCharacter.Ship.Impulse.Rotate.z = 0.2 * PowerScalar * SpeedRateScalar * DamageScalar * SailCompensation;
This seems to behave a whooole lot more sensible.
All it does is divide the speed by 2 if you're not using sails. In my test condition, this results in 6 knots with no sails, 9 knots with half sails and 12 knots with full sails.
Wouldn't you agree that's much more better, considering the simplicity of the fix? :dance
 
that does make a lot more sense naturally, idk why I didn't see that, eh, it will take a couple of tries before I do something useful I guess, lol
 
yeah, my goal is to help make a stable build mod 14 in any way I can (plus I partly want my name in the credits video too, I won't lie, lol)
 
Haha; there's a lot of people who don't have their names in there yet, that video was made quite a while ago already.
As a start: Welcome to the "Modders" group! :woot
 
Oh yeah, this calls for a celebration! Cheese for everyone! Wait, scratch that, cheese for no one. It can be just as much of a celebration if you don't like cheese, true? lol
Also, what file did you mess with that had those values?


:warr
 
Back
Top