[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/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 Sat Oct 20, 2018 7:28 am 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 ChrisH » Sun Dec 12, 2010 12:42 am

ChrisH
Colonel
 
Posts: 57
Joined: Tue Nov 30, 2010 8:54 pm

Re: Game idea concerning killer robot ants

Postby antimatroid » Sun Dec 12, 2010 12:46 am

I agree, but if they can see what friends they see can also see, then you can try to coordinate having chains of ants moving around in packs with a larger "current" field of vision, still not seeing what all of your ants can see (they could still use colours to try to coordinate which direction they want to move in etc.).

The idea with old/new information was mostly so a new child could start with the same information as its parent, but if we do the home hole idea with that being the ant generation point, I think that can be skipped, and each ant only passed current information each turn.
antimatroid
Brigadier-General
 
Posts: 126
Joined: Tue Feb 16, 2010 7:41 am

Re: Game idea concerning killer robot ants

Postby ChrisH » Sun Dec 12, 2010 1:18 am

ChrisH
Colonel
 
Posts: 57
Joined: Tue Nov 30, 2010 8:54 pm

Re: Game idea concerning killer robot ants

Postby antimatroid » Sun Dec 12, 2010 1:26 pm

I have thrown together a very early example map generator for a game along these lines. It currently has 4 symmetries that it picks between randomly, players home bases are represented with 'a' and 'b', walls are '#', then numbers represent the number of grains that can be harvested on that square. No ants are starting on the grids here, this was made with the thought of ants being spawned on the home base whenever there is some grain deposited there (decrementing it upon making an ant) and the home base also has no ants residing on it. Home bases would start with 5 pieces of grain or something, so you have 5 bots at turn 5 assuming you have moved the spawned ones each move.

The code can be found here: http://codepad.org/XmI7BuyH (Edited: for bugs)

There is an example map generated at the bottom of that page.

The map is made with the intention that edges are wrapped, and given that condition, you are guaranteed to be able to reach every non-wall square from your home base. All maps are 32x32, but you can easily tweak a parameter, you must use square grids for the 4th symmetry to work.
Last edited by antimatroid on Sun Dec 12, 2010 5:50 pm, edited 1 time in total.
antimatroid
Brigadier-General
 
Posts: 126
Joined: Tue Feb 16, 2010 7:41 am

Re: Game idea concerning killer robot ants

Postby antimatroid » Sun Dec 12, 2010 4:59 pm

This is how I currently think the game could be implemented and be reasonably interesting:

1. At the very start of the game, you will be passed the following information:
rows columns maxTurnsInAGame maxTimePerTurn
You are to return "go" once you have finished setting up, you have up to 3 seconds, this is so different languages have time to start up and you can allocate memory before the game really starts.

Every other turn, you will be passed information as follows, you will only be passed information for squares that you can currently see, but this includes squares where there is "nothing" there:
'S' row col (new square information at grid[row][col])
(you will be passed any of the following lines if there is an ant/bullet/grains there)
'A' player grains hp
'B' direction
'G' grains
'H' player (this is for home squares)

2. Each player controls all ants in the one process (so all share the same information), two friend ants cannot move into the same square (that would be an invalid order and loss of game), if two opposing ants land in the same square, the one with the lowest hp dies (could be both) and the other one loses that many hp, although ants may swap places.

3. Each ant will have a vision radius, including the home base, each turn you will only be passed information for squares within these fields of vision.

4. If your home square has grains deposited on it at the start of a turn and no ants are currently on it, an ant will spawn there, decrementing the number of grains. The home square will start with 5 grains.

5. Ants can harvest, deposit, shoot, and move (only one of these on a given turn, and processed in this order)

6. Harvest requires the square you are located on to have grain(s) on it, it will yield you 1 grain and you have a maximum carrying capacity.

7. Deposit requires a direction, if another ant is in that square, they get up to their carrying capacity of what you deposited, otherwise the deposit turns into harvestable grains on that square (I think an exception needs to be made here, if the deposit is to your home base, then it goes to that stock before "landing" on the bot that just spawned there).

There is no limit to how much grain can be on a square at any point in time.

8. Shoot requires a direction, the bullet will follow that path until landing in the same square as a wall, one or more other bullets, or an ant. If a bullet lands in the same square as an ant, then that ant loses 1 hp, if an ant gets to 0 hp, it dies. Bullets get moved and processed before ants move.

This means that if you shoot at an ant in an adjacent square, they will be hit even if they try to run, and if an ant is in the square that a bullet is about to go into at the change of turns, they will get hit, even if planning to move out of that square.

If an ant dies, its "harvest" gets taken if opposing bots landed on each other (up to its carrying capacity), otherwise it is deposited on that square.

9. You can move north, south, east, or west provided it isn't a wall and one of your other bots isn't currently or going to be in that square. The edges of the grid are wrapped, so if you move off the bottom, you come in on the top (provided a wall isn't there), similarly with the side edges.

10. A player is considered "dead" if any of the following conditions are met:
- They have no ants (it's not possible to have no ants and grains on the home base)
- Two of their ants are in the same square, or one of their ants lands on a wall.
- An enemy ant is currently located on their home base (it's easy to have this as a queen ant, with it's own hp? meaning ants can either attack your home base or kamakazee into it)
- Their bot doesn't return "go" in the specified time, either when setting up or making a move.
- Their bot crashes.

If one player dies before the other, they lose, if both die at the same stage, it is a draw.



I realise people want to do the separate processes for each ant, and I agree that it would be more interesting, but there's going to be way too much overhead with the number of bots that need to play games, not to mention having each process need to connect when playing on tcp.
antimatroid
Brigadier-General
 
Posts: 126
Joined: Tue Feb 16, 2010 7:41 am

Re: Game idea concerning killer robot ants

Postby lavalamp » Sun Dec 12, 2010 9:11 pm

Why do we need the bullets?
lavalamp
Colonel
 
Posts: 56
Joined: Wed Oct 06, 2010 9:10 pm

Re: Game idea concerning killer robot ants

Postby ChrisH » Sun Dec 12, 2010 9:54 pm

ChrisH
Colonel
 
Posts: 57
Joined: Tue Nov 30, 2010 8:54 pm

Re: Game idea concerning killer robot ants

Postby antimatroid » Mon Dec 13, 2010 2:58 am

antimatroid
Brigadier-General
 
Posts: 126
Joined: Tue Feb 16, 2010 7:41 am

Re: Game idea concerning killer robot ants

Postby delt0r » Mon Dec 13, 2010 9:02 am

So in the interests of moving the discussion to something more concrete. I have hacked up a engine and visualizer for the rules i suggested (yes i am biased, why do you ask?).

Lets be 100% clear here. This is not an engine for the server, this is not even a suggestion for that. Its not a suggestion as to the game IO format. Its a quick check to see how the ideas really pan out in real "life". The source is included and feel free to hack it. But again I am trying here is to movie the discussion from ideas to something more concrete.

Currently i give very little information to the ant bots. So coordinating between them would be harder than it should be for bot implementations. There are some easy changes to the protocol that could fix that.

First my new rules: (expand to make it clear.)

1) its on grid that wraps top to bottom, left to right.
2) there are only ever 2 players.
3) ants see the world relative to them only.
4) an ant can move one square in any direction (yes diagonally.)
5) an ant can attack an adjacent square instead.
6) Ants never ever stack. There is at most one ant per grid square at any one time.
7) If an ant does not try to move or attack and there is food at that grid location. It eats a unit of food.
8) once an ant has eaten 5 units of food, it lays an "egg" at that location.
9) the egg "spawns" or hatches as soon as the square has no other ants on it.
10) if an ants hit points go to zero or below zero, it dies and is removed from play.
11) Collisions and illegal moves do no damage and bots are not penalized for it.
12) Collisions are resolved in a deterministic fashion. If 2 ants try to move to the same square, neither moves.

A turn happens in the following order:

Harvest
attack
move
spawn (aka egg hatching)

The visualizer is very very basic (10 min coding tops). So don't expect anything much better than a ascii art output (I almost did that). You can't see health or food levels of the ants. But you do get the idea. The current bot is quite stupid. Its totally ignores walls and gets its ants stuck all the time.

In the interests of just getting an idea, the maps are totally random as are the 4 starting ant positions.

Separating intention to attack from move simplifies many things in the engine. There are a lot of special cases if a move is also an attack.

Here it is (java). Source is included (jars are just zip files). However its a bit sloppy, like my room really. I am on irc for direct questions (CEU time)

http://www.mabs.at/ewing/HackAnt.jar

Use as follows with the jar in the same dir:

java -jar HackAnt.jar 50 50 "java -cp HackAnt.jar deltor.borgant.DemoRageBot 0" "java -cp HackAnt.jar deltor.borgant.DemoRageBot 0" 100

The last number is the time in ms for each turn, ie the speed. (try a 1 for the argument to the bot to change its behavior).

So some observations. First a little cooperation would go a long way. Forming hunting packs would work well. Defensive packs would too. Also being smart about ants that already have 4 food would make big gains against bots that don't. Stacking, and locked combat would remove a lot of this. I hate stacking, also hard to see, and always results in the tactics of stack everything you can, see any RTS forum for flame wars about stacking. Don't get me started with locked combat, i mean whats the point? but feel free to add these things.

The other observation is that the game gets a very strong "alife" look.

Anyway. The idea is that now, rather than "i think that this would ....". Lets try it and see. If its quite hard to implement, or leads to bad dynamics (ie interesting games) then we can drop these ideas quickly.

And lets be extra clear. Some of the stuff in this "rough cut" are there not because i don't like others, but because they were easy to put in and get the thing going. Random starting positions is one of those things.

Simple additions that could go a long way. Give the ants their real position so that coordination is easier. Extend attack range. Not hitscan however so attack something does no damage to something in between.

tbh i am not sure i really like the ants idea over all.. but i don't have a better idea. Yet...

Also real life is getting in the way again, so i may be a bit quiet for the next few days.

EDIT:
Forgot about the protocol. Perhaps for now just try and read the code. Sorry. gtg
It was like that when I got here.
User avatar
delt0r
Colonel
 
Posts: 89
Joined: Sun Sep 12, 2010 8:03 am

Re: Game idea concerning killer robot ants

Postby antimatroid » Mon Dec 13, 2010 9:09 am

Here is a more recent version of the possible map generator: http://codepad.org/TMm3UoKq

I'm pretty sure your opponents home square can be anywhere else on the board provided its distance (before adding walls) was at least 24, so you don't know that their base is one of a certain set of squares, which was the case before.
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 3 guests

cron