• Math Blog

    This week, the project review got delayed to Wednesday, and as such, I had more time to refine the save handler into the best state it can be before the review/new demo. The largest improvement added was a way for the player to reset their save data, so that if they wish to restart from the beginning, they can do so with a single button press. To do this, I had to use an understanding of data and statistics to be able to understand and tweak what should be reset, whet

    (The save reset button in the main menu)

    Along with being able to reset the save data, I also added the precursor to a save versioning system to make sure that if the player’s save data is out of date and incompatible with the current version, the game can reset the data automatically, which is to make sure that whenever the player tries to load a save that dosent exist, it creates one automatically. To do this, I had to use Boolean Algebra (Standard: Algebra and Functions) to check whether the player has a valid save file at their selected filepath, then subsequently create a new save, then call that code any time that a piece of save data is being loaded.

    (The boolean function that creates the saves whenever the file is nonexistent)

  • Math Blog

    This week, we are timecrunching because project review is within another week, and as such we need to get as much *WORKING* stuff into the game as possible. As my task that I spent nearly the entire week implementing, I had to make a handler class that allows the player to save their progress within the game. To do this, I had to understand Data serialization and Statistics (Standard:Data, Statistics, and Probability) to be able to convert a large list of variables and other data, into a both human & computer readable JSON file.

    (The function within the handler that saves the data)

    When creating the save handler, I also had to have an understanding of Geometry (Standard: Geometry) as of current, the biggest part of the players progress that we are saving, is where within the 3D world the player had visited last, so when the player restarts their game or loads the file again, they can be placed right back where they were, and to do this, we need to know the exact point within the world the player last was.

  • Math Blog

    This week within Game Development I had to implement crouching down into our game, and leaned on boolean algebra (Standard: Algebra and Functions) to be able to signal when to move the camera down, along with signal to the enemy AI that the player cannot be detected unless there is direct line of sight. The code itself was rather simple, as it was just setting the boolean variable whenever there was an input and than within the process that is called every frame detecting if the variable was either true or false.


    (The code detecting inputs, than setting the variable respectively)

    Along with using boolean algebra, I had to have an understanding of linear interpolation and translations (Standard: Number & Quantity) to be able to smoothly move the camera down in game when the code mentioned above detects that the player is crouching. This was necessary because without the smooth transition between crouching and standing (and vice versa) the players camera snaps which not only does not look as good as a smooth transition, it could cause motion sickness in certain groups of players (granted this game is probably not the best for that subset of players for a multitude of other reasons).

  • Math Blog

    This week, within Game Development, we were back to our normal, yearlong projects. In my case, this meant adding brand-new secondary weapons into the game.
    Since I have not refactored the blocking code just yet, I haven’t been able to add the shield, but I was able to add the tomahawks and throwing knives to the game. To do so, I had to have a deep understanding of vector mathematics (Standard: Number and Quantity). When implementing them, I had to have a different approach to coding their movement and physics, as the tomahawks and throwing knives have a much slower velocity compared to the previous projectile weapons; therefore, I focused on making the initial impulse as well timed as possible, along with at just the right angle and velocity to look consistent, and “good”.
    Along with using vector mathematics, I had to use a deep understanding of 3D Geometry (Standard: Geometric relationships), especially for the tomahawk, as the tomahawk is intended to spin within the air after thrown. To add this intended spinning effect, I had to understand the direction to rotate the tomahawk scene, after thrown, at what intervals to rotate it, and make sure that the animation was mostly faithful to the hitbox of the tomahawk.

  • Math Blog

    This week, within game development, the game jam was extended. Due to this, this week I pivoted back to coding to be able to make as much progress on the code for the project as possible.
    My main goal for the week was to get the UI and code for each stage working and finished. This involved using Boolean algebra (Standard: Algebra and Functions) to make the logic that determines how to spawn the tetrominos that the player places down in order to increase their score. I used Boolean algebra in this way by creating multiple If-Else statements that determined which marker to set the tetrominos placement to, which tetrominos to deactivate in order to place new ones down, and how the placed and deactivated tetrominos may affect the player’s score.

    Line tetromino
    (A Line, T, Z, and Square tetromino, respectively)

    Along with this, I had used an understanding of 2D space (Standard: Geometry) to be able to create the game’s UI, and have it function correctly. I used Geometry in this way to be able to signal within the code where players are clicking, and if the code should spawn new items, tetrominos, or power-ups if the player clicked on the respective UI or button area.

    (The game’s UI within the Godot editor)

  • Math Blog

    This week in game development, it was another game jam, and as such, I had to design a new game. To do so, I had to use algebraic functions to determine the minimum required score that the player needs to reach in order to progress within the game. The function that determines the minimum score being: f(x)=((2x/10)+x2+10)f(x)= ((2^x/10)+x^2+10)
    with ff being the score, and xx being the player’s current stage.
    Along with using functions, I also had to use numbers and statistics to determine parts of the player economy. Namely, how the player gains money and how certain “modifiers” within the game give the player extra money. The player gains money by having more unplaced tetrominos by the end of the stage, and the modifiers that can be used during stages give the player a flat amount of money each time they are used.

  • Math Blog

    This week in game design, I had to rely heavily on Boolean algebra and have a deep understanding of Boolean algebra to refactor code that allows the player to attack with their main-hand weapon from 4400 characters of code, down to 2200 while still keeping full functionality. The code snippet below shows two boolean statements used within the new code, along with comments explaining what each part does.

    Along with boolean algebra, I needed to have a deep understanding of probability and random numbers to add code that determines when a bleed effect is added to an enemy with a random chance, along with the damage and duration that the bleed effect will last.

  • Math blog

    This week, in order to fix bugs related to the stake gun secondary weapon, flintlock secondary animation, along with certain animations, I had to use vector mathematics, along with boolean algebra. When fixing the stake gun and flintlock, I had to change the impulse applied to the projectiles to prevent them from colliding and getting stuck on the player when traveling too slow, along with creating a boolean statement to determine when to apply this impulse to make sure its after the projectile’s position was set to the correct marker. when fixing the animations, I had to edit a faulty expression that determined when to play the animations that correlate to player movement and locomotion.

  • Math Blog

    This week, it was essential to use both boolean algebra, algebraic functions, along with geometry to improve and polish the animation system. This involved creating complex algebraic equations/functions and boolean expressions to allow animations to flow together more smoothly than before, along with more accurate detection of when to actually trigger each animation. Along with the boolean algebra and algebraic functions, it also involved using an understanding of geometry to add some minor tweaks and changes to animations to once again make the animations flow together more smoothly and add better transitions between animations.

  • Math Blog

    This week I had finally got the animation system to start to work, which required an in-depth understanding of boolean algebra and logic. I had gotten the system to work by intertwining different variables within a script (Variables such as whether a player is running, the velocity of the player, which swing within a combo the player is on, whether the player has the block button held down, etc) with boolean expressions in a tree, that periodically updates to transition between different animations.

    Along with the animation system, I had been working on fixing multiple bugs involving object collision, and a bug involving the projectile from the flintlock freezing in place when spawning, which required an understanding of vector mathematics to be able to redirect objects out of the ground, along with fix the projectile.