<< Back to Programming Forum   Search

Posts 1 - 20 of 26   1  2  Next >>   
AI capable of defeating Prod 2.0: 1/16/2023 04:03:20


Benjamin628 
Level 60
Report
https://www.warzone.com/MultiPlayer?GameID=33216911 Prod 1.0
https://www.warzone.com/MultiPlayer?GameID=33220618 Prod 1.0
https://www.warzone.com/MultiPlayer?GameID=33222360 Prod 2.0 with randomness

I have been working on this AI for over a year now, starting over several times. I think I have something that picks decently good and plays not terrible (I need to program in combos and coverage still, which are of course the hardest things to implement algorithmically).

Here's what my To-Do List looks like:
- Fix leftover movement - leftovers need to be moved to the target area (backwards BFS)
- Attack with higher, defend multiple territories - need to use heuristic based on income
- Expansion is pretty solid, make sure we go for 2 turn 11 when it's possible

I don't really want to post my educational GitHub account that hosts the project repository to the public, so please DM me if you're interested in the source code/explanation :)

Edited 1/16/2023 04:03:38
AI capable of defeating Prod 2.0: 1/16/2023 08:38:26


UnFairerOrb76 
Level 58
Report
Yo this is very cool, not seen a new AI in years!
AI capable of defeating Prod 2.0: 1/16/2023 10:54:03


καλλιστηι 
Level 62
Report
The true final boss is Wunderwaffe.
AI capable of defeating Prod 2.0: 1/16/2023 11:11:26


καλλιστηι 
Level 62
Report
Let me do a quick review of 3rd game. Hopefully it will help you improve the AI.
1) I don't like picks. Asia is a large area without wastelands, yet no early pick occupies it. Getting #1 #2 #3 results in a cluster and bad position.
2) Decision to go for Central America is a terrible idea because it is contested from the North AND South. It was a counter which should be used for breaking bonuses. Probably the best choice would be to just focus on breaking enemy bonuses.
3) like counter to South America turn 2
4) Turn 4 should move toward Indonesia
5) Turn 8 taking Antarctica was an absolute waste of armies
6) Turn 10 taking neutral in Australia was an absolute waste of armies


Your AI should learn delays: spam 1s transfers to make attacks after them happen later. It also failed to move armies to the front when it should have and rised into neutrals it didn't need.

I suggest you play games with reinforcement cards, as it rewards taking a territory every turn and changes the template a lot.

Edit: turn 6 in 2nd game, congo should have been taken with 1+1+3, not with 6.

Edited 1/16/2023 11:14:27
AI capable of defeating Prod 2.0: 1/16/2023 11:17:26


καλλιστηι 
Level 62
Report
It is your decision in which template you develop the AI. However, I would like to tell you, that Warzone has Wunderwaffe: an AI that is decent in Strat 1v1 and similar templates. The biggest contribution you can do would be to create an AI which can play on Biomes of America and similar maps, or Landria, or an AI that can play French Brawl and Yorkshire Brawl - no AI is even close to be able to play on these maps.

Wunderwaffe is very good in bullying noobs: https://www.warzone.com/SinglePlayer/Level?ID=1382522
https://www.warzone.com/SinglePlayer/Level?ID=1382856
https://www.warzone.com/SinglePlayer/Level?ID=1382749
https://www.warzone.com/SinglePlayer/Level?ID=1393325

Edited 1/16/2023 11:20:46
AI capable of defeating Prod 2.0: 1/16/2023 15:45:27


Benjamin628 
Level 60
Report
Hey thank you for the comment. I also think Wunderwaffe is incredibly difficult to beat for a bot. Will be putting in some more work to improve play!
AI capable of defeating Prod 2.0: 1/16/2023 22:24:45


Norman 
Level 58
Report
Nice work, @Benjamin628

I don't really want to post my educational GitHub account that hosts the project repository to the public, so please DM me if you're interested in the source code/explanation :)

From my experience, especially for junior programmers, just the fact of having a project on Github is a huge plus for potential employers.
AI capable of defeating Prod 2.0: 1/16/2023 23:55:57


l4v.r0v 
Level 59
Report
Nice progress!
AI capable of defeating Prod 2.0: 2/2/2023 21:36:17


ps 
Level 61
Report
nice!
AI capable of defeating Prod 2.0: 2/10/2023 09:48:19


Norman 
Level 58
Report
I'm not at all acquainted with mods and stuff. Is there a way for two bots to battle it out? At minimum there is the PlayBots: https://github.com/FizzerWL/WarLight.AI/blob/master/Common/PlayBots.cs but I guess you can't see the games afterwards (haven't used the bot interface in some time)?

If someone would challenge me, I would be up to update my bots. But I need some competition with smack talk and stuff.
AI capable of defeating Prod 2.0: 2/10/2023 10:52:33


Farah♦ 
Level 61
Report
As if you could write a competent AI, Norman. Enough smack?
AI capable of defeating Prod 2.0: 2/10/2023 11:15:01


TBest 
Level 60
Report
I'm not at all acquainted with mods and stuff. Is there a way for two bots to battle it out?


Well, not without hurdles. But if you really wanted yes. Mods are all in lua, so for a mod bot - you would need* to write in lua. This also means that you probably have some extra concerns with respect to performance. To compensate, you can store things across turns through. Having history would probably make bots stronger.

* Well, you could also take user input (and output). So copy out the game state, run a bot turn locally, then copy back in the orders each turn would be doable. Means you don't have a rewrite the bot in lua, but also manual effort so.

Basically, https://www.warzone.com/Profile?p=7263394758&u=AIServer%20Bot_1 , I think this is/was a much better way to play bots, instead of trying to use the mod framework.

Edited 2/10/2023 11:15:31
AI capable of defeating Prod 2.0: 2/10/2023 13:15:43


DanWL 
Level 63
Report
Looks like TheAIGames closed. Was looking at https://www.warzone.com/blog/index.php/2014/03/announcing-the-warlight-ai-challenge/ and hoping examples of AIs were still available
There is still https://www.warzone.com/Forum/141709-warlight-ai

Edited 2/10/2023 13:19:20
AI capable of defeating Prod 2.0: 2/10/2023 15:10:12


Norman 
Level 58
Report
@DanWL: Their business model was somehow centered around enabling companies to let their employees play in bot competitions against each other but apart from maybe 1 university I have never seen them getting any customers.
AI capable of defeating Prod 2.0: 2/10/2023 18:41:24


Benjamin628 
Level 60
Report
@Norman you can use the old Warlight.AI (yes, that old!) framework and just have your bot tell you what moves to make and you just commit them. I currently don't have time this semester to work on the bot, but we'll see around spring break time ;)

I'm willing to challenge, but currently Wunderwaffe thoroughly outmatches "Prime"
AI capable of defeating Prod 2.0: 2/10/2023 19:55:51


καλλιστηι 
Level 62
Report
You can't even store small bits of data in AI? That sucks.

@Benjamin, if you wish, I can help you with algorithm-making and tactics/strategies.
AI capable of defeating Prod 2.0: 2/10/2023 20:14:42


Benjamin628 
Level 60
Report
Awesome! I would love to get some insight on a really good picking algorithm. I think I have something alright now, but teaching the AI to combo and take 2-turn-12 for example would be incredible.
AI capable of defeating Prod 2.0: 2/10/2023 20:46:39


καλλιστηι 
Level 62
Report
The problem with picking is that going just for income usually isn't a good idea. Take this distribution for example. Northern Africa is a far better bonus, because it is safer (you just need to defend 1 territory) and lets you attack two territories in Eastern Africa.
AI capable of defeating Prod 2.0: 2/10/2023 21:37:03


καλλιστηι 
Level 62
Report
Let me post an algorithm that should produce decent picks for templates similar to Strat 1v1:
1) look for FTBs which you can complete from at most 2 picks. Firstly pick territories inside FTBs, then territories that let you complete a FTB.*
2) Make a map of bonuses. Remove bonuses, which are ineffective (+3 for 5 territories, +4 for 5, +5 for 6) or have a wasteland. I will call this map aux map.
3) Split aux map into regions. A region is a set of bonuses. The region is continuous (for any two bonuses in a region, there is a path between them that leads through the region) and maximal (adding any bonus will cause it to not be continuous). You can do it by BFS. No bonus should be in two or more regions.**
4) Remove regions whose bonuses have a total value lower than 5.
5) In every region, find the following picks:
a) picks in safe bonuses - bonuses connected to the region only from 1 territory. These bonuses must be completable in 2 turns.
b) counter picks - if you take one territory from that pick, you will border at least 2 bonuses in that region.
I will call all these picks potential picks.
6) Sort regions by the total value of bonuses they contain descending. Pick 1st pick in the biggest region, 2nd in the second biggest etc. If a region doesn't have a potential pick, skip it. If it has multiple, pick just one.
Tiebreaker #1: be safe picks.
Tiebreaker #2: smallest bonus.
Tiebreaker #3: bonus connects to as many bonuses in region as possible
Tiebreaker #4: random

7) Repeat 6 until you run out of potential picks with the following changes:
a) if there is a region of value >=12 without potential picks, all picks in it are potential. Though don't put more picks in that region than to any other region.
b)
tiebreaker #0: If the bonuses of the new pick borders one of your old pick, go for that.
tiebreaker #0.5: If the bonuses of the new pick borders connects to your picks via 2 or more bonuses, go for that.

8) If you still don't have 5 picks, consider safe bonuses in regions with a lower value than 5 (the bigger value of the bonus the better), then counter picks in ineffective bonuses, then pick something in a region where you don't have any pick. Then just pick +3s, +4s, +5s which are not ineffective.
9) If you have 5 picks, you can place 6th pick on a territory that neighbours your 4th or 5th pick's bonus. (if you get 6th pick, enemy has your 4th and 5th picks).


*FTB picks should be before picks made in 5). Probably the most annoying distribution to deal with are FTBs which border 2 green territories (so if you have 2 territories, the opponent can still counter from 3rd). You can deal with them by just not flagging them as FTBs.
** map specific, but if there is a huge region going through Australia, break the connection between Australia and Indonesia for region making purposes, but keep the connection when checking for safe bonuses & counters.

Edited 2/10/2023 22:07:26
AI capable of defeating Prod 2.0: 2/10/2023 21:45:40


καλλιστηι 
Level 62
Report
Distribution


Regions


Potential picks


Picks
Posts 1 - 20 of 26   1  2  Next >>