Page 1 of 1

Locas Ants Sim Remake

Posted: Wed Mar 21, 2018 4:05 pm
by pixelicidio
Hi, I'm new here and my name is Denys :) ,

The original "Locas Ants" was an Ant path algorithm simulation I made many years ago. Watch here: https://www.youtube.com/watch?v=G5wb4f5n6qQ&t=53s

Many people liked and wanted to understand and play with my awkward code made with Delphi 7. Recently I started a remake and selected Lua + Love2D as the best candidates trying to give a more accessible, cleaner and simpler code while adding some new cool features.
nicePath.gif
nicePath.gif (1.08 MiB) Viewed 1428 times
The project is in progress and anyone can access my new-less-awkward code on GitHub: https://github.com/piXelicidio/locas-ants

The idea is to have an integral base to share with anyone who wants to study the real-time simulation of ants optimization algorithm (with some personal approaches toward more fun), or create their own simulation|game.

Watch the last screencap showing the implementation of "grass":


Quick notes about Love2D:
- The performance was something of my concern for this project and Love2D did better than many other similar API/Engines that work with Lua.
- Loved the easy to setup and iterate along with ZeroBrane Studio
- The API is simple and that gives you the whole power.
- Thank you for the well-maintained documentation.
- Love the love2d.org website design.

Hope you enjoy the little ants. :awesome:

Run the .love: https://github.com/piXelicidio/locas-an ... 0.2.1.love
Github source: https://github.com/piXelicidio/locas-ants

Some useful keyboard shortcuts:
'2'- Toggle: Ants will check and obey ;) pheromones every frame. Result in less natural but prettier path.
'4'- Switch on/off the algorithm. Ants will stop.
'5'- Toggle: Show pheromones traces.
'6'- Toggle: Disable object avoidance.
'0'- Toggle: Do not draw ants.
'm' - Prints used RAM on console.

PD: If the framerate run too slow reduce the # of ants in code\simconfig.lua > simconfig = { numAnts = 4500 ... } Also I'll be very grateful and happy to hear how many Ants you can handle at 30fps and your PC specs.

Re: Locas Ants Sim Remake

Posted: Wed Mar 21, 2018 11:53 pm
by pgimeno
Can't. Stop. Staring.

:D

Straight from GH without modifications, revision 1622d10 (latest as of this writing), I get 30 FPS on my computer. i7-4790 @ 3.6GHz

Edit: Forgot to specify the GPU. nVidia GeForce 8600GT with proprietary drivers. The OS is Debian 9.4.

Edit 2: It was a challenge to make them follow two paths with different lengths, but I finally managed to get it:
Ants-split-path.png
Ants-split-path.png (460.76 KiB) Viewed 1377 times
It seems to be metastable at best, but this one seemed to last for quite a long time.

I'm very impressed with the simulation. Great work.

Re: Locas Ants Sim Remake

Posted: Thu Mar 22, 2018 2:42 am
by pixelicidio
Hey! @pgimeno, that's and interesting "kite" formation...

Thanks for sharing your PC specs! very appreciated. It's running well, that revision is set to 4,500 ants. I'll be going to show the # of ants on the screen.
It seems to be metastable at best, but this one seemed to last for quite a long time.
Don't understand, sorry. I never use metatables, don't know how :awesome: , I use closures.
I'm very impressed with the simulation. Great work.
Thanks again! ;)

Re: Locas Ants Sim Remake

Posted: Thu Mar 22, 2018 12:02 pm
by pgimeno
pixelicidio wrote:
Thu Mar 22, 2018 2:42 am
It seems to be metastable at best, but this one seemed to last for quite a long time.
Don't understand, sorry. I never use metatables, don't know how :awesome: , I use closures.
Sorry for the confusion. I meant "metastable" as in "only stable when not affected by anything but small fluctuations". But no, it's not even that. I've seen it end up on the left path, and on the right path, meaning the lengths are probably well adjusted but it's just not stable enough. Kinda like a pin you try to stabilize in the upright position: it will always tip over one way or another, but it will take longer if you get a good equilibrium.

Re: Locas Ants Sim Remake

Posted: Fri Mar 23, 2018 9:20 pm
by Germanunkol
Very cool project! I really hope someone turns this into a game :)

Re: Locas Ants Sim Remake

Posted: Mon Apr 02, 2018 3:24 am
by pixelicidio
Hi, update:

Implemented portals:
Image

Ants can teleport! :)