Java-Gaming.org
Java4K winners:
[
by our judges
|
by the community
]
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members
News
: Read the
Java Gaming Resources
, or peek at
the official Java tutorials
Home
Help
Search
Login
Register
Java-Gaming.org
>
Games Center
>
Showcase
>
Ant Colony Simulator (not really a game)
Pages: [
1
]
Print
Ant Colony Simulator (not really a game)
(Read 2095 times)
0 Members and 1 Guest are viewing this topic.
KevinWorkman
Jr. Member
Posts: 62
Medals: 3
klaatu barada nikto
Ant Colony Simulator (not really a game)
«
on:
2011-12-14 08:13:14
»
Here's the link, check it out if you feel like it:
http://code.kevinworkman.com/Ants/
As a final project in my AI class, I developed a program that hopefully introduces non-programmers to the artificial intelligence principle of emergence in
ant colony optimization
.
Basically, the program models how real-life ants cooperate to find food. Even though each individual ant is pretty dumb, the colony as a whole shows intelligent behavior. Through pheromones and some very simple rules, ants work together to respond to dynamic environments (which you can change on the fly).
The program's source is available, and it might serve as a base for another programmer to implement something more game-like. This could be the beginnings of a tower defense game, or just a better version of the open environment I've started here.
I'm submitting this later today, so any feedback on stuff that isn't obvious is appreciated. Also, if anybody using a mac could do a quick "this works", I'd appreciate it. My professor uses a mac, but I don't have one to test on.
I've also posted this
here
and
here
.
Nate
JGO Neuromancer
Posts: 1062
Medals: 30
mooooo
Re: Ant Colony Simulator (not really a game)
«
Reply #1 on:
2011-12-14 14:35:29
»
Can we see an applet?
Nevermind, found it on the right.
projects
KevinWorkman
Jr. Member
Posts: 62
Medals: 3
klaatu barada nikto
Re: Ant Colony Simulator (not really a game)
«
Reply #2 on:
2011-12-14 14:38:59
»
Quote from: Nate on
2011-12-14 14:35:29
Can we see an applet?
Nevermind, found it on the right.
I've been trying to figure out a clean, obvious way to indicate that a user on my site should click one of those options to run the programs. Really obvious things are usually ugly, and really nice-looking things are hard to notice. Putting them on the right is the best I could come up with, but I'm very open to suggestions!
Games published by our own members! Go get 'em!
theagentd
JGO Wizard
Posts: 1391
Medals: 88
Re: Ant Colony Simulator (not really a game)
«
Reply #3 on:
2011-12-14 15:02:18
»
My first thought was "Meh." but after watching it for a few minutes, I realized how awesome it is. I've always been fascinated by games that play themselves. Why not evolve it a little to make the food resources limited, allow ants to reproduce into more of themselves and add random map generation? You could even make different ant factions that can fight against each others and make the ants leave pheromone trails of danger, e.t.c. You also need better graphics. >_> It's very hard to see the flow of the "game" when the ants teleport between tiles. A smooth movement from tile A to tile B would make a huge difference!
There is no god.
sproingie
JGO Strike Force
Posts: 893
Medals: 55
Re: Ant Colony Simulator (not really a game)
«
Reply #4 on:
2011-12-14 15:07:04
»
Wasn't too hard to find. I really like the "require all" trick for finding a hamilton circuit.
While they do converge on a path eventually, I do find that that individual ants still tend to move a little more erratically than other ant simulators I've seen. Before weighting for trails, do you have them moving in a completely random direction each turn, or do you have them favor moving forward?
KevinWorkman
Jr. Member
Posts: 62
Medals: 3
klaatu barada nikto
Re: Ant Colony Simulator (not really a game)
«
Reply #5 on:
2011-12-14 19:48:08
»
Quote from: theagentd on
2011-12-14 15:02:18
My first thought was "Meh." but after watching it for a few minutes, I realized how awesome it is. I've always been fascinated by games that play themselves. Why not evolve it a little to make the food resources limited, allow ants to reproduce into more of themselves and add random map generation? You could even make different ant factions that can fight against each others and make the ants leave pheromone trails of danger, e.t.c. You also need better graphics. >_> It's very hard to see the flow of the "game" when the ants teleport between tiles. A smooth movement from tile A to tile B would make a huge difference!
Thanks! The original purpose of this was not to be a game, but to serve as a final project for school, so I shied away from / didn't have time for game-type stuff. Same excuse for graphics and smoother animations.
However, one of my goals was to build up a code base that I or somebody else could build on to implement something like a game, or to go the opposite direction and implement a more scientific version of this. I went for the middle ground so that it was usable for as many people as possible. I actually seriously consider the fact that you stayed interested for a couple minutes and then thought "now what if this was added..." a great success.
KevinWorkman
Jr. Member
Posts: 62
Medals: 3
klaatu barada nikto
Re: Ant Colony Simulator (not really a game)
«
Reply #6 on:
2011-12-14 19:52:36
»
Quote from: sproingie on
2011-12-14 15:07:04
Wasn't too hard to find. I really like the "require all" trick for finding a hamilton circuit.
While they do converge on a path eventually, I do find that that individual ants still tend to move a little more erratically than other ant simulators I've seen. Before weighting for trails, do you have them moving in a completely random direction each turn, or do you have them favor moving forward?
The "require all" option was initially a stab at modelling the traveling salesperson problem. It's not strict in that it doesn't enforce the rule that ants can't travel through the same food twice, but I think they come up with some interesting solutions. They also come up with some ridiculous solutions, but that's part of the fun, right?
And yeah, good observation on the ants' movement. They move completely randomly until they find a pheromone, at which point they either weigh them or choose the best option (depending on the trail strength). I considered having them prefer forward movement (or even making their direction preference be an adjustable parameter), but I decided against it.
ra4king
JGO Kernel
Posts: 3149
Medals: 196
I'm the King!
Re: Ant Colony Simulator (not really a game)
«
Reply #7 on:
2011-12-14 23:11:29
»
Wow I almost did not see the time fly by! I kept playing around with it and making many different paths
Great job!
-Roi
Doodle Jump online!
Follow me on Twitter!
theagentd
JGO Wizard
Posts: 1391
Medals: 88
Re: Ant Colony Simulator (not really a game)
«
Reply #8 on:
2011-12-15 04:27:24
»
One of the ultimate games I want to create is an MMORPG game where all content is generated and controlled by an AI similar to this. Think about it; a game where towns and cities are naturally formed around places with lots of people and travelers; a game where towns need resources to survive and can actually disappear if they are destroyed or they become too unpopular, e.t.c. Players take the role of a single person in this world, and can do whatever they want to try to become successful, or ruin other peoples work. I tried to experiment with a very simple AI for a small community which built houses for people to live in, gathered wood for house construction and gathered food for keeping the population alive. I had a very hard time getting it balanced. It always massed a single resource too much or built too many houses, and then I realized it was because they were communists! I realized the problem was that a central AI controlled how many people to assign to resource gathering and how many houses to build, and it's very hard for "the state" to determine optimal numbers for this! A swarm approach (AKA ant colonies) is MUCH more effective at adapting to changes and other stuff than a supermind overviewing everything, because it is simply put to difficult to determine an optimal strategy. Let the drones do the work and it should be able to adapt to anything in a much more realistic and simple way!
Gah! You're distracting me with insanely interesting ideas!!! T___T
There is no god.
Fokusas
Jr. Member
Posts: 51
Medals: 2
Re: Ant Colony Simulator (not really a game)
«
Reply #9 on:
2011-12-15 05:04:16
»
Very nice idea
both of you
Games published by our own members! Go get 'em!
KevinWorkman
Jr. Member
Posts: 62
Medals: 3
klaatu barada nikto
Re: Ant Colony Simulator (not really a game)
«
Reply #10 on:
2011-12-15 08:37:57
»
Quote from: ra4king on
2011-12-14 23:11:29
Wow I almost did not see the time fly by! I kept playing around with it and making many different paths
Great job!
Thank you! Anything that wastes other people's time is a great success, haha.
KevinWorkman
Jr. Member
Posts: 62
Medals: 3
klaatu barada nikto
Re: Ant Colony Simulator (not really a game)
«
Reply #11 on:
2011-12-15 08:38:38
»
Quote from: theagentd on
2011-12-15 04:27:24
One of the ultimate games I want to create is an MMORPG game where all content is generated and controlled by an AI similar to this. Think about it; a game where towns and cities are naturally formed around places with lots of people and travelers; a game where towns need resources to survive and can actually disappear if they are destroyed or they become too unpopular, e.t.c. Players take the role of a single person in this world, and can do whatever they want to try to become successful, or ruin other peoples work. I tried to experiment with a very simple AI for a small community which built houses for people to live in, gathered wood for house construction and gathered food for keeping the population alive. I had a very hard time getting it balanced. It always massed a single resource too much or built too many houses, and then I realized it was because they were communists! I realized the problem was that a central AI controlled how many people to assign to resource gathering and how many houses to build, and it's very hard for "the state" to determine optimal numbers for this! A swarm approach (AKA ant colonies) is MUCH more effective at adapting to changes and other stuff than a supermind overviewing everything, because it is simply put to difficult to determine an optimal strategy. Let the drones do the work and it should be able to adapt to anything in a much more realistic and simple way!
Gah! You're distracting me with insanely interesting ideas!!! T___T
Wow, that definitely sounds fascinating. I'd love to hear more about it if you get something workable going.
Orangy Tang
JGO Kernel
Posts: 2959
Medals: 37
Monkey for a head
Re: Ant Colony Simulator (not really a game)
«
Reply #12 on:
2011-12-15 08:41:16
»
Quote from: theagentd on
2011-12-15 04:27:24
One of the ultimate games I want to create is an MMORPG game where all content is generated and controlled by an AI similar to this. Think about it; a game where towns and cities are naturally formed around places with lots of people and travelers; a game where towns need resources to survive and can actually disappear if they are destroyed or they become too unpopular, e.t.c. Players take the role of a single person in this world, and can do whatever they want to try to become successful, or ruin other peoples work.
Eve.
[
TriangularPixels.com
- Play Growth Spurt, Rescue Squad and Snowman Village ] [
Rebirth - game resource library
]
theagentd
JGO Wizard
Posts: 1391
Medals: 88
Re: Ant Colony Simulator (not really a game)
«
Reply #13 on:
2011-12-15 09:16:42
»
Quote from: Orangy Tang on
2011-12-15 08:41:16
Quote from: theagentd on
2011-12-15 04:27:24
One of the ultimate games I want to create is an MMORPG game where all content is generated and controlled by an AI similar to this. Think about it; a game where towns and cities are naturally formed around places with lots of people and travelers; a game where towns need resources to survive and can actually disappear if they are destroyed or they become too unpopular, e.t.c. Players take the role of a single person in this world, and can do whatever they want to try to become successful, or ruin other peoples work.
Eve.
Never played it. I'm a cheapskate.
There is no god.
sproingie
JGO Strike Force
Posts: 893
Medals: 55
Re: Ant Colony Simulator (not really a game)
«
Reply #14 on:
2011-12-15 19:03:43
»
Quote from: theagentd on
2011-12-15 04:27:24
One of the ultimate games I want to create is an MMORPG game where all content is generated and controlled by an AI similar to this. Think about it; a game where towns and cities are naturally formed around places with lots of people and travelers; a game where towns need resources to survive and can actually disappear if they are destroyed or they become too unpopular, e.t.c.
This is probably where Dwarf Fortress's Adventure Mode is heading in, oh, another 20 years. I only ever play Fortress Mode myself, and it also has some pretty interesting emergent behaviors, though not a lot of direct interaction between dwarfs except when they're killing each other...
asphaltgalaxy
JGO n00b
Posts: 29
Medals: 1
Re: Ant Colony Simulator (not really a game)
«
Reply #15 on:
2011-12-29 09:09:46
»
Nice simulator, great job! Tried several maze construction strategies...
And yes, they're still searching for food
asphaltgalaxy
JGO n00b
Posts: 29
Medals: 1
Re: Ant Colony Simulator (not really a game)
«
Reply #16 on:
2011-12-29 09:14:39
»
Quote from: sproingie on
2011-12-15 19:03:43
Quote from: theagentd on
2011-12-15 04:27:24
One of the ultimate games I want to create is an MMORPG game where all content is generated and controlled by an AI similar to this. Think about it; a game where towns and cities are naturally formed around places with lots of people and travelers; a game where towns need resources to survive and can actually disappear if they are destroyed or they become too unpopular, e.t.c.
This is probably where Dwarf Fortress's Adventure Mode is heading in, oh, another 20 years. I only ever play Fortress Mode myself, and it also has some pretty interesting emergent behaviors, though not a lot of direct interaction between dwarfs except when they're killing each other...
And it's little bit like Majesty (at least older one). You can stimulate heroes by money (not always), and you never know, will reach your mage level 7 or not
KevinWorkman
Jr. Member
Posts: 62
Medals: 3
klaatu barada nikto
Re: Ant Colony Simulator (not really a game)
«
Reply #17 on:
2011-12-29 13:57:45
»
Quote from: asphaltgalaxy on
2011-12-29 09:09:46
Nice simulator, great job! Tried several maze construction strategies...
And yes, they're still searching for food
Thanks! If you feel like it, you might try playing with the simulation parameters to encourage them to solve a maze. Something like setting the max pheromone slider to a high value and the dropoff and evaporation sliders really low might help them solve it better.
Pages: [
1
]
Print
Jump to:
Please select a destination:
-----------------------------
Games Center
-----------------------------
=> Featured Games
=> Showcase
=> Contests
===> LWJGL16k - 2011
===> 4K Game Competition - 2012
===> JGO Comp Petite
===> Finished Contests
=====> 4K Game Competition - 2011
=====> 4K Game Competition - 2010
=====> 4K Game Competition - 2009
=====> 4K Game Competition - 2008
=====> 4K Game Competition - 2007
=====> 4K Game Competition - 2006
=====> 4K Game Competition - 2005
=====> Tiny Game 2010
=====> JGO Comp 2009
=====> 16K LWJGL Competition - 2005
=====> Java Technology Game Development Contest - 2004
-----------------------------
Discussions
-----------------------------
=> General Discussions
===> Suggestions
=> Business and Project Discussions
===> Jobs and Resumes
===> Community & Volunteer Projects
=> Miscellaneous Topics
-----------------------------
Game Development
-----------------------------
=> Newbie & Debugging Questions
=> Articles & tutorials
=> Game Play & Game Design
=> Game Mechanics
===> Artificial Intelligence
=> Networking & Multiplayer
=> Performance Tuning
=> Shared Code
-----------------------------
Java Game APIs & Engines
-----------------------------
=> Engines, Libraries and Tools
===> Java 3D
===> JInput
===> jMonkeyEngine
===> Xith3D Forums
===> Tools Discussion
=> Java 2D
===> JavaFX
=> OpenGL Development
===> JOGL Development
===> LWJGL Development
=> Java Sound & OpenAL
===> JOAL Development
=> Java on Mobile Devices
===> Android
===> J2ME
Featured Game
Latest Featured
Add yours!
Add your game by posting it in the showcase section.
The first screenshot will be displayed as a thumbnail.
Latest pastebins
obsidian_golem
2012-05-23 10:14:50
Danny02
2012-05-21 17:10:34
Danny02
2012-05-21 17:07:10
Danny02
2012-05-21 16:56:12
davedes
2012-05-21 13:59:23
obsidian_golem
2012-05-20 20:28:41
darkjava55
2012-05-12 16:14:40
Ultroman
2012-05-12 09:36:05
Ultroman
2012-05-11 22:49:53
Ultroman
2012-05-11 22:20:01
Loading...