Retrospective: Asteria Prototyping

There's a particular game design I've had in the back of my head for a few years now. A sci-fi cooperative shooter. Originally the idea was mash up of Left4Dead and Phantasy Star Online. Valve's cooperative shooter was the first time I'd seen a game so successfully engender team work, and was still a very immersive experience. The 'AI director' tech meant it took a lot longer before it was the norm to game the systems. I played PSO on the Dreamcast a few years earlier, and enjoyed the world, particularly the first few levels, the aesthetic and the space opera feel of the main story, even if the mechanics were a little clunky.

Sometime after playing L4D I found Alien Swarm , a free top down shooter from Valve with a strong 'Aliens' vibe, it seemed to incorporate similar swarming logic in it's enemies along with class specific mini-games. The fact it had classes and was a softer coop made it naturally closer to PSO, and yet still had the high skill ceiling / potential for mastery of the first person shooter which PSO had lacked. So the design shifted to being closer to a mash up between Alien Swarm and Phantasy Star Online.

Alien Swarm Phantasy Star Online

A quick aside, you can still play both Alien Swarm and Phantasy Star Online for free, and I would recommend doing so! Replaying Phantasy Star Online has been an interesting experience for me, the story and tropes employed in the side quests are quite dated and some are kind of problematic and whilst it suffers less than a lot of even modern shooters and MMOs, it does have some *ehem* interesting choices for some of the female characters costume designs. That said whilst the story hasn't aged well, I feel the mechanics and cadence of combat are far more compelling than I gave them credit for when I played as a teenager, that was probably the then Counter-Strike player thinking anything that wasn't twitch / reaction based wasn't really testing skill, although admittedly I still love twitch based games.

Having spent quite a lot of my spare time over the last few years making game prototypes, but not this one as I felt it was too ambitious to achieve, I decided it was time to try anyway, perhaps part of the issue with my difficultly finishing projects was I was focusing too much on what I thought I could achieve versus what I actually wanted to make.

After creating a placeholder player that turned to face your cursor with slight delay out of a pair of cubes (the top cube looking at the aim point gives a surprising amount of character to it), I followed and adapted a FPS UNet tutorial to set up basic networking - client hosted with an authoritative host - which was surprisingly easy to get working. The tutorial did seem to want you to write almost every script as a network aware script but I ended up moving towards having a single script per character to relay messages and commands with individual components focusing on their own responsibility.

Cube Player Prototypes Rigid Body Experiment

I created a test level out of Unity's prototyping geometry, and a basic system for spawning enemies who seek the nearest player and deal damage in a cone in front of them. Once all enemies in an area were killed the doors would unlock and the player could continue. At this point I discovered that UNet's high level API does prediction and interpolation for you on Network Transforms that have a character controller component on but not for other Networked Transforms, it turns out you can avoid having to write your own by attaching that component on non-host clients.

Level Prototyping

I also proved out a few different weapon types (burst fire, mini-guns, grenade launchers) and bought a humanoid 8-way run with independent aim animation set and got that working with characters who's movement is not controlled by root movement of the animations. Using the animation root movement may look good, but generally feels unresponsive which isn't really what you want in a top down shooter.

8 way run and independent aim

This all sounds like solid progress right? Well quite, but then it got to the point of needing to take another pass on the enemies, which were not intended to be classically humanoid. At least point quite how much I had been relying on what I already knew how to do, or could buy off the asset store became clear. So I stopped to take stock, it had been a few months of spare time at this point. I was quite happy with the prototype as a prototype, it was quite clear the progress was going to slow down significantly as I would have to either skill up or bring in other people to help and if I was serious about trying to make this it was going to be years.

As you can guess from this being a retrospective, I wasn't quite ready to commit to that and was worried that skilling up on this project that I cared about so much would compromise it's quality, and previous attempts to form a team to make a game had resulted in drama and bad feelings and being in a lead role for client development in work at the time I didn't feel like doing something that looked even more like day job during my spare time as well.

This lead me onto my current Unity project, which I'll talk a bit more about in a future post - but it embraces reliance on pre-built assets, and should allow me to practice the polish (and you know finishing a game) aspects of game development, as well as getting to make features I've not created before but would be relevant to this game as well, say like character customisation.

I was making all this in Unity 5.6 as I had a perpetual licence, and the new versions of Unity hadn't provided any killer features I felt would help the particular games I was trying to make. Over the last few months this has changed, particularly ProBuilder becoming integrated into the editor, improvements to the terrain system landing in 2018.3, and the decal system on the newly released FPS sample project are all very interesting and potentially useful to this type of project. The other major development is that UNet is being phased out, however the replacement has yet to be revealed and whilst the forum threads state it will still be possible to run p2p client hosted games it remains to be seen how straight forward this will be when the focus seems to be on providing infrastructure as a service.

I'm hoping to revisit this project in future, when the new networking technology from Unity becomes available, and when I've had the opportunity to practice some of the areas of develop I don't get to focus on as much in my day job. I hope to blog about that project I'm using as a practice soon.

Posted by Delph

Retrospective: Hestia

At the start of this year I played around with PICO-8 and there were lots of things I loved about it! The focus on being a fantasy console meant that retro aesthetics of the sound, music and graphics were nicely in sync. The image memory and code character limits forced you to focus on achiveable games. The BBS system was very cute, worked well and had some of the "view source" mentality for game dev that helped me get into web dev.

However there were a few things I didn't like; the small caps font in the integrated IDE I found extremely difficult to parse and switching to an external text editor broke immersive beauty of the program. Whilst the focus on character limits and low memory was encouraging for small scope games, it forced you to write very imperatively which I think is kind of bad practice and prefer writing in an event driven style, and this meant certain game types were extremely popular on the BBS (2D platformers I'm looking at you).

The final thing was, I came a bit late to this particular party. I've been told by early adopters that originally it was very "anyone can make a game and publish it" but later in the lifecycle the BBS was populated by exceptional works by highly practiced devs and demo scene style proof of concepts for raytracers and other tech, very impressive but also quite intimidating.

So inspired by PICO-8 and having previously tried making pixel perfect games in Unity and found it wanting, I spent most of my free time in January having a crack at making a similar set of tools as that provided by PICO-8 but with web tech instead. I was aware at the time this has been done before, but this was about learning and fun rather trying to create a competitor.

The idea for my implementation was a set of tooling in which you could pick - or provide - colour pallettes and input capabilities as part of the configuration. You could stick to the SNES style d-pad plus 2 buttons, or you could go full keyboard and mouse, atari style, or anything in between. Allowing you to choose the limitations you wish to work with. As I wasn't planning to actually simulate a console, I had no plans to artifically enforce any kind of image or code memory limitations.

I started with the renderer and discovered quite a few things:

  • The Canvas 2D context obeys image rendering properties, and the CSS attributes for these aren't consistent across browsers.
  • Almost all functions on the canvas 2D context are anti-aliased, even when you've set canvas image-rendering properties to pixelated or equilivent.
  • When you draw lines you need to use a half pixel offset to get sharp lines, or it'll blur the line across 2 pixels.
  • Browsers do not display their window content at a 1:1 ratio, 1px in CSS is not 1px on the screen. You have to use the non-standard but prevalant window.devicePixelRatio to adjust the size of the canvas to get a precise number of screen pixels per texel.

I successfully worked out a set of basic drawing methods, which could draw pixels at a specified integer scaling to screen pixels, by using a small subset of the canvas rendering functions. I then discovered that the exact pixels on canvas are accessible as a TypedArray you can directly manipulate, which this Mozilla Hacks article outlines nicely.

Faced with the fact that I should probably re-write the renderer using this method instead, I realised I was spending all my time on tooling and that there was still significant work to do! Knowing that there was a game I wanted to try to make that would have probably been better in 3D anyway, I decided to shelve the project and revisit it when I felt like doing more pixel art.

Now that I come to write this up - knowing that my next two projects were created using Unity3D - a pattern to the projects I attempt emerges. On some projects I write things from scratch, enjoying not being tied to a commercial package and focusing on learning. On others I take advantage of my experience in Unity to create things much more quickly and allowing me to put the majority of time into making a game rather than creating the tooling that I need to effectively make a game! I do think both approaches have merit and I enjoy doing both, and rather than cutting this out, I'm planning to revisit projects when I feel the desire to switch approach.

So to allow me to easily to resume work on this project, I have uploaded it as Hestia on GitHub. I'm sorry there's no pretty pictures to go with this post, but this one didn't get past the coding stage!

Posted by Delph

A Wild Blog Appeared

After keeping the same design and broadly the same content for years, I've updated the site with a cleaner design and refocused the content. This includes adding this blog system, which should allow me to post about investigations, work in progress projects, and occasionally just stuff I'd like to write about!

It also includes putting up a page for Fury, the WebGL renderer I wrote a few years back, and sending some time updating the voxel terrain demo with improved performance and the ability to generate larger environments asynchronously, as it's a fun thing to play with.

The pixel art that I posted on twitter for Pixel Dailies earlier in the year are viewable on the pixels page, and I plan to post further pixel art pieces I make there too. Hopefully I'll get better. The new format of the site will probably better represent the fact I'm a bit of a dabbler.

I also took a little time to clean up the tutorials section, both updating a couple of the WebGL tutorials that had become out of date, and removing the Unity tutorials that were really glorified blog posts which were heavy on approach but light on detail.

I'm hoping to either polish up and post, or write a retrospective on, a few of the projects I worked on over the last year, as I've worked on quite a lot but not talked about or posted any of it! After that I plan to have a crack at actually completing a personal game, crazy I know.

Posted by Delph