1. Dismiss Notice
  2. GOG.com logo

    Thanks to YOUR votes, GOG.com now sells:
    - Sea Dogs - Sea Dogs: Caribbean Tales
    - Sea Dogs: City of Abandoned Ships

    Vote now to add Pirates of the Caribbean to the list!

    Dismiss Notice
  3. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  4. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  5. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

Feature Request Soldier Weapon Types During Boarding

Discussion in 'Build 15 Brainstorming' started by Pieter Boelen, Jul 29, 2016.

  1. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,581
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    That would be an option. The ideal solution though, as far as I'm concerned, is to be able to define valid officer types for weapons.
    So if the game is generating an OFFIC_TYPE_GUARD for HOLLAND, the game will check the actual initItems.c definitions.
    It'll then look for all weapons it could possibly assign to such a character with the level of that particular character, then randomly assign one of the available weapons.
    Then there would be ZERO hardcoding and it would all hang on the actual initItems.c definitions. Would be pretty awesome. Probably not so easy either though.
     
  2. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,682
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)
    I think that is going to give you problems too ... because some weapons might need to be used for 2 or 3 different groups. so you have to assign them to an attribute of the item which has a sub under it again to store all the different groups. Which means its going to be harder to visualize how to input this (can't be done like how most attributes are given). And also from a performance perspective this would mean each time you want to equip a guard the game has to look trough the full items array at least once. I'd say my idea would be better for performance.
     
  3. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,581
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    It can just be done inside the item-specific switch-statement that is already in initItems.c .
    Maybe add one of those character type attributes in the main table and IF more are needed, add them to that switch.
    Should not be too big of an issue.

    Performance will not be much of an issue, because "looking through the entire items array" is already done whenever any random character is being equipped with a random weapon.
    We never noticed a performance issue when we introduced period-correct blades (which affects the same functionality in a very similar way), so the effect will be negligible here too.

    Your idea is basically a way of directly rewriting what we already have in a different format.
    It would probably improve readability, but it wouldn't in any way affect the actual functionality as it would still involve fully hardcoding the weapon assignments.
    So you'd have to list the item ID in initItems.c and then again for all its possible uses in the 'GiveSoldierWeapons' function.

    What I propose is to directly use initItems.c only and not bypass the regular equip functionality at all.
    This would also solve the "captains should not have muskets" wish, plus it could handle the indian weapon assignments in the same way too.

    I know it is possible and I cannot possibly think of a more ideal solution.
    But getting it actually working like that would definitely require some more thorough development.
     
  4. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,682
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)
    okay, so we're gonna do this? Or should we wait till after the public release?
     
  5. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,581
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    At the moment, the system at least isn't broken.
    This feature would involve rewriting and cleaning up the code, plus adding new functionality.

    "Fixing and finishing" always has top priority as far as I'm concerned, so it is fine by me if this one waits a bit longer.
    @Grey Roger may still do the level-dependent soldier weapons through the current system, since I explained yesterday how to make that work.
    That would probably suffice for the time being if we indeed do a release by September or so.
     
    Levis likes this.
  6. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,389
    That code may look very straightforward to you but I'd still need some time to figure out exactly what it means and how to translate it into exact game program code. Also, such time as I have for writing code is going on developing the next bit of "Ardent", especially if we're looking at a September release.

    The one thing I did notice from the low level version of "Soldier Weapons" is that, having successfully taken the payroll ship during "Ardent", I also captured a large number of light tizonas, which have been duly handed out. Once the player character is reasonably tough and the higher level weapons become available to naval ships, those ships effectively become a source of free high level weapons. About the only drawback I can see for players is that if the crews are carrying the weapons I suggested then they're not carrying Hibernians, which are both an exceptionally good sword and a very valuable item to sell. That just makes warships even less profitable to attack than merchants, from which you can capture both Hibernians and valuable cargo.
     
  7. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,682
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)
    here's a example on how to do it in code, so you can just copy paste it:
    This is how it looks now:
    Code:
    void GiveSoldierWeapon(ref curchar, int iNation)
    {
        if(GetAttribute(curchar, "auto_weapons") == "off") return;        //JRH: skip auto given and equipped weapons
        DeleteAttribute      (curchar,"Items.gunpowder");
        DeleteAttribute      (curchar,"Items.pistolbullets");
        DeleteAttribute      (curchar,"Items.musketbullets");
        TakeItemFromCharacter(curchar, GetCharacterEquipByGroup(curchar, BLADE_ITEM_TYPE));
        TakeItemFromCharacter(curchar, GetCharacterEquipByGroup(curchar, GUN_ITEM_TYPE));
    
        string SoldierBlade = "";
        string SoldierGun   = "";
        switch(GetCurrentPeriod())
        {
            case PERIOD_EARLY_EXPLORERS:
                switch(iNation)
                {
                    case ENGLAND:    SoldierBlade = "blade22";    break;        // ARF: Corsair's Pride (available all periods but guards get earlier)
                    case FRANCE:    SoldierBlade = "blade9";    break;        // ARF: French Admiralty Rapier (not available after golden age of piracy)
        [...]
    
    This is how you want to change it (might have made some typos but this should give you the idea:
    Code:
    void GiveSoldierWeapon(ref curchar, int iNation)
    {
        if(GetAttribute(curchar, "auto_weapons") == "off") return;        //JRH: skip auto given and equipped weapons
        DeleteAttribute      (curchar,"Items.gunpowder");
        DeleteAttribute      (curchar,"Items.pistolbullets");
        DeleteAttribute      (curchar,"Items.musketbullets");
        TakeItemFromCharacter(curchar, GetCharacterEquipByGroup(curchar, BLADE_ITEM_TYPE));
        TakeItemFromCharacter(curchar, GetCharacterEquipByGroup(curchar, GUN_ITEM_TYPE));
    
        //Get the level of the soldier
        int slevel = sti(curchar.rank);
    
        string SoldierBlade = "";
        string SoldierGun   = "";
        switch(GetCurrentPeriod())
        {
            case PERIOD_EARLY_EXPLORERS:
                switch(iNation)
                {
                    case ENGLAND:    if(slevel < 10) SoldierBlade = "blade22";               // ARF: Corsair's Pride (available all periods but guards get earlier)
                                     else            SoldierBlade = "blade23"; break;   // LEVIS: Another blade which needs to be changed to something else
                    case FRANCE:     if(slevel < 10) SoldierBlade = "blade9";                 // ARF: French Admiralty Rapier (not available after golden age of piracy)
                                     else            SoldierBlade = "blade 10";  break;  // LEVIS: Another blade which needs to be changed to something else
        [...]
    
     
    Pieter Boelen likes this.
  8. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,581
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    This is the very simplest version I can think of as an example:
    Code:
    void GiveSoldierWeapon(ref curchar, int iNation)
    {
    if(GetAttribute(curchar, "auto_weapons") == "off") return; //JRH: skip auto given and equipped weapons
    DeleteAttribute  (curchar,"Items.gunpowder");
    DeleteAttribute  (curchar,"Items.pistolbullets");
    DeleteAttribute  (curchar,"Items.musketbullets");
    TakeItemFromCharacter(curchar, GetCharacterEquipByGroup(curchar, BLADE_ITEM_TYPE));
    TakeItemFromCharacter(curchar, GetCharacterEquipByGroup(curchar, GUN_ITEM_TYPE));
    
    string SoldierBlade = "";
    string SoldierGun  = "";
    if (bSeaActive && bAbordageStarted)
    {
    if(GetCurrentPeriod() >= PERIOD_GOLDEN_AGE_OF_PIRACY)
    {
      if (sti(curchar.rank) > 5)
      {
      switch(iNation)
      {
      case ENGLAND: SoldierBlade = "blade11"; break; // ARF: Highlander (available from The Spanish Main)
      case FRANCE: SoldierBlade = "blade13"; break; // ARF: Duelling Rapier (available from The Spanish Main but marines get later)
      case SPAIN: SoldierBlade = "blade47"; break; // ARF: Light Tizona (available in all periods)
      case PIRATE: SoldierBlade = "blade34"; break; // ARF: Dragon's Head (available all periods)
      case HOLLAND: SoldierBlade = "blade19"; break; // ARF: German Rapier (available from The Spanish Main but marines get later)
      case PORTUGAL: SoldierBlade = "blade45"; break; // ARF: Crab Claw BroadSword (available all periods)
      case AMERICA: SoldierBlade = "bladeC6"; break; // ARF: Smallsword (available from The Golden Age of Piracy)
      // default:
      SoldierBlade = "blade36"; // ARF: Hunting Sword (all periods available), only for "non regular" nation
      }
      if(iNation == PIRATE) SoldierGun = "pistol7"; // PB: Brace of Small Pistols, because musketoons on pirate "marines" look weird
      else SoldierGun = "pistolmtoon"; // PB: Musketoon for periods from Golden Age of Piracy
      }
      else
      {
      switch(iNation)
      {
      case ENGLAND: SoldierBlade = "blade11"; break; // ARF: Highlander (available from The Spanish Main)
      case FRANCE: SoldierBlade = "blade13"; break; // ARF: Duelling Rapier (available from The Spanish Main but marines get later)
      case SPAIN: SoldierBlade = "blade47"; break; // ARF: Light Tizona (available in all periods)
      case PIRATE: SoldierBlade = "blade27"; break; // GR: Bosun's Choice (available from The Golden Age of Piracy)
      case HOLLAND: SoldierBlade = "blade19"; break; // ARF: German Rapier (available from The Spanish Main but marines get later)
      case PORTUGAL: SoldierBlade = "bladeC11"; break; // GR: Milanese longsword (available from The Spanish Main but marines get later)
      case AMERICA: SoldierBlade = "bladeC6"; break; // ARF: Smallsword (available from The Golden Age of Piracy)
      // default:
      SoldierBlade = "blade36"; // ARF: Hunting Sword (all periods available), only for "non regular" nation
      }
      if(iNation == PIRATE) SoldierGun = "pistol7"; // GR: Brace of Small Pistols, because pirates are getting a better than average sword
      else SoldierGun = "pistol8"; // GR: brace of flintlock pistols for periods from Golden Age of Piracy
      }
    }
    
    @Levis' version would do the trick as well. Depends on where you like your if-statement to be.
    With his version, you could have a different rank change for each nation. :onya

    I'm beginning to think maybe there really should be dedicated soldier weapons, as in "weapons that are specifically intended for soldier use".
    Maybe those could be made unlootable. Or have them be never sold at random, really good, but also have really low sell values.
    So if you do manage to survive against them and you do manage to get a lot, you may be able to equip your own crew with them to even the odds, but you won't get rich from them.
     
  9. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,389
    Change of plan for Portugal. For low level, let them have blade45, i.e. Crab Claw broadsword. And change its description so it's no longer "ancient and rare". Because if you do a Google Image search for "Portuguese sword", you see quite a few pictures of something looking not too unlike it. It's quite similar to Spain's Tizona and Light Tizona in appearance, not too surprising as it's from the same general part of the world, and pretty close in performance to the Light Tizona which is Spain's low level sword.
     
    Pieter Boelen likes this.
  10. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,682
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)
    so @Grey Roger you are going to fix the weapon assignment right?
     
  11. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,581
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    @Levis: Grey Roger is on vacation at the moment.
     
    Levis likes this.
  12. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,389
    I'm back briefly, but have no intention of doing anything to soldier weapons because I'm busy working on my storyline. I did a bit of searching through game files and on the Internet to try to find appropriate weapons for various nations in various periods, but beyond that I'll leave it to someone who is interested enough in this mod to make it happen. Personally I'd be quite happy just to let boarders have random weapons as they always used to. ;)
     
  13. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,581
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    It would be nice to have this feature at least functional in some way.
    I gave it a shot, but whatever I try, @Grey Roger has some reasons against it.
    This is why I was hoping he could set something up that is at least as good as it can be within the current limitations.

    If a complete rewrite as I described earlier could be done, that would solve a lot of the issues and clean things up quite nicely.
    But that is time consuming and risky and therefore should not be done now.
     
  14. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    I'm willing to try this out (certainly seems more urgent than the maltese crypt rebalancing I was intended to tackle, so I'll push that off until later and try this).

    However, first, I want to make sure I understand what is needed, and a plan of action is agreed upon, so I don't waste time on something people don't want. :)

    After reviewing this thread in detail, I think:

    PRINCIPLES (from reviewing past comments in this thread)

    1) The idea about soldier weapons only applying to some of the solider decks (first, or maybe first 2) Pieter had in the first page makes sense. I think we should implement that, but would need to ask for someone else to do that part, as I wouldn't know how.

    2) I think we do need new weapons for soldiers. It is absolutely correct that using the officer versions cheapens the officer rewards, and doesn't make sense, and there is a scarcity of good choices right now especially in some time periods. Also, it is too hard to balance the stats properly from the existing choices, as against gold cost and fighting ability. I think it will be much easier to create new stats that make sense and fit perfectly.

    PROPOSAL

    1) I make makeshift soldiers weapons by the following method: find a graphic currently in the game that looks about right for the period/nation, probably using many of the current recommendations for initial ideas, then copy over its current GM files with the new name, list the same graphic in the iteminit, and use wikipedia and such to write the item describe entry. I think I should be able to find a currently existing model that fits, especially since I won't have to care about the stats at all during this process.

    2) These new soldier weapons would have names appropriate to what I can find might have been issued during the period, and will have stats defined that make them slightly higher tier than comparable swords the player would be seeing at the same level. Their resale value would be on the low end, but reasonable. They wouldn't be the highest tier necessarily, so there might be some expensive really good blades on the high end of that level range that perform a tiny bit better (depending on era and such).

    However, where there is a perfectly appropriate sword already present (which there do seem to be a few), I will keep that one. But I anticipate mostly making new ones.

    3) All swords should have quality forced to be "average", so no fine or good ones. This would reflect standardization and mass distribution, and means that the player wouldn't really be able to stock up on extremely powerful weapons for his crew by claiming them (unless willing to sit at the blacksmith), because while the weapons themselves are slightly higher tier, they would be only be comparable to the "Fine" quality weapons otherwise available at the level (and less good than fine versions of the best). Additionally, with average quality, they will wear out eventually, limiting the effect of one boarding if it happens when the player is lower down in that level tier.

    4) We skip pirates and let them have random weapons, variety is good for them anyway, they should be using whatever they could find.

    5) Guns are done somewhat randomly, with a range of 2-3 options, including some small percentage getting the grapeshot area of effect weapons like musketoon at the appropriate level (we could limit it to only 20% or so for the area of effect stuff like the musketoon, but it should be sometimes present I think, otherwise unfair advantage for the player). Basically, guns would have slightly greater variety.

    WHAT I THINK I NEED TO DO

    1) Research the history of swords used by these nations and periods, using sources like wikipedia to create items describe text description and appropriate names

    2) Copy the GM files, add the new weapon line to the items init file

    3) Use Pieter's post number 48 code as a template, and expand it out to cover the various cases of periods and player level.

    IMMEDIATE QUESTIONS if I am to go ahead with this

    1) How do I force the weapon to always be of average quality? For example this line from Pieter's example code, what would I have to change to ensure it is "average"?:
    case ENGLAND: SoldierBlade = "blade11"; break; // ARF: Highlander (available from The Spanish Main)

    2) Other than adding in the items by giving them one line in items init, copying over the GM files from the sword whose graphic I am reusing, and adding a couple of lines to itemdescribe, do I need to do anything else to add a new sword if I am reusing existing models (basically, the first 3 files I posted for the Baker Rifle mod thing, the two GM files and the items init file including the extra line, plus the item describe)? I figure the Baker Rifle was more complicated because of the whole rifle hip thing, and I want to make sure these are the only needed steps.

    3) Other than filling out and duplicating the code in Pieter's post number 48 above for each time period/player level case, is there anything I would need to do otherwise?

    4) How do I use Pieter's code example when defining a random chance for 2 different guns to be picked? Could you write an example for me, with a 80% chance placeholder gun 1, 20% placeholder gun 2?

    BIG INITIAL QUESTION

    Is there anything else? This, I think I can handle. It will probably involve adding some 20 new swords to the game, with resued graphics, but I can do so quickly enough by the method I described. People would have to be ok with reusing the graphics though, because creating new for each one would be too much, and I don't think I can do this properly working entirely restricted to current blades. Later, someone could always create new graphics for them, but we would have to be ok with reusing for now.

    So please approve, disprove, or post specific revisions, and let me know whether I should go ahead. :)

    (note: if it is approved or approved with revisions, this will take me a couple of weeks to complete, because I want to spend time reading up on the military history of each nation and creating accurate swords, rather than just what seems to fit)
     
    Armada likes this.
  15. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,581
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    First of all, please know I'm tremendously grateful to you for being willing to look into this!

    You need to do nothing. Unless you specify "blade11+1" or "blade11-1", average is exactly what you'll get. ;)

    Nothing springs to mind right now.

    Just editing the Soldier Weapons function should do. :yes

    'frnd' is "float rand" and returns a random number between 0.0 and 1.0, so you can use:
    Code:
    if (frnd()<0.2) SoldierGun = "pistol7";
    else SoldierGun = "pistol8";
    
    I think there are a tremendous lot of alternate weapon models that could be used here:
    WIP - Ostrov's Incredible Weapons Collection | PiratesAhoy!
    Maybe when the time comes, @Jack Rackham and/or @Grey Roger could assist with the interface images?
     
  16. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,389
    Why would military weapons necessarily be poor quality? They wouldn't be Excellent, of course, but then weapons found on random enemies never are anyway. If anything, I'd expect military weapons to be at least Average and probably better, as they'd be issued as new and the soldiers would be expected to keep them in good condition. What they wouldn't be is expensive.

    And what's wrong with letting people stock up on decent weapons looted from dead enemies?
     
  17. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,581
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    That's what @Tingyun specifically wants to do. :yes
     
  18. Jack Rackham

    Jack Rackham HoO Team Member Quest Writer Storm Modder

    Joined:
    Jul 5, 2004
    Messages:
    3,287
    Gender:
    Male
    Occupation:
    math teacher
    Location:
    Sund, Ramsjö, Sweden
    Do we really need 20 new swords?
    A quick counting and I found 77, my own quest things not counted.

    But if you feel for it, I may help with pictures in the future.
     
    Pieter Boelen likes this.
  19. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,581
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    That was probably just a quick guesstimate.
    But with a lot of weapons limited to only certain time periods, there aren't that many active at the same time.
    And quest-only/unique ones aren't available for general use either.

    :woot
     
  20. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,389
    Not so. He wants to force them all to be exactly Average - no Good or Fine ones. He's specifically trying to block what I like doing, which is equip my officers and crew with Good and Fine weapons looted from dead enemies.

    Also, my original objections still stand. If all NPC naval ships get these weapons then either you also get them when you play as a Naval Officer or you're the only naval ship in the Caribbean without them. If the military weapons are always too powerful then the "Ardent" storyline is stuffed; if they're not powerful then naval ships become easy targets when you're higher level and have acquired powerful swords elsewhere.

    So enemy naval crew weapon types need to be dependent on either your level or the size of the ship, the way random weapons presumably are now; and you need to get similar weapons issued to you if you play as a Naval Officer. Maybe have some suitable military weapons in your weapons locker at game start. When you are promoted and get a new ship, clear the weapons locker, then add some new weapons suitable for the new ship.
     
    ANSEL likes this.

Share This Page