guest    Login  Signup

search 

home news about media forums community download
Forums . Development Blogs . Technical Blog #3 - Failing Toward Equilibrium

Development Blogs

Design and Technical Posts from the Development Team

Currently: 8 Topics, 40 Posts

Technical Blog #3 - Failing Toward Equilibrium

jeff
Lead Developer
Jen: M
I've posted before before about Antilia's RPG gameplay being built on top of a world simulation, and as an author and world builder the prospect of seeing the world of Forra come to life in an interactive way (possibly even surprising at times) is very exciting. Simulations come with their own challenges of course, both in managing their complexity and also ensuring that they aren't designed in a way that is too volatile.

Designing the world simulation in a way that allows the player to have meaningful impacts on the world while at the same time ensuring the world tends toward stability is something that I've been putting some thought into the past few months. Stability in a system with complex relationships and inter-dependencies isn't something that can be assumed, in fact it is something that needs to be carefully engineered.

As a thought exercise, let's assume that all NPCs in the game will be individually simulated. Now, of course for optimization reasons NPCs that are closer to the player will no-doubt receive more CPU time (but that may be a topic for another post), but let's assume that all NPCs need to eat, sleep, clothe, arm, house, and protect themselves. The system will evaluate NPC skills and have them them select a "job" that earns them income, such that they can purchase items to keep their homes stocked with goods. Let's additionally assume there is an active economic simulation. What happens if the player disrupts the supply of food or another required resource to a major city - possibly not even intentionally?

In extreme situations where a player (or group of player) have deliberately set out to do something like that it could be rather fun. Or a group of players might team up and mine all the minerals out of a system of caverns, causing local NPCs that earned their income by mining the cavern to lose their source of income and seek new jobs - possibly leading to a small village becoming a ghost town. A player might intentionally try to corner a resource market, and the resulting chaos could be quite interesting (or dare I say it, educational even.)

Obviously how these scenarios play out depends on the robustness of the simulation as well as the availability of alternatives. In simple simulations "food" might just be a single resource. Without food, NPCs can't perform actions as quickly causing a sort of 'depression' where whole cities grind to a halt. Whole towns could become stuck in a catch-22 scenario such that every NPC is thinking "I am hungry. I need to farm in order to have food. Need food in order to farm." NPCs, having limited 'memory' can also risk getting stuck in cyclic conditions. Of course, "rescuing" villages and even cities out of these scenarios is an opportunity for the player as well - a sort of side quest that was never written by a programmer, but instead could arise organically in the world based on real topography and resource availability.

I think we would agree, however, that these sorts of scenarios should be extremes, and not something that arises often due to a 'butterfly effect' whereby the sinking of a single fishing boat or the mining of a single cave results in massive world changes.

To prevent this sort of thing from becoming the norm rather than the exception, I'm working at designing the world such that all resources have multiple supplies, and that individual resources have alternatives. For example iron may be rare in one region, but if supplies don't arrive bronze is still viable for building tools. This sort of design isn't new to Antilia, it was in fact something we had to account for in MMO design. If a player needed to feed their character, there were multiple ways of doing that - fishing, harvesting cactus fruit, and if worse comes to worse... there's always bait fish or iichii meat.

I'm interested in hearing the community's thoughts on such a dynamic world and how to keep it fun and allow big things to happen... without radical changes happening every time someone cuts down a few more trees than we as designers anticipated.
Monday, December 7, 2015 12:47pm
Jeff Leigh - Lead Developer - Right Brain Games
Fayola
Jen: 10
Since some materials are more rare/common in particular regions there should be price adjustment based on the region and material. You should also have a reputation system so if you have a good/bad reputation you can buy and sell items at a better/worse price. Also you mentioned previously that we can choose our character's background and parents so that should also affect reputation. One more thing, if we can build our own shops we should have customers buy and sell items based on the on the kind of shop. For example if your shop specializes weapons and armor a warrior is far more likely to buy from your shop than a farmer, your prices should also be able to affect your reputation. For example if you sell a low quality item at a high price people will avoid your shop because they want goods at an better price. Just a suggestion.
Monday, December 7, 2015 2:34pm
blueslyster

Jen: 101
So basically be the Sims in a way, but in a larger scale. :P
Monday, December 7, 2015 4:13pm
Sly da' Talikus aka LongSly
I will mallet all who question me! O.O
Spyred

Jen: 76
I don't really have any specific examples for Antilia, but it did get me thinking of another little game called S.T.A.L.K.E.R.: Shadow of Chernobyl.

Let me paint the picture first:
A post-apocalyptic world, poised as a for hire hunter of odd and unique objects only found deep in radioactive territory dubbed The Zone. With no memory of who you were before and only the hint of a clue of a man you were paid to kill, you set off into the Zone to find answers. The game itself is fairly dated by now, but every time I try to play it (I keep dying without saving. X_X) it always manages to surprise me with something a little different than last time.

It's a game that constantly makes me wonder if what just happened was the product of genius open world coding, a rare scripted event, bad coding that just happened to work out, or the game itself is possessed (Unlikely. XP)...

Here's an example:
Near the very beginning of the game there is a dead body out in the open just off the road you travel on. He had some stuff on him if I remember right. Usually this body is surrounded by mutant dogs.

First time: Only one dog. Go up to it and pull my pistol out. The dog runs away yelping. I shrug, grab the loot, and move on.
Second time: One dog again. Go up to it and pull out my gun again. The dog gets angry and charges. Killed it. Looted. Moved on.
Third time: Several dogs. Decided it wasn't worth risking this time and moved on.
Fourth time: No dogs. No body. "What?......" After noticing on my mini map that the body was moving under the road I was standing on I decided to investigate. Turns out the road is actually a bridge I never noticed before and one of the dogs was dragging the body away from it's usual spot. It wasn't a bug. These dogs were actually programmed to drag dead bodies but up until this point this was the first I've ever seen it happen.


Here's another example:
Another thing these mutant dogs were programmed to do was to randomly sniff the air. When I observed them doing this it was only briefly and usually with the rest of its pack. Never put much thought into it.

Walking up the road again, noticed a dog on the side of the road up ahead, alone. Suddenly the wind blew from the direction I was heading towards and the dog suddenly stop and started sniffing in that direction. Probably a minute went by and it didn't stop.
Assuming by now that this might be a bug, I walk up to the dog. Still sniffing upwind/up road. Some more time passes as I wonder what I should even do right now about this. Suddenly the dog starts yelping and runs off for no reason.
It was at this point I remembered that dogs have very good senses of smell. Was it possible that the devs put that much thought into the game; that the wind could carry a dangerous scent that dogs only could pick up on? Nah, couldn't be.
I pull out my binoculars and looked upwind anyway. Five high level human enemies were heading towards my direction. I freaked a bit and jumped into the nearest bush to avoid detection.
It's also notable that these particular enemies only hung around a base that was also up ahead. Never once until that day did I ever see them leave and start exploring around.


It's stuff like that and many more that just makes me wonder. It's that bit of wonder of never being sure if it's the game or not that I feel makes a good simulation. How does one go about coding or making that? I don't honestly have a single clue, but I hope it sparked some ideas. :P

((Sorry for the wall by the way. X_X))
Wednesday, December 16, 2015 1:27am
Myka
Jen: 13
Quote by Jeff Leigh:

Obviously how these scenarios play out depends on the robustness of the simulation as well as the availability of alternatives.... Of course, "rescuing" villages and even cities out of these scenarios is an opportunity for the player as well - a sort of side quest that was never written by a programmer, but instead could arise organically in the world based on real topography and resource availability.

This seems like it would be incredibly complex to design & implement, but the degree of pseudo-randomness this would add would be amazing; no two players/groups would have the same playthrough, and it guarantees there will always be something else to do.

Finished all scripted quests? There's always a village to save, a caravan to protect, or any number of disasters (social, economic, and possibly natural?) to mitigate and recover from.
Thursday, December 17, 2015 1:26pm
jeff
Lead Developer
Jen: M
Quote by Myka:
This seems like it would be incredibly complex to design & implement, but the degree of pseudo-randomness this would add would be amazing; no two players/groups would have the same playthrough, and it guarantees there will always be something else to do.

Finished all scripted quests? There's always a village to save, a caravan to protect, or any number of disasters (social, economic, and possibly natural?) to mitigate and recover from.

One does have to design the system from the beginning to behave this way, but I believe it can be managed with basic rules on how things are simulated. A simple example would be this: Imagine a checkerboard with a 'simulation' that runs on it such that on each step a random piece is selected and if there is an open square next to it, a new piece is created there (if there are no pieces, add one randomly to the board). This simulation would always tend toward filling the board, and even if a 'disaster' were to occur such that a block of pieces were removed, the board would eventually fill up again.

So when designing a system like this, it's important to design things such that they can withstand and recover from catastrophic disruptions rather than amplify them. If NPCs don't receive enough food, lowering their productivity while food is unavailable may be appropriate, but you wouldn't want them to actually perish from starvation.

I guess the short-hand of the blog post was that when simulating anything, the simulation should improve things at each step, and even if that results in some temporary ghost towns, the net effect on the entirety of the simulation is improvement. Then you can tune any destructive elements (natural disasters, bandits, etc) to be infrequent enough to allow the system to recover (or even consider the overall system health when introducing destructive elements).
Thursday, December 17, 2015 3:45pm
Jeff Leigh - Lead Developer - Right Brain Games
Myka
Jen: 13
Quote by Jeff Leigh:
... the simulation should improve things at each step, and even if that results in some temporary ghost towns, the net effect on the entirety of the simulation is improvement. Then you can tune any destructive elements (natural disasters, bandits, etc) to be infrequent enough to allow the system to recover (or even consider the overall system health when introducing destructive elements).

Hmm... tempting me to throw together a few models over break.
Friday, December 18, 2015 11:22am
Page: 1

You are not currently logged in. You must first log in to post a reply.
Frequently Asked Questions Development Team

Antilia - Copyright © 2017 right brain games