Tutorial – Creating a Realistic Boat in Unity

August 14, 2019

Realistic Boat Physics

Unity

Harbrador – Make a realistic boat in Unity with C#

By: eriknordeus

As someone interested in using real world physics and applying it with Unity’s physics engine, this tutorial just looked very interesting and promising. It appears they do a lot of work determining buoyancy as well as air and water resistance using the actual mesh of an object. They also split the code up in a nice way, separating a lot of the math into its own class to keep scripts organized and easier to use/read, so I wanted to look into that organizational setup. Overall, this is just a cool project that has a lot of factors I want to learn more about (physics in unity, organizing scripts, applying real world concepts to Unity/games).

Thesis Game Concept – Buoyancy

February 6, 2019

Buoyancy Game Concept

Thesis Physics Game Concept

This concept focuses on creating a physics-based game with a lot of variable parameters using buoyancy to guide the main mechanics.

The first focus is just setting up a script that handles adding buoyancy force to an object. This script was named BuoyancyApplicator. It has a section of variables dedicated to determining the buoyancy force (all the variables in the basic buoyancy force equation), a section dedicated to different geometry dimensions (to determine volume for the previous equation), and then other Unity specific variables (such as RigidBody component). The standard buoyancy force equation used is:

(buoyancy force) = ((liquid density) * (acceleration due to gravity) * (volume of displaced liquid))

All of these are variables we can alter to provide a different experience, but for the simplest version in a given scenario, we can keep gravity constant, the volume displaced will be a constant (from the shape of the object) as it will be fully submerged the entire game, and liquid density just changes when the object goes from one liquid to another.

The game will involve the player controlling an object going through different liquids, so we needed a way to account for this transition. Since we just need to change it upon entering a new liquid, I placed the update for the liquid density variable in the OnTriggerEnter, and just have the “liquids” has trigger collider areas.

In an attempt to make it more physically accurate, I implemented Unity’s own rigidbody drag factor. Fluid drag is a fairly complex calculation, so in an attempt to just mimic it simply, I set the drag equal to liquid density times an arbitrarily defined drag coefficient that is manually assigned. I am not entirely sure how Unity’s rigid body drag works, but this approach seemed to give the desired result for the most part. It was especially helpful for cases where I had the object speed up a lot going through a very dense liquid, and then slowing down when entering a less dense liquid. All of this together even worked to have the object sink when it entered a very low density liquid.

Recap – Week of December 30 to January 6

January 6, 2019

Recap – Week of December 30 to January 6

Terminology from Tactics Tutorials

Physics Constraints

Write Up on Physics Constraints by Hubert Eichner

A nice description of equality constraints, impulse and force based constraints, and other physics constraints used in games.

Priority Queue

Youtube – Priority Queue Introduction

Quick video by WilliamFiset on concept of Priority Queues and Heaps.

Heaps

Youtube – Heap Explanation

Quick video on concept of data structure of heaps, which was a follow up to the priority queue information above.

Subscriber Pattern (Observer Pattern?)

Wikipedia – Observer Pattern

Searching for subscriber pattern resulted in a lot of information on observer patterns, which may be another term for the same thing described in the tutorials. This will require further investigation.

Dictionary

C# Corner – Using Dictionary in C#

Nice, simple write up on basic functionalities of the dictionary type in C#. “A dictionary type represents a collection of keys and values pair of data.”

Youtube – Create a Dictionary Using Collections in C#

This is a basic video tutorial for setting up dictionaries and using them in C#.

Stacks

Tutorials Teacher – Stacks

Tutorial on setting up stacks in C# and some of their functionalities.

Microsoft Documentation – Stacks

This is the Microsoft documentation on everything about the stack class in C# with examples.

Queues

Microsoft Documentation – Queues

This is the Microsoft documentation on everything about the Queue class in C# with examples.

Youtube – How to Work with C# Queues

Simple tutorial initially from Lynda.com about using queues.

Video Game Physics – Constrained Rigid Body Simulation by Nilson Souto

January 5, 2019

Video Game Physics – Constrained Rigid Body Simulation by Nilson Souto

Toptal – Video Game Physics Tutorial – Part III: Constrained Rigid Body Simulation

By: Nilson Souto

Link to Erin Catto’s box2d.org

This appears to be a good follow up to the game physics GDC talk by Erin Catto I watched earlier. This serves as another listing of physics constraints and how they can apply in games, specifically when dealing with rigid body elements. I also learned the constraint type is “revolute”, not “resolute”. This article actually references Erin Catto and his Box2D site since it goes into his creation of the sequential impulse method.

May 6th, 2018

Terms and Definitions for Investigating Real-Time Rigid Body Deformations in a Game Environment

Engineering Terms

This is just a list of useful terminology for understanding rigid body deformations in the real world in an effort to translate them into a virtual setting, preferably for games. I am currently looking into research that uses finite element analysis and modeling techniques in order to create physically accurate deformations in real-time in a video game setting.