Thursday, December 20, 2012

Reverse Time Spell

After designing the game event system which allows backwards stepping through the game I have just thought of a spiffing new spell - Reverse Time. When your wizard casts this spell the game is rewound back to the beginning of your previous turn. This should be properly visualised with all the animations and effects playing in reverse. Naturally, all spells cast by other players would be restored and creatures unsummoned, but it could get you out of a tricky spot, or give you a tactical advantage. Interestingly your reverse time spell would also be restored and you could use it again and again, until it fails.

Wednesday, December 19, 2012

Networky Updatey

The good news is that the infrastructure for multiplayer Chaos games is in place and functioning. This includes:

  • Account creation
  • Login
  • Create game (2-4 players)
  • Join game
  • Leave game
  • Map initialisation and deployment of wizards
The only thing you can do at the moment is end your turn - so there no game play yet. Before I get onto that I need to figure out how to make both synchronous and asynchronous games work properly. The underlying functionality is basically the same. Synchronous games operate under tighter rules - you have a relatively short time limit for your turn. If you fail to respond in time your turn is ended automatically. If you get disconnected your wizard will be taken over by the AI, but I want to allow players a chance to reconnect to the game if they just experiencing internet glitches.
Asynchronous games are played over a much longer period of time, but still with a time limit. This will most likely be some modified chess clock style of timer, where you have a total time limit for completing all your turns, and the time counter counts down while it is your turn. The other thing I need to do with asynchronous games is store and retrieve the game state in a database. Synchronous games are totally 'live' and they reside in the servers memory until the game is over.

The game state is represented by an initial state and a list of game events, which can be anything that happens in the game, such as moving a creature to a hex or an attack. This list of events allows players, or even observers, to view a game from the start - or even to watch completed games. I also want this playback feature to operate with rewind controls so you can step backwards or forwards in the game sequence. This requires a little extra data storage because for each event I have to store the state 'changed from' as well as state 'changed to'. I also need to pack the data into the smallest possible size for network transmission, which means using the minimum number of bits for a piece of data. The Lidgren network library handles this pretty well. I am pretty confident that an average game will be packed into around 20-30kb in size, which is pretty small, but the smaller it is the more games a single server can handle.
Finally, before I start on the game player proper, I need a system for local games. Internally the same message transfer occurs between the client and server functions, but I don't need to update the game state on both server and client side since there will only be one representation of the game. It's a bit more fiddly than it sounds, but I hope it won't take too long. Then the game will have solid foundations for local and network play and I will proceed to creature summoning, movement and combat.
Here is a three player game set up from a client point of view with three wizards deployed. Note, the final game will not look like this, so please don't make fun of my little wizard models!


Saturday, December 15, 2012

Summoner Wars Reviewed


Before I delve into 'Lords of Chaos' I will take a slight diversion and talk about a game I have been playing on my iPad called 'Summoner Wars'. I bought the board game a couple of years ago and was intrigued by its similarities with my old Chaos board game. In Summoner Wars you have a main character, a Summoner, who is the equivalent of a Chaos wizard. All characters and creatures are represented by cards which are placed on a grid of rectangles, just as in my game. There are no spells as such in Summoner Wars, but there are 'event' cards, many of which have magical spell-like effects. The main emphasis of the game is in summoning creatures and moving them on the board to attack and kill the opposing Summoner.
It’s fun, fast moving, two player game with some nice touches. A big feature of the game is the faction decks, which are nicely designed. You play a particular faction which has its own unique set of cards, giving each faction unique characteristics. They aren’t based on purely conventional fantasy cliches either. For example, the ‘Phoenix Elves’ are adept with fire and ‘Tundra Orcs’ can create ice walls. There are eight factions available, plus mercenaries which can be used in other faction decks. Furthermore, there is a bit of a deck building meta-game involved. The interface for doing this in the iOS game is a bit of a disaster, but it does allow you to configure and save multiple decks for each faction.
The game mechanics are simple and relatively straightforward. Every character has a summoning cost, an attack value and life points, angd some have ranged combat ability. They all obey the same basic rules of movement and combat. However, every card has a special ability which modifies the basic rules in some way. For example the Cave Goblin Beserker can attack all adjacent enemy characters, or the Phoenix Elf Guardian  has the ‘precise’ ability, which automatically inflicts a wound without rolling the dice.
The iOS version of the game is a very faithful rendition of the boardgame. It uses all the card art from the board game, and the dice rolls are presented with the relevant ‘faction dice’. It is definitely well done, but there are problems with this approach. Even playing on my iPad 3 I couldn’t distinguish the different event cards in my hand. They all have the same graphic - a problem with the physical game - and you can’t quite read the text without tapping on a card to zoom it. They action is presented with a few visual and audio effects, which overall feels a bit lifeless.
There are two basic modes for playing the game - single player and multiplayer online.  The single player game against the AI is good for learning the game and the different factions, but the AI just isn’t good enough to present an interesting challenge. It is the multiplayer aspect of the game which is the real deal. However, it is a very pared down, bare bones experience. When you set up a game you can choose your faction deck and the game time limit (which I think is the time you get for your turn, I am not sure). This time limit ranges from 15 minutes to 14 days. This provides the usual asynchronous game play, but the 15 minute game would seem to imply a quick player ‘live’ game. However, I have never managed to play a 15 minute game. It seems that the game starts some time when I am offline and I run out of time, forfeiting the game. There is no indication whether another player is actually online or not, so this short game option seems broken.
The game is still good, for sure, but I think it is a wasted opportunity. More could have been made of the single player game by adding some kind of metagame that gives continuity and progress from one battle to the next. With the online game there is no attempt to promote a social community around the game. You can’t communicate with your opponent, there are no competitions or tournaments, no link to a forum to discuss with other players (despite the fact that Plaid Hat has a very good website for Summoner Wars with an active forum). It is actually a bit sterile compared to the board game where you have a physically present, live human being to taunt and spar with. With Chaos Reborn I do not intend to make this mistake, and I will develop as much community infrastructure as I reasonably can. I learned this the hard way with Laser Squad Nemesis - your player community is your best asset, but don’t underestimate the importance of building the infrastructure as the community grows and develops its own direction.
I would be interested to hear what other Chaos gamers think of Summoner Wars, so if you can, try it out - its free to play with the Phoenix Elves faction.

Friday, December 7, 2012

A History of Chaos

While I am busy with the network code of 'Chaos Reborn' I thought I would delve into the distant past and write something about the origins of the original Chaos Spectrum game. It started as a board game / card game hybrid inspired by a Games Workshop board game called Warlock. The year was 1981 and I was hanging out in the games club at school. I watched some kids playing Warlock and was intrigued.  I liked the idea of spells on cards, but I thought the actual board was a little useless, because it consisted of nothing more than a ring of wizard tokens standing completely motionless for the battle. 'Pointless,' I thought, 'I can do better.' The kids never actually let me play Warlock, so I actually knew nothing about the game play, but I wasn't interested anyway. So during the summer holidays I set about creating my own wizard game, which had spells and wizards on cards and a game board consisting of a grid of seven by eleven rectangles and a track for law/chaos balance. I made the cards using my grandfather's typewriter, which I considered an amazing piece of technology, plus my Rotring pen and coloured pencils for the rather bad hand drawn art. The game was great fun and very quick playing, even with a lot of players. Technically the game could be played with up to twelve, but I don't think that was ever attempted. Four to six players resulted in a good fun battle. Fortunately for the sake of posterity I still have the game, and for the first time ever I have some images of it for public view. There are some interesting differences with the computer game, so I will explain how the board game works.
Here is an assortment of creatures:
Each creature has a name, and possibly a law/chaos value and a set of six stats, as follows:

  • S = Success roll for casting. Players must roll this number or higher on 2 dice, adding the wizard's spell ability and any law/chaos shift bonus, in order to summon the creature.
  • R = Magic Resistance. You had to roll this number on 2 dice to resist some spell effects.
  • M = Movement. The number of spaces the creature could move, diagonally or orthogonally. 
  • V = Manoeuvre rating. If adjacent to an enemy, you had to roll this number or less on 1 die to be allowed to move.
  • C = Combat rating. Add 1 die roll to this number to determine combat value.
  • E = Endurance rating. Add 1 die roll to this number to determine defence value. If combat value exceeds defence value the creature is dead.
In the computer version, dice rolls were replaced by a random number generator producing values between 1 and 10. Your wizard could ride mounts, as in the computer version, but the effect was to increase the wizards endurance value by one. You could choose to attack the wizard or the mount. You may also notice that the Gryphon has two movement values. At some point I decided to make the game more sophisticated, so I got the Tippex out and wrote two movement values in place of one. The first value is for movement on the ground and the second through the air. If you chose to fly with the creature it couldn't attack after landing, but you could if you moved on the ground. It was an attempt to reduce the overwhelming danger of flying creatures - something I left out of the computer version.
Now let's see a selection of wizards:
They had quite a range of values, with some being very good fighters but with less spells or ability. You may notice that they had a lot less spells than in the computer version.
Here are some more creatures:

The interesting thing about the dragons is that they had their own spells which they could cast in the spell phase along with your wizard. This didn't go in the computer version.
Some creatures had special rules:

The Vampire was a powerful creature, but had one dramatic weakness - it was instantly killed by the 'Blinding Light' spell. It also has a special mist form that gives movement benefits while not being allowed to take part in combat. The Hydra could effectively resurrect itself and a the Faun, being a particularly magical creature, had a spell.
Now let's see how the blobs, fire and trees worked:

On casting one of these spells the player took a set of 8 cards representing individual blobs, fires and trees. The blob and fire spread in the same manner by rolling a dice for each card on the board and spreading in the indicated direction, or dying out.
Finally, here are some interesting spells which didn't make it into the computer version:

These were basically left out of the computer version because of the complexity of implementing them, or I didn't consider them interesting enough. However, some of them might find their way into 'Chaos Reborn'. One major addition in the computer version is the ability to cast creatures as illusions. This is something that couldn't really be implemented in the board game.
After making the card game a school friend of mine made a version for the BBC model B computer. Due to its very limited 32k memory he had to program it in text mode, so each creature was represented by a block of four letters.  When I got my ZX Spectrum in 1983 the thing that impressed me most about it was its whopping 48kb of memory, and only 7kb of this needed for the screen. It would be good for a sophisticated game like my wizard board game, I though. But my first two games for the Spectrum were 'Nebula', a 4X space game, and 'Rebestar Raiders', the forerunner of 'Rebelstar', 'Laser Squad' and 'X-Com'. These games were written in BASIC, which was slow and inefficient. I then decided to take the plunge and program a game completely in Z80 assembly language, and that game would be Chaos. I will admit that it is not the best piece of programming in the world, and had some quirky bugs, but it worked. Debugging was quite tricky in those days, and I had to print out the code with the Spectrum's wacky little printer and step through it by hand.
Publishing the game was somewhat complicated by the fact that my colleagues who worked for RedShift, the company that published my earlier games, had left en masse and proceeded to do deals with Games Workshop. This resulted in several computer games being made for them, such as 'Talisman' and 'Battle Cars,' which were computer adaptations of Games Workshop boardgames. But the deal also included 'Chaos.' It seemed like things had gone full circle - Chaos the board game being inspired by a Games Workshop board game, and then later the computer game published by Games Workshop.
I don't know what happened with Games Workshop's computer games publishing, but it seems they abandoned efforts in this direction early on. I was left to go my own way, and went on to make 'Rebelstar' for Mirrorsoft's Firebird label. The game sold well, so they wanted more from me. I offered 'Chaos' and they accepted it. The game was to see public release again as a Your Sinclair cover mounted game, not just once but on two occasions. Effectively this means Chaos has been published four times. I have no idea how many people have played it, but it is probably my most widely played 8-bit game - mainly thanks to Your Sinclair.
This is not the end of the story, of course. I will write something about 'Lords of Chaos' and 'Magic & Mayhem' in a future post.



Monday, November 26, 2012

Networky Malarky

For the past week I have been working on the networking infrastructure of the game. I am using a very nice and simple library called Lidgren. So far I have a client connecting to a server, and the server sends the map data to the client. The server is a pure C# .NET app, and doesn't need Unity at all. There is a lot of work to do here, so don't expect to see a playable version of the game very soon, but I think building solid foundations for multiplayer network play is a very important part of the development and cannot be put off until later, as much as I would like to get some game play in there as soon as possible. Based on this multiplayer foundation I will begin building a playable game and releasing it for public testing. Once the multiplayer game play is solid, I will begin on the AI and the single player campaign mode.
The multiplayer features of the game are quite ambitious, but I think very important and central to the game experience. So here is a more detailed list of features for some discussion. Please add your own ideas, comments and suggestions.

  • Asynchronous play - basically you can send turns when other players are offline. There are many iOS games that work this way these days, so I think it is a popular and expected feature. However, I dread to think how long an eight player match will take with this method of play. There will be a chess-clock style timer for each player though (measured in days, for sure) in a similar manner to the way we implemented it with Laser Squad Nemesis.
  • 'Live' multiplayer - Here players will need to be connected, and each turn will have a relatively short timer. This should be more appropriate for more players and closer to the original Chaos experience.
  • Same machine multiplayer - classic Chaos mode - players used the same computer/device. Easy enough to implement for casual games - but could actually be tied to player log-in and be official league or tournament games. No reason why not.
  • AI take over - if a player fails to respond in time to his turn, then the AI will take over and allow the other player(s) to finish the game. The AI difficulty will be adjusted to the level of the player. This takeover feature may be an option in the game set up - but personally I find it frustrating when players just abandon games. Even if you are losing at a game of Chaos there is alwasy some chance, however small, that you can still win, so players have no excuse!
  • Alternate victory conditions - Apart from simple deathmatch style victory, I will experiment with a number of alternative scenarios, such as artefact capture, exit through the portal Lords-of-Chaos style, and several more.
  • Alternate set-up rules - Some experimentation is required here, but one example would be that each player, given the same random selection of spells, must choose to discard some before entering the battle. This guarantees a completely fair intial starting point, but still with some uncertainty about what spells other wizards have chosen to take into battle. 
  • Co-op - play in a team vs other teams - 2 vs 2, 4 vs 4, 2 vs 2 vs 2, and so on.
  • Co-op vs AI - Players play co-operatively against a really nasty AI controlled uber-wizard, perhaps with various hazards and wondering monsters around the map.
  • In game chat - chat channels for team mates, all players, to one player and so one.
  • Elo ratings - There will be a league system with player ratings based on the Elo system. League champions enter the hall of fame.
  • Special tournaments - knockout tournaments with special maps and rules will take place on a regular basis. These could be designed and run by players.
  • Special award medals - for certain achievements - most dragons slayed, most illusions disbelieved, most wizard-on-wizard kills, and so on. Could be awarded once per month.
  • Player designed scenarios - Players can create maps, deploy artefacts, wondering monsters, create set-up rules and victory conditions. Even spell choices can be affected - removing some spells, guaranteeing others, or altering the rarity. Any player can set up a custom game like this, and other players can rate them. The best scenarios will go into the official repository.
  • Stats - lots of them, for each player, for games, for spells. For example, kills, deaths, disbelieves, illusion %, wizard-on-wizard kills. Stats for games could include - most deadly spells, most popular maps, and so on.




Tuesday, November 20, 2012

Illusions and Disbelieve

I have stated that the Illusion mechanic in Chaos will remain in Chaos Reborn. Any creature spell can be cast as either an illusion or a real entity. Illusions are automatically cast - the spell never fails - whereas a creature spell would usually have some chance of failure. Illusory creatures have all the attributes of a real creature, except that they don't generate dead bodies. When they are killed, they disappear in a puff of magical smoke - thus revealing that they were illusions all along. Illusions are vulnerable to a wizard's 'Disbelieve' spell, which will automatically dispel an illusion. Now one commenter, Matty, has an issue with it. I will quote his post for discussion.

"Creatures can be cast as illusions" Ooh, no. See, I think that's one of the things in the original Chaos that there was a real problem with. What happened is that someone would summon a dragon and the other player would go "pah, not real" and the next turn would cast disbelieve and it was (almost always) gone. I always felt it added little to the game and lead to too many annoying "disbelieve" spell phases. 

I happen to think that the illusion mechanic is something that made Chaos a bit more unique. It added an element of bluff to the game which worked well with human players. If players have a tendency to cast illusory dragons there will also be a tendency for them to be disbelieved. However, casting disbelieve does waste a valuable opportunity for casting another useful spell if the disbelieved creature turns out to be real. I do like it - its simple and adds a real tension to some of the decisions in the game. However, Matty does have another suggestion:

If you're going to have illusions I suggest this: illusionary creatures that are just that - they appear but can't harm or even touch anything. So you've got a wizard and he has a couple of giants guarding him and the other player is trying to think how to deal with them but, unknown to said other player, the giants aren't real and his troops could just wander through them. Rather than give an "illusion?" option on summoning there could be a specific illusion spell which allows for a range of frightening but illusionary monsters to be summoned

Possibly the illusion spell allows you to cast an illusion of a creature spell that you already possess. It's not a bad idea. But if illusions can't harm anything, they won't be terribly useful, and the Disbelieve spell would be used rather rarely. I am not inclined to change the design from the original Chaos, but I would welcome some debate on this issue.

Saturday, November 17, 2012

Chaos Map Editor

The Chaos Reborn map editor is now available - just click here to download it (windows version). Unrar it and run the .exe. It is very basic, with simple place-holder graphics. Despite my love of hexagons I would like the graphics to look much more organic, somewhat disguising their obvious hexagonal nature. However, that will come later. My next task is to build the network multiplayer infrastructure of the game, which will take a while. I do intend to release playable versions of the game as I go along, which will be publicly available, at least until the funding campaign begins.
If anyone wants to fiddle with the map editor, any comments and ideas will be welcome.