Powargrid
  • Home
  • Blog
  • Buy
  • Demo
  • Media
  • Press
  • The Daily Blobbie
  • Blobbie Meme Maker
  • Forums

One AI Wai

9/6/2017

0 Comments

 
Today, a short blog post about something we didn't do instead of a long one about something we did :). As mentioned in the last blog post, we haven't included support to add one or more AIs to games with 3+ players. Here, I'll dive into the two issues that make this difficult enough to justify (in our eyes) not adding this in the multimultiplayer update.

First off, ​playing with more than two players (or teams) adds a formidable amount of complexity to Powargrid. Determining the game state and choosing which opponent to attack becomes much more difficult, since you don't just have to evaluate which target can most easily be reached, but also which opponent is the most dangerous to you. Attacking a weaker opponent can be bad for you if that gives a more dangerous opponent time to build up superior defenses or (worse) pull ahead on the number of power plants.
So sometimes you want to refrain from attacking. Or perhaps you want to put weapons down that threaten a player's base without actually charging them, awaiting the opportune moment or forcing them into a (temporary) alliance with you.
Which brings me to the social aspect, which is an even harder problem to tackle than the one above. While entering into formal(ish) alliances is rare in games like these, informal, spontaneous unspoken ones are quite usual. I usually see those as a small version of 'live and let live' arrangements that sometimes emerged during WWI, including all the fragility and vulnerability to (perceived) missteps those had. Luckily Powargrid is a lot less lethal.
Both the tactical and the social aspects are needed in an AI, at least to a certain degree, to prevent the AI from being too stupid, too frustrating or both. An AI that consistently attacks the weakest player and then gets overrun itself is no fun.
As an example, take a look at the gameplay GIF I included in the last blog post:
Picture
If you look closely at the gameplay, you'll see that yellow keeps attacking green, even though blue is clearly (to the human eye) the largest threat. Once green has only one power plant left, blue moves in to destroy yellow in a swift attack while ignoring green. Yellow didn't see this coming and didn't have the resources or defenses to repel the attack. After this, green's single power plant was easy to pick off for blue.
Perhaps not surprisingly, I recorded this GIF by playing (with blue) against three Skrimish AIs. And since my aim was to create a nice-looking GIF, I didn't even fully exploit the tendency of the AIs to go after each other. I hope this gives you a feel for why creating a Powargrid AI fit for multimultiplayer games is difficult :).
The second issue in creating a multiplayer AI crops up when you play in teams. The problem I described above goes away if the players are divided into two teams. But then the AI(s) will need to cooperate. And while I think anything beyond 'kill the other team' is a bonus, this doesn't hold up when it comes to blocking, which we found out when building the seventh campaign mission: A Piece of Paradise.
Picture
It turned out that the AIs often blocked each other, since they can't use each other's network, can't shoot through their team mates' buildings and can't sacrifice buildings to make room. The consequence of this was that the blocked AI started to build lots of power plants, eventually making the mission unwinnable. This was before the cost of power plants went up the more you had, but even now, the AI would just spam out lots of substations. Which looks stupid (imho), impairs its ability to build weapons to defend itself and creates a frustrating grind the player has to go through to get to the enemy power plants.
In this mission, we solved this by defining sections of the grid that are forbidden in the pathfinder. Michiel expanded our A* algorithm for this purpose (for more about that, see this blog post). In the picture above, the path yellow has used to get to blue's base is forbidden for green. The forbidden tiles for yellow lie on the outside of the grid.
While this is a good solution for A Piece of Paradise, it would be a hell of a job to implement this in a general sense. Hardcoding this into each AI for every map, every starting position and every possible distribution of players in teams is obviously way too much work. But writing something general is difficult, espectially if you want the AIs to be able to communicate about this. Also, sometimes it can be a very good move to block your team mates, since that may save them from an incoming attack.
So this is also a difficult nut to crack. And even then we're only looking at the first step of cooperation.
So that's why we haven't included adding AIs to 3+ player games in the multimultiplayer update. And to be honest, I don't think this is something we'll add in the next update. We' But we will keep this in mind.

I guess that the short blog post turned out to be a bit longer than I'd thought, but I hope you liked it :).

-Willem-

PS; don't hesitate to let us know if there are Powargrid features you'd really like to see or if there is a subject you'd like us to address in a blog post.
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Author

    We're Michiel and Willem. Hi!
    This blog is about the development of Powargrid and our experiences in doing so.

    Archives

    June 2017
    May 2017
    November 2016
    October 2016
    September 2016
    July 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    March 2015
    January 2015
    December 2014
    November 2014
    October 2014
    September 2014
    July 2014
    June 2014
    May 2014
    April 2014
    March 2014
    February 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    September 2012
    August 2012

    Categories

    All
    Game Design
    Marketing
    Progress
    Slacking
    Tech

    RSS Feed

© Wee Free Studio | Steam | Twitter | Facebook | RSS feed | Press | Contact