rust-game
A demonstration of the future of programming
Play the game here
In order to spur a virtuous cycle of Rust adoption (as described in
my proposal), I worked with a
team in order to create a video game that might convince people to
start adopting Rust. During this process, I needed to use 21st century skills
Creative Problem-Solving
One of the issues that I encountered was that there was an object in the GLTF file that was exported from Blender that was causing my convex decomposition algorithm to panic. I had to take the vertices from my algorithm and graph them to find the problem. It turned out that my algorithm was panicking from a flat surface being decomposed. Once I figured this out, an easy flatness check and algorithm swap made rust-game panic-free.
Experimentation
While I was working on rust-game, after implementing GLTF loading and hitboxes, I needed to do a performance test to make sure that there were no critical memory issues that might prevent us from moving forward with importing Blender files into the game. To do this, I imported a Minecraft world that was far larger than our actual final world to see if there were any performance issues. Luckily, rust-game ran at a smooth 1440p/144FPS, even when put under an unrealistically sized world.
Debugging
While I was implementing controller support, I had an issue with my trigonometry where, when pushing the analog stick directly to the left or right, no movement would register because of a NaN error. It turned out that this was because I was taking the arctangent of y/x, which doesn't exist at y=0.
Please see this section of code for the now working algorithm
Understanding of Engineering Principles
I had to understand engineering principles throughout the entire development process. Here are some of the many instances of this:
- Bevy uses ECS, which was used in every function in my code
- Large projects (rust-game is over 1000 LOC) require careful thought towards scalability
- The WASM port required consideration of the limitations of what can run in browsers, which is why we switched to embedded assets
- One of the basic CS optimizations is operation caching, which I used here to deal with our convex decomposition algorithm
- Serialization/deserialization is another fundamental CS principle, which was used when I was trying to implement operation caching.
Presentation Skills
When we presented our results, we had to communicate our project clearly to a non-technical audience. We decided to create a hands-on experience. For this to work, we had to make sure our game could properly communicate with school laptops, which we did using our WebAssembly port.
Collaboration
Teamwork and frequent communication was critical to make sure that the code of rust-game which I coded would be compatible with the 3D models created by my teammate. We overcame this issue by regularly communicating and testing our compatibility to detect features that existed in Blender but had not been implemented in my code, among other methods.
Schedule Management
We were on a very strict time limit, and still didn't fully understand our respective programming tools, so we decided to aggressively weight the learning phase of our project. This may have cost us a lot of time at the beginning, but it made the actual creation process very efficient.
I also had to deal with sunk cost fallacy when implementing multi-threaded convex decomposition. I spent almost a week trying to implement multi-threaded convex decomposition in order to speed up the development process, each day feeling like I was almost thereā¢. Ultimately I decided to prioritize features that would help end users rather than just developers and dropped the idea.