Monday, 25 January 2010

Gmod Brain #2

Here's the basic construct I'm looking at for a given neuron.

When the control center sends out a "decision" signal, the neuron checks the incoming relevant variables from global variables, the precise number of which it gets from gGetNum(1) then counts upwards from there. For example, if the 1st gVar tells the neuron that there are 8 variables to acquire, it gets gVars 2-9 and stores them in together in a string separated by "-". gVar(2) is always the action to be undertaken in a string dialect (Such as "turnLeft", "turnRight", "Reverse", etc.)

The neuron then checks it's existing storehouse table of variable strings, to see if it's encountered the same circumstances before. It adds the modifier from that string reference to it's eventual result.

What occurs next is basically a random reaction. The neuron generates a random number from 0 to 1, adds the modifier, and rounds to 0 or 1 exactly. If it gets a 1, it sends out a "good" signal, and if it gets a 0, it sends out a "bad" signal.

The control center, which sets the number in gVar 1 and collects all the relevant good/bad signals, then tallies which state wins out and informs the operating body.

Meanwhile, the neuron waits until either it receives another "decision" signal or it receives a "pos" or "neg" signal. If it gets a "neg", it subtracts -0.1 (for example) from the stored modifier for the variable string in the storehouse, and adds 0.1 if it instead gets a "pos". Therefore, the neuron becomes less likely (but not unable) to choose the same bad idea twice and more likely to choose the same good idea twice.

Of course, this isn't by any means a perfect simulation of organic thinking, because in the words of Carl Sagan "The brain does more than just recollect, it intercompares, it synthesises, it analyses, it generates abstractions."
That of course is the next stage, once the neurons and control center can be properly composed for separate action types like motion and pathfinding etc.

No comments:

Post a Comment