Rotates.org

August 8, 2014 - Phaser Isometric plug-in

Recently, as part of my continued work on Archaos (yes, I’m still working on it, never fear!) I put together an isometric (well, axonometric to be a little less precise) renderer for Richard Davey‘s wonderful Phaser HTML5 game development framework. It’s got a nice adjustable axonometric projection helper, a simple and fast physics engine based on Phaser’s own bread-and-butter Arcade Physics, and it’s probably close to production ready. I deliberately kept the system simple, and the API as close to the existing Phaser API as possible to allow for quick adoption, and it plugs in pretty much seamlessly.

You can view the microsite I put together for it here, browse the repo (and maybe even if you feel like it, or spot some of my horrendous and inevitable broken maths, contribute) on GitHub here, view the API docs here, and I’ll also be posting some simple examples to demonstrate the various features shortly. Enjoy!

March 31, 2013 - Pathfinding and interaction

I’ve spent the last few days working on the pathfinding system on Archaos. This replaces the previous and temporary ‘one step at a time’ way that non-flying units were controlled, and makes the process of moving of your units much easier and faster.

I’ve spent a fair bit of time testing the system and comparing movement ranges with the infographic posted previously. Due to some discrepancies with the way the original game handled non-flying movement, calculation of a non-flying unit’s range isn’t trivial – and when you throw in obstacles and danger of your unit getting engaged, the efficiency and accuracy of the pathfinding system becomes vital. I may still need to tweak it a little further but at the moment I’m very happy with the results.

archaos-pathfinding

Ease of interaction is one of the top priorities of the game; if the game’s controls aren’t implemented correctly, it could quickly get very annoying – for instance, if it was easy to accidentally move a unit to the wrong position. This is especially important when dealing with mobile devices, which offer less feedback and less accurate interaction methods.

With this in mind, all actions carried out in the game must be confirmed, either by tapping twice in the same spot, or by tapping the ‘confirm’ button which will appear once you’ve tapped to express your intent. This method seamlessly works between mobile and desktop, with intent on the desktop being indicated as you hover your mouse over the board.

March 23, 2013 - Future proofing

For the last few weeks I’ve been adding in two very important systems to Archaos – namely real-time communications via TCP, and the use of a database back-end for the server. The first makes games much more responsive, and allows the server to inform connected players of actions as and when they happen. It will also pave the way for an exciting addition I have planned, which will (hopefully) combat the inevitable pacing problems that arise from typical turn-based games. If you want to know more about what I’m getting at, give this excellent article a read.

The database server, client and game server respectively.

The database server, client and game server respectively.

The second addition is a solid database-driven server. Until now, as a temporary solution I’d been storing all of the game data in a single file. When the server opened, it read all of the users and games from this file, and then stored all of the data in memory. If the data changed, the server would periodically save the entire file back to disk. The server would only write the data to disk if it had changed, and only once every so often – this kept writes to a minimum. The solution was fine for small scale testing, but it would not have scaled up well – quickly consuming all of the memory in the server machine, as well as being difficult to manage.

Now all of the data is stored on a mongoDB server in essentially the same format. The game server is then only responsible for the manipulation of the data, and not the storage and management of it. The game server itself is relatively simple in its approach; when a user sends an action, it loads the game, determines if the action can be performed, and if so what the outcomes are. It then saves the changed game back to the database and sends the actions to all of the connected players (which it does via TCP). The game server never keeps games, users, units or anything else in memory for longer than it needs to check or manipulate it. There are no special objects or instances; every function works only on the raw data. I may introduce some caching to reduce database operations later but at this stage the setup is fairly efficient.

So, I have what I feel is a solid base now, I’ve got some of the actions in and working (such as creating, joining and leaving games, unit movement and engagement) and now it’s just a case of writing the client-side stuff for the remaining actions, adding in the spell system and then getting it out there for public beta testing!

Look out soon for another post on the spell system and how I intend to tweak it to provide a more balanced start to each game.

January 11, 2013 - Merry Christmas and a happy new year!

Apologies for no updates in a month – I’ve been working on other small prototype projects, sharpening my skills and learning new languages (such as C# in Unity 3D – which I cannot recommend enough!) as well as just recently attending a rather prolonged hospital stay. Needless to say I’m back on with things now so expect to see some more updates and progress in the coming days and weeks!

November 20, 2012 - Alpha details and a matter of originality

The client now connects to the server, downloads a list of games and then can connect to any individual game and begin interacting with the server, sending moves and updating the clients as the game progresses.

From a technical standpoint, the ‘netcode’ is fairly simple; when a client connects to a game, a snapshot of the game with all of the relevant data (position and status of units, players, whose turn it is etc etc) is delivered to the client which then sets the board up accordingly. The client then starts either polling via HTTP or listening via TCP (how this is chosen I have yet to decide) for new ‘actions’.

Not related to post: The unadorned mini-map – and yes, units now cast shadows. The shadows stay on the ground when they move too! Like proper shadows! I am so smart.

Actions represent every possible individual step which influences the game state in some way; a player joining or leaving during pregame, a unit moving, a new turn, a player being defeated or the game ending. Each action has both a timestamp and a consecutive action number. This means that all the client has to do is keep a record of which action number it’s up to, and wait for new actions. When new actions come through, the client processes these new actions in turn until it’s up to date with everyone else.

Because of the added complexity of creating a game which works over the Internet, some slight changes have crept into the gameplay, though these will be mitigated to keep the game as pure as possible. One such change is the way that individual units’ moves are processed.

In original Chaos, when you move a unit, after it has moved, it may then perform an attack (if it moves adjacent to a combat-capable enemy unit) or a ranged attack (if appropriate). These potentially up to three components of each unit’s ‘move’ are all typically linked together. With Archaos, a player may move their unit, and then lose connection, their PC may crash, the boss may come in – whatever – the point is they may be interrupted. In this case, with the traditional system there’d be two choices – either to automatically ‘end’ that unit’s move completely (which seems a tad unfair) or invalidate the unit’s move (not really practical).

The solution therefore is for the client and the server to track the move/attack/ranged attack phases as just that, distinct phases of the move. That way, if a unit moves but doesn’t get to perform its attack or ranged attack, clicking on it later in the same turn would allow you to continue its remaining phases.

Of course, this differs from Chaos and I’m always acutely aware of things which differ from what is both in my mind and the minds of most of its fans a well balanced and perfectly fine game. With that in mind, what I can do to ensure the gameplay remains (mostly) original is to automatically call the attack/ranged attack routine in the client after each unit’s movement phase. If the player then actively cancels one or both of these phases, they are marked as ‘complete’ and the unit’s move ends completely. Action or cancellation will be made mandatory on the client, so that the only time when the option to ‘revisit’ a unit will be available is if the move is cut short in some way. This does mean that players could potentially quit out of the game in order to bypass cancellation, but as there are no benefits I can see to doing so, it means that this feature can do its job without interrupting gameplay.

The game is now quite close to the alpha stage – that is it will be in some way playable very soon. The alpha will almost certainly begin by the end of this week, or the weekend at the latest (unless I run into some catastrophic game-breaking bug) and will feature a comparatively small subset of gameplay to begin with:

  • Users will be creatable
  • Games will be creatable (with the ability to set a width and height of the board – wizards will be spaced around the board as in the original game dependant on number of players)
  • Games can have up to 8 players and can be limited to fewer players if the player wishes
  • Players will be able to move units around the board, attack one another and cast basic creature units
  • Players will be able to defeat other wizards and win the game
  • Players will not be able to cast non-creature spells
  • Wizards will not be able to mount creatures such as horses etc
  • Animations for things such as spell casting, attacking, ranged attacking and wizard deaths will not be implemented at this stage
  • There will be bugs, crashes and weirdness – this is an alpha remember!

I will make further announcements about the alpha during the week on Twitter. I will be looking for volunteers to help me test the game and iron out any issues with what is essentially the core gameplay mechanic. It won’t be a particularly amazing experience at this stage (not compared to the original game or the final product, or even the subsequent beta) but it will be essential to test it on a range of hardware, and in a range of conditions.

As Archaos is already multi-platform ready, I will be able to create iOS and Android builds for those alpha testers who would like to try it on their iPhones and iPads. If this is the case, I’ll provide further instructions on what you need to do to get Archaos running on those devices. I’ve not yet tested Archaos on Android but I will at some point this week before I start alpha.

If you’d like to be part of the alpha phase, and have read all of the above and realise that you’ll be testing a limited and unfinished product, leave a comment below or drop me a line on Twitter.

November 2, 2012 - Julian Gollop has an announcement to make…

Earlier on I got wind of news that very nearly made my heart stop.

Yes, Julian Gollop – creator of the original Chaos, of the original X-Com, and of many other seminal classics, has begun work on his own remake of Chaos using Unity 3D to initially target PC, Mac and iOS. He also stated:

…which bodes well for it sticking to the original winning formula.

Development on the game has only just begun, and Julian is currently looking for good artists. He has estimated that the game will take around a year to finish, so we’ll all have to be patient.

I guess the recent massive success of XCOM: Enemy Unknown has brought Gollop back to the forefront and given him the motivation needed to revisit what has to be in my (and many other people’s) opinion one of the greatest games of all time.

Julian, if you read this, I wish you all the very best with your remake. Chaos has been crying out to be remade for a modern market, and a market that’s now clearly in the right place to readily accept a multi-platform turn-based strategy title such as this.

What however does this mean for Archaos? Surely with this title coming out, it makes Archaos obsolete and possibly in danger of legal action as it will directly compete with Julian’s version on the same platforms?

Sometimes it really is worth meeting your heroes.

March 12, 2011 - Merry Christmas, happy new year and so on

First of all, apologies for not updating in yonks – I could give you the usual programmer excuses about real life, work and so on but you’ve heard them all before, so I’ll dive right in to what I’ve been doing:

Archaos is very, very slowly moving along – we’re talking geologically slow here, but nonetheless there’s still a roadmap and there’s still progress on it. My aim now is to have a release before my 30th birthday (next year) and I’ll be damned if I don’t make it!

I’ve been experimenting with presentation and so on, and came up with a little thing tonight which I thought was quite cute.  I’m really feeling the love for CSS3 and HTML5 now.

WordPress has become my new powerhouse tool at work, and I’ve been churning out sites left, right and centre in this wonderful blog engine turned CMS (as of 3.1 especially so) – check out some of the following:

The last is our most recent project, and is very much not a site you’d expect to be WordPress powered – such is its flexibility!

I don’t update on Twitter much anymore, as it’s become a bit of a joke now with all of the celebrities and ridiculous trends; it pains me to say it but I think Twitter is more about Justin Bieber now than anything sensible. Alas, I spend most of my social networking time now on Facebook.

Finally, I’ve booked a flight to Arizona in September for a two week photography road trip with two of my good friends – should be awesome!

Anyway, hopefully that’s got everyone up to speed on what I’m doing – keep your eyes peeled in the coming months for updates on Archaos and other projects.

August 18, 2010 - Raise dead

Well well well, I guess I haven’t posted here in… ohhh, ages? I owe you all an apology to be perfectly honest, as I’ve neglected to work on Archaos (or indeed any personal projects) in the time since my last update.

Life has panned out for me – work became extremely busy in the last few months, and my ever expanding role has ever expanded – and indeed shifted towards a more theoretical and management-style thang. I’ve been working directly with clients and producing a lot of exciting stuff for a lot of exciting projects which, if I get off my lazy arse and update this blog more often, you will no doubt hear about!

Another significant development is that I’m no longer a lonely geek sat in his room listening to chip music and writing Javascript – I’m a very much not lonely geek sat in his room listening to chip music and writing Javascript. I have indeed found a (dare I say it) lady geek – though to her credit, not even close to the caliber of my pure unadulterated nerdiness – whom I spend as much time with as my work and her sanity allows. I won’t allow myself to become soppy and embarrass her (and myself) but… well, I absolutely love you, and you make me a very, very happy boy. Oh bugger, I don’t think I succeeded there. Never mind!

This has meant of course (yes, you all knew it!) that my personal projects have taken a back burner in all of this. Well, I say a back burner, but I actually mean ‘have been placed in tupperware tubs and frozen’. I must say now that my passion for Archaos in particular has not waned one bit – however after such a hiatus, I’d like to start a lot of it again rather than try and work my way back into the existing code base. A problem with learning as you create is that everything you did a month previous is a bit crap – so stuff I started last year is gonna be pretty goddamn terrible now.

I will return to Archaos. I absolutely promise I will, and I have been reading Gooey Blob and other Chaos related stuff. The end of the year always proves to be a better time to get on with personal projects, and I hope to have something playable in December.

To those of you who still read this, still follow me on my similarly neglected Twitter account, I salute you – and I’ll be around more often!

P.S. Check this out. WOW!

Website and content © 2009–2026 Lewis Lane