Making a Game in Unity 012: Crews

Just so you know, this is not a tutorial series! I am writing this series mainly to give you a behind the scenes look at the process of making a game in Unity, and to document the development of this project.

See other posts in this series.


Making a game in Unity 012

In the last two weeks, I added crews, along with support for multiple ships in the world. I also fixed a whole range of issues that were plaguing ship flotation and maneuverability.

Monday

Today I fixed the character controller drifting problems. I need to take another look at it though, since walking up stairs still doesn’t work.

Tuesday

This morning I added the necessary UI to support crews. Crews will be like teams, each with their own ship. Later in the evening, I modified the ship spawning mechanism to work with crews, meaning there can now be multiple ships in the world. Then I made it possible to create a new crew after joining the game, which also provides you with a ship.

Wednesday

Today I added the ability to join and leave crews. I was sort of busy, so that’s it for updates.

Thursday

This evening I made it possible to leave a crew. There’s still a few cases I need to handle properly, like when the last person leaves. Currently that would just result in an empty crew, but I want it to remove the crew instead.

Friday

Today I set about deleting crews when everyone leaves, but I ran into some issues with removing the ship’s collider. When it gets removed, it produces an error, but I currently have no idea why.

Saturday

I managed to resolve the error this evening. I had totally forgotten to delete the game object that the ship code was attached to, which resulted in impulses being applied to the deleted—and therefore nonexistent—collider.

Sunday

Today I didn’t write a blog post. I’ve been struggling to come up with interesting, valuable-to-read-about topics that I can write about well. I’m currently still in high school, so outside of this game I’m developing, nothing in my personal life really intersects with the topic of programming. Since there’s already so much well-researched information out there about a massive range of topics relating to tech, I don’t see the point in adding more articles to that pile. I’d also prefer to spend my time programming, rather than sinking hours into researching a subject that has already been covered plenty of times. That being said, if you have any topics you’d like me to write about, please let me know either in the comments, or on Discord!

I feel like the most valuable information I can provide will come from my personal experiences, and currently this series is covering the extent of that. In the near future, I’ll have to get a programming job somewhere, and that process is something I could easily write about. While spending hours and hours on research for a post every second week will probably lead to burnout quite quickly, I really don’t mind taking a comparatively short amount of time to write about a programming-related experience I’ve had. As a result, I’ll probably start updating this series on a weekly basis instead of bi-weekly.

In terms of actual project progress, I made the ship flotation system more reusable and a little easier to manage. It’s still behaving strangely, and there’s clearly something wrong, but I’ll have to look into that tomorrow.

Monday

This evening I fixed the flotation system. It had been super bouncy ever since I upgraded from BepuPhysics v1 to v2, and I really wasn’t sure why. After some fiddling and investigating, I noticed that gravity was enabled for ships. Since my flotation code already adds “artificial” gravity, this was essentially resulting in double the gravity being applied. That caused the ship to sink too far into the water, and subsequently to bounce back up higher than intended.

Additionally, I fixed the ship’s propulsion, which was also still broken from the upgrade. The methods used to apply forces function slightly differently in v2, so the same code was still error-free, but it left the ship spinning in circles instead of moving in a straight line.

Tuesday

Today I made a few minor changes to my console Logger class. Yesterday I started building a chess game for my programming teacher to use as teaching material next year, so for the remainder of the school year, my class time will be going towards that instead of this project.

Sunday

Wednesday through Saturday were unproductive in terms of progress. I was pretty busy with various things, but I was also feeling very unmotivated in my free time.

This afternoon I started by updating the physics engine. There’s been a few bug fixes, some related to character controllers—one of which fixed an issue I was having when a player would jump while on a ship. Even though he had the same velocity as the boat when standing on it, as soon as the two weren’t in contact anymore, the player would lose all momentum. That shouldn’t have been happening, and it made predicting where you’d land quite hard. Luckily it’s no longer a problem.

Later in the evening, I fixed the ship turning mechanism, as that was also still broken from the v1-to-v2-upgrade. I then removed the restrictions on the player’s rotation while steering, and I cleaned up a bunch of built-up clutter from various tests in the project. I also sailed the ship around a bit, and I have to say, I’m super happy with how it works so far.

What’s next?

As I explained earlier, I’m currently out of topics to write about outside of this series, so I’ll start updating this weekly instead of bi-weekly. However, I’m graduating from high school next week (finally!), so depending on how much progress I manage to make, I might do one more post covering two weeks of development.

Project-wise, there’s still a few character controller related things I’d like to take care of before moving on (ladder climbing, air control, some polishing). After that I’ll probably move into terrain generation, but I likely won’t get to that until after this coming week.

See other posts in this series.