This is my game development blog for 3to1 Games at Warren Tech.
The pink posts are math blogs.
Things are going hard. I added support for using menus with the arrow keys. I don't think it matters a whole lot but it still makes testing a little easier. you still need a second player though who would likely use a controller. I'm strugguling to find stuff to work on and the motivation to do them. I have started looking into networking for Nyar as well as working on some personal coding projects. One of those projects i worked with creating and moving enemies and the other one I really just created the project for wyrmgen. I also made a new css file for christmas time.
Meetings and stuff today. Added some descriptions and stuff and discovered a packaging error. Packaging errors are bad news if you like executable files...
Honestly did enough today to count for a math blog so that's what ill do.
I started working on a project to procedurally generate a dungeon like level. Today I just made a base room. It has 6 inputs: x length, y length, wall height, if it has two doors, enterance door, and exit door.
Creating the floors is easy. One loop loops another loop creating creating a grid of floor tiles. The walls are a bit more difficult. First I do all the north/south facing walls, I loop through them for each tile on the x axis and a second loop does it for the height of the walls. Then I have to add the y length inorder to place the walls on the opposite side. Then I do It again for the east/west facing wall but with the x and y axis swapped. This would apply for S2: Algebra and Functions because of the equations that find where to place the static meshs.
Code that builds the walls and a resulting room. (try opening images in a new tab
Then I must place the doors for the rooms. I have 2 3d vectors called "enterance" & "exit". I then loop through each wall in the structure with the plan to find the wall closest to my 3d point. But first I need to adjust the vector im checking to get the center of the mesh instead of the corner (I add 200units to its x or y based off its rotation). Then I get it's distance from the previous 3d vector. Once I find what wall is closest, I replace it's mesh with the doorway mesh. I do this again if there is another door to add. S2:Geometry should be the best math practice for this because of how I find the center of the mesh and discover where to place the door.
Okay so right now stock photo stick guy can parry while an attack is on cooldown. If the attack has an animation (which it doesn't) then he can parry as long as their animation is still playing. Cooldown however, isn't very accurate it's just the closest data we have. So to have this character work without animations would require some new data for attacks. Like an "attack time" that would tell Stick Guy if the person is attacking. Also currently, all data for this special is stored within stock photo stick guy. So when he "parries" he litterly deals negative damge to himself in order to "block" the damage. The better way to do this is have every enemy check during their attack if they are hitting the stick guy. And then decide if they are dealing the damage. But then you'd have to have parried like on the EXACT FRAME. So this whould probobly need to check constantly during the attcks duration wheather its damage needs to be compleatly ignored. And THEN maybe we need to even delay doing the damage until after the attack ends and not just when it hits. Like imagine swinging a sword and we have to wait to deal damage until after the sword swing is over instead of when the sword actually connects because what if they parry and UGH.
TLDR: "Parry" needs to be defined so I know what needs to be done. Anyway it will be a lot.
The character's special has been redifined and is prboably now one of the simplar ones. But I really did want to do one of those above. So I'm a little disapointed. I also started working on the Skrbl character. It should work as long as it gets it's character data.
Stock photo stick guy's parry. It works by doing a normal attack and checking if it hits. Id the attack did hit, it get's it's opponents current status. If they are attacking it will get their attack's damage and deal that to them.
I was wrong. The animations didn't work. I had to add the block animation. The pentagram idn't really there anymore now that the statemachine is more complex. Looked at ai and was terrified. Oh gosh this could be horrible. Also created an exeption so grabbed characters are "idle". Could later have a grab pose play instead.
The animations finally work! I also learned of a strange issue in UE where if a animation has too few frames (under 20), the animation notifies don't fire consistantly.
The animation notifies are functions that fire during points in an animation. I use these to tell the character when to do it's attack as well as when the animation is over. Attacks now also have a special boolean so they don't wait for the animation notify if they don't have a animation. I think this could work for S2: Algebra & Functions as we have to determine when is is okay to play the animation and to correctly time the functions to the animations.
I also had to fix an issue with how characters moved backwards when controlled with a gamepad. Because gamepad input and keyboard input are treated diffrently for movement, characters could only move backwards when moved with a keyboard.
The code for determining if the player is moving backwards first has to find what movement key is being hit, and then check based off a variable named "facing multiplier" to find if the character is walking backwards. This is used to sate the variable "play rate" in the walking animation. This can also be used to change the speed of the character as well if a gamepad player only does a partial input.
I think the way the players input actiion value is used for the play rete of the animations can apply for S1: Number ad Quantity.
animation with notifies.
I was wrong yestraday and the character animations were not done. I needed to bind the attack checking to the animation. It should work now. I also found a issue where if a animation has too few frames, the animation notify fails to run. So all future animations need to have 20+ frames. They can be as long as they want but that should fix it. Setting the punchs attack to be the kick animation proves the problem is related to the animation and not the code.
Character Animations should work entierly now. Animations run a notify that should end their attack state. If a attack has a animation the player character will ignore the cooldown and will wait for the notify to finish cooling down.
Trying to add the animation features to the NCharacter & BaseCharacter.
Updated blogs today to meet te comments. Other than that I fixed a merge conflict created by Dillan and I working on NCharacter.
Hooray! I moved most of the test character's animation code to the base character. So that way later characters can still work. There is likley gonna be a TON of very similar AnimBlueprints and thats gonna be weird. Now I just to need to completly redifine attacks to be triggered by an animation and not by a button press. Thats likley going to take longer but maybe not!
Figured out a plan for using animations to determine when to attack for things. Using animation notifys like on last years project to check for when and as the character attacks.
I got a test character working with the animations correctly. Dillan finished the player blueprint today however and much of what I had done will now have to change to work with the new base character and the new character data system.
Halloween today! I finished the animation blueprint for the most part I just need to change the character's state effectivly in its blueprint code. I use a enumerator that includes the main actions the player could do.
When the player is attacking for example, I would set its current action to be "primary" or "secondary" based on what attack they are doing. If they arn't attacking, I would check their velocity to see if they are jumping/falling to set their action to that. Otherwise I would set their action to "none". Later on I would be able to detect if they were walking and what direcetion but that could overwrite recent changes in the base character controller so I have to wait. I do it in this order because these are the actions that would take priority. If the player is jumping AND kicking then the kick animation is more important. But we would likley later have a animation for when the player is doing both but we don't have those yet and this character is just for testing.
I belive this would account for S2: Algebra & Functions because of how the charcters current action is determined. As well as S1: Number and Quantity because to detect the player's jumping I have to check for their Z-velocty and deceide if its great enough to apply the animation.
(this code is newer because im updating this blog from the furure! but it should be similar)
Ill. Sick. Plagued.
Didn't accomplish much today but I am making a anim blueprint for our characters. Still awaiting some animations to use for this. Maybe ill also make a pause screen.
Project organization today. With the clickup and communication stuff. I think everyones doing okay emotions are hard. I spend most of the day debugging issues with the healthbar whitch were caused by subtracting from a variable an extra time and setting the health before it was ready.
Health bars are wired up. Additionally for fun I worked on the procedural stairs. (I think these are SO fun)
In the gif you can see the stairs change size using a 3D point in the world. The blueprint for the stairs gets the position of that corner relative to its own in order to set the scale of the stairs. One of these values (Y) won't matter much because it's scale is the same on every step but the others (X & Z) are more important for generating the stairs.
An additional variable called "step height" is used to decide how tall each step should be. Using the step height and the Y value as the "goal height" I can determine how many steps to create. It won't always be able to reach the goal height however if the step height won't allow it but it gets as close as it can.
Each step's demintions are determined with: BaseX/Amount of steps * current steps index, BaseY, Step Height).
Then the steps position is set by adjusting the Y value for the height of each step generated before as well as ajusting the X value by shifting it over the same way.
Translating the box's dimensions and locations should account for S1: Number & Quantity. And the equations for how they are determined would likley apply for S2: Algerbra & Functions.
Spent more time with PCGs om Unreal Engine. I made a spline that spawns meshs along it. Its not actually doing anything cool but it's still pretty neat. I'm going to keep working with procedural content when I can but I kinda wish I was using a diffrent engine. Unreal is super heavy and it becomes pretty clear anytime you need to do somthing technichal. IM TRYING TO MAKE PROCERURAL STAIRS. There is a lot of math in determining how to place the steps I should really be doing this in C++ i think instead of blueprint math is easier there.
Rushed to get a playable demo. Using a line cast to do atacks. Nothing complicated but I was just trying to have somthing done while dillan is busy with the real character class. Anyway we have somthing that is playable and some people really like it for some reason.
Looking at Unreal's Procedural Content Generation Framework. Created a landscape where bushs and rocks are placed procedurally. Looks bad becaue I'm using starter assets just to experiment with.
I'm not sure if I meet all the math standards for this week but I'll see!
Unreal has a plugin call 'Common UI". Its usually for frequently used UI systems that many games need. In our project I used it to set up a controls screen thats accsessible from our games menu. I used common UI to have UI that responds to what the player's controller is. We do this by creating a data table of the various controlls the player has and the inputs on both keyboard and gamepad that correspond.
Then I create a blueprint under a class Common UI calls "base controller data". In here I can set a texture to each of the inputs for a given controller type.
Finnaly on the controls screen I create a UI Widget that connects to a indidual row in the data table from before in order to display the correct input for the player.
I think these could apply for S3: Data & Statistics
I also tried to learn some swift this week. While I didn't do much apart from mess with the one of the base projects, I did experiment with adding additional events on actions like clicking the screen to change colors and the size of objects on screen. While not very much some of this could apply for S2: Algebra & Functions
This whould change when a gamepad is connected.
Implimented common Ui into our own project. There are alot of changes with the player charactors so I can't really make them correct yet but they are there and can be out in easier.
Used Common UI in order to chamge a input prompt in diffrent controler types. Couldn't get it into the main project in time.
Worked on creating a health bar widget. This new widget holds a function that updates its values. Setting the percentage of the health bar by dividing the players's maximum health and their current health is pretty simple. However, the color of the healthbar is also set to change based on its value. unreal reads RGB values between 0 and 1. The health bar is just translating between green and red so at max health your color would be: 0,1,0,1. While at zero health it would be: 1,0,0,1 (you also wouldn't be able to see this though as at zero the health bar wouldn't be visable). The equation: 2^x -1, creates a slightly more interesting transition then a linear equation and spends longer "green" than it spends "red" that I believe feels better to the player. However I'm not an artist and this could change.
Using this equation I can decide what the green value should be. The red value is just determined by subtracting the green value from 1.
While a bit redundent I did also start on learning the Common UI system this week. While I mention more detail next week, is uses a data table to hold information on the games controls and what inputs connect to them on diffrent controller types. What I did this week is very similar to what is done next week but I did this in a seperate test project and had to change somethings with are actual game.
I think the beginings of what are done with CommonUI should account for S3: Data & Statistics and the health bar's color change should be S2: Algebra and Functions because of the function that determines the color and how it is used.
Git. Learning Git and trying to fix problems. I had to remove a bunch of files from the git using the terminal. That was fun and I messed up a bunch! Hooray!
I guess it was a skill building week. I went and experimented with our project from last year to create a ranged character. While before attack detection was determined by tracing along the character's weapon, the ranged charcter must attack based on the cameras direction.
In games, a ranged attack is often done by firing a line trace and check for collisions based off how the character is aiming. But especialy in third person games, the player's camera and the weapon the attack should come from are in very diffrent locations. The way I solved this is by firing two diffrent lines. The first one starts at the player's camera and using it's rotation creates its end-point very far away.
The second trace is done from the the character's axe (I didn't change the model or animations so this attack looks a bit weird) to the first point the first trace hit. This trace however only checks for enemies. Then it uses a system (very similar to how it worked before) to chose what hit actors should take damage and how muc based off the attack the player used.
The line trace is a vector and would likley apply to S1: Number & Quantity while the code that manages it and deals damage should count for S2: Algebra & Functions.
Sick :(
New project??? I might see if I can get some help on the messenger pigeon game but I don't know if I can do it. It's also really not a great pick for this big of a team anyway. Tvornok for me was really confusing and I kinda struggled with finding things to work on and I wasn't very happy with what we were doing. It looks like we might be working in unreal too so I think I could really learn some new stuff there. OR WHAT IF WE MADE THE MC ECHER TOWER DEFENSE GAME. I'm excited I just really want to make somthing fun.
Luke stayed up and did a ton of code last night. Set up the itch.io page and played some other projects. There isnt much left to do for me so I might just be working on another website instead. Here is our game
-UPDATE-
there was a mistake on the HW bit :(
Finally actually hiding the codes and stuff. I think we will finish in time. Had to change the password script to allow for secondary and tertiary passwords. I was really confused on how I could pass an array into the function so for the sake of timeliness we have a max have 3.
Created all the updates pages. They should be finished as we implement codes and write some pretty CSS. I wrote the diary for the missing child using the limited information on taiga. I'm pretty bad at writing like this but I think I figured it out well enough. I will probobly link the itch page when we finish on friday.
Made a password protection script for future password protected pages. The password is set in html so the same script can be used on many pages with diffrent passwords.
Created a password protected test page for the website.
Recorded today! Had to record a lot and my hand is pretty shakey but I guess it adds to the erieeness. I'm pretty bad at improv but it's okay it works. We got a background on the website but its kinda hard. Might end up being just a weird photo at the end instead.
Missed a few :/
Building a website for the jam. Started work by learning javascript for the site while designers created the plan so we know what to make. We plan to start filming soon as well but I don't think we have time today.
Kept working on the glowing and the screen. Was slow because I was also trying to debug some errors I'm pretty sure the other programers already solved.
Started work on the glowing effect. Learned Godot's particle system and some of its lighting.
Implmented the screen shake. Took some time because I input the equation wrong and couldn't figure out why things were not behaving as I expected.
Worked on screenshaking. Generates a random angle and then shakes the screen in that direction. Multiplying the normalized direction vector with a sine wave with "decreasing" amplitude (It stops before increasing again)
Mostly team organization today. Learned a lot about Godot and C#. Maybe I'll work on the parallax backgrounds unless somthing else comes up.
Today I worked on making a "door" node that teleports the player to a Vector2. One can use the parent node "intractable" for other things as well. The door uses its refrence to the player sets their position to that of one of its child nodes. Then I learned about some vector math on Godot's docs.