Jump to content

  • Log In with Google      Sign In   
  • Create Account

Every Semicolon

Probably Archery: A Brief 7DFPS Post-Mortem

Posted by , 17 August 2013 - - - - - - · 1,169 views
7dfps, 7hfps, probably archer and 5 more...
Probably Archery: A Brief 7DFPS Post-Mortem This year’s 7DFPS game jam is the first game jam South East Games (my cousin Shane and I) has taken part in, but I’m pretty sure it won’t be the last. In one of those all-too-common moments in developing our larger game where we stopped, turned and began throwing around concepts for something smaller to make, we threw out “what about something like QWOP and Surgeon Simulator except its multiplayer archery”. We liked it, but normally that idea would be put into some dying part of our brains and we’d return to working, but (un?)fortunately, 7DFPS was a less than 2 weeks away and that gave as an excuse to do it.

7 Hours - Hemisphere

Posted Image

The weekend prior to the start of the 7DFPS, the organizers decided to put on a 7 hour version, the 7HFPS. This would be used to start getting things active early and help test their web site systems prior to the main event. At first I wasn’t particularly interested in working on something for 7 hours, instead eagerly anticipating starting on our silly archery game. Then we thought of making a first person bullet hell game. It seemed simple enough for 7 hours and we created Hemisphere.

7 Days – Probably Archery

Posted Image

I was a little worried about how development of Probably Archery would go over the 7 days since I got pretty bored making Hemisphere and that was only 7 hours. That wasn’t the biggest concern though, because Shane had full time work on all week and I had contract jobs to work on. The amount of hours we could spend per day during the 7 days would be fairly limited. There was around 3 days where I could work for decent stretches of uninterrupted time on the game, otherwise coding bits and pieces here and there. Shane had to make art assets after work, but got most of what we needed done during the starting weekend.

When thinking about how the game would play, we pictured awkward looking people struggling to get arrows nocked and fired in something resembling the right direction. As we built the game, it became harder to tell how it would feel to new users and felt less silly than we expected. Still, we wanted to keep the sense of humour so we had some very obviously inaccurate and silly aspects (players are balloon-headed sack people). Also by choosing to not research anything about archery at all and not worrying about accuracy, there are some aspects like the arrow being on the wrong side of the bow that probably annoy the hell out of people that know about archery, physics, etc.

I’d normally be very keen on the idea of live streaming development of the game, but the erratic development times weren’t ideal for that. I did enjoy sitting in the 7DFPS chat and watching various live streams over the course of the week. Playing the in development builds of games and having people in the chat test Probably Archery’s multiplayer early was awesome. The latter half of the week once I started doing this made the experience much greater as I felt more connected to other people and the jam as a whole instead of working on some silly game in solitude.

Ultimately I was fairly happy with how the game turned out. When I woke up this morning and decided to Google “Probably Archery” I was excited to see a couple of YouTube videos people had made while playing the game. Unfortunately one was prior to me updating the controls text to make it clearer that you could move the left arms shoulder and elbow joints as well, and the other was recorded before I fixed an issue where 3 people could be in a multiplayer match instead of 2 which would cause all sorts of issues. Still, just the fact that anyone played a game we made in 7 days and didn’t hate it is exciting to me.

Some brief technical points on how various parts of the game are done:
  • The arms are rigged and skinned and have a few animations for hand poses
  • ​The clavicle/shoulder, elbow and wrist joints are moved in code with min/max angle restrictions
  • Hand animations are set to only affect finger joints and can be played without affecting the rest of the arms
  • 2 pass arm shader draws translucent (arms fade when close to the camera to not obsure aiming vision) and opaque parts of the arms separately. This allows for proper depth sorting.
  • 2 cameras are used, one to render player arms/bow/arrow and one to render everything else. This allows for higher quality shadows from the directional light on the arms as the camera farClip-nearClip distance is short, while also allowing other environment shadows to look good with effective distance for cascades.
  • Bow string and hanging target rope is a quick script I wrote that generates a cylinder mesh of customisable quality and allows you to set Transforms as segment points. The bow string has a center Transform that gets attached to the hand when the arrow is nocked and drawn. The hanging targets have Transforms attached together with spring joints.
  • Bow drawing sound is a looping clip that I mute/unmute based on whether the draw strength was changed in the last frame.
  • Arrows have an Audio Source playing a whistling wind loop. This gives a really nice 3D effect as arrows fly past your head.
  • Multiplayer uses Unity’s built-in networking because of time constraints. We setup a master server and NAT facilitator on an Amazon EC2 server. When the player hits the multiplayer button, it will look for a hosted game with only 1 player (the host) in it and join. If it fails to join (the host has their Firewall blocking connections for example), it will look for another host, only trying that same one again after 30 seconds. If it doesn’t find a host it will host a server. This is fairly simple for me to setup and for the player to use, but it has some issues. If the player is full screen and hosts, they won’t notice a Windows Firewall popup asking them to allow access for the program.
  • Besides connection/disconnection code, all networking calls the same RPC method sending though a byte array with the first byte being a packet type. I assign callbacks/delegates to the NetworkManager to be called when certain packet types are received.
  • Arm collision is handled through capsule/capsule intersection tests (closest distance between 2 line segments vs the sum radius of both arm parts being tested). After moving a joint, collision is tested on that part of the arm and all parts down the hierarchy against the parts of the other arm. If they now intersect, the movement is ignore and reverted. When drawing an arrow and moving the left arm, collision is ignored to allow the right arm to intersect anything for gameplay purposes. After this, the right arm could be intersecting the left so intersection is allowed following drawing an arrow until there is no intersection. This allows the player to move the arms out of each other without issue, but not back in.
  • We added Google Analytics events to the game so we can see stats of how many people play each version, play the single player, multiplayer, etc.
  • I didn’t mean to put ‘COLOR’ instead of ‘COLOUR’ in the colour picker text in the menu, but American spelling of color in the Unity code was messing with my head Posted Image.
Again, we’re happy with how it turned out. It was hard to judge how it would play to a new user since after a short time with the mechanics, it became very easy for me to hit what I wanted. I think the game is a perfect fit for higher end motion control like the Razer Hydra, albeit with a separate control scheme where you only moved the hands (position and orientation) and the parent joints moved with IK. Having the WASD keys free also leaves the option for movement to be added if we wanted to develop it further and have larger scale multiplayer.

Thanks to the 7DFPS organizers for putting on a great event. There are a lot of really cool games that were made during the week. I think I’ve played just about all of them at this point. We’ll definitely get involved again next year and will hopefully have 7 days full time we can dedicate to making something cool.

Probably Archery 7DFPS Game Page
Probably Archery Web Player page

Volumetric Objects in Unity

Posted by , 29 June 2012 - - - - - - · 12,564 views
and 1 more...
For something a little different than just posting hours of video of me making an unnamed game, I thought it would be good to write something and talk about something different here for a change Posted Image.

First, I recently left my lead programming job to start doing indie development full time. The job was slowing and a combination of events created what felt like the perfect moment to pull the trigger on this. I'll post more about my experiences trying to generate in income to live on from the comfort of my home as I have more to write about, for the moment I thankfully have some great contract work that still keeps things in the black week to week at the moment.

For this entry however, I want to talk a little bit about volumetric objects, specifically the volumetric objects I've created and added to my Advanced Surface Shaders package for the Unity engine.

Volumetric Objects


The volumetric effects I've created so far are 3 basic shapes: box, sphere and cone. Rather than create and modify actual geometry for these shapes, I simply render a basic mesh just to have something render and I extend it's size/bounding volume on the CPU when the object's attributes change to encapsulate the size of the object. At this time I also pass information about the shape to the shader.

The shader is where the actual visual shape of the object is determined. Raycasting is used per pixel to determine the near and far intersection points (if any) of the volume and from that information the opacity of the object can be determined. The further the ray travels through the volume, the higher the opacity. I provide a visibility property for the shaders to determine how far you can see through an object before it becomes opaque. The effect also support the camera being inside the volume.

Posted Image
Click for higher resolution image

One of the key features of the volumes though is the support for texture sampling. Currently I support only world space sampling which is useful for the typical use cases of dust and fog within the volumes, especially when they are moving or there are multiple volumes near each other or intersecting. This way the textures shown within them will remain "in place" in the world as the volumes move and the textures can appropriately "move" from volume to volume like pieces of dust moving from within range of one spotlight to another. In future updates I will support local space texture sampling with control over the direction of the sampling for effects like light enclosures casting shadows down the length of a spotlight cone shaft.

To achieve the texture effects within the volumes I ray march along the intersecting section of the ray and sample the texture at that sampled position.

Posted Image
Image from the Volume ray casting page on Wikipedia

I really love what can be done with these sorts of effects and just throwing an arbitrary texture onto a volume and seeing the results gives new ideas about possible uses that would provide effects I've never seen before.

Over the coming weeks I'll add all the additional functionality I can think to add to the shaders for the package and provide variations on the shaders that are optimised by not doing what that isn't needed. For example if there is no texture used then there is no ray marching required and a far simpler path can be used in the shader to find the opacity per pixel. Or for cone volumes if there is no top cap required then calculations within the cone intersection test can be ignored.

I'll post more about work I do in Unity and for the Unity Asset Store here when there's something I think is cool enough to share. I'm working on a new system at the moment that could be released in the next couple of weeks that I'll be sure to detail here Posted Image.

If you want to grab the Advanced Surface Shaders package for these volumetric effects and a host of other shaders (e.g. Triplanar texturing, cone stepped relief mapping, parallax occlusion mapping, skin shading, etc) then you can check it out on the Asset Store from here or go to the Unity forum thread for more videos and info.

Every Semicolon: Parts 13 to 18

Posted by , 16 June 2012 - - - - - - · 726 views

It's been a while since I've done a post here in the journal. I didn't want to do a post per episode, but since there's been 6 episodes since my last post I thought I should do the update. I think that's all I'll write because well... there's 9 hours of video below. Yeah... Lots of good progress and cool stuff worked on so if you're one of the crazy (awesome) people that has time to sit through this stuff then this should keep you busy for a while Posted Image.

Part 13:

(I recommend watching in fullscreen 1080P. Youtube).

Some of the events in this video:
  • I setup the ballista so that it will interpolate it's animation based on the adjustable power and tilt
  • I make the ballista play a shoot animation adjusted depending on the selected power and tilt

Part 14:

(I recommend watching in fullscreen 1080P. Youtube).

Some of the events in this video:
  • I setup more intuitive controls for the ballista (and other weapons) for adusting tilt and power

Part 15:

(I recommend watching in fullscreen 1080P. Youtube).

Some of the events in this video:
  • I identy the cause of editor freeze that occurred in the last couple of videos through a process of elimination and fix the issue
  • Some small tweaks and fixes

Part 16:

(I recommend watching in fullscreen 1080P. Youtube).

Some of the events in this video:
  • I introduce the Developer Console system
  • I create an exploding barrel block
  • I make the trajectory indicator remain full when changing size
  • I ensure the ballista bolt ejects from the ballista at the correct angle

Part 17:

(I recommend watching in fullscreen 1080P. Youtube).

Some of the events in this video:
  • I discuss my scene view camera technique
  • I add and setup the new clouds model and skybox
  • I add the WIP cannon model and setup the cannon mechanics
  • I update some of the textures to higher resolution versions
  • I add a custom inspector for the standard Transfom component allowing copy and paste and world space changes

Part 18:

(I recommend watching in fullscreen 1080P. Youtube).

Some of the events in this video:
  • I create a Quick Selection tool to allow for fast selection of multiple nearby objects

Every Semicolon: Parts 11 and 12

Posted by , 24 April 2012 - - - - - - · 1,044 views

I've done another couple of episodes focusing first on getting the first iteration of the Dwarf model into the game and then creating a component copying editor window using reflection. I wrote up some thoughts on my experience doing these videos a little while ago and never posted them. I'll most likely update that and post it in the near future. There's a lot of benefits to doing this that weren't immediately obvious, and I think it will be much easier for me to articulate those in text than while rambling away while programming in the videos.

Part 11:

(I recommend watching in fullscreen 1080P. Youtube).

Some of the events in this video:
  • I add the first iteration of the Dwarf model
  • I write a script to reassign bones for skinned meshes to another skeleton
  • I write the first step of an Actor script that randomly changes the playing idle animation
Part 12:

(I recommend watching in fullscreen 1080P. Youtube).

Some of the events in this video:
  • I write an editor window for copying entire components or component values to another object
  • I fix up the initial orientation of the fired projectiles
  • I setup the platforms to be able to move up and down on a sine curve

Every Semicolon: Parts 9 and 10

Posted by , 11 April 2012 - - - - - - · 809 views

Keen to get some of the new artwork in and working, I've done another couple of episodes of Every Semicolon. One of these days we're going to need to name this game...

Part 9:

(I recommend watching in fullscreen 1080P. Youtube).

Some of the events in this video:
  • I integrate some new block artwork, creating functional prefabs for each
  • I modify the duplicate offset objects shortcuts to make the next prefab object in a series
  • I setup a new test fortress with the new blocks

Part 10:

(I recommend watching in fullscreen 1080P. Youtube).

Some of the events in this video:
  • I setup the ballista bolt projectile with proper collision and custom center of mass
  • I setup the ability to change the firing angle for the ballista (and other future weapons)

January 2017 »

15161718 19 2021

Recent Comments

Recent Comments