Thursday 24 December 2009

Sync Error 2

I fail at network programming. Sync errors, buffer overflows, goodness knows what is going on. I may as well just declare this to be a single-player game.

I envy Vic Davis having the balls to release a game that handles multiplayer by just saving turns to a file and asking you to email them between players yourself. It doesn't do anything for you.
Maybe not the best idea though. Don't know how his sales are going, but I'm having a hard time finding anyone to play Solium Infernum with, so that's probably not a good sign. And there was really positive press about that game too. I guess indie multiplayer games are just a bad idea. Even Multiwinia did poorly apparently. Sucks.

Sync Error

The network code is mostly in working order now, which is great. I've been playing some multiplayer against my wife. I just win with no effort in a one-on-one game, but if we add in some AI allies it can make it fairly balanced - she gets a Hard AI on her team and I only get an Easy one.

But it sometimes gets out of sync. And I have no idea why. Sigh.
I can detect it when it happens, so I could just send the entire game state across to get it back in sync, but I want to try to fix it so it just doesn't happen at all.

Also, Mouse Maze 2. Tomf has been at it again! Now with achievements and thinner walls.

Tuesday 22 December 2009


I managed to get a couple of other PhD students at my university interested in Mouse Maze - they've been running variations on my genetic algorithm method and Andy's gotten his score up to 34,188, which is fairly impressive. My best is only 20,158. (Tomf did fix the 200 visits bug; first he just pushed the limit up to 1000, which we then proceeded to achieve, but I think he's fixed it properly now.)

Need to get around to beating Andy sometime, I think it's mostly just a matter of CPU time spent, but more important right now is Vertex Dispenser. I've been saying for a while that I only needed to spend a few days focused on it to get things like the multiplayer working properly, and now I am trying to do just that. So far I've managed to get the netcode back into the state it was a year or so ago - so it basically works, isn't jerking about wildly and constantly throwing error messages, but will probably get out of sync occasionally still. Plus there are going to be problems with sounds that get started, turn out not to have ever happened, and never end up being stopped. Still, progress!

Friday 20 November 2009

Mouse Maze: Obsession

Have become obsessed with maximising my Mouse Maze score. I've improved my search algorithm, and I've found mazes with scores up to 9960 and 642. Haven't input this to Kongregate yet, just because the maze will take so long to run - Tomf really needs to add a fast-forward button (also more graduations of colour - he really wasn't expecting anyone to get scores this high; more on that later).

Nobody's competing with me for top scores, which is a little unfortunate - that would be more fun, but it's still interesting to compete with myself and see how high it's possible to go. Apparently Tomf's code uses 1000 as the visited value for walls (just picking an arbitrary big number he thought nobody would ever reach), so if I can get the mouse to visit a tile more than 1000 times, it will power up and start walking through walls. This is my goal: break his assumptions and break the game. I'm only in the 600s at the moment, but there's some vaguely exponential behaviour which causes it to sometimes increase in fairly large steps, so I may not be too far off:


In this configuration, if the mouse is at C and has visited A N times, then it must visit each of B and D N times before it will return to A, and in the process it will visit C 2N times.

Edit: I ran a maze that should achieve 642 visits to the same tile, but at 201 the mouse levelled up and started crossing walls. So I'd gotten the value wrong; I've broken the game already. Awesome. I feel a sense of achievement - I now have the actual maximum possible score given the current implementation. Am now hoping Tomf will fix it so I can have a higher score.

Wednesday 18 November 2009

Mouse Maze

Tomf made a puzzle called Mouse Maze. The basic concept is that it solves mazes with a ridiculously inefficient algorithm, and you have to find input to maximise the inefficiency. It's quite easy to make a maze that takes a few hundred steps, but after that it gets difficult.

For a long time, this very elegant maze was the second highest scoring, at 1135 moves. As it was saved to the folder of shared mazes, lots of people ran it and got the same score, but there was one single person with a higher score of 1223, with an unknown maze. Then recently someone came up with this maze, giving 1364 moves, and saved it, so it was possible for anybody to reach the top of the score table.

When Tomf told me someone had found and shared a better maze I was a little disappointed - I'd liked the mystery of the top solution being unknown. I have now fixed this; see the high score table.

Thursday 5 November 2009

Pulse Wave (GREEN)

The effect of pushing away adjacent players/robots was originally on an ability named Kamikaze. The main effect was to suicide while doing lots of damage to anything nearby, but I threw in the pushing effect as well on the grounds that interesting interactions were bound to emerge from it somehow. Eventually I figured out what these emergent interactions are, and they're pretty cool, so when I cut Kamikaze, I went looking for where else this effect could be applied. Pulse Wave had been looking a little overpowered, and funnily enough, on it the pushing is actually something of a disadvantage - when you've stunned someone you want them to be next to you so you can attack them. I was pleased to be able to bring Pulse Wave down in power level and keep the interesting interactions from pushing things all in one move.

Tuesday 3 November 2009


Haven't had much time for working on Vertex Dispenser lately. I was near to a proof of a problem I've been working on for a while, so I've been working hard on that trying to get it out. That done, today I've just been slacking off, but I'll be back to work tomorrow. Vertex Dispenser is in a state where it really needs some dedicated time spent on it to finish it off; I've run out of little things I can do between the work I'm supposed to be doing; so probably I won't get it done until the Christmas break. I've lots of new ideas for games swirling around, but again they'd need a dedicated coding session to get them off the ground. Maybe I should get into making board/card games, so I can cut out the hard work of programming and just get straight into design.

I've entered the IGF, so we'll see what comes of that. There are three hundred entries, some of which I know to be excellent, but most of which I've never heard of. Who knows. Also got around to registering, as I've been meaning to for a while.

Monday 19 October 2009

Protection (GREEN)

In general, the abilities introduced in the first campaign are the ones I first put in the game, while the other ones I added later when I came back to it with new ideas after a break. Protection is the exception. Repair Swarm had its place originally, but players were being confused by it because it works in a slightly weird way - they were doing things like activating it when they were nearly dead, expecting it to repair them immediately. I realised that if they'd had Protection instead, it would have done exactly what they wanted then - Protection was the ability they were intuitively wanting to use - so I swapped them. It seems better to have the easier-to-use stuff introduced first, and the more confusing stuff later. An improvement! Hooray!

Monday 5 October 2009

Star Attack (GREEN) and Blog Explanation Procedure

There's not much to say about this ability - it's been in there from early on, has changed very little, and is very easy to understand how to use - so instead I'm going to provide an explanation for these posts.  People have told me for a while that I should start a blog, so finally I got around to it, but had no idea how to start writing in it.  I'd put the name Mighty Vision as the blog title (being an ability in the game I'm working on), was staring at it trying to think how to start writing, then I thought "alright, it says Mighty Vision there, so I'll just write about that".  So now I'm writing a series of posts about the Vertex Dispenser abilities, mostly as an exercise to get me into the swing of writing things at all.  I'm trying to say something interesting about each one, whether it's how it changed during the design process or how it can be used in the game.  There are currently 28 abilities in total, so that determines enough posts that by the time I'm through I'll doubtless have levelled up.  And maybe I'll have gotten around to releasing the game, so the things I'm talking about will make sense to people other than myself and the few who've tested it.

Friday 25 September 2009

Boobytrap (RED)

It's good to scatter these unpredictably, because the point is that your opponents don't know where they are and die by setting them off (or else get discouraged from capturing territory when wounded; win/win).  This makes Boobytrap another good candidate for automation (Alt+X), because it'll essentially just place them randomly, and has the advantage that it uses them immediately when the energy bar is full, so you'll get slightly more of them out overall.

I like to find corner cases, and try to make them interesting - this is Nethack's influence showing through.  (Of course, Nethack takes it way too far; they made the interesting corner cases too powerful and broke the game, then tried to rebalance in light of them, thereby making them essential knowledge.)  My original implementation of Boobytrap was a simple binary state, using the ability again on a boobytrapped vertex would have no effect.  This wasn't really acceptable - not only is it less interesting than it could be, but if someone accidentally does it, their use of it would be wasted!  So first I just made them stack, but it got a bit weirder after that.

Tuesday 22 September 2009

Vertex Attack (RED)

This one's a very situational ability, because its effectiveness depends directly on how many adjacencies there are between your vertices and enemy vertices.  Usually such adjacencies are short-lived, because the faces on either side will attack each other - generally territories stabilise to solid regions of faces separated by a gap of at least one vertex, a kind of 'no-mans land' between.  So often Vertex Attack will have a fairly small effect, but you can control it, try to set up situations to maximise it.  It'll also depend on the level - if there are mostly open faces, there will be more adjacency because the faces aren't attacking to get rid of adjacent enemies; on some levels like the torus there is generally a lower ratio of perimeter to amount of territory, so less adjacency.

I've just run a couple of tests to measure the effectiveness on a few different levels.  In a game on a sphere, all faces initially present, Vertex Attack made an average of 12 attacks each time it was used (about 24 points of damage, as each attack does 2 damage on a hit), but this ranged from 1 attack on a very poorly timed use to over 20 when large battles were going on, and over 50 when Expand Edges had recently been used.  On the torus, with most faces closed, an average of 10 attacks - slightly less, because of the smaller perimeters.  On a sphere with all faces initially open, an average of 20 - it's a very powerful ability in this case; one time it made 54 attacks without Expand Edges even having been used!

So it seems rather powerful for such a low level ability; situationally it's doing over 100 points of damage.  But I don't believe it's overpowered; its average damage is in the mid-twenties, which is comparable to Roaming Mine or Boobytrap, and it's only doing the really high damage on specific unusual levels or in a combo with Expand Edges - and combos with white abilities can be expected to be strong, since Damage All is regularly throwing out hundreds of damage points on its own.  Plus it'll sometimes do almost nothing, and you don't always know when it'll be most effective because the adjacencies might be out of sight.

Thursday 17 September 2009

Local Capture (RED)

There's not really much to say about this one - it's pretty straightforward, new players seem to easily grasp what it does and how to use it, it's been in the game in pretty much the same state since the very beginning.  The only change from the original is minor; it used to only capture whole faces, but now if it can't capture an entire face (because another player owns some of the vertices) it will still take all the vertices and edges that it can.

The thing that is interesting about Local Capture is that (like Close Gaps and Expand Edges) it works on the basic game mechanics rather than creating some new type of object, so it only really makes sense in the context of Vertex Dispenser.  Some of the abilities could be more or less directly translated to lots of other games, things like "fire a missile that homes in on enemies" or "damage all enemies on the level".  But "capture adjacent faces" is only meaningful because territory is good to acquire and hold onto for various reasons, and faces are units of territory which automatically attack.

Tuesday 15 September 2009

Roaming Mine (RED)

There's some quite interesting emergent behaviour that came up with Roaming Mine, that makes it potentially a very powerful ability.  Its movement algorithm is as follows: sort adjacent vertices into three lists; enemy, neutral and friendly; then select a random element of the first of these lists that is non-empty, and move there.  Simple enough - it'll basically move about at random, but it would rather go towards enemies (and damage them), and it might as well steer away from friendly territory - it's more likely to find an enemy elsewhere.

But what happens when there's a hole in the middle of your territory; a neutral vertex (or a few) surrounded by friendly vertices?  The Roaming Mine will always prefer to move into the neutral area over your vertices, so it'll get caught, never finding its way to an enemy.  So there's a risk that they'll never do anything, staying stuck in this hole forever.  But the cool part is: this is actually an advantage.  It allows you to focus your attacks to maximise effect.  When a solitary Mine trundles off and does a small amount of damage, it might end up having no effect whatsoever, if perhaps a Repair Robot fixes things up before another attack is made in the same area.  But if you save several of them up, trapping them all in a hole, and release them all at once (perhaps by capturing the neutral vertex they're stuck on), then they'll burst forth like a swarm of angry bees and do all their damage in one go.  Much more effective!

I liked this strategy so much that I made the AI check if a gap in their territory had a Roaming Mine in it, and if so not fill it up, so that when I'm playing with AI allies they won't mess up my plans.  Useful.

How can it be countered?  A well-placed Pulse Wave could take out the whole lot in one go.  Charging in and releasing them yourself before too many are saved up could help - especially if you soak up some of the damage with Protection or Fortification.  And you could always try doing the same thing yourself - hoarding up your own arsenal ensuring mutual destruction.

Monday 14 September 2009

Video again

This time it's awesome.

Toggle Faces (BLUE)

This one's a bit weird, it doesn't see much use most of the time.  It's pretty important on some levels - where there are lots of faces toggled off at the start, it's very useful for toggling them back on (although then you have to be careful that your opponent doesn't take over the valuable real estate you've just created).  But why would you ever want to turn faces back off?
I can think of a few interesting strategies based around this, but I'm not sure that they're ever worth the effort to pull off.
- Make holes for laser turrets to shoot through.
- Make a border of toggled faces along your territory so that it's slightly harder for enemies to break in; they don't have faces to back them up.
- Weaken enemy territory by charging in and making holes in the surface, so even when they capture it again it's not strong with faces.

I think it's worth leaving in there to be an unusual ability with potential applications by advanced players, even if most of the time it seems like a waste of a slot.  Time will tell whether anyone figures out how to put it to good use.  (Plus, as I said above, it's quite important on certain levels.)

Friday 11 September 2009


I've just assembled a short video of Vertex Dispenser in action.

I've compiled a version that runs a replay, saving every frame as an image file.  Then I can compile the images to a video with VirtualDub.  Next task is to make a video that's actually interesting, splice together bits from various plays with some music over it.

Invisibility (BLUE)

It's important to remember that while invisible, you can and will still be attacked.  When a face attacks, it simply selects a random enemy vertex next to it, making no distinction between occupied and vacant vertices.  This means that you can reduce the likelihood of a face attacking you by capturing some other vertices next to it; often a useful trick to know.  But it also means that being invisible provides no advantage against enemy faces.  Obviously you do get an advantage against enemy players, because they don't know exactly where you are, but still they can often figure it out if they're paying attention.  Robots are affected, which makes quite a difference when you're dealing with Shield Robots, which need to know where you are in order to block your attacks.  And of course Hunterseekers can't home in on you and Laser Turrets can't attack you if you're invisible.

In a way, I kind of think Mighty Vision is better than Invisibility, because the amount of extra information you get is more than the amount of information Invisibility hides from your opponents, especially since Mighty Vision lasts considerably longer.  But Invisibility's a lot easier to use, and the advantage it gives you against Shield Robots and Laser Turrets makes it indispensible.

Thursday 10 September 2009

Teleportation (BLUE)

Teleportation is the little death that avoids total obliteration.  It allows you to move around the level quickly, and instantly escape from dangerous situations (often to the dismay of your opponent who was about to kill you).  It's mechanically very similar to dying: both take you out of the game for a little while, during which you can move around the level to look at stuff, and then spawn at your selected location.

Originally, when you died, you couldn't do anything until you respawned at a random vertex.  This was too much of a punishment - there needs to be an advantage gained by killing enemies, but being unable to do anything for a while is just frustrating.  Being able to look around while dead helped a lot, because the game is still responding to input and you still feel involved, but ultimately I decided to allow selecting your respawn location.  It was difficult, because I worried that the advantage from killing a player would be too little, but it turns out I was wrong; the time spent dead and the loss of colour energy are far more significant than the nuisance of not being where you want to be.  And because teleporting takes much less time and doesn't stop you gaining energy, it's still way better than dying.

Wednesday 9 September 2009

Mighty Vision (BLUE)

Mighty Vision has a few different effects, all related to letting you see information that would otherwise be hidden:
- show enemy hit points.
- draw a line over enemies, to locate them without a line of sight.
- show invisible enemies.
- uncover boobytraps.
The general effect of all this is to let you die less and kill your enemies more.  You'll know better when to retreat (because you're fighting someone stronger than you) and when to press the attack (because they're about to die).  It's a small but significant tactical advantage; I find it very helpful.  But I've noticed that beginning players rarely use it.  Perhaps it gives more information than they can use effectively.  Perhaps they just don't think of it while they're busy with everything else (if this is your problem, try setting it on automatic (Alt+A) so that it'll be used whenever it's ready).  Or perhaps they just don't realise the value of the information - it's easy to underestimate abilities that don't give a direct material advantage.

The original design for Mighty Vision was quite different; your avatar would be stuck still (as with Guided Bomb) while you move your view around (as with Teleport) to look at stuff.  This was pretty weak, because it was rare that any advantage you could get would be worth using up your BLUE energy and spending that time vulnerable and not doing anything.  Now you can use Teleport (or just die) if you want to have a peek around like that, and as a bonus you can get straight there if you see somewhere useful to be.