Desktop Tuesday: Multiplayer


http://www.stonehearth.net/dt-multiplayer/

8 Likes

Great job TR

I think the best way to solve some problems is to do the old Minecraft dedicated server style and have the host limit his server to the amount of players he thinks his computer can handle. Another idea that would be cool to add is an option in stockpiles and boxes to directly allow other players direct access to them without the need to loot them.

Also another possibility you guys could explore is that the fog of war could hide other players from each other. You guys could make this a server config option eventually if you guys wanted to.

Lastly I know this would be a lot of work to do but what if you guys had each of the clients process the a.i. for their own hearthlings and just have the clients send to the server the position data and hearthling actions so as the abstract the a.i. out onto people’s own computers

4 Likes

How about adding a Test your System option, with a question to send none personal data to you.
This would help to players to use the right number of hearthlings for their personal game and mp games.
And if someone wants to send you the none personal data, you will get to know us better :wink:

2 Likes

All the pranking made us wonder about whether the game should have a “declare war” button. What do you think?

I think maybe something similar to Civilization, where you are sovereign townships and people can’t enter your buildings without first having formed an alliance. In Civ, they call it “Open Borders”. Further, you could make it so that other players can’t open crates or interact with inventory at all. Instead, offer “Trade agreements” where players can request quantities of items from another player.

One cool way to handle goods transfers might be provide an authorization layer on top of crates. Basically like IAM roles in AWS or the Share button in Google Docs – Share this crate. Cool, with which players? megashub and sdee. Done. Now megashub or sdee can send Hearthlings over to pull items from that container at will. Of course, you’d have to also provide a way to tell Hearthlings to transfer goods into the shared crate.

Talking about declaring war specifically, if the above were true (alliances and shared storage), then if another player either tried to enter another player’s buildings uninvited, or tried to look inside another player’s storage containers without having been granted access, the player could be warned “You don’t have a treaty with this player. Going through with this action is an act of war! Do you want to declare war on megashub?”

And if they say yes, then green turns to red and the battle begins. :slight_smile:

Anyway, just some thoughts on the subject. Hope they’re useful.

Note: ‘buildings’ in this context = ‘anything with a door or gate’ – so if you direct your Hearthlings to ignore ownership and break down someone’s gate, you’d declare war on them. Could broaden that further and say ‘any block, item, critter or hearthling not owned by the player’. So if you tried to steal someone’s sheep, war. Loot someone’s items, war. Blow a hole in their outer walls… war. Tricky bit will be, …build a ladder to scale over someone’s wall… war? Hmm.

You’re already calcing player controlled areas to determine where monster can spawn, so you may be able to reuse that code to determine a player’s current “border”. Then it would become much simpler – path your hearthlings into another player’s area without an Open Borders treaty, get prompted to declare war. Of course, pathing code would need to consider another player’s area as being an obstruction, so that natural pathing doesn’t constantly try to move people through someone else’s town. But that doesn’t seem insurmountable.

6 Likes

Some thoughts:

“1. Adding multiplayer to a community builder is a great way to hang out with your friends. For a while, we weren’t sure how this sort of interaction would fit into the game, because nobody has ever really done it before, but the answer is that building and trading together feels awesome”

YES!!! I could see this from the very beginning and I am so excited you were able to feel the same excitement! This is why I was very put out with the idea of delaying multiplayer until it wasn’t even a blip on the radar. The potential for drawing in new players is HUGE!

“2. All the pranking made us wonder about whether the game should have a “declare war” button. What do you think?”

That’s certainly reasonable. You could also force players to build a certain distance apart, although I can see that being used for malicious purposes as well, and squabbling over where people are allowed to build. I think it should be allowed to set people as hostile, and then each client simply sees the other as “monsters” and fights them. Well, it won’t be as simple as that, of course… you’ll have to figure out how to work in building destruction and the like, but I think it’s very possible.

“3. Should the game set limits on the number of people? Should multiplayer involve fewer hearthlings per town?”

Another very reasonable thing. You can set a population cap. In most games, this is already set, and the more players you have, the fewer hearthlings that can exist at one time. Of course, this could open the door to hostile PVP actions from players who go to war in order to have more hearthlings, but I think most people will be happy to cooperate. As long as they can set their population cap, I think people will be happy with it, and I think you could even make that an option rather than mandatory… with a little warning that says “If you don’t set a population cap, the game could become unstable with too many hearthlings” or something of that nature.

“4. And what should happen when one player saves and exits the game but everyone else wants to keep playing?”

Good question. Some games get around this by forcing all players to quit when one of them exits. I think that if a player quits, his town should just exist as it does, with hearthlings doing what they were doing before. If they begin to die, or if they’re attacked, other players will still get warnings that their ally is in trouble, but they’ll be under no obligation to help. If players quit a game in progress, they should be responsible for what happens if other players decide to continue. Ultimately you can’t manage them too much. You’ll need to have players deal with the fallout of other players going behind their back and playing while they’re not there. Also, it would be helpful if a host could be designated who had the ability to save and quit for everyone.

4 Likes

Another way to possibly handle goods transfers is through a Trade Agreement… I give you 4 sheep, 20 iron, 54 wood, 15 crates of berries and 4 iron pikes for, 3 leather, 10 gold, and 20 meat pies. or Whatever.

Once the deal is done, those items become invisible to the player that once owned them, and visible to the player who accepted them. Doing this would also grant non-military Hearthlings temporary Open Border access to the other player’s territory in order to retrieve the items from the other player’s storage containers. Once all items have been removed, the Open Borders access auto-expires unless an Open Borders treaty exists, of course.

Then you wouldn’t have to modify the way crates and storage work today. Less micro.

5 Likes

Yeah I had this same thought. Scale down the number of starting Hearthlings by the number of human players, maybe.

1 Player – 7 Hearthings
2 Players – 6 Hearthlings each
3 Players – 5 Hearthlings each
4+ Players – 4 Hearthlings each

Cap the map at 60 total Hearthlings. So if there’s 5 players with 4 each at the beginning, the map would start with 20 total Hearthlings and each town could scale naturally until 60 is hit. Then you have to trade Hearthlings with other players that need them more.

That opens up interesting game play too… “Hey, I have this huge build project and plenty of spare food. You’ve got lots of guys but are behind on your food operation. How about you lend me 5 Hearthlings for 10 game days. That would reduce your food burden and I’d get my project done faster.”

5 Likes

Maybe a reasonable PvP option that still kinda fits the atmosphere would be to have a food fight sorta thing. Like the food fight equivalent to paintball. Once the hearthlings health bar is covered with food they’re “knocked out” of the competition. Different foods could have effects like a knockdown (watermelon/pumpkin) or a DoT (golden gourd curry lol), advanced food effects granted from higher level cooked foods or foods specially treated by different crafters (engineers). The winning group would get a morale boost and the others a penalty. Nobody would have to worry about their hearthlings getting killed, it’d all be in good fun, and the penalty wouldn’t be as severe as say losing a war with kobolds (unless players got too reckless with their food supplies). This would keep players on friendlier terms early game as food is such a vital resource to sustain and grow your population. Especially aggressive players will find themselves struggling to maintain their towns and lagging behind in growth, giving the other players a chance to get ahead. Encouraging players to keep up with combat, farming, and crafting instead of just trying to take everyone out with just combat. Late game perhaps the food covering the hearthlings health bars keeps the owner from seeing their health for a period of time (making combat a gamble), maybe the food attracts bugs requiring the herbalist’s help to prevent sickness/disease, or pests in the area with the most affected food soaked hearthlings needing a Trappers attention or they’ll occasionally startle your hearthlings.

While I definitely think hearthlings killing other hearthlings goes against their very nature, a friendly food fight can’t hurt right?

3 Likes

It could certainly be a fun alternative to war, but cute + brutal still has it’s charm. :wink: Also, if they’re ok with killing cute goblins I don’t think killing each other is a problem.

About war: should you be able to capture other players hearthlings? And then what? Ransom? Convert? Work for their freedom? Work/sell as slaves? … Probably not the slavery part… unless you can play as an evil overlord… It could be interesting to have one player play as the over powered evil that the others have to unite against. :smiling_imp:

About who gets to do what and where: the multiplayer map could be generated and divided into specialized areas from the start. One for each player. They could be specialized in a certain resource or having better builders, crafters or soldiers, or some other benefit. It would encourage players to trade and cooperate.
Land could also be used as a resource to trade with.

Well yeah, but the goblins are trying to kill them. When you’re cooperating, by giving the goblins tributes, the hearthlings are just fine with the goblin chief patrollin’ around the town. Hearthlings don’t go out of their way to attack mobs that aren’t hostile, they only defend themselves. So I’m still certain it’s against their nature, though it may not be against a players nature lol. I still wish there were a more peaceful way to resolve the whole goblin issue (aside from the end)…they are pretty darn cute.

Cute + brutal does have it’s charm, but that doesn’t mean everything cute has to be brutal. We’re not gettin’ Happy Tree Hearthlings without some heavy modding lol.

1 Like

+1 To what @megashub says about alliances, etc.

What I really want to beg for, though, is not to limit the number of hearthlings. It is a reasonable solution to a degree, but I think it indicates a larger performance-related issue. There must be some way of offloading some of the processing requirements of hearthlings, both in single-player and muliplayer.

Sadly, I wish I had some idea as to what places a solution could come from, nor do I have any idea how to isolate and benchmark the exact processing requirements of an individual hearthling :slightly_frowning_face:

That is really to say: I hope limitting hearthlings will be a last-ditch, temporary solution

Great work! I am amazed that you made MP roughly work in such a short time. I have to admit i was on the skeptic field on this one although I love Stonehearth. If I may, I wanted to point you to other indie developers that have discussed at length the problems of multiplayer and determinism (I myself know little about it).

Here is an example: Friday Facts #149 - Deep down in multiplayer | Factorio

They did that quite often and sometimes in a really detailed way, I think you can use their experience at least as a source of inspiration. The games are similar in some aspects and really distinct in others (and both really lovable because of that).

In any case, good luck! I’ll be following your work!

P.S.: I hope it is okay to post that link here.

3 Likes

Great news for those macOS/Linux players who want to play this game with others. Of course there are a few technical barriers to overcome, no version of StoneHearth for Linux/macOS being the chief one I suppose.

I just want to highlight this part of DT

Before we finish I want to stop and acknowledge the incredible work that Tony and Angelo did to get us to this point. As an engineer, I was often frustrated with the fact that Tony’s original design for Stonehearth enforced a strict client-server model, because it meant that when I was working on client-side stuff like ghost entities for placement or the music changing for night and day, that I had to jump through lots of hoops to get server-side data to myself. In the end, however, I always followed his model because he built it in such a way that subverting it to hack in whatever I needed was more work than going along with the correct solution. This meant that years later, when it was time to turn multiplayer on, Angelo had only to work hard for a day and a half to get the initial connection to happen. In the land of computer science stories, this was nothing short of miraculous–there was a chance, we thought, that it could take months or more.

This right here is why I backed the project. I knew that TR’s ace in the hole was its strength in implementing multiplayer. Client-Server was always there. A DAY and a HALF!

I realize the challenges ahead, but for now, I’m glad you guys got a bit of shared Stonehearth experience in… and immediately started to mess with each other.

3 Likes

You could make war penalties when playing multiplayer, so there doens’t come trolls or just an annoying friend.
Just like in civ and also i think it would be good that it’s not possible to see the other cities at all, so there could come a more surprising aspect in the game, and so you can’t see your friends progress if they want to declare war.

This conundrum about war in multiplayer touches IMO on a major unanswered question in the world of Hearth. The devs, (and a lot of players afaik) see the world of Hearth as a more peaceful word than our own. However, one can do most things in the world of Hearth that one could do in our onw world.
So the question, then is:

What, then, is the force responsible for keeping the world of Hearth so peaceful as it is ?

If you can answer this question, then maybe that could also answer what to do with aggressive players.

(Now before I give a potential answer, I want to say that @Logo s idea of food fights sounds cool, we should talk about that one, even although I’m not responding to that idea in this post)

One answer to that question is karma, as in “Rayya’s fortunes go to those who act peacefully.”.In essence the game master becomes harsher on those who go to unilateral war.

So imagine one player performs an act of war, just like in @megashub s post, the game gives a warning that going through with it will constitute an act of war, and “Rayya’s/Cid’s fortunes go to those who are peaceful.”/“Warlike tribes will feel Cid’s karma” (depending on the tone you wanna set). If the player decides to push though the warning, the fight will become harsher for him, and maybe more aspects of the game as well. Whether you want to translate this into punishments for the aggressor (luck not on your side, slower progression, lower efficiency), or buffs for the defendants (Cid responing more favorably to healing prayers by cleric, etc.) , doesn’t really matter for the essence of it, so you have options.
It might be a good idea to scale the karma effects to the difference in advantage that the offensive player has over the defening player, so city builders don’t get defeated easily by those that go for quickest progress, despite the effects of karma.

However, this doesn’t take into account that both players might want to go to war, in those cases, you can ask that the players agree on a duel, which is basically a war which is agreed on by both parties. A duel can be a food fight, a single stand-off at a preplanned moment and location, or a full game-long war, depening on what the players decide, what the context of the session is, or what the story is in a particular game. Karma will not intervene in duels on behalf of any player, scince both parties agreed to it. Every player can stop the dual at any time, making the other party the agressor if they don’t stop fighting.

2 Likes

Hello everyone,

The last two DTs were very interesting and I think it is time we discuss this topic more seriously. There have been many posts about mutliplayer ideas, but now that the team is really working on it, we should gather ideas and thoughts so that the team has a rough idea what the community has in mind when they think about multiplayer.

Now on topic: The questions that arise are quite difficult to solve. When someone is hosting, this person will have serious performance issues, that get bigger and bigger the longer the savegame is played. More hearthlings and more structures and more enemies will bring down even the best systems out there and making it unplayable especially for the hosting person. So the question is, should team radiant limit the number of players?

I personally think: Yes! For me personally it would be enough to have a 2 or 3 player mode. Going higher then that can mean that there is not enough ressources for everyone and very soon the map would look like a switzer cheese. So 9 players is not needed in my opinion, 3 is enough.

But would this solution be good enough? There will still be plenty of people whos system is to weak. Therefore everyone should have the option to rent a dedicated server to run the game on. This way, the server had to host all the stuff, while the players can enjoy a good performance, since the dedicated servers will be standardized and will be strong enough to handle even 3 players with big cities.

Ofc. there are many things more to discuss, but the first questions we should answer (I think) is, how many players should be allowed and what kind of options the players have to host a game. :slight_smile:

3 Likes

I love the game and where it’s going! So i’m gonna spit-ball some of the ideas that have popped into my mind for multiplayer.

With reference to the question: What if there was a way to evaluate how many hearthlings a host can support and then setting a player limit per host? I think 3-4 players would be plenty. :slight_smile:

Would it be possible to run path finding logic on individual systems and then sync that information with a server, rather than have all logic performed on the server? So the server holds map information and everything else is individual to the player’s kingdom. :slight_smile:

Another thought… What if game play was more geared towards a mmo kinda thing? Where you have your empire (map), which consists of 1-4 co-op players. And your map exists in an expanse of other individual empires which can interact in battle maps or through trade.

Just some thoughts…

A good idea. To add on to that a bit, dedicated server support feels like a natural fit for Stonehearth’s architecture, since a single machine already has to track everything for all the players. More than that, the app is already split into client and server pieces, so if the team can evolve that to allow for a many-to-one relationship (many frontend clients to one server), then you could conceivably host a server-only dedicated server that isn’t also trying to reserve resources for the user GUI.

3 Likes

in terms of the multiplayer mode i think that a server option could work, it would take a lot of organisation however as the general gist of the idea, the first player would spawn at a location they choose on starting the server, then when another player joins the map they get to select location is a certain distance from any other players.

in theory a hundred players could all join one server if it could process it however most servers would only have a couple of players.

the goblins… would have to be reworked for this to function, they would most likely have to spawn a minimum distance from all players bases, they would be strengthened when they spawn, so with more soldiers or defences if more players are nearby and then the players could work together to fight them off.

im not sure how to get the goblins and red kiln to fit into a multiplayer server however just being able to set up trade routes or something between players on a map would be cool.

having battles between players would be call imo but i think the focus should be on working together to create a kingdom where each player has a city or town within it .

thats just my ideas and im sure you can come up with better ones

1 Like