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.
Nerv:a library for controlled randomness
-
- Prole
- Posts: 13
- Joined: Sun Mar 09, 2014 1:44 am
Nerv:a library for controlled randomness
- Attachments
-
- demos.love
- (6.7 KiB) Downloaded 168 times
Re: Nerv:a library for controlled randomness
Cool stuff. Simple idea that creates very interesting things.
Btw, I managed to get it to loop on itself =P
Btw, I managed to get it to loop on itself =P
Follow the potato. Achieve enlightenment.
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: Nerv:a library for controlled randomness
Hi, nice library.
I'd like to point out that this library is not tight to love2d (you might want to update the description on github). It can be use on any Lua based environment, as long as it is feeded with a delta time value, for updates.
Second, I noticed some functions need to check arguments before using them. In that respect, i would recommend to perform all the assertions first and then, use the arguments. As-is, using this lib with REPLers, in case one pcall's a method with some incorrect arguments, there are likely one or two assignements that will be made internally, leading to some unexpected behaviors...
I'd like to point out that this library is not tight to love2d (you might want to update the description on github). It can be use on any Lua based environment, as long as it is feeded with a delta time value, for updates.
Second, I noticed some functions need to check arguments before using them. In that respect, i would recommend to perform all the assertions first and then, use the arguments. As-is, using this lib with REPLers, in case one pcall's a method with some incorrect arguments, there are likely one or two assignements that will be made internally, leading to some unexpected behaviors...
-
- Party member
- Posts: 712
- Joined: Fri Jun 22, 2012 4:54 pm
- Contact:
Re: Nerv:a library for controlled randomness
This is really awesome. I just learned about the whole nerve impulse transmission again at university, it's a great topic and you're using it for awesome effects. I especially ike demo 2...
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
-
- Prole
- Posts: 13
- Joined: Sun Mar 09, 2014 1:44 am
Re: Nerv:a library for controlled randomness
Thanks for the awesome comments
Good suggestions. Maybe I will implement them in the next version.Roland_Yonaba wrote:I'd like to point out that this library is not tight to love2d
...
Re: Nerv:a library for controlled randomness
God's in his heaven, all's right with the world.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
-
- Prole
- Posts: 49
- Joined: Thu May 29, 2014 10:56 am
Re: Nerv:a library for controlled randomness
Great stuff!
I am a big fan of biology informing computer science (genetic algorithms, neural networks, etc.).
Your demo looks very nice!
I am a big fan of biology informing computer science (genetic algorithms, neural networks, etc.).
Your demo looks very nice!
--
My OOP implementation:
https://github.com/stefanstr/class-by-gestaltist.git
My dungeon / tiled map generator:
https://github.com/stefanstr/lua_maps_by_gestaltist
My Love2D experiments:
https://github.com/stefanstr/Small-Love2D-Projects
My OOP implementation:
https://github.com/stefanstr/class-by-gestaltist.git
My dungeon / tiled map generator:
https://github.com/stefanstr/lua_maps_by_gestaltist
My Love2D experiments:
https://github.com/stefanstr/Small-Love2D-Projects
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest