We recently added a feature to Powargrid we are very excited about: a framework/interface that allows you to program your own AI to pit against yourself, your friends, and other AIs!
User AIs are written in the Lua programming language, a very popular programming language for scripting and modding games. Famous examples include Civilization V and World of Warcraft.
Add-ons (just user AIs for now, but maybe we'll add custom maps later!) are loaded from the Addons directory, but you have to enable this first. To enable add-ons, go to the Settings menu, select Add-ons, and check the "Enable add-ons" box. This lets you run AIs you've put in the add-ons directory. If you want to write your own AI, also check the "Enable dev tools" box. This enables the debugging console in skirmish games with user AIs.
There's a button to open the directory in a file browser; it's located at .../path/to/Powargrid/Add-ons/AI. Inside you'll find a directory containing "Daft Wullie", our example AI. It's named after a Discworld character, because we are both huge Terry Pratchett fans :)
The next posts will discuss the debugging tools we've included to help you write your own AI, the functions you have available to do so, and a bit about the technology behind the user AI framework, for those that like to take a look under the hood. Stay tuned!
In 1v1 playtesting, we found that the first player has a small, but definite advantage. We wanted to give the second player a small benefit to offset this. However, we weren't sure what an appropriate compensation should be. So, we're leaving it up to the players!
We've defined a couple of second player "perks". For example, you could start with a substation already built. Now, when starting a multiplayer game, you roll the dice to see which player gets to pick the perk. Then, the other player gets to choose if they want to go first, or if they want to take the perk (and go second).
We're hoping this will let people balance out the perceived strength of the different options, according to their taste. The current perks are just a first attempt, so don't expect these to be final!
New achievements! Fancy graphics settings! Three campaign difficulty settings! A peek at all the campaign levels even though you won't be able to play them in the demo! Gratuitous exclamation marks!!
So yeah... try the new version now!
We've also released a new Linux version, although we're unable to test it ourselves at this time. If you want to give it a spin and let us know how it goes, that'd be great!
Sometimes you fix a bug and you're almost sad to see it go. In this case, we finally fixed the one where the game would spawn an additional AI (computer player) when you return to the main menu scene after playing a skirmish map. That means that you have three computer players controlling two teams, so they start taking each other's turns, which means the game goes crazy and it's awesome :)
Holy ****, look at what we found in our mailbox this morning! :O
We're gonna be on Steam! Woooooo! Thanks for all of your support!
Mildly excitedly yours,
Willem and Michiel
Hi! Michiel here, and I've been playing with the Unity animation system. Pretty cool! Never done anything like this, so I just wanted to give you a peek at what I'm working on.
One of the factories in the mission we're working on has a huge fan on the roof, and of course that's gotta get blown off when you destroy the factory. I've done most similar effects using the physics engine, but in this case I needed more control than that would give me.
Unity has a very nice system for creating animations. You just set up a few key frames: after one second, I need this thing to be here, and oriented like this. Then, a little later, it should be here. The animation then interpolates between your key frames, making everything nice and smooth. You can even "animate" other things: the pitch and volume of an audio source, for example. That's all in the curves you see above. Finally, you can trigger events at certain times. For example, when the fan detaches, it triggers a particle effect and a nice KA-THUNK sound.
Well, enough talk - let's have a sneak peek!
Today is my wedding aniversary and I actually remembered :). This means I won't be working on Powargrid tonight, since I'll be taking my wife out to dinner. Which is slacking through celebrating, a.k.a slackibrating.
On the non-slacking side of things, I've taken next week off from my dayjob so I can get some more Powargrid work done (and perhaps catch up on some lost sleep too). With that in mind, Michiel made some tweaks to the dialogue system yesterday (which I couldn't have made myself), which allow me to finish the dialogues for the factory mission. So that's at the top of my to do list for next week.
In other small news, some more people gave us feedback on Powargrid last week, and it was all positive :). On top of that, we understood that they did't just play for a few minutes before forming their opinion, but that they actually played through a significant number of the available campaign missions. It's great to get confirmation that we're building something cool.
Also, I've noticed that slowly but certainly I'm getting more comfortable with the idea of marketing our game. Having read quite a bit on the subject, I already knew that marketing is something that is both necessary and doable for indie studios. And that, if it's done right, marketing is also beneficial for the people you're marketing your game to (instead of being annoying). But knowing these things are quite different from actually talking and writing about Powargrid.
This blog was a good first step, followed by joining Twitter (as a studio, @WeeFreeStudio, and personally, @Fuddleclutch). And demo-ing our game at the Dutch Game Garden was also very cool and insightful. So I'm quite confident that by the time we finish Powargrid, we'll have the skills to set up a marketing campaign to match the quality of the game we're building. It's probable we'll write a separate blog post about our marketing experiences once we collect some more of them.
Finally, here's a development picture of the Factory Mission that Michiel Tweeted last night. It features a delete button for destroying buildings and the option to use more power than you actually have. I'm sorry to say that we won't let you wield that kind of power in the actual game ;).
Anyway, that's all for this short update. I'll be sure keep you posted on the progress I make next week.
- Willem -
We just uploaded a new alpha version for you to play with! The big change is the completely redesigned second campaign mission, "All His Base". Some players found the old version to be quite confusing, and it was a bit of a slog to play through. It should now be clearer, and a lot more fun to play. Plus, we think it's rather pretty! What do you think?
We also added a couple of achievements, and the dialog text now "fades in" over time. You can make change the speed in the settings menu, by the way.
What happens often in game design / game creation is that something looks quite simple on the surface, but turns out to be much more complex once you get down to the details. Or it IS simple, but will take a lot more work to get done than you anticipated beforehand. Both these issues can dramatically increase the time you need to create your game, and they make it easy to bite off more than you can chew. I recently read an article from Chris DeLeon (a.k.a. HobbyGameDev) in which he touched on this subject. Since we've encountered our fair share of these time-consumers in building Powargrid, even though it's a relatively simple game compared to the big titles out there, I thought it could be illustrative to walk through a couple of examples here.
We've seen the 'takes much more time than we thought'-effect most often in creating missions for the campaign. The main reason for which is that we're not willing to compromise the simplicity and elegance of the basic game rules for the sake of the campaign. One of the key characteristics of Powargrid is that the gameplay is complex even though the basic rules can be explained in two and a half minutes. We also consider that one of the game's strengths, so we're careful not to break that. For other games, the reasons unexpected things crop up will usually be different. But they'll be there nonetheless.
Using the Powargrid mechanics and our AI, it's quite easy to set up a skirmish-like mission where both you and your opponent get some power plants and then battle it out. And to be sure, a number of missions in the campaign are just that. But using nothing but that setup doesn't give players the excellent experience we're hoping to provide. So we want to make more interesting missions, but that also means they become more complex to design and build. On top of that, a lot of the earlier missions in the campaign also function as tutorials, which also places extra demands on mission design.
In building the mission we're currently working on, quite a few unforeseen things cropped up. And while the time loss is annoying, it does give me some good examples for this post :). The basic idea for the mission is simple; destroy five factories that belong to the yellow blobbies.
The Mission Concept
When I drew the concept for this mission, I naively thought that this would be one of the straightforward ones. Turns out I was wrong. It quickly became clear that just having a few extra buildings to blow up wasn't fun enough. It adds a bit of an extra element because destroying a factory opens up a big chunk of the game grid at once. And while that rewards you for carefully timing a factory's destruction, it wasn't enough. On top of that, if all other buildings need power plants to run, it's not exactly logical that factories (which usually are pretty energy-intensive) magically power themselves. Luckily, both problems could be solved by simply placing a power plant next to each factory, which in turn uses up all the power that power plant produces. That wasn't very complicated or time consuming yet, but it did set the stage for more complications.
In the original design I gave the AI two power plants, just like the player. But with these extra yellow power plants the AI gained 50 power per turn to use against the player each time a factory was destroyed. This added an element of danger to the mission, which was certainly fun to play against, but it also meant that balancing the mission became an issue. The mission could quickly become too challenging, especially for players who don't read dialogues and thus might remain unaware of the AI's power boost until it's too late.
After a number of iterations, we settled on a combination of four adjustments:
Do factories conduct power? An easy question, since all buildings in Powargrid conduct power, so why not factories? Well, we found that it looks strange when the AI builds in a spot that only touches a factory. As a player you get the feeling that the AI is cheating when it does that. Michiel had to do some retooling on a basic level for the buildings to add the possibility to not conduct power. This is not complex or hard to do, but it is another one of those things that we did not foresee in the mission concept, yet do take extra time.
In some missions, you know beforehand that getting the dialogues right will involve more work than 'just' writing them and then slapping on some triggers so they get displayed at the right moment. When I started writing the dialogues for this mission, I thought they'd be pretty straightforward. Some mission explanation, some background, some banter and an explanation for each of the five factories. Easy enough, right?
But then I realized there was a catch. The best moment to explain what each factory does is when it stops working, which happens either when it's destroyed (duh) or when its power plant is destroyed. But these situations are different enough that, in my opinion, they can't be covered by the same dialogue without making the writing too contrived.
What happens if multiple factories are destroyed at the same time? The simple thing is having the dialogues pop up one after the other, but that makes the dialogues feel disconnected. The way-too-much work option is to write a separate dialogue for each possible combination of factories.
And what if a factory is the last factory to be destroyed? That calls for yet another different dialogue for each factory. And that's before differentiating between whether or not the yellow blobbies still has power plants up when you blow up the last factory.
So much for 'easy enough'. We tried multiple approaches to find a spot where dialogues feel right and the amount of work is less than ludicrous :). As an example, having the dialogues trigger at set moments during the mission, irrespective of whether or not a factory is still in operation, felt way too tacked on. On the other end of the spectrum, writing dialogues for every possible scenario is out of the question because of the sheer number of possibilities. Eventually we settled for a dynamic system that triggers whenever a factory is destroyed and can also handle multiple destroyed factories at once. Unfortunately that does take some retooling of our dialogue system (and thus more time), but by now I think it's clear that's not an uncommon price to pay. This is now at the top of our to do list.
The AI is Confused
There are a couple of things in this mission our AI is ill equipped to deal with. Since this blog post is already very long, I'll mention one. Our AI has a defense routine which usually works fine, but which is inefficient for power plants not at the edge of the game grid. The AI builds a lot of power lines to claim territory, even though a single power line in a strategic spot would also do the trick. The simple fix (or perhaps workaround would be a better word) in this case was to add power lines in those strategic spots. But if that hadn't been possible or if we'd wanted a more basic and universal solution, we'd have had to (re)write a large amount of AI code. So even though we got off light there, this could easily have been another big issue we hadn't foreseen when we first designed this mission*.
So even though Powargrid is a relatively simple game (to learn, though not to master) with a small number of clearly defined rules, we still run into many issues that complicate design and take up a lot of time. And what I've shared here is only what we encountered in one of the fifteen missions for the campaign. And the complexities and time sinks multiply quickly the bigger and more elaborate your game becomes. so in my opinion, Chris' advice to start with a modest first project is very good indeed!
PS; I shall now spam the obligatory links:
* And we're not done yet with this mission. Among other things, we still need to decide whether the AI needs to defend the factories in a more active manner. But luckily, that's a simple thing and implementing it will hardly take any time at all, I'm sure ;).
Just a quick test to see if this shows up both on Twitter and our new Facebook page. Also, have a picture of the mission we're currently working on!
We're Michiel and Willem. Hi!