<< Back to Warzone Classic Forum   Search

Posts 141 - 160 of 565   <<Prev   1  2  3  ...  5  ...  7  8  9  ...  18  ...  28  29  Next >>   
WarLight AI Challenge: 4/14/2014 01:13:31

{rp} pedrito 
Level 48
Report
I think it's very possible to extract source from jar files with an utility like JD GUI.

http://jd.benow.ca/
WarLight AI Challenge: 4/14/2014 01:14:48

RvW 
Level 54
Report
When compiling from source code to object (executable) code, a large number of details about your program disappear. For instance, compiling the following code
    // Initialise the entire array
    for ( int i = 0; i < myArray.length; i++ )
    {
        myArray [ i ] = i;
    }
will result in object code which is identical to if you had compiled the following:
    for ( int x = 0; i < y.length; x++ )
    {
        y [ x ] = x;
    }

So yes, the structure can be recovered, but all your comments are gone and all (or most? not sure about the details of Java) variable names are gone. This makes it much harder to figure out what your code is doing and much, much harder to understand why it is doing so.

If you think your bot has a chance of performing well and you don't want to help your opponents, I'm sorry, but I'd advice against freely distributing the .jar file.

Of course, if there are some people you trust not to even attempt such reverse engineering and be careful enough not to share it with other people, you could always send a select group of people a private message (go to "Mail", right next to "Forum" in WL's menu bar) with a link to your .jar file. (Note I'm just giving options; judging people's trustworthiness is something you can only do yourself.)
WarLight AI Challenge: 4/14/2014 01:49:44


125ch209 
Level 58
Report
it's not really for me, i don't really care about giving away my code (I even gave my code to another warlight player in the AI competition so that he could help me figure out what is wrong with it). It was more for other bot like Norman's, wich has been on top of the ladder for some time now, so i would understand if he didn't want his bot reverse engineered...

if someone wants to trade JAR files, just mail me

Edited 4/14/2014 01:57:17
WarLight AI Challenge: 4/14/2014 02:16:24


Norman 
Level 58
Report
I don't have any practical experience with this stuff but possible solutions imo:

- Use an obfuscator
- Turn the .jar file into an .exe file (should also work I think)

Fighting against other bots would be nice. During the weakend I changed my old fighting algorithms. Against the old version of my bot I only get 57% win rate since both versions have the same "basic thoughts". Playing against other bots however I finally reached the 2800 rating (as I write this post). You guys thought SupremeDalek was out of business? Well, guess again. I'm back again and stronger than ever. I was to bored and didn't have enough time to add code lately. But then you wannabes pushed me down to 5th place and I just couldn't let that insult slide.
WarLight AI Challenge: 4/14/2014 02:20:51


125ch209 
Level 58
Report
hahaha yeah congratz on the 2800 rating. you want to trade JAR?
WarLight AI Challenge: 4/14/2014 11:58:58


ps 
Level 61
Report
there are java decompilers (that extract .java from the .jar) and code prettifiers (that turn obfuscated code into readable code) available. it can be cumbersome but it can be analyzed. but all things considered it's much easier to look at the damn game and figure out what the bot is probably doing.
WarLight AI Challenge: 4/17/2014 19:24:20


Norman 
Level 58
Report
My favorite game so far:
http://theaigames.com/competitions/warlight-ai-challenge/games/534de8bd4b5ab2132e949ae8

Very interesting moves by pedrito turn 72 and 73. I wonder whether pedrito was watching SupremeDalek's deployment to find out if he was expanding and how much of the africa he already had.
WarLight AI Challenge: 4/17/2014 21:19:36


125ch209 
Level 58
Report
yeah really interesting move, he watch supremdaleck's deployments for sure
WarLight AI Challenge: 4/17/2014 23:51:16

{rp} pedrito 
Level 48
Report
So lucky at the end :) Bot knew he had Africa before he even deployed 8 guys the first time, I'm surprised myself.
WarLight AI Challenge: 4/18/2014 23:46:57


Muli 
Level 64
Report
I'm actually kind of surprised how well my bot is doing since he doesn't have any idea of where the enemy is or how much income he has / if he has a bonus. Yet he has beaten all the higher placed bots in one of the last games and keeps pending around the 7th place.
WarLight AI Challenge: 4/19/2014 00:06:38

Hennns
Level 58
Report
What I find very intresting is that none of the bots decides to take brazil earlier, which should be a top priority for both of them (and any decent wl player would proably have done). if you guys get to the level that the bot would take brazil earlier I'd be very impresed. Still it is impressive to figure out the opponent have africa whith no vision and before it deploys +8.
WarLight AI Challenge: 4/19/2014 03:53:58


125ch209 
Level 58
Report
do you guys figured out how to retain state between runs? i've been trying to do that in order to access the state of the game from previous turn for advanced strategy, but the only way i found is through object serialization, wich we need writing access to do...wich we don't have
WarLight AI Challenge: 4/19/2014 10:29:15

RvW 
Level 54
Report
I don't think you're supposed to be able to do that... If memory serves there's a clause in the rules which says you can't base decisions on who you're fighting (in other words: having a line "if opponent = X then do-something else do-another-thing" in your code would not be allowed).

A sort-of way around that is to gather everything your bot has learned in "offline" testing and include that knowledge right into the source code. But with offline testing, you can only fight against opponents you have the code for. Except...

If your bot does not rely on randomisation anywhere (if it always plays exactly the same game if the opponent makes all of the same decisions) you could even feed it matches played on the server by having it play against a fake opponent which simply "plays back" the moves of an opponent in an interesting game. Note the bit above though; any knowledge you gain will be used against all opponents, including the ones with a completely different style!
WarLight AI Challenge: 4/19/2014 13:08:10


125ch209 
Level 58
Report
actually i didn't mean retain state between games, i only need between rounds (the program runs every rounds right?), like here when we play warlight and check the "history". I would like to have access to the map, the opponent moves and my moves from previous rounds
WarLight AI Challenge: 4/19/2014 13:59:43


ps 
Level 61
Report
125: just do an object array and stores all moves from all rounds as you parse them.
WarLight AI Challenge: 4/19/2014 16:19:05


125ch209 
Level 58
Report
yes but since the bot runs every rounds, i can't initialize the array, because it is just going to start a new array every rounds right? and i can't add objects to an array i didn't initalized..

Edited 4/19/2014 16:58:36
WarLight AI Challenge: 4/19/2014 17:21:17


125ch209 
Level 58
Report
Another question :) : Can someone explain me what is done in the BotParser class? i understand all of the other classes, but this one i don't get...
WarLight AI Challenge: 4/19/2014 18:01:29


Norman 
Level 58
Report
@RvW:
And where is your bot?

@125ch209:
Every round the game engine calls the two functions getPlaceArmiesMoves and getAttackTransferMoves. Your bot isn't shot down between the turns, that happens at the end of the game. However since you are using the java starterbot you have to be careful using the java starterbot data structures to store your state. As far as I looked at the code only the visibleMap (including Region and SuperRegions) is generated completely new each turn. Other values as the startingArmies are just overriden each turn. So if you store the BotState's in a list you will get unexpected behavior if you don't pay attention.


I'm interested in how you guys bots work. Let me explain my bot. The architecture of my bot consists of three components named "model", "evaluation" and "strategy".

- The "model" component is responsible for finding out what is going on behind the fog. The algorithms here take exponential time on the amount of possible SuperRegions.

- The "evaluation" component is responsible for evaluating the situation. It uses the results of the model component. More concrete it's responsible for guessing the opponent deployment per region, calculating whether the game is won, lost,... and most importantly giving each region one of three integer values named attackRegionValue (if opponent region), defenceRegionValue (if own region) and expansionRegionValue (if neutral region). The exact integer value isn't relevant, I think they are arranged at an ordinal scale. Futhermore this component calculates for each region a couple of integer values representing stuff like how many armies I need to defend with / without opponent deploying so he can't break me / I get an even fight when he attacks, how many attacking armies would be complete overkill,...

- The "strategy" component is responsible for performing the actual moves. It uses the results of the other two components. First I calculate how many armies I want to spare for expanding at max. Then the expansion moves are calculated. At last the fighting moves are calculated. I don't have any hardcoded moves in my bot like "take North Africa when you have South America (seriously... come on guys)". All moves are directed by the precalculated region values. Using the region values allows me to let my bot easily perform smart moves. For example when I have the option to transfer armies from Region C to the opponent bordering regions A or B then I can base my decision on which region has the higher defenceRegionValue.
WarLight AI Challenge: 4/19/2014 18:31:53


125ch209 
Level 58
Report
My bot strategy is really very messy.
I have a "base model strategy", where i sort all regions and put them in Lists to prioritize them:
-lists to prioritize underAttack regions to defend (in order:region part of a SuperRegion i own, region bordering a SuperRegion i own, Isolated Regions, ...)
-lists to prioritize neutral region to expand to (last region to get bonus, last 2 regions to get bonus, regions bordering a superregion i own, regions part of a superregion where there isn't known opponent regions, ...)

I'm also watching the visible armies deployed by opponent last turn (total and by regions) , the regions attacked by opponent last turn, and i know the picks i lost to the opponent.

so this is the "base" model, and then i add a bunch of specific situations, for example:
if i own australia and that i don't have any regions in south america, africa or europe, i list region 36,37 & 38 as special regions i need to take asap with as much armies as i have, etc

also, i reorganised the visibleMap so that i run through the regions in a customized order and not by Id

here is an example of my error dump:

Round 4

myRegions: 42 39 21

opponentRegions: 12

underAttackRegions: 21

safeRegions:

specialPriorityRegions:

priorityNeutralRegions_01:

priorityNeutralRegions_0: 41 40

priorityNeutralRegions_1:

priorityNeutralRegions_2: 22 23 24

priorityNeutralRegions_3: 20 18 38

priorityNeutralRegions_4:

priorityMyRegions_0:

priorityMyRegions_1:

priorityMyRegions_2: 21

priorityMyRegions_3:

isolatedInDangerousSuperRegion:

Opponent Reinforcement: 5

line 1266: placing 2 armies on Region: 21

Region to break :12

line 1480: placing 2 armies on Region: 39 to take Region 41

line 1504: attacking Region 41 from Region 39 with 3 armies

line 1586: placing 1 armies on Region: 21

time spent on method: 4454000



i just discovered how to print the line number in the code, wich is absolutely awesome for debugging

Edited 4/19/2014 19:31:47
WarLight AI Challenge: 4/19/2014 22:47:23


Norman 
Level 58
Report
http://theaigames.com/competitions/warlight-ai-challenge/games/5352f3d64b5ab22610ebf080

I think turn 8 shows buggy behavior since there are armies left for attacking from Peu.
Posts 141 - 160 of 565   <<Prev   1  2  3  ...  5  ...  7  8  9  ...  18  ...  28  29  Next >>