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

Concept for Nation.strength attribute

CouchcaptainCharles

COO (Chief Oddity Officer)
Storm Modder
Pirate Legend
I have harboured ideas for a "nation.strength" attribute for some time but I always had other things to do. Now that Grimm has raised the Nations at war topic it might fit in.

The idea is to assign to each nation the atribute ".strength". All nations would start the game with the same strength (let's say 100) Everytime a ship is being sunk the strength of the winning nation would be increased and that of the looser decreased slightly. The conquest of a city would shift the nation.strength considerably.

At a later stage one could introduce random events, e.g. earthquakes, plagues or unrest would weaken nations, reinforcements from the mothercountry would add strength.(simple newsstyle texts would do, like in Pirates! )

The nation.strength would influence the gameplay. E.g. sailors of a strong, victoriuos nation would fight better (similar to the morale factor). A strong nation would have a booming economy, i.e. higher goods prices, bigger and richer cities, stronger fortgarrisons. A weak and desperate nation would pay more for the help of privateers.

Here the player joins in. You can influence the fate of nations just by letting battles happen, i.e. just by staying at the scene of a battle till some ships have been sunk. Or you join the service of a nation and actively influence the outcome of battles. (combines with Verruckt's military mod and Nathan's RM mod) Joining a strong nation would make things easier for you, joining a weak one should be more rewarding.

Once I have the thiefmod finished (probably sometime in 2010 ) I plan a missiongenerator for clandestine missions. Those could influence nation.strenght as well: assassinating a famous admiral, stealing battleplans, sowing unrest or sabotaging towns or forts could all weaken nations.

One day I'll surely tackle those things, but I have already so many half finished mods and concepts that I wouldn't mind at all if someone else adopts those ideas. Feel free to take anything of them that might be of use for you.

The good thing is that it can be done step by step, and even by several people independently. Once you have established the attribute nation.strength anyone who has found or made the code for a certain event can say "Hey, I want this to change the strength of a nation" and add one line of code.
 
Sounds fantastic, CCC, but do you think we'll all STILL be playing PotC in 2010? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/razz.gif" style="vertical-align:middle" emoid=":razz" border="0" alt="razz.gif" />

Just kidding... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" /> It really DOES sound great, I love the idea of having the fluxuations in nation strength and being able to influence battles and things of that nature. One of the things I have always enjoyed about <i>Uncharted Waters, New Horizons</i> is that there IS a way to influence country strength or allies by investing in a port or a business in a particular town... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
<!--`QuoteBegin-CatalinaThePirate`+--><div class='quotetop'>QUOTE(CatalinaThePirate)</div><div class='quotemain'><!--QuoteEBegin-->Sounds fantastic, CCC, but do you think we'll all STILL be playing PotC in 2010?  xD: <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/razz.gif" style="vertical-align:middle" emoid=":razz" border="0" alt="razz.gif" />[/quote]
Well, I have already braced myself for the fact that I will be the only one by then. The last Akellani....
Maybe I can force my future grandkids to play my mods... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/diomed.gif" style="vertical-align:middle" emoid=":dio" border="0" alt="diomed.gif" /> No, they might sue me for child abuse <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/slap.gif" style="vertical-align:middle" emoid=":slap" border="0" alt="slap.gif" />
 
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> Don't feel bad, in 2010, I'll probably still be trying to fix my Sneaky Trader Mod! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
A great idea <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
Sweet idea, absolutely! This also plays into so many ideas I've had myself: A public notice board in taverns or printer's office, so you could check in and get the latest happenings... and then my series of skill/`rep-affecting` medals could certainly be rewarded for helping toens in various ways.

(And we'll all be playing this game in virtual reality by 2010, I should expect.)
 
Sounds like a great Idea, just having the attribute, I think will open up new possibilites for other modders as well. I look foward to seeing what you and others can do with it.
 
And may I add to my former comment that as I may have mentioned (I can't recall) I hope to work up some code on this very idea, though certainly I'd far rather work in concert. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
I hope so too <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

You are most welcome back, Nathan <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/william.gif" style="vertical-align:middle" emoid=":will" border="0" alt="william.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/william.gif" style="vertical-align:middle" emoid=":will" border="0" alt="william.gif" /> About two dozen posts by you in one day <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_eek.gif" style="vertical-align:middle" emoid=":shock:" border="0" alt="icon_eek.gif" /> Now that's what I call a comeback <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />


<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" /> Grimm , if you want to trigger political (or other events) there are several methods. One is to do it in a dialog. Remember Pirates! where the tavernkeeper would tell you all about war, peace, earthquakes and plagues? You could add a link to the tavernkeeper or citizen dialogs where you ask about political news. That link would lead at random to other nodes in which the NPC would tell you e.g. "Spain declared war on France" or "The Portugese have put a price on your head" or "Most of the Dutch garrison died of yellow fever". And each node would contain the code to create the event you have just been told about:

SetNationRelationBoth(SPAIN,FRANCE,RELATION_ENEMY);

SetRMRelation(GetMainCharacter(), PORTUGAL, REL_WAR);

SetTownNumTroops("Douwesen", 300);


For more examples of nationrelation code look at the case "begining" in quest_reactions.c or at the VERRUCKT MILITARY or NK RM mods. For event triggering dialogs have a look at the Wiki location cloning tut 2.


You can also make random events on a time basis. Here is an old post by me about scurvy, but you could apply it to trigger any other event as well:

--------------------------------------------
No need to be amazed, as anything in life it's easy once somebody tells you how <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
If I understand you right you want to learn how, so here is an easy example how to program events. It's not very elegant programming, but I tried to keep it simple for a start.

Let's assume we want to make an event "Scurvy kills 10% of your crew", and for this there shall be a 20% chance every day that you are at sea.

Open the file programworldmapworldmap_events, find this function

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->

void wdmNextDayUpdate()

{

    // NK --><!--c2--></div><!--ec2-->

This function runs every "morning" on the worldmap, and as you see has NK already put something in there (crew foodconsumption) Above that we add these lines between { and // NK -->

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->

void wdmNextDayUpdate()

{



    if(rand(100) < 20)



    {

 Characters[GetMainCharacterIndex()].Ship.crew.quantity = makeint(sti(Characters[GetMainCharacterIndex()].Ship.crew.quantity) * 0.9);



 Log_SetStringToLog("Scurvy has killed some of your sailors");

    }



    // NK --><!--c2--></div><!--ec2-->
May look complicated, so let's disect it:

rand(100)
...creates a random number between 0 and 100, like throwing a (big) dice

if(rand(100) < 20)
...is a condition which checks if our random number is smaller than 20. If it is, i.e. on about 20% of all days, the program executes the code between the following { } brackets.

Characters[GetMainCharacterIndex()].Ship.crew.quantity
...is an attribute: the crewquantity of the maincharacter

= makeint(sti(Characters[GetMainCharacterIndex()].Ship.crew.quantity) * 0.9);
...multiplies this by 0.9 i.e. reduces the crew by 10%

Log_SetStringToLog("Scurvy has killed some of your sailors");
...displays the text between the " " on screen.


Now this simple screen textmessage looks of course a little "undramatic" in a 3D game. A bit more decoration and story would be nice. One could e.g. put this codesection into a dialog, e.g. if you talk to your officers they may sometimes cry: "Captain, something terrible has happened..." and tell a lively disaster story. Or one could trigger a cutscene: You in your cabin, officer rushes in: "Captain, something terrible has happened..." One could even let some "sick" (i.e. poisoned) sailors rush in and die at your feet. But that would take of course a score of codelines more.
 
Thank you CCC. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
I see you've all been most devio--err, productive, in my absence. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
(And thus much to catch up on. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> )

Regarding events.

What I'd like to write is a `post-event` handler for world events.
I.e. normally you have postevent() which executes a function after a time delay.
What I'd like to add is a world events queue that one can post an event to with a time component, and when the time is right it executes (or immediately, as the case may be). Events like the above, and given in shorthand rather than writing specific functions.

Actually, no little resemblence to Akella's quest handling structure. In fact, we might as well just use that to handle times (I already rewrote it to handle more time units IIRC), and then have a special prefix to the questcase like WorldEvent_ and QuestComplete would have a separate handler at the top to handle these since they'd have variables attached in the text of the questcase.
 
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->Grimm , if you want to trigger political (or other events) there are several methods. One is to do it in a dialog. Remember Pirates! where the tavernkeeper would tell you all about war, peace, earthquakes and plagues? You could add a link to the tavernkeeper or citizen dialogs where you ask about political news.  <!--QuoteEnd--></div><!--QuoteEEnd-->
That was the general idea, though I want it as one of the rumors (i.e. if you ask a citizen about the news around, he´s supposed to tell you something like "I´ve heard France is at war with Spain" for example). The mayor problem is, apart from writing it into code, checking which relations the respective countires had befor, it wouldn´t make much sesne if two countries are already at war and the rumor says they have just declared war. As well, wars and alliances (is there a "neutral" relation between nations or can they be noly allied or at war?) should last some time (wars particularly, <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" /> ).
 
Yup, there is a neutral relation. Portugal has it with everyone but pirates, IIRC.

Hmm. How about, two cases for ending a war:
1. Nation strengths diverge too far (loser sues for peace)
2. Nation strengths stay similar, war peters out (peace through exhaustion).
 
<!--`QuoteBegin-NathanKell`+--><div class='quotetop'>QUOTE(NathanKell)</div><div class='quotemain'><!--QuoteEBegin-->Yup, there is a neutral relation. Portugal has it with everyone but pirates, IIRC.[/quote]Unless you're playing CCC's "Stormy Start" - sometimes you will find Portugal at war with England, which is really odd since I generally favor the Portuguese in the game.

I like this rumors of a political nature idea - you can excuse the "just declared war" part as the news getting around SLOWLY. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->Yup, there is a neutral relation. Portugal has it with everyone but pirates, IIRC.  <!--QuoteEnd--></div><!--QuoteEEnd-->
No, they´re allied with all (that two beer mugs), so I gather there are only "allies" and "enemies" among nations and only the player can have a "neutral" relation to a nation.

<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->I like this rumors of a political nature idea - you can excuse the "just declared war" part as the news getting around SLOWLY<!--QuoteEnd--></div><!--QuoteEEnd-->
That´s the main idea, it would be way easier doing it by the "daily crew update" function (at least I suppose that), but that lacks that certain flavor - something I´ll never forgive the new "Pirates", not being able to chat with other ships anymore to learn the news but getting them automatically. That and the "sighting" function.
Perhaps the sighting could be `re-implemented` in PotC, if you hit another ship sailing the ocean, just don´t give the information who and what they are (e.g. "Group of Merchants flying the English flag"), but just give the choise whether to engage or not, so you have to find out yourself what you´re up against. How about it?
 
<!--`QuoteBegin-v_Grimmelshausen`+--><div class='quotetop'>QUOTE(v_Grimmelshausen)</div><div class='quotemain'><!--QuoteEBegin--> The mayor problem is, apart from writing it into code, checking which relations the respective countires had befor, it wouldn´t make much sesne if two countries are already at war and the rumor says they have just declared war. [/quote]
Well, that depends on how sophisticated you want your mod to be. If you just want to add some variety to the game you could make the events so vague that they make sense in any case.
E.g. the news "Spanish troops have attacked Douwesen", together with code setting Spain&Holland to "war" and reducing troops and wealth of Douwesen, would make sense no matter if Spain and Holland were at peace before or already at war. A bit clumsy, I admit, but it would save a hell lot of `relation-checking` code.

As for ship encounters, I agree that it would improve the game if you had to identify sighted ships by telescope in sailing mode. False flags would make that a bit more thrilling, but that would only work if there were a motivation to approach neutral or friendly ships (trading? news exchange? pressing crews from merchants?)
 
There's the "scales" icon that means neutral, rather than the mugs=friends or guns=war.
There's certainly a REL_NEUTRAL in the code...

Re: SMP vs. P!G. I agree absolutely.
We could go to P!G's `multiple-screen` approach* for contact--first is sail sighted (go closer/sail away), then number* (ditto with less chance to escape), then type (ditto with even less) and lastly flag (with almost no chance to escape).

*modified to account for POTC's possibility of multiple ships

Re internation relations.
What about this? The switch happens via DCU, but you're not _told_ about it until you get the latest news (or an enemy ship fires on you, heh...)
 
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->We could go to P!G's `multiple-screen` approach* for contact--first is sail sighted (go closer/sail away), then number* (ditto with less chance to escape), then type (ditto with even less) and lastly flag (with almost no chance to escape).  <!--QuoteEnd--></div><!--QuoteEEnd-->

Whow, getting ambitious. I thought nothing more than removing the information text from the encounter dialog, in my opinion, that would have the desired effect

@CCC
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->Well, that depends on how sophisticated you want your mod to be<!--QuoteEnd--></div><!--QuoteEEnd-->
Not very, I just wanted the political situation to change once in a while and thought the rumors a nice way to do that, almost like the Coastraiders. But to get info about shiptraffic you´ve got to talk to certain people, the travellers (the ones who can pick your pockets and usually do that), while the ordinary citizen don´t tell you anything of value if you ask them for rumors.
 
Encountering ships for trading or exchanging news - I'd love that. For the `set-up` I picture being able to "board" an allied ship, and so you and the captain appear in someone's cabin and you both talk about rumours, initiate quests, or, best of all, trade cargo (all very much like the old Oregon Trail actually)... say you need some food, and have too much ammo, and he needs ammo and is willing to spare some food...

Or you stab him right there and take his ship, bwa ha ha! For a horrendous rep drop, naturally.
 
Or he serves you poisoned portwine, bwa ha ha! For a horrendous head drop, naturally. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/dev.gif" style="vertical-align:middle" emoid=":d:" border="0" alt="dev.gif" />
No risk no fun <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
Back
Top