Merchant Class (Overall idea, seeking interest/advisement)

Hello! My name is Jake and I’m digging into the modding on Stonehearth a bit.

I’m still feeling things out, but there are a few ideas I have churning and it would be really nice to get some quick feedback on them (both in terms of player interest and from experienced Stonehearth modders on whether the ideas are even possible currently.) With this idea, I will give the gist of it and why it seems attractive to me, as well as what aspects of the game I would imagine would be affected by such a mod. Please do feel free to correct me or give feedback on these.

Merchant Profession

What it is, and why I think it would improve gameplay.

Currently, economy in the game is limited to collecting raw resources, refining them, using or selling the raw and refined items to the occasional traders, and purchasing items from those traders. This is rather limited, and I feel there’s a lot more mileage to be gotten from this sort of stuff.

What I’d like to do is to create a ‘merchant’ profession. You would assign an area (like you do with farms or trappers) which represents a shop. Similar to a stockpile, you would allow or disallow items to be stored there.

Some furniture (tables, counters, boxes, crates, barrels) provides space for items to stored and eventually sold. Other furniture (rugs, wall tapestries, decorative items) are placed to increase the appeal of the shop. High appeal increases the chances that an item is sold.

There are two ways that an item can possibly be sold. First, any non-merchants could have a new task they can do when they’d otherwise be idle: window-shopping. This both gives a small morale boost and can lead to purchases (and thus gold!) Second, as your settlement gains in value, peaceful travelers could pass through, stopping by your shops with a higher chance of making purchases than your regular citizens.

Technical Issues

Well, I can imagine the following would need making/editing for Merchants to become a reality:

  • Merchant class
  • Shop Zone (Repurpose stockpile? Redo entirely somehow?)
  • Shop Furniture (decorative and additional storage types, likely created at the carpenter/mason/clothier)
  • Better stockpile interface (seems like you’d need much better control so as to not sell all your food/equipment/etc accidentally. Both finer control and “Sell as long as we have more than X of this item/category.”)
    • Alternatively, simply add in finer overall stockpile control, then be able to set all stockpile priority levels? This would allow the player to stay above a certain amount of certain items with proper stockpile planning, as well as allow production chain stockpiles.
  • Travelers (‘Peaceful’ enemy spawns with custom behavior?)
  • Window-shopping (New citizen behavior with priority just above idle?)

well you definitely have me intrigued! as for whether its possible… i’ll just page our lovely modding support, @Drotten, to see if he can help answer that.


Well, after a bit of frustration with Qubicle (and the fact that the trial cannot export QB files whydoesnooneevermentionthis) and remaking the model in MagicaVoxel, I have my first model! Here’s a render of the single wooden displaycase! (My first model, so (probably overly) excited!)

Edit: Now with additional Merchant’s Token (job upgrade item, crafted at Carpenter for now.)


At first upon reading it it all seems to be possible to manage, except for one little thing: the new shop zone.

Actually making the zone wouldn’t be all too difficult (just taking the stockpile code and remake it, as you say), but adding it to the UI along with the other zones is an entirely different thing. All the buttons for the UI are stored in JavaScript, maybe it’s because I’m not all too familiar with JS but I couldn’t find a way to add my own button among them (without overriding the file containing them, which I don’t recommend). I’d imagine that there are easier ways of doing this later in development to add extra support for modding, but as it is now it’s hard.

As for the interface, I’d say go with adding your own for the new zone. The devs are looking to reduce the amount of buttons for the storage for performance issues (it’s tied to the idle hearthlings problem), so overriding the current system with your own is risky and should probably be in its own mod if at all.

The rest I’d say is not really a great deal of problem. The new travelers and their AI (along with the new AI for the hearthlings) can take some time to implement, but it’s doable. :+1:

1 Like

Hmm… thank you for your response!

Just to clarify, are you saying that its hard to add a new sprite to be used in the UI buttons, or that its hard to add a 5th button to the zones menu? If it’s the former, I’m fine with just using the stockpile image for the time being.

Edit: Also, you say the amount of buttons for the storage is related to the idle hearthlings problem?! Those two things seem so disconnected; I’m not sure I even understand how that can be the case. That just seems so bizarre.

A new sprite is easy enough, it’s adding the button that’s difficult. I don’t want to say it’s impossible though, as it was some alphas ago since I tried this (though it’s implemented the same way now as then) and I didn’t do that much research into this other than a few attempts.

It has to do with how much each hearthling has to think, when looking at which storage to place every item the hearthling is carrying; he/she would have to compare the items category to each storage’s filter to see where it can be placed. So the more storage there are each with different filters the more time a hearthling has to take to find the correct one. (at least that’s my take on it :stuck_out_tongue: )

Oh yikes.

Wait, do hearthlings compare every item in their inventory to all the storage filters before they start moving to store anything? If so, that’s crazy, and I can totally see why that’d create a huge performance issue.

Yup. Though it’s not the sole cause for the idle problem, but when lots of hearthlings are carrying 4+ items and trying to find a suitable storage, well, it all adds up to the cpu alongside with everything else all the hearthlings have to think about.

shakes head

I’m sure I’m not in the best position to throw stones, but if it were me I’d just have them strongly prefer gathering items that closely match the items already in their backpack, and have them simply work on storing one item at a time. That way, the next item will have a high likeliness of being stored in the same location. Slightly reduced worker efficiency, greatly reduced performance issue.

I would suggest to see how the ‘task manager’ system goes if they do implement it. I think that will be our saving grace when it comes to the villagers ‘thinking’ which also may aid in what you are looking into do as well

I haven’t seen anything on this ‘task manager’ system, but I am curious to know more. Link?

it showed a little bit of it in this blog post

they also have done some work on it in the last couple o’ streams.

1 Like