View profile

Sid Makes Games #2: When Bodies Collide

Sid Makes Games #2: When Bodies Collide
By Sid Shanker • Issue #2 • View online
Welcome to the first real edition of this newsletter! If you’re new here - this newsletter is going be about games – the game I’m making, . Note: I am not Sid Meier. If you are ok with that, read on!

What I've Been Up To
I’m currently working on a 2D top-down multiplayer game in Unity. I’m still fleshing out the mechanics, but the general idea is that multiple players will be in a house or something like that, and each player has a secret “target” (another player) to kill. (Drawing inspiration from both Assassins and Among Us).
So far - I have a multiplayer environment that players can join, and I have a character object that players can control:
I've done a single character design (I call him Edgar)
I've done a single character design (I call him Edgar)
There are still a bunch of weird bugs around the character controls & animations that I want to look into, but the next steps are going to actually be playing around with some different game mechanics. The main thing here is figuring out what I want the combat mechanic in the game to actually be. I’m definitely going to look into whether items are a thing I want to include, and am curious to play around with placing objects in the environment that the players are in.
When Bodies Collide...
One of the fun things about Game Development that I don’t get to experience when writing server-side code (ie: my day job) is that bugs are super visual! Today, I am excited to show off…this:
Get outta here!!
Get outta here!!
This is pretty annoying: one player coming in contact with another player, it sends the other player flying off…into the abyss. However, trying to figure out what was going on here ended up teaching me a lot about how Unity & Game Engine physics work!
So, what’s going on here?
For the movement of these player objects, I’m taking advantage of the physics system that Unity provides. This is important – this “physics” system allows us to enable behaviors like: “I don’t want my player to be able to walk through a wall”. Unity’s editor allows you to take advantage of this through defining your player, and other objects in the world (such as walls, or in this game, treasure chests) as RigidBodies.
By defining both the player and walls as Rigidbodies, we make it such that players automatically follow basic physics rules, preventing them from say, walking through the walls, and achieve this without writing any code.
With regards to the bug here, it seems like something is going on with how these rigidbodies interact with each other. What I discovered is that when one one body collides with another, a force is applied. Since I haven’t defined any friction in this world, any force will cause the object receiving that force to continue traveling. This isn’t an issue for objects like walls or treasure chests, which are given special powers to never move (which won’t work for players).
While moving like an air hockey puck looks cool, it unfortunately isn’t what I want, and it seems like I’m actually going to have to write some code to address players colliding.
Thoughts & Feelings So Far
So far, I’m still in the honeymoon phase of trying out a new hobby, and am having a great time. The small amount of experience I’ve had so far has made me way more appreciative of the games that I play, and I’m in total awe of game devs right now.
There are still a bunch of things I’m getting used to, and some things I’ve been frustrated about in the game dev experience:
  • I don’t have any version control set up for my Unity files, which makes it harder to get back to a working state if I broke something. Experimenting with things seems more heavyweight than it should be. Consequentially, there’s no easy “diff” you can look at to look at changes
  • Testing stuff out takes a while. Especially that I’m making a multiplayer game, to test if things are working or not, I have to create a lobby, join, and then discover I didn’t save properly 😢 Curious to see what other devs do on this front!
  • Working on Windows more generally – I don’t have any valid complaints about it, but I’m just not used to it and feel dumb sometimes. Basic things like remapping my Caps Lock key took forever.
I’ve also been really impressed by the Game Dev community. There’s so much amazing content on YouTube for learning how to do this stuff – I’m particularly thankful to Dapper Dino, Mister Taft Creates, and Black Thorn Prod for their videos!
What I've Been Playing
For the past couple weeks, I’ve been playing a lot of the 2D platformer Celeste. It’s an incredible game, and it’s particularly cool how the story complements the gameplay. The story is all about persistence, and overcoming self-doubt. In the meantime, because of the difficulty of the game, you as the player also have persist and overcome self-doubt. It’s a really cool approach to storytelling, that as a player you go through the same emotions as the character. Be forewarned if you are going to try playing it – it really is very difficult.
Celeste is also a great example of excellent game design. The Game Maker’s Toolkit video Why does Celeste feel good to play? gets to the core of what makes the game feel good to play. Some of the elements that I thought were really interesting were tuning the acceleration and deceleration of the character can really change the feel of the game.
For instance, if a character decelerates too slowly, they’ll take a long time to stop and feel somewhat out of control. On the other hand, if the character reaches top speed very quickly, and also slows down very quickly, the character movement will feel “robotic”.
From "Why does Celeste feel good to play?"
From "Why does Celeste feel good to play?"
Adjusting the widths of the acceleration and deceleration times are key to having a character that feels good to move around. The Celeste devs came up with a really good balance here that makes Madeline, the character that you control, a fun character to control.
A meta-insight from this is how details like this that might on the surface seem small can really change the experience of a game.
Thanks for reading!
If you made it this far, thank you! I’m excited to continue sharing more of my progress. If anything here resonated with you, or sparked a thought, feel free to drop me a line! I’ll be experimenting with different formats for this, and appreciate any feedback as well!
Did you enjoy this issue?
Sid Shanker

Sid makes games! Follow along for fun content about games & game development!

In order to unsubscribe, click here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Powered by Revue