[A16] Military Strength Calculation

Hey everyone,

Does anyone know how the new military strength is calculated? This is the new score that determines what ambient threats are thrown at you rather than hearthling count. I went digging for this after I picked up a purple general hat before finding a green scout hat :unamused:

It’s referenced in the game difficulty files:

\stonehearth\data\game_mode\normal\normal.json

      "hard_raids": {
         "can_start": {
            "test_1": {
               "military_strength_check": {
                  "type": "deny_if_not_between",
                  "item": "score",
                  "score_type": "military_strength",
                  "value": {
                     "min": 110,
                     "max": 200

I tried my usual approach of digging through the files but got lost around equipment_piece_component when it looked like it was also taking into account weapon damage and armor resistance. Combat job abilities look to add to the score as well.

Maybe @sdee could share some insight on the calculation? Even if it’s likely to change next build, I wouldn’t mind a rough idea how fast or how slow to scale my guys to move into the next raid.

Also, is there some html code I could reference to have it show up in my town menu with food and morale scores? I tried view.score_military and other variations but no luck. Not looking for anything fancy, I can correct the UI as needed for my own fancy-ness. :wink:

Thanks!

3 Likes

Adding @linda, since @yshan is away from the office right now!

Update: From Linda: the military score for one hearthling is the military_scores of all the equipment they are wearing. If the equipment has a military score or an ilevel, it uses that as the military score for that piece of equipment. Otherwise it is the weapon_damage/damage_reduction

1 Like

The view.score_ values are set in the javascript, so if you want it to show up in your town window, you need to add this line of code to the town.js file around line 301 within the _updateUi function:

`setValueFloored('score_military', self.get('score_data.category_scores.equipment'));`

I’m guessing you already have this part in the HTML, but if not, put this block of HTML into the town.html file under line 74, near the other score div blocks.

<div class="row indented" id="equipment">
     <div id="militaryIcon" />           <!-- you can make an icon for this and add the link to town.less -->
     <div>Military Strength</div>
     <div>{{view.score_military}}</div>
</div>
3 Likes

Does this mean that if you have 6 combat job hearthlings but none of them have upgraded equipment, your military strength would be 0? Or do the default gear values calculate into the total?

With that said (asked), is there any way to choose which gear hearthlings equip? Right now I notice they grab the best item they can at the moment. If I want to scale them down or hold some better gear in reserve to keep my military strength down for a bit, is there any way to achieve that?

1 Like

Thank you @linda and @sdee. The equipment_piece_component.lua file just clicked in my head with your explanation!

Would the score checker take the single highest value in an item or in order of first returned? From the .lua, it looks like it’s more an order of what it finds first: 1. Military score, 2. ilevel, then 3. weapon damage or armor reduction.

As an example, here’s a shortened piece of gear and syntax may not be accurate:

   "components": {
      "unit_info": {
         "display_name": "Example Weapon",
      "stonehearth:equipment_piece": {
         "slot": "mainhand",
          },
         "ilevel": 20,
         "military_score": 22,
   "entity_data": {
      "stonehearth:combat:weapon_data": {
         "base_damage": 25,

Would it take the base_damage value of 25 to add to the score since it’s highest or military_score of 22 since that would be returned first? I could see an unwitting modder gimicking the game if it’s the latter.

Thanks.

@ursapolaris: the default gear has a military score, too, so you should totally have some score, even with apprentice combat units.

Re: picking items, we do not plan to implement picking gear per hearthling. One of our design goals is to reduce micro, wherever we can. :smiley:

Yup, your speculation is correct. It will pick military score if it finds that, otherwise it will choose the ilevel or finally weapon damage/damage reduction.

It’s worth noting that the military_score is only currently used on job abilities, so for example promoting to a knight gives you a 20 point increase in military score. Weapon and armor were not intended to have the military_score field since it they already have the ilevel/damage field.

Min/maxers of the world are sadfacing. :disappointed_relieved:

1 Like

Using current game mechanics, your “unequip” option is a temporary demotion to Worker. They’ll drop everything on the spot. The items will be reclaimed and put into storage or equipped by others.

As for selectively equipping your guys, that’s a little trickier but can theoretically be done. You’d need to build only what you need and when, store it in a specific location somewhat far away then command move your guy to it and the ai hopefully kicks in for that hearthling before another. Having the footman/archer/cleric beside the storage point before the item is placed should have this work somewhat seamless since a worker carrying an item isn’t considered public inventory.

For the most part however, we shouldn’t need this level of min/max in this game. It has a relaxed pace to it and once combat is tuned along with additional equipment we’ll be golden.

Well, one of the things that’s problematic right now is that I use making weapons and armor as my primary means of boosting net worth in a hurry - crafted gear has immense value increase over the raw materials used to make them. And the higher the level of gear the greater the proportional increase in value over materials. If I want to slowly level my combatants while building large net worth, then my Military Score could wind-up ahead of where I want to be on difficulty in Normal mode.

I still argue the case for an Easy Mode. :wink: Something between Creative and Normal. I still regularly lose hearthlings (esp archers and trappers) when the kobolds and ogres start showing up. :unamused:

1 Like

what armors are you making that are supposedly good sources of net worth? Equipment is tuned to not be a good source of net worth – ex if you just sold the ingot ingredients to a vendor, you would get the same amount of gold. Maybe we have a bug if they are a good source of income (note: ingots only have net worth value when you sell them)
Thanks
-Yang

OK. For those interested, attached is a ready to go alteration of the files necessary to tweak your Town UI. Please only try this if you know what you’re doing. :slight_smile:

stonehearth_military_strength.zip (11.8 KB)

Here’s an example of what the change will do. I placed the Military Strength at the bottom of the list and I’m using a smaller version of the footman icon.

edit: This isn’t a mod by the way. This is meant to directly replace existing files which Radiant doesn’t recommend. I’m still new at this and off the top of my head I’m not sure if I can use overrides for this but if I can, I’ll make a mod out of it and upload/replace later.

3 Likes

Building buildings/structures should net you a higher net worth from their base components compared to making weapons. Weapons/armor should almost be a trade off, if not a depreciation, against components used.

Careful where you place random buildings though to increase your net worth. That will increase your village size/radius that the game will use to place mobs. If you spread too far, you may end up with mobs spawning “inside” your perceived base due to distance between structures. There’s a video that explains this better but I don’t remember its link.

Well, there you go then - that’s why I turn the ingots into gear right away - they’re worth nothing as ingots. If you make them into gear, at least they’re now WORTH something. If ingots had some value, I wouldn’t be converting them all into gear/items right away. :wink:

Hmmm maybe we should make ingots contribute to networth then :slight_smile:
Always a possibility

1 Like

Pretty sure the gold in Fort Knox contributes to America’s Net worth. Anybody know how many villagers it’s got?

The US Gold Reserve was moved out of Fort Knox over 2 decades ago now. It hasn’t been there for a very, very long time. :wink:

Well now I just look silly.

I havnt read everything that you all has wrote
But I see it strange that I have military strength 27 without any soldiers at all in the village
and for what I know the civilians cant fight with the tools or unarmed…
is this a bug in the game?