dgiriyftes
New Member
- Dec 24, 2021
- 5
- 3
- 80
Yeah, basically haha. For now it is atleast. I'll add some "trait personality" to make it less random.
I'll try to get the 0.1.0 as soon as possible!
I might have a suggestion for you. But of course do whatever you want. It also might very well not be compatible with your current setup or might be to big of a change, but I feel like it could serve as inspiration. I am also not sure how well it would work performance wise.Well, it's not that random.
The NPCs have 3 interactions possible between eachother.
Talking, insulting and Fighting.
When two NPCs do not know each other, they have a 50% of chance to engage a positive or negative interaction.
But then, the odds depends on their relationships/affinity. The more friendly an NPC is toward another, the higher chance he will start a positive interaction
I feel like the aspect of randomness can give replay value. I had a brief look at your game and all the NPCs governed by some discrete states e.g. where they are and what they are doing. A possible idea to make the characters distinct while retaining randomness might be the following.
Say a configuration of the system consists of the locations and lvls of all characters and what they are doing. On top of this each of your characters might have internal values describing their personality.
Than one might be able set up Markov chain Monte Carlo scheme to transition from one configuration to the next. I assume you have some "energy function" being the sum of how well each character is doing (the quality of your city could be included in this as well, as I saw in your devlog that you wanted the city to be variable as well). This energy function could also be higher or lower based on if characters "like" to be in this situation due their personality. So this would assign an energy value to each configuration. Then a transition rate from one configuration to the next could be described by the Boltzmann factor of your difference in energy between the states, as in the Metroplis-Hasting algorithm. (So a change from your current configuration to a randomly chosen different configuration would always be accepted if the energy decreases but if it increases it might still happen based on the Boltmann factor.)
So this transition would be accepted or rejected based on some random number which is higher or lower than its correspond transtion rate.
(More explantion at the Metroplis-Hasting algorithm wikipedia page)
Of course most states should be unreachable from any current one, so one could optimize here. And many decisions of NPCs are independent so these could be performed in parallel.
So this would minimize the energy function while admitting fluctuations due to randomness. I'd assume their would be a lot of metastability, so one could end up with "stationary" configurations which look quite different from one another based on the chosen seeds for the RNG.