Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+4)

Wanna buy some math?

This is a topic for math lovers, if you don't like, sorry,  please just read the next paragraph as it's the only part that may be interesting to anyone.

The game will have lots of procedurally generated NPCs. The process is quite simple: from a list of "generation references" do a interpolation between 2 extremes. For instance, one reference is "BodyGen|Gen.Cheek" as you guessed this describes the model's cheeks, 0 in there means very thin cheeks while 1 very thick, and 0.5 would be "avarage".

There's a total of 26 references that can vary between two extremes, so first interesting fact is that there are virtually infinite possible combinations, meaning each generated model is almost completely unique, since between two real numbers there are an infinite amount of numbers.

So the problem is that real life is not 100% random, we usually don't have a population of completely random visual traces, there's a distribution and a "standard" statistical range of each body part dimension. There is a statistical model that describes probability of something in a population, it's called Normal Distribution.

Here is an exmple of a estimation of pizza delivery time in a custom population of a specific city:


Taken from this nice article: https://statisticsbyjim.com/basics/normal-distribution/

Here is the formula for that graph:


My mean is 0 and my standard deviation is 0.2.

So, what I needed is to remap that my system, so 0 and 1 are the extremes of my graph, so they get low probability while the middle is high probability. In other words I had to solve the equation for f(f(x) / 2.0), which gave me the following result:


and that's the equation used in the game.

Show post...

Hmm, pizza 🍕 

(+1)

XD

Dang, that's actually so cool! This post has me hooked on the project, keep it up!

(+1)

Thanks man! I wasn't sure if I'd post more math related updates, but your support made my mind!