Gaming Your Way

May contain nuts.

Knight's Quest, the story so far...

Sorry we've been a bit quiet here recently, both Olli and I have been beavering away like a couple of mentals on projects which hasn't given us any free time to devote to the blog ( Also we didn't have that much of interest to say ).

Knight's Quest, our first Facebook and our first RPG, has been my main focus for weeks. It's finally starting to come together after weeks of just working on the techy side, so I thought it may be of some interest to go over some bits and bobs from it.

The game is iso, which is a pain at the best of times. Z-sorting is murder. How I've gone about it is to split the map into sectors. Each sector is 16x16 tiles, and we only z-sort on those visible areas ( Also we turn off any plotting in sectors which aren't visible ).
This really reduces the sorting to just what is needed, also the floor tiles are burned into their own bitmap ( See this old post ) so we're only having to sort tiles and sprites, which helps.
Also as we're using the blitter we don't have to worry about sequential indexes, it's like as2 all over again, where you could give a sprite any old depth and not care about it.

Next up, the dungeons. I've used Olli's generator ( He's written tons about it previously ) and it works a treat. Basically it creates "cells" which are in this case 4x4 tiles. The cells tell us which walls or doors are present. Rather than just randomly plot tiles I've set up a lot of mc blocks, eg.

KQ_tiles.png
This may be tricky to explain well so stick with me. As we read each cell we know what's there, let's say for example a north and east wall. From there we look up the array which contains all the blocks with a north and east wall and pick one at random.
The floor is burnt into the background bitmap and the wall tiles ( Or cauldron placeholders ) are converted into blitter sprites ( Bobs ) which can then be plotted / sorted etc.
The reason for this is that we can then hand design a lot of different wall blocks and use them randomly ( Rather than just picking one random tile at a time ). It should make the dungeons look more hand designed, which is what we want.
It's important that we create the impression that someone has slaved over each dungeon to make it look as non-random as possible.


I think that's about it for now, there will be more to share real soon.

Squize.

Comments (4) -

  • Nate

    9/2/2010 4:16:25 PM |

    Good luck with the game fellas.  I will be following your progress.  Always a pleasure.

  • Vlad

    9/3/2010 2:30:24 AM |

    Hey mate, sorry to hijack your post (good luck with the development btw :)) with something I've been wondering about, but how are you managing the display lists in your blit engine? An array? A linked-list? A vector? Pen and paper? :)

    I've been wondering how it could be possible to have the best of both lists and arrays/vectors but I haven't got a decent conclusion.

  • Squize

    9/3/2010 11:27:17 AM |

    Cheers Nate. This is one of those projects where we don't have any real excuses, normally there's outside input or a stupidly short time frame to make things, this one doesn't have these issues to hide behind, so it's got to be good :)

    Hey Vlad, just simple ol' Vectors. Straight forward and quick enough. There's a Vector that handles all the Playfields ( ie containers / pseudo layers ) and each Playfield has a Vector for tracking all it's Bobs / Sprites.
    There's no scope for nesting Bobs, as that would just be too much for me to get my head around :)

    For the depth sorting it's just a simple sort based on the bobs z. I was unable to find a way to sort Vectors so I'm having to copy the Vector to an array, sort that, and then restore it back to the Vector. Messy, but a quick fix solution until I figure out a good way to do it. With the sector based approached I've gone for with the game means I only have to sort per sector, so even though the map is 5x4 screens we're only ever sorting a quite small number of objects.
    I had 60 something sprites all a* pathfinding their way around the map and it didn't drop a frame, so that's more than enough speed for now.

  • Badger

    9/14/2010 2:37:11 AM |

    Hey :) this is shaping up great.  Can't wait to see where it leads.

Comments are closed