Nerv:a library for controlled randomness
Posted: Sat May 31, 2014 11:34 am
Hi all,
The other day when I wanted a whale to jump out of the sea randomly and naturally, I ripped the concept of nerve impulse transmission off my biology lecture notes, and the outcome was surprisingly nice.
I decided to make the concept into a library (using love.math.noise for randomness), and nervwas born.
nerv might be useful for The following scenarios:
1. make birds fly/frogs jump/fog lift randomly when player approaches
2. make enemies attack player randomly when player approaches and drastically reduce the chance of enemies attempting to attack when obstructed by obstacle
3. make customers leave the store with increasing chances as the waiting time increases
4. make interesting interactive patterns
The basic idea is that on each frame, stimuli are summed up, and if they are strong enough, a function that you supplied will be called. For a short period of time afterwards, the nerv instance will not respond to any stimuli.
Refer to Github for more explanations and documentation.
https://github.com/pelican2014/nerv.lua.git
Demos give you an idea of nerv.
The other day when I wanted a whale to jump out of the sea randomly and naturally, I ripped the concept of nerve impulse transmission off my biology lecture notes, and the outcome was surprisingly nice.
I decided to make the concept into a library (using love.math.noise for randomness), and nervwas born.
nerv might be useful for The following scenarios:
1. make birds fly/frogs jump/fog lift randomly when player approaches
2. make enemies attack player randomly when player approaches and drastically reduce the chance of enemies attempting to attack when obstructed by obstacle
3. make customers leave the store with increasing chances as the waiting time increases
4. make interesting interactive patterns
The basic idea is that on each frame, stimuli are summed up, and if they are strong enough, a function that you supplied will be called. For a short period of time afterwards, the nerv instance will not respond to any stimuli.
Refer to Github for more explanations and documentation.
https://github.com/pelican2014/nerv.lua.git
Demos give you an idea of nerv.