profile_space.png
Hi, my name is Stefan and I’m a game developer, working mostly with gameplay, tools and shaders. You can find all of my work samples here, there’s a CV page for all that serious stuff and an About page if you want to know more about me.

Welcome to my portfolio!
— Stefan Andersson

Releases

Gorn 2 - Ranged Weapons

GORN 2 is an extremely violent (and funny) mod-friendly gladiator game in VR, and the sequel to one of the best-selling VR games of all time. This was an absolute dream project to work on and I learned so, so much about reactive programming, dependency injection, physics and more!

One of my biggest responsibilities during the project was ranged weapons; essentially, write a re-usable and easily moddable ProjectileLauncher script, implement a Bow and Arrows and teach our Rokibes to use them. Later on, I was also tasked with implementing a Nailgun and a Bazooka using the same system.

 

Gorn 2 - Unique Kills Crowdpleaser

In Gorn 2, we occasionally have optional challenges - called Crowdpleasers - that the player can complete to earn a reward, and during one of the last fights of the game, it was decided that the Crowdpleaser would require the player to kill 15 enemies with 15 different weapons; a sort of walk down memory lane, if you will. This posed an interesting challenge, because as I quickly found out, this is a lot harder than it sounds in a physics-based environment.

We had a system in place that I had developed earlier called DamageContext, which would allow us to glean information about a damage event:

  • A weapon has an attached DamageContext component and things the DamageContext needs to be aware of:

    • Colliders (even a regular collider, like the handle, can cause impact damage)

    • Damage-causing components (like Piercing, used for arrowheads)

  • When a body part impacts a collider, we check if the collider is associated with a DamageContext

  • The body part may also receive damage events from components like Piercing, and these carry a refernce to the DamageContext

  • The body part can then retrieve information from DamageContext like, “is the weapon this is attached to held by anyone, or was it recently held by anyone?”

  • The weapon itself can also listen to its DamageContext to receive information about the damage events it was involved in, like “did I manage to kill anyone?”

My starting point was here then, creating a script that could listen to OnKill events and use DamageContext to figure out if the player was holding the weapon. Except, when I tested it the accuracy was terrible - unusable, even! It turned out that when the player strikes an enemy, it’s often just as likely that what actually kills them is the enemy hitting their head against the wall, poking themselves with their own sword, falling off a platform or suffering any of a myriad of other horrible fates. The solution then was actually quite simple - like the adage goes; “keep it simple, stupid!”

Instead of somehow trying to figure out if the player was technically responsible, simply try to figure out if the player is likely to believe they were responsible! Instead of telling DamageContext it scored a kill when it technically did, I created a system called DeathBlameHandler that kept a history of recent damage events; when an enemy dies, the system goes through the history to check if any of the recent events were associated with the player, and if so, uses that as the death-causing event and calls that DamageContext! This worked great, as you can see in the video! When I kill someone using a new weapon, a new box is ticked on the wall, but when I re-use a weapon, it does not.

There are times when it feels a bit too generous, but I would rather the player feel they were treated unfairly in the positive sense than the negative.

 

UNTITLED PROJECT

This is my private project that I worked on in my spare-time for about three years. I wanted the player to be able to create an indoor environment with as few restrictions as possible, while still keeping it as a normal, uniform grid - for my own sanity’s sake. I had to make a lot of compromises in the end, but I think the result, while not completely finished, still turned out pretty nice. I’ve written some stuff about the more interesting features below.


Toca Life

Here are some features I’ve worked on for Toca Life - a roleplaying app where you do pretty much whatever it is you want to do. Grab some characters and mess around with the world!


Fluid Simulation

Here is a project I worked on that started as part of the Untitled Project but ended up as just a good learning exercise! I found an old implementation of smooth-particle hydrodynamics in Java which I rewrote to C#, then converted to HLSL after learning how to use compute shaders.


Lootbox Worktest

This was for a worktest I did, applying for a position as a Tech Artist. The assignment was to create a scene where a lootbox appears, the player opens it, is presented with the contents and then you can choose to reload the scene. Preferably with some unique setting, so, I chose space!


Unity Tools

Here are some tools I’ve made for various purposes!