<< Back to Warzone Classic Forum   Search

Posts 61 - 80 of 565   <<Prev   1  2  3  4  5  ...  16  ...  28  29  Next >>   
WarLight AI Challenge: 3/19/2014 17:19:37


125ch209 
Level 58
Report
thx it worked
WarLight AI Challenge: 3/19/2014 18:20:58


hedja 
Level 61
Report
Guys if you want to practise to see how your ideas will do on warlight, but cant because there isn't "random warlords with 2 picks in each bonus" choice in settings, you can use this link which has all the territory names, and just highlight the first two to come up in each bonus until you have all the possible picks. time consuming i know but the only way to test ideas on warlight.

http://j.mp/OxnV8y

EDIT: If anyone wants to play and see what they need to make sure their bot does, I am looking for people to play some 1v1s with if they want. Just make a game with me and we can chat about it and do some practise

Edited 3/19/2014 19:03:50
WarLight AI Challenge: 3/20/2014 16:39:59


Muli 
Level 64
Report
Can anyone explain me how it works with "Neighbours"?

setup_map neighbors 1 2,3,4 2 3 4 5
Finally we can see that regions 1, 2 and 3 are all connected to each other. Region 4 is only connected to region 1 and 5. Both region 3's neighbours are given, so it's left out in the line, continuing with region 4.


I really don't understand how that fits together :(
WarLight AI Challenge: 3/20/2014 16:53:57

Fizzer 
Level 64

Warzone Creator
Report
setup_map neighbors 1 2,3,4 2 3 4 5

Yeah, it's tricky to decipher. I wish they had used a better syntax.

First split by space, then look at each pair:

1: 2,3,4
2: 3
4: 5

This means that 1 is connected to 2, 3, and 4. 2 is connected to 3. 4 is connected to 5.

All connections are implicitly two-way, so you also have to read it in reverse. The first line says that 2,3, and 4 are connected to 1. Second line: 3 is connected to 2. Third line: 5 is connected to 4.

You can go back and fill in the gaps to get this:

1: 2,3,4
2: 1,3
3: 1,2
4: 1,5
5: 4

Edited 3/20/2014 16:59:21
WarLight AI Challenge: 3/20/2014 18:37:47


Muli 
Level 64
Report
oh thanks, that makes sense :)
WarLight AI Challenge: 3/21/2014 03:24:19


zach 
Level 56
Report
I have a question for you guys: For neutral territories (excuse me, regions), what does the getPlayerName() method return? "neutral," "unknown," or something else?
WarLight AI Challenge: 3/21/2014 08:10:28


125ch209 
Level 58
Report
i think it is "neutral", and "unknown" in when the region is not on the visibleMap, wether it is actually neutral or owned by opponent.
(i hope so, cause that's how i coded...)

Edited 3/21/2014 08:10:40
WarLight AI Challenge: 3/21/2014 10:37:45


Odin 
Level 60
Report
"Unknown" is reserved for regions that are not visible and therefore (theoretically) their owner is not known.

It seems "neutral" is the correct word for regions that are visible and not controlled by either player. However, if that were not the case, you could circumvent the problem by defining as neutral every territory that fulfills these three conditions:

1. It is visible
2. It is not controlled by you
3. It is not controlled by your opponent
WarLight AI Challenge: 3/21/2014 13:18:18

RvW 
Level 54
Report
Of course, since there's only two players (and no abandon cards or something like that), once you know a territory is controlled by your opponent, it will remain controlled by your opponent until you (re)capture it. The big point they make about never being able to tell whether your opponent controls a bonus is mostly nonsense; it is perfectly possible to keep track of which territories are certainly controlled by your opponent, even if you can no longer see them (you still cannot keep track of their progress in the fog, nor can you tell army numbers).
WarLight AI Challenge: 3/21/2014 16:04:48


Odin 
Level 60
Report
Whom does the uploaded code belong to? Does someone get automatic licenses? I don't see any terms of service in theaigames.
WarLight AI Challenge: 3/21/2014 16:28:59


125ch209 
Level 58
Report
i have a question:
in the PlaceArmiesMove.java file, there is this method:

public String getString() {
if(getIllegalMove().equals(""))
return getPlayerName() + " place_armies " + region.getId() + " " + armies;
else
return getPlayerName() + " illegal_move " + getIllegalMove();
}

How is this a "String"? region.getId() is an Integer, and armies is an Integer too. So how is the concatenation of all this can be a String?


I tried to modify the method to:

public String[] getString() {
if(getIllegalMove().equals(""))
return {getPlayerName() , " place_armies " ,String.Valueof( region.getId() ) , " " ,String.Valueof( armies ) };
else
return {getPlayerName() , " illegal_move " , getIllegalMove()};
}

but i get an error:
src/move/PlaceArmiesMove.java:47: error: illegal start of expression
return {getPlayerName() , " place_armies " ,String.Valueof( region.getId() ) , " " ,String.Valueof( armies ) };


any thoughts?

Edited 3/21/2014 16:35:53
WarLight AI Challenge: 3/21/2014 16:45:19


zach 
Level 56
Report
I think it automatically casts the value "region.getId()" as a String, so that isn't necessary. Was the code not working to begin with?


According to this, you're fine: http://stackoverflow.com/questions/4105331/how-to-convert-from-int-to-string

Edited 3/21/2014 16:50:44
WarLight AI Challenge: 3/21/2014 17:13:34


125ch209 
Level 58
Report
thx i didn't know this way of casting

i'm trying to get this:

For 1 given move -> if it is a PlaceAmriesMove, then getRegion() and getArmies()

exept i don't know how i can identify the type of the move (PlaceAmriesMove or AttackTransferMove).
if i do getString() of the move, that i'll get me the concatenated string, but i can't access the second term of the string ("attack/transfer" or "place_armies"). That's why i tried to change it into a String [] so that all terms can be isolated:
{getPlayerName() , " place_armies " ,String.Valueof( region.getId() ) , " " ,String.Valueof( armies ) }

any idea on how i could get the type of a given move?

Edited 3/21/2014 17:14:51
WarLight AI Challenge: 3/21/2014 17:28:03


zach 
Level 56
Report
You might be able to copy some of the code from the BotParser file (around line 44)

Why would you need to determine if a move is a deployment or an attack/transfer?
WarLight AI Challenge: 3/21/2014 17:28:37


125ch209 
Level 58
Report
maybe a solution would be:

in the PlaceArmiesMove.java write the method

public String getType() {
return " place_armies ";
}

and in the AttackTransferMove.java write the method

public String getType() {
return " attack/transfer ";
}

Now if i have a (Move givenMove)
if i do givenMove.getType(), would this return the correct Type of move?
would it recognize automatically wich "getType()" to use?
WarLight AI Challenge: 3/21/2014 17:31:52


125ch209 
Level 58
Report
Why would you need to determine if a move is a deployment or an attack/transfer?


If my region is bordering an ennemy region, i want to know how much armies the ennemy deployed on his region on the previous turn, so that i can have an idea of how many armies he will deploy this turn, and adjust the armies i am deploying on my region accordingly.

Edited 3/21/2014 17:34:31
WarLight AI Challenge: 3/21/2014 17:36:52


zach 
Level 56
Report
That should work because each getType() corresponds to a specific type of move.

I have a question about the map updating. When I use the getArmies() method during my attacks/transfers to figure out how many armies I have, does it give my the value from the beginning of the round, after deployments, or that moment?
WarLight AI Challenge: 3/21/2014 17:41:02


125ch209 
Level 58
Report
I don't have the answer. in fact i was wondering about this too and i knew this was a question i would need an answer to when i get to the Attack/Transfer part of the coding.

i hope it is after the deployements...that would make our lives much easier

Edited 3/21/2014 17:41:52
WarLight AI Challenge: 3/21/2014 20:48:12


zach 
Level 56
Report
I came up with a solution to the deployment/update problem, but for some reason, it makes my bot freeze in the first 5-10 turns. At first, the bot does fine using troops on the same turn it deploys them. Then it just stops everything--deploying and moving--for the rest of the game. When I check the output under "go place_armies 2000" and "go attack/transfer 2000", it says:

Maximum number of idle moves returned: skipping move (let bot return 'No moves' instead of nothing)
WarLight AI Challenge: 3/21/2014 20:53:02


{rp} Julius Caesar 
Level 46
Report
sucks that i cant use either starter bot, damn you google chrome books and your shatty app collection of file handlers!!
Posts 61 - 80 of 565   <<Prev   1  2  3  4  5  ...  16  ...  28  29  Next >>