[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4586: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4588: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4589: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4590: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
AI Challenge Forums • View topic - Game idea concerning killer robot ants

It is currently Wed Jan 17, 2018 3:13 pm Advanced search

Game idea concerning killer robot ants

Topics about starter packages, visualizer or any other third party tools.
Please submit new language requests in the Language Request Forum.

Re: Game idea concerning killer robot ants

Postby antimatroid » Sat Dec 11, 2010 11:43 am

I agree with delt0r about making the idea simpler, somewhat going along with delt0r's proposal, here are my thoughts on how it could feasibly be done (pretty much a rewrite of delt0r's post). (This has ended up somewhat more complicated than I hoped, but I'm pretty sure this has less implementation issues than previously suggested ideas).

1) The game is played on a discrete symmetric 2d grid with two players, each player with a set of ants (each player may start with more than one ant). Each ant is its own process and can set itself to any of C colours. Each turn, the map fed to an ant has updated information for squares they can reach within r turns, as well as the most recent information they knew about other squares on the grid.

I've considered allowing communication to be a string, but then when people view the games (like on your profile) do you get to see the string the ants have? That kind of gives away what people are doing, and is messy dependent on the constraints on the string length. It would be kind of cool if people had to come up with their own "colour code" for communication as well.

A potentially cooler options would be if an ant also got updated information for what a friend ant they can see can see. I'll leave it up to discussion as to what people prefer, I don't think it's too hard to implement this second option.

2) Each turn the information will be passed to an ant like in the following examples:
N A 1 4 R 0 2 (new entry / ant / player 1 / 4 hp / colour is red / x coord / y coord)
N W 3 6 (new entry / wall / x coord / y coord)
O R 3 3 5 (old entry / resource / number of hp / x coord / y coord)

(Edit: the first line will probably need to contain specific information for the ant that the process is for)

3) There are a number of options with wrapping the edges of the map, I think the two reasonable ones are:
- no wrapping, equivalent to playing on the grid you see, you can't pass through walls.
- wrapping the edges, equivalent to playing on a sort of torus, this means you can walk through the top edge of the grid and come out in the same column at the bottom, similarly with the side edges.
I'll leave this one open to peoples opinions, personally I like the second.

4) The game is turn based and simultaneous, meaning all ants get to make a decision at the same time.

5) The goal of the game is to have more ants at the end of the game than your opponent. The game ends when the turn limit is reached, or all the ants on one (or both) teams are dead.

6) The time limit will be done with the wall clock, if one of your ants fails to return a move within the specified time and the opponents bots all respond, you lose, if you both have at least one ant that doesn't respond, it's a draw. I'm not sure what should happen if you ask to send an ant into a wall, should that ant die or the player lose the game?

7) Each turn an ant can move in any of the 4 directions to an adjacent square, or stay still. You cannot move diagonally (you could permit this, but the "metric" gets funky either way)

8) If an ant doesn't move in a square with resources, it harvests one of the hp, I think this should be handled before battle with new incoming enemies, then a decision needs to be made about which ant gets it if multiple friends remain there from the previous turn and there isn't enough hp for each ant to harvest.

9) Ants can move into the same square as other ants, if you and an enemy land in the same square, you automatically fight until one ant dies (subtract hp of lowest from highest, if equal, both ants die). A decision needs to be made about which ants should fight if a player has two of theirs land in the square simultaneously, the easiest to implement would be to fight weakest bots first. Another consideration here is possibly letting the ants designate some kind of priority based on how much knowledge the ant thinks it has.

10) A decision needs to be made about what happens if enemies in adjacent squares decide to "switch" places, do they fight during the transition or just pass each other? I don't think it really matters either way.

11)If an ants hp rises to H (even), then the ant splits into two ants, each with H/2 hp. The new ant process will be fed the same information as its parent, both with their corrected hp level.

Anyway, feel free to poke holes in where this might not work, or how you think it could be done better.



Edit: I really like Meatkat's idea about the home hole, it could be used with my version above, where harvesting yields a separate value to hp, ants have a max carrying capacity, and if they walk back onto the home base, their load is deposited. I would suggest perhaps having all ants for each player spawn on their home base at the start too, so they all know where they're going back to. An additional win/lose/draw condition could be added for an ant entering the enemies home hole. We could also allow ants to pass harvest to friend ants on the same square, which gets processed before moves.
Last edited by antimatroid on Sat Dec 11, 2010 2:35 pm, edited 2 times in total.
antimatroid
Brigadier-General
 
Posts: 126
Joined: Tue Feb 16, 2010 7:41 am

Re: Game idea concerning killer robot ants

Postby Meatkat » Sat Dec 11, 2010 2:12 pm

So I think we've been a little too focused on making the ants separate threads. I think another way to accomplish have lots of 'dumb' agents is to make them... well dumb! So I present to you:

Ant Rage
An ant battle simulator

Universe
World is an n x m grid consisting of symmetrically placed 2 ant holes (one for each player) and food.
This world is traversed by any number of player 1 / player 2 ants

Initially the map is unexplored for each player, but once a square is explored it is visible forever. (so there is no 'fog of war' alternatively this could be added)

The ant
The ant is pretty dumb, only understanding a few basic commands and taking a while to perform each.
Possible actions: Move, Guard, Gather

Move
The ant deterministically moves to location (x,y) where (x,y) is relative to that ant's home hole. A move to (0,0) would tell the ant to go into it's hole.

Guard
The ant stays where it is, just chillin'

Gather
The ant moves to location (x,y) and looks for food within an nxn grid of that location. If food is found the ant picks it up and brings it back to the hole. The ant dissapears in the hole for FOOD_GATHER turns to deposit the food, then appears in a square next to the hole, ready for commands. If there is no food at the location, the ant pretends a 'Move' command was given instead.

Note
You can issue one of these commands to an and every MIN_COMMAND_ROUNDS but commands can't be given to an ant if it is currently doing another action. Thus if you tell an ant to move somewhere that takes it less than MIN_COMMAND_ROUNDS it will just hang out idle until you can give it another command.

Ant RAGE!
When an ant sees an enemy ant it flies into a RAGE, forgetting any orders (and dropping anything it's carrying), it moves toward the enemy ant deterministically in the shortest route possible to engage in combat. Additionally it changes it color to 'red.' Any allied ant who sees an allied ant turn 'red' flies into a RAGE, moving toward that ants current position by the shortest route deterministically, this ant changes it color to yellow until it too sees an enemy, at which time it becomes red.

Combat in AntRage is known as GLORIOUS COMBAT.

GLORIOUS COMBAT is worked out automatically, using one of the already proposed methods. Ant's start with STARTING_ANT_HP and are automatically returned to full health if they spend any amount of time in the ant's nest hole. Once no enemies are in site, ants turn from red to yellow, if there are no red ants in site a yellow ant turns back to normal. Once the ants have recovered from their rage they are ready to be given new commands (they've forgotten the old ones) and will just hang out until a new command is given.

The GLORIOUS COMBAT system would look really cool on the visualizer as well, as players will watch ants RAGE, change color, and rush into GLORIOUS COMBAT! A movement bonus could also be added to make things more exciting (and/or realistic?) for ants in a RAGE!

The Birds and the... ants?
Inside each ant hole is the player's queen. She will generate another ant every ANT_REGEN turns as long as she has ANT_CREATION_FOOD food available to her in her hole.

Victory Conditions
If an enemy ant manages to get into you're hole, you've lost.
The game ends after MAX_TURNS turns, whoever has the most ants wins (including ants dropping off food) if that is a tie, whoever has the most food stored in their nest. If that is a tie, it's a tie.

Turn Time
Each player has 500 ms (250 ms?) to give commands to any/all ants that are able to receive orders.

Notes
The coordinate system zeroed at the hole is important so that the enemy can't learn the location of the enemy hole until they do a bit of exploring (they can't figure out the location of the enemy hole until they know the size of the map and two of the map edges).

If an ant would have moved off the map, it instead stops, pretending that it has reached it's destination. This gathering ants would look for food, moving ants would just stop. More than one ant can occupy a square at a time.

I think does a decent job of simplifying things and overall could have some pretty interesting dynamics.

Thoughts / comments?
Meatkat
Lieutenant
 
Posts: 14
Joined: Sun Oct 03, 2010 7:38 pm

Re: Game idea concerning killer robot ants

Postby Mistmanov » Sat Dec 11, 2010 4:33 pm

Mistmanov
Colonel
 
Posts: 70
Joined: Fri Sep 24, 2010 6:50 pm

Re: Game idea concerning killer robot ants

Postby iouri_ » Sat Dec 11, 2010 5:41 pm

I'd have to agree with delt0r, a simpler set of rules is better. His are probably the best I've seen so far, though personally I'd prefer more control about where to spawn a new ant and making "eat" an explicit order.

I'd prefer string messages to colors or scents, as they're more intuitive to work with, likely more human-readable (that is, until the contestants start compressing everything into them), and still leave enormous room variety of strategies.

With respect to visualizing the string messages: if they are short, they can be placed directly onto the visualizer; so long as there aren't 100 ants, this can work reasonably well. Alternatively, there can be a separate "log" area below the visualizer where the messages from each ant show up.
iouri_
Brigadier-General
 
Posts: 105
Joined: Thu Feb 11, 2010 4:16 pm
Location: Toronto, Canada

Re: Game idea concerning killer robot ants

Postby Mistmanov » Sat Dec 11, 2010 6:01 pm

Mistmanov
Colonel
 
Posts: 70
Joined: Fri Sep 24, 2010 6:50 pm

Re: Game idea concerning killer robot ants

Postby iouri_ » Sat Dec 11, 2010 6:27 pm

iouri_
Brigadier-General
 
Posts: 105
Joined: Thu Feb 11, 2010 4:16 pm
Location: Toronto, Canada

Re: Game idea concerning killer robot ants

Postby Meatkat » Sat Dec 11, 2010 6:35 pm

About the multiple thread thing....

If you were just asked to submit the RobotAnt object with a method called run(GameState g) which was not allowed to have any static variables would that work? The program would create multiple RobotAnt objects, which each could create more objects, etc.. but as long as none of these are static, there's no writing to files, and they can't modify the game state, is there any way for one RobotAnt object to get information from another? Maybe I'm not thinking haxx0rz enough (or in enough languages). Who can show me how it's done?

Stated again:
No writing to files, no modifying g, no static varibles.
RobotAnt josh = new RobotAnt()
RobotAnt jane = new RobotAnt()
//put them in a list, array, whatever...

//some point later
josh_action = josh.run(GameState g)
jane_action = jane.run(GameState g)

Can josh communicate with jane? (use any language you like)
Meatkat
Lieutenant
 
Posts: 14
Joined: Sun Oct 03, 2010 7:38 pm

Re: Game idea concerning killer robot ants

Postby mleise » Sat Dec 11, 2010 7:39 pm

Yσμ αrε ηστ τhιηκιηg hαXXσr εησμgh, dμdε ;)
In pure OOP languages you might get away with that, but in C for example you can also declare global variables. They could even be disguised in some macro and last not least some languages may offer standard libraries that offer some sort of global variable. In Java it could be a singleton object who's state is used to pass information. Most virtual machines offer some kind of singleton application object for example. If that can be modified you have your storage. In C there is the global variable 'errno' which is an integer and could be set to point to a common memory block that the ants use to communicate.
So I would doubt there is a way to enforce this behaviour for all languages even if a real person was reviewing every upload.
mleise
Lieutenant-Colonel
 
Posts: 42
Joined: Mon Sep 27, 2010 6:18 pm

Re: Game idea concerning killer robot ants

Postby iouri_ » Sat Dec 11, 2010 7:53 pm

Forgot to add: for delt0r's rules, it may be better if the attack range would be 2 instead of 1, as (a) it will allow for wider, more complex multi-ant battles, esp. around obstacles and at choke points, and (b) it will encourage more confrontation, making the game more dynamic.
iouri_
Brigadier-General
 
Posts: 105
Joined: Thu Feb 11, 2010 4:16 pm
Location: Toronto, Canada

Re: Game idea concerning killer robot ants

Postby antimatroid » Sat Dec 11, 2010 10:46 pm

Guys, we need something that will ACTUALLY work, if you don't allow ants to fill the same square, resolution of moves becomes a lot harder, if you do attacking other than landing in the same square, that gets harder too (although could just be processed before moves).

If you're going to spit out ideas from here, it would be good if you actually provided ideas that could be implemented, and if it's not immediately obvious, say how you propose it could be done. Also, when passing game states, do you guys want to be passed both new and old information? And should new information be just that which you can see within r moves, or what friend ants inside that distance can see as well, and so on?
antimatroid
Brigadier-General
 
Posts: 126
Joined: Tue Feb 16, 2010 7:41 am

PreviousNext

Return to Starter Packages & Tools

Who is online

Users browsing this forum: No registered users and 2 guests

cron