<< Back to Warzone Classic Forum   Search

Posts 71 - 90 of 565   <<Prev   1  2  3  4  5  ...  16  ...  28  29  Next >>   
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!!
WarLight AI Challenge: 3/21/2014 20:59:35


zach 
Level 56
Report
There are some sites that let you write/compile code online, like http://www.jdoodle.com/ or https://ideone.com/

It's not the most convenient way to program, but it's better than nothing.
WarLight AI Challenge: 3/21/2014 21:07:37


125ch209 
Level 58
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)


I had that same problem, i thought it was because my bot was taking to long to calculate the deploying armies, but then after a successful update (unrelated to the issue), all went back to normal... so i don't know how it got fixed but i don't think it is because the bot wasn't quick enough
WarLight AI Challenge: 3/21/2014 21:16:57


{rp} Julius Caesar 
Level 46
Report
yeah but I dont wanna from scratch make a bot, I wanted to just edit the pre packaged bot into a murder machine. huh... eh maybe ill make an attempt at just creating a bot, I have no clue what framework i should ue or what the hell it does, cudos to you fizz, this is insanley hard.
WarLight AI Challenge: 3/27/2014 02:14:59


Motocross5800 
Level 50
Report
what program do i use to make a bot in C or C++? sorry, i am new to this stuff.
WarLight AI Challenge: 3/27/2014 02:33:09


Odin 
Level 60
Report
I'm not really a C or C++ expert but I've heard that Visual Studio by Microsoft is very good for those languages.
WarLight AI Challenge: 3/28/2014 00:42:46

RvW 
Level 54
Report
Motocross:

Sounds like you need to learn how to program first. Maybe it'd be best to Google a C programming tutorial for Windows / Linux / whatever you use. Chances are it will contain a recommendation (and download link) for an editor. As an extra benefit, all screens, menu options and shortcuts mentioned in the tutorial will match perfectly.
WarLight AI Challenge: 3/30/2014 07:08:22

Good Kid 
Level 56
Report
"If I knew how to write an AI that were on par with top human warlight players, I would be a millionaire, probably even a billionaire. It's much more complex a task than what you would think."

Millionaire, maybe, bullionaire, no. It wouldn't be "that" hard. Bots can beat legit players in virtually every game in existence.

In 1997 Deep Blue beat Kasparov at Chess, computers today are a lot more powerful than they were 17 years ago, the top chess bots today are significantly better than the top human players.
WarLight AI Challenge: 3/30/2014 08:06:59


professor dead piggy 
Level 59
Report
Didn't IBM make Deep Blue, and aren't IBM billionaires?

YMCM could write pseudo code that would be top 10. Warlight gets quite formulaic and follows rules and a strategic 1v1 is like a big complicated system that im sure one could model. Teaching it to guess what was happening behind the fog would be the hardest but that's not necessary to beat most top 10 players.

Edited 3/30/2014 08:08:11
WarLight AI Challenge: 3/30/2014 10:40:47


Green 
Level 56
Report
I would love to see that top 10 beating pseudocode Piggy, perhaps I could learn something.
WarLight AI Challenge: 3/30/2014 14:42:24


Odin 
Level 60
Report
If I knew how to write an AI that were on par with top human warlight players, I would be a millionaire, probably even a billionaire. It's much more complex a task than what you would think.

That aside, writing an AI that can beat other AI's is much easier.


Well, my comment was about Warlight, not about chess, nor about some other random game. Chess and Warlight aren't comparable because Warlight's complexity is exponentially higher than that of chess. This is especially obvious in the endgame of chess, where a computer can often calculate the objectively best move within seconds.

If you want to make software that is on par with top human Warlight players (on all maps and settings, not just a single one), you have the following options: 1) Hard-code every possible board situation into your program, 2) Make the program think holistically, like a human being, and 3) Try to imitate human-like thinking in your program.

1) Is impossible because there are billions over billions of game situations that could arise. Hard-coding all of them is not feasible. And you'd have to do it again for every new map and setting.

2) Nobody in the world has been successful in this yet despite numerous efforts.

3) I won't say it's impossible to imitate human thinking to a degree, but making code that could beat a top player at Warlight by merely imitating would be very difficult, with no guarantee of success. There are numerous challenging taks, such as estimating enemy income and activity, or evaluating random game positions. Also, the human player could exploit knowledge of the AI's style and play in a way that is extremely effective against it. Making the AI to react to that in a sensible way is very difficult.

All in all, my prediction has held well until now. The top player of the AI ladder admits that his current bot could probably not fight on par with even a mediocre WL player. Even on such a simple map as Small Earth. Still, it has no trouble beating other AI's.
Posts 71 - 90 of 565   <<Prev   1  2  3  4  5  ...  16  ...  28  29  Next >>