Locas Ants Sim Remake

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
pixelicidio
Prole
Posts: 5
Joined: Sat Mar 17, 2018 2:47 pm
Contact:

Locas Ants Sim Remake

Post 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 7830 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.
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Locas Ants Sim Remake

Post 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 7779 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.
User avatar
pixelicidio
Prole
Posts: 5
Joined: Sat Mar 17, 2018 2:47 pm
Contact:

Re: Locas Ants Sim Remake

Post 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! ;)
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Locas Ants Sim Remake

Post 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.
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Locas Ants Sim Remake

Post by Germanunkol »

Very cool project! I really hope someone turns this into a game :)
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
User avatar
pixelicidio
Prole
Posts: 5
Joined: Sat Mar 17, 2018 2:47 pm
Contact:

Re: Locas Ants Sim Remake

Post by pixelicidio »

Hi, update:

Implemented portals:
Image

Ants can teleport! :)

Post Reply

Who is online

Users browsing this forum: No registered users and 43 guests