<< Back to Warzone Classic Forum   Search

Posts 511 - 530 of 565   <<Prev   1  2  3  ...  14  ...  25  26  27  28  29  Next >>   
WarLight AI Challenge: 6/26/2014 08:10:14

GreenTea 
Level 60
Report
>> I don't think GreenTea meant your bot.
Yes. Im about Blender, when he come to North Africa with 20 army and then just stop after not seeing enemy..
WarLight AI Challenge: 6/26/2014 16:41:23


Trogatog
Level 52
Report
Yes. Im about Blender, when he come to North Africa with 20 army and then just stop after not seeing enemy..
Ahhh, gotcha. My mistake! :)

Anyhow, here you got crushed by a really hardcoded bot:
Yes, my bot is not smart by any means. I just programmed enough to (mostly) beat the starter bots that are in the queue right now.

Edited 6/26/2014 16:42:53
WarLight AI Challenge: 6/26/2014 20:41:55

Ikalgo
Level 50
Report
Norman, there are currently 4 exact same bots like your "OneLiner" bot in that competition :P

On the contrary, having learned from this competition (thanks guys!) I wrote my bot in the most general way with some opponent modelling and it really works well!

Edited 6/26/2014 20:45:51
WarLight AI Challenge: 6/29/2014 05:18:26


Norman 
Level 58
Report
Hello

I just uploaded my bot at github:
https://github.com/Norman1/SupremeDalek

You can use my code to write your own bot or improve your bot. The code should be relatively easy to understand and I wrote lot's of comments.

Those who followed the AI challenge might have noticed that I stopped updating my bot long before the finals. It was to time consuming for me. However I'm still interested in designing a warlight AI capable of beating an average human player. For me it's about the beauty of seeing my bot play not primarily about the competition. If you wrote a hardcoded bot your bot does exactly as you tell him. However SupremeDalek consists of lot's of small heuristics and when working together they result in smart warlight play capable of solving situations that I haven't thought about when writing my bot.
WarLight AI Challenge: 6/29/2014 21:43:28

GreenTea 
Level 60
Report
https://github.com/Norman1/SupremeDalek/blob/master/src/model/MapModel.java
method calculateEnemySuperRegionsFromDeploymentInput
nice for loops xD
WarLight AI Challenge: 6/29/2014 23:09:48

GreenTea 
Level 60
Report
https://github.com/Norman1/SupremeDalek/blob/master/src/basicAlgorithms/DistanceToOpponentBorderCalculator.java

Much easy to implement this functionality using general breadth-first search with passing callback which will be triggered on every visited region (pattern visitor).
WarLight AI Challenge: 6/29/2014 23:11:40

GreenTea 
Level 60
Report
WarLight AI Challenge: 6/29/2014 23:56:01


Norman 
Level 58
Report
Hello

Yes, the nested for loops are poorly implemented to get all possible permutations. However I think the MapModel class is the only class difficult to understand while the other code is super simple.

With the code duplication you are also correct but this should be the only code duplication that you find. I'm not an expert on all possible shortest path algorithms and I only thought about my algorithm for a couple minutes and then implemented it.
I'm not sure about other algorithms but my implementation suits my needs fine and has following benefits:
- Only needs to calculate the shortest paths once a turn for the whole board.
- If there are two ways to move fastest from A to B then I can use this for order delay moves. (wanted to implement but didn't)
- If region A is better than region B (while both on shortest path) then I can move to region A (didn't implement)
- If a region has opponent presence I can exclude that region to move around the opponent (also possible with other algorithms)

Edited 6/29/2014 23:57:50
WarLight AI Challenge: 7/1/2014 23:03:58

GreenTea 
Level 60
Report
Some random remarks

https://github.com/Norman1/SupremeDalek/blob/master/src/evaluation/RegionAndSuperRegionAnnotator.java
subRegion.getPlayerName().equals("neutral")
Many such magic string constant usage. Could be replaced with static final variable.

Also comparing string is slow operation. For my bot I had replaced owner with just integer number.

https://github.com/Norman1/SupremeDalek/blob/master/src/evaluation/GameStateCalculator.java
in method isStalemateSituation2 used magic constant number 4 for number of neutral regions of bonus. What about unusual maps with, for example 10 regions per bonus?

https://github.com/Norman1/SupremeDalek/blob/master/src/evaluation/RegionValueCalculator.java
if (region.getSuperRegion().getId() == 6) {
					region.setAttackRegionValue(region.getAttackRegionValue() + 4);
				}
				if (region.getSuperRegion().getId() == 2) {
					region.setAttackRegionValue(region.getAttackRegionValue() + 3);
				}

Hardcode not usable on other maps. Also what if on same map ids of regions will be changed?

Also in many classes (BotState state) is passed as argument to static methods. In this case Better to make methods not static, and put BotState state as field of corresponding class. And then access methods via instance of class without need to pass BotState every time.

https://github.com/Norman1/SupremeDalek/blob/master/src/evaluation/SimpleHeuristics.java
calculateMostDesirableSuperregion - income of region is not taked into account.
Imagine that you have one bonus with 5 regions and 10 income.
and other bonus with 4 regions and 1 income. And in both bonuses you have 1 captured region.
Then your method will return second bonus as more desirable.
WarLight AI Challenge: 7/2/2014 06:42:00


Norman 
Level 58
Report
Hello

The class RegionAndSuperRegionAnnotator isn't used and neither isStalemateSituation2.

Also in many classes (BotState state) is passed as argument to static methods. In this case Better to make methods not static, and put BotState state as field of corresponding class. And then access methods via instance of class without need to pass BotState every time.
I probably think of those classes as utility classes. However if performance was an issue with my bot eliminating BotState as a parameter wouldn't help since BotState is stored on the heap.

Anyhow, I didn't upload my bot to discuss low level coding stuff nor did I claim that he was completely properly coded. I also never claimed that my bot works on all maps nor do I think that your bot does. A test would be if your bot can defeat the warlight AI at the Big Europe map map and if yes, if he can also defeat the warlight AI on this map with 0 neutrals.

I think my bot can help other warlight players who want to write a bot or improve their bot. It's not about whether I used Integers or Strings as parameters but for example my way to determine the move order or my thoughts when evaluating a region.
WarLight AI Challenge: 7/2/2014 08:30:37

GreenTea 
Level 60
Report
ok. it was just what I saw first of all when reviewing your code during 15 minutes :) Unfortunately have not much time to analyze AI algorithms, etc..
WarLight AI Challenge: 7/2/2014 19:59:17

{rp} pedrito 
Level 48
Report
We get extra cash for winning the institute prize :)
WarLight AI Challenge: 7/2/2014 20:30:37

{rp} pedrito 
Level 48
Report
Also here's the source for pedrito:

https://github.com/pedritoelcabra/pedritobot

It's messy and ugly. I need to be more organized and methodical for the next competition...

Note the four map-specific routines I had prepared but then disabled for the final version. They did reduce my performance. I should have left this one in though, now that I think about it:

    // catch a bot going for early europe - Blender!!
    if(($map_name == "small_earth") &&
            (!count($map->prov_in_bonus(6, $map->player_two))) &&
            (!count($map->prov_in_bonus(2, $map->player_two))) &&
            (!count($map->prov_in_bonus(6, "unknown"))) &&
            (!count($map->prov_in_bonus(2, "unknown"))) ){
        
        if(($round == 1) && ($map->regions[12]->owner == $map->player_one) ){
            toLogX("enemy going for europe... going for break!");
            $map->proposed_moves[] = new CMove(10, 5, 5, 12, 6, 12, 21, 0);
        }
        
        if(($round == 2) && ($map->regions[21]->owner == $map->player_one) ){
            toLogX("enemy going for europe... going for break!");
            $armies = $map->regions[21]->armies - 1 + 5;
            $weaker = ($map->regions[18]->armies < $map->regions[20]->armies ? 18 : 20);
            $map->proposed_moves[] = new CMove(10, 5, 5, 21, $armies, 21, $weaker, 0);
        }
    }


It needs some tweaking against the current version of Blender though because it seems that he now always takes one SA pick in addition to Europe.

Edited 7/2/2014 20:40:21
WarLight AI Challenge: 7/3/2014 01:59:01


Norman 
Level 58
Report
Hello

Very interesting bot. Pedrito always seemed the strongest bot analyzing the map and now I see that you indeed had some interesting ideas to predict the opponent moves and predict what is going on behind the fog. Also your sucker_punch is interesting.

I will take a closer look at your code.

Edit: The anti Blender code in action:
http://theaigames.com/competitions/warlight-ai-challenge/games/53b4be1b4b5ab20b42236dca
I knew your bot couldn't be 'that' good to dynamically go strong into North Africa instead of taking his bonus.

Edited 7/3/2014 02:42:10
WarLight AI Challenge: 7/3/2014 11:00:01

{rp} pedrito 
Level 48
Report
Sorry to disappoint you Norman, but that is not the anti-Blender code. It is indeed completely dynamical.

First of all, the anti-Europe routine is part of the hardcoded map-specific stuff that only was active for some days in May when I was trying it out. It has been disabled for the finals and still is, and it's only still in the source for reference.

At the beginning of bot.php:
$use_map_specific_strategy = ""; // No map specific stuff will be used

Second, it would ONLY work on turns 1 and 2, and ONLY when the enemy has no presence in either SA our Australia. So against the current version of Blender it would be completely useless.

Have a look at the logfile for this game to see what's really going on:
The first digit on the line is the turn number. I have left only the relevant parts.
...
1 opening move
1 1 of my good provinces have enemies adyacent: 10
...
1 reinforce:
1 joining up armies inside bonus Oceania(6)
1 proposed to transfer 1 armies from 42 to 41 (priority1)
...
2 opening move
2 going for attack!
...
3 hiding place Europe(3): 16 spare armies and needs 15 to complete bonus
3 initial stage is broken because we have expanded
...
3 attitude towards Europe(3): break
...
3 break proposed priority 8: deploy 0 - 5 at 12Brazil and attack 21North Africa
...
4 attitude towards Europe(3): get presence
...
4 proposed to destroy enemy at 18Western Europe, from 21North Africa (deploy 0, attack with 2) priority 6
...
4 increased attack amount of the only attack leaving 21North Africa
...
---------------------------

It hasn't always worked so well... but it makes me very proud when it does like in this case.

I know what some of you are thinking: "WHAT!! Thats hardcoded! Your bot is talking about Europe and all kinds of map specific stuff in the logfile!"

That's only part of the logging function. Yes, on any different map it would throw an out of bounds array error and I would have to disable that particular logging embellishment, but the actual gameplay decisions are not linked to any predefined values but made up 100% on the fly.
WarLight AI Challenge: 7/3/2014 12:30:40


Norman 
Level 58
Report
Hello

The new version of my bot (not online yet) also looks at missing opponent deployment to gain intel about the opponent bonuses before the opponent shows his newly acquired income. However my bot is much more careful with his assumptions than your bot is.
- My bot needs intel that the opponent has at least one spot in that bonus.
- I only consider missing deployment for the last 4 turns.
- If there are to much territories missing my bot doesen't assume the opponent took the bonus

First my bot was more bold with his assumptions but I ran into the problem of getting many false positives.
- The opponent might deploy in the background and move his stack to the front (often mathematically the better option when not getting first order)
- I could consider the amount of armies the opponent has visible to eliminate some missing deployment. However the opponent might also have lost some armies in a fight,... Is there even a way to tell how many armies the opponent lost in a fight? He might have lost armies in a fight and also transfered the same turn from the background to that region.

So what happened was stuff like my bot thinking that the opponent took Asia from Australia as I lost sight for a couple turns. What happened however was that the opponent built a huge stack to break Africa / South America.


I find it strange that your bot is able to tell Europe since he probably didn't lost a spot there. What is special about Europe?
- Europe has the best income / territory ratio?
- Europe is the only bonus that pedrito isn't bordering?
- North America / Asia take to long? Why then not Africa? Especially since Africa has less territories than Europe.



Edit: Looking at the thoughts of your bot, your bot is a 'macro bot' while SupremeDalek is a 'micro bot'. Your bot looks at the big picture and then calculates a doable and worthwile strategy to cope. SupremeDalek however is all about which regions are more worthwile than others without following any explicit strategy. That's why SupremeDalek plays so strong when stuff gets messy since he always knows what spots matter a little bit more than others.

Edited 7/3/2014 13:08:23
WarLight AI Challenge: 7/3/2014 14:14:45

{rp} pedrito 
Level 48
Report
Yeah I commented on this big difference between Dalek and pedrito some pages earlier. Dalek builds on territory values while pedrito builds on values from move-types.

I think your approach is indeed more solid and versatile, although my bot is definitely one of the tougher bots out there once the game breaks up.

I decided long ago that for the next competition I would include influence maps, so that information about territory value can be calculated each turn much like your bot does.

Why Europe? Africa and NA are visibly not owned by Blender, SA and Australia are disputed, leaves Europe and Asia. Europe is smaller.
WarLight AI Challenge: 7/3/2014 14:51:45


Norman 
Level 58
Report


Now look at that...
WarLight AI Challenge: 7/3/2014 20:30:24

GreenTea 
Level 60
Report
Photoshop..
WarLight AI Challenge: 7/4/2014 03:34:49


Norman 
Level 58
Report
Nope.
Posts 511 - 530 of 565   <<Prev   1  2  3  ...  14  ...  25  26  27  28  29  Next >>