<< Back to Classic Forum   Search

Posts 57 - 76 of 565   <<Prev   1  2  3  4  ...  16  ...  28  29  Next >>   
WarLight AI Challenge: 2014-03-19 00:00:29


Odin 
Level 61
Report
This challenge actually seems fun, and doesn't take that much time. I'll give it a try.

Also, I noticed that in the java code, there's a Long variable "timeOut" passed to many of the methods, but never used. Have you guys found a use for it? I think it's the maximum time you can take each turn.


Yes, the bot is expected to commit orders within 2 seconds.

If I understand correctly, you can access System.currentTimeMillis() which gives you the current time. I might be mistaken though.

http://www.java-forums.org/advanced-java/14441-timeout-method-execution.html

See post #3, first part.
WarLight AI Challenge: 2014-03-19 12:26:51


Banana 
Level 61
Report
maybe someone who know how to do this, can put up a tutorial on youtube? :D about basics
WarLight AI Challenge: 2014-03-19 16:02:14


125ch209 
Level 58
Report
anyone can help me understand something plz:

when i load the java starterbot as it is when i downloaded it, compile is a success. But if i unzip the starterbot i downloaded, then zip it again myself, the compile fails and i get:

"javac: no source files
Usage: javac
use -help for a list of possible options"

any guess on why is that?
WarLight AI Challenge: 2014-03-19 16:09:04


Odin 
Level 61
Report
The compiler cannot find the source files?

If you cannot get that to work, you can download the zipped file anew, open its files without unzipping them, and copy-paste your modified files in their stead. Then upload the zip file.
WarLight AI Challenge: 2014-03-19 17:19:37


125ch209 
Level 58
Report
thx it worked
WarLight AI Challenge: 2014-03-19 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 2014-03-19 19:03:50
WarLight AI Challenge: 2014-03-20 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: 2014-03-20 16:53:57


Fizzer 
Level 64

War.app 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 2014-03-20 16:59:21
WarLight AI Challenge: 2014-03-20 18:37:47


Muli 
Level 64
Report
oh thanks, that makes sense :)
WarLight AI Challenge: 2014-03-21 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: 2014-03-21 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 2014-03-21 08:10:40
WarLight AI Challenge: 2014-03-21 10:37:45


Odin 
Level 61
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: 2014-03-21 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: 2014-03-21 16:04:48


Odin 
Level 61
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: 2014-03-21 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 2014-03-21 16:35:53
WarLight AI Challenge: 2014-03-21 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 2014-03-21 16:50:44
WarLight AI Challenge: 2014-03-21 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 2014-03-21 17:14:51
WarLight AI Challenge: 2014-03-21 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: 2014-03-21 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: 2014-03-21 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 2014-03-21 17:34:31
Posts 57 - 76 of 565   <<Prev   1  2  3  4  ...  16  ...  28  29  Next >>