A downloadable project

DOWNLOAD 

This is an early version of the game. (I need some friends to come back from winter break so that I can get more up to date video.)

For my final project of Game Engineering II, I made a multiplayer fencing typing game. After a countdown, up to 6 players can move around and attack each other using text commands. Some examples being strike, to swing their sword, and roll to dodge. After a player takes any hit, their health bar would lose a heart, and everyone would get teleported back to their starting positions to play again.

The reason I decided to pursue this type of game was because it would allow me to add interesting features to my animation system, like flipping sprites on the X and Z axes while only using the same sprite sheet. Also, I am very interested in networking and multiplayer games, and Roberto’s networking system sounded fun to learn and use. It also helped that I am good friends with Roberto and could easily ask him questions when I ran into issues.

Chai’s Animation System:

  • My goal was to get Direct3D to work, but after getting what I thought was the entire implementation in, it didn’t immediately work. Thus, I decided that I didn't need it to make a game and moved on. 
  • Based on feedback during the systems presentation and my current needs for this game, I added support for any length animations on the same sprite sheet. 
  • Dynamic color changing during runtime. 
  • One-shot animations.
  • Support for frame checking for events that play on specific frames of an animation. 
  • Clearer naming and data separation for animations, animators, and draw call data. 
  • Flipping animations on the X and Y axes. 
  • I didn’t need to do anything for the UI. I just used the existing sprite sheet system to display different static images when I wanted to. 
  • Moving tileable textures across the screen. I just made a new shader that used the existing animation framework. I really just added this for clouds. 
  • I would like to rework this code to be less coupled with the graphics system. Right now all the frame-changing logic is being run internally by the graphics library, which makes it annoying to update the code. Every time that I want to change some of the logic, I need to update my graphics, animation structures, and game-related object structures. I feel that making it possible to just pass individual frame data into the graphics engine might make development a bit faster. 

Yens Collision System: https://joumik.github.io/p/game-engine-ii-collision-system/ 

  • Triggering collision events and understanding where exactly hitboxes were. 
  • Since collisions could never be ignored or disabled. I teleported the hitbox backwards in the sword hitbox in the negative Z direction and back to its normal position on specific frames of the sword swing animation. 
  • During a roll, I also teleport the player's hitbox away in the Z direction, making the sword trigger unable to activate. 
  • Missing ways to differentiate between colliders on the same game object. I added a really simple tag ID to his collision class so that I could quickly differentiate between different collision events. I was using basic position checks before this change since each player knew the locations of their own colliders, and it could be assumed by heights what was a sword and what was a body. I felt that this was not very scalable. 

Roberto’s Networking System: https://reynosorobertov.wixsite.com/mysite/post/network-system-for-game-engine 

  • Roberto’s system was designed to be server authoritative, which led to some issues of duplicated inputs for clients. It took me a while to figure out what was exactly happening because I can only debug one client at a time. The client would send some data to the server, and the server needed to update all of the existing clients, but this meant that it was sending the data back to ALL of the clients, including the one that just sent its data. After figuring this out, it was a simple change to check which client sent data and skip sending data to the same client. 
  • When making actions that the player could do, I made a bunch of methods that could be called by inputs. This made it very easy to pass enums that would correlate into actions in the networking system. This would also keep the amount of data I was sending to a minimum.
  • Syncing players between games was done by passing a player's X position almost constantly. This was not the best solution in the slightest. There were some bugs inside my movement code that made movement inconsistent because its move time was tied to an animation. They made the desync very noticeable. If I had made movement more consistent, I could have gotten away with just updating position only during parts of an animation, like the end of a roll, instead of constantly. 

Devyns Input System: https://sites.google.com/view/dlg6320wu/engine-system-release 

  • Windows Callbacks for registering keypresses was an issue for me. The function was static, and I kept trying to add a static member variable to store his key manager system but kept getting a separate instance of the manager. After talking with Devyn, the solution was to make it an external global variable.
  • Implementing the rest of this system was super straightforward, and I really appreciated the example on the instructions with possible key checks. 
  • I ended up making 16 possible typed actions that the player could input. 
  • strike 
  • roll
  • turn
  • up1-5
  • Back1-5
  • Red
  • green
  • blue

Overall, implementing my fellow classmates' systems was relatively painless. I felt that they all did a great job explaining how to add and implement their systems. It also helped a lot that my game was 2D. It made development significantly easier, not needing to worry about rotations or 3-dimensional space. This allowed my logic to be simple and easier to debug quickly. My game also transformed during development to fit the basic functionality of their systems. Initially I was toying with the idea of adding jumping and physics-like knockback, but this was over-scoped for the amount of time I had to work on this. I also saw Roberto and Gabe struggling with their car physics systems with collisions and networking. 

Class Reflection:

These are some of the topics I learned about during this class.

  • Platform independence
  • Graphics Debugging 
  • Lua 
  • Maya plugin 
  • Human-readable files

These feel self-explanatory to me, but I like to talk about where I feel that I really improved. 

Architecture and design:

I find that I cannot predict every use case for a system or know exactly how abstracted it should be. The best thing to do is just start programming, and once you have something running, it's easier to go back and refactor while making iterations and new features. It was great to test the system in a real-world game environment and see exactly what functionality it needed to function and make it more efficient to use for myself. It was amazing to see 4 separate systems coming together to make a functioning game with little tweaking and understanding of how the underlying systems work. Even during the final project, I kept finding myself tweaking small bits of code I had written in the past. 

Data Types with Memory Optimizations:

Example:

When using the networking system, I needed to store a client ID; in the past, I wouldn’t even think about it and just use a standard integer variable, but now I stop and think for a sec. Will this number ever be negative? No, I should use a type of unsigned int. How large will this number realistically ever be? I only made 6 spawn locations for players. I could add more, but there will definitely be performance issues passing that many players' data around to each client. Uint8_t is perfect for this. It is an unsigned int with a max of 255. I just saved 3 bytes of memory. These savings will be even more drastic in object-oriented programming, where this could be duplicated many times in one game. Like each animation in my sprite animation sheet. 

This was one of my favorite projects I’ve ever worked on, and I learned so much from it.

I DID NOT CREATE THIS ART. PLEASE SEE THESE TALENTED ARTISTS ON ITCH.IO:

https://aamatniekss.itch.io/fantasy-knight-free-pixelart-animated-character 

https://free-game-assets.itch.io/free-summer-pixel-art-backgrounds 

Download

Download
Chai Game.zip 804 kB

Leave a comment

Log in with itch.io to leave a comment.