Don't wanna be here? Send us removal request.
Text
Projectile Code
The enemies in my game shoot projectiles that do 1 point of damage.
This code increases the projectile speed every 40 seconds by quite a considerable amount.
On overlap with the player check if a bunch of variables are true or false (like if the player is dead or is mid animation), then execute the below code:
This code reduces the player HP by one and plays a sequence that flashes the player red for a few seconds, then plays a HUD animation that flashes the screen red, then it plays a damage sound effect. The last part where it changes the IsDamaged variable doesn't work for whatever reason but I didn't have enough time to figure out why so it's just left there not working.
0 notes
Text
Creating a Speed Power Up
To make a speed powerup I made a glowy sphere thing that appears on the map and started the code like this:
In order to play HUD animations and also change the player speed I need to grab quite a few variables from the player character.
This mess of code then just multiplies the player speed by 2, plays a few animations and particle effects, then delays by 5 seconds and divides the players speed by 2.
Then, in a seperate actor, this code triggers an event every 30 seconds to spawn the powerup somewhere random in the NavMesh.
0 notes
Text
Enemy Spawner Actor
At the BeginPlay event it spawns the first enemy at a set location, then triggers a timer to execute the EnemSpawn custom event, this checks if the player is dead, then checks to see if the enemy cap has been reached (the maximum enemies that can spawn is around 50) then executes the enemy spawn code here:
This code just finds a random point in the map NavMesh and spawns 4 enemies at 4 random locations (it also plays some particles to indicate the enemy spawns), then it add 4 tro the enemy count variable that I made to track how many enemies where in the level at one time.
0 notes
Text
Making a basic following enemy
In my game I wanted the enemies to be just basic, constantly following, projectile launchers whos speed and numbers scale over time.
To achieve this I made both an enemy character blueprint, and an enemy spawner actor.
(The code for my Enemy character)
This is the basic movement code for my enemy, whichy simply moves it towards the player character every game tick (it also checks whether the player is dead or not, if the player is dead it destroys itself.)
This code executes when the player collides with the enemy, causing the players HP to fully deplete (this executes the on death code on my player character) and to play a damage flash animation.
This small bit of code uses the pawnsensing component to detect the player and checks if a few variables are true or false (this is because I don't want the enemies attacking the player after death thats just silly).
After those checks the enemy spawns a projectile that is fired towards the player characters current location, it then triggers a small cooldown so to not spam projectiles.
This code (as it says on the comment) increases the enemy Max Walk Speed by 250 every 40 seconds.
Before I created the seperate actor for spawning the enemies I used this unused code to spawn the enemies instead, I chose not to use this because the enemy spawns weren't randomized and it was easier to use a seperate actor to handle the spawns.
0 notes
Text
Creating a State Machine for my health animations
In order to show the increasing imbalance in my player as their health degrades I need to show different animations for their stages in health, to do this I created a basic state machine:
(The full state machine)
What the first chunk does is check if the players health is equal to 2, if it is it plays the first low health animation (a slight tipping of the scales), take note of the Do Once node because this is off the Tick event, I need to make sure it only plays this animation once and loops it.
The next bit is a little more confusing, it checks if the players health is equal to 1, if it is it plays a period red vignette flash on a separate widget that's added to the viewport that indicates the player is on low health, then it stops the previous HUD animation and plays an animation that shows the scales in even more imbalance.
For the final death animation please refer to my blog post about my death code.
0 notes
Text
How to play animations on a Widget within the Player Character
Because my widget is setup in a strange way (being that it isn't added to the viewport and its instead displayed directly in front of the camera {this is becuase I wanted it to be effected by post-processing}) I couldn't play animations to it in the conventional way.
What I needed to was make a reference to the HUD widget to get the animations from (On event BeginPlay):
Then in order to play the animation, I need to get the animation data from the reference created on BeginPlay but the target of the animation needs to be the widget within the player character as opposed to simply using the HUD reference for the target too:
This has some interesting drawbacks, like how fading opacity doesn't really work properly (it doesn't fade out it just instantly disappears, this can be seen in the balancing scales on death as they are supposed to fade out, but they instead just disappear {I kept this in because it's barely noticeable in game though}).
0 notes
Text
Dash code
In my game I gave my player a dash to assist maneuverability and evasion of enemies, to do that I used this code:
What is does is on Left shift (will be a different button when in the arcade cabinet), it checks to see if IsDashing (a variable created to check if the player is dashing) is true or not, if its false it sets it to true, then it launches the character 4x the players current velocity, plays a small dashing particle effect, adds a delay (this is the dash cooldown) and then sets IsDashing to false again.
I intend to create a HUD element that shows the Dash cooldown and indicates when the player can dash.
0 notes
Text
On Player Death
A LOT happens on the player death in my game, so what I'm going to do is display the code in chunks and explain it individually to make it more digestible for future reference.
The death code is off the Tick event, first it checks if the player health is less than or equal to 0, if it is it then triggers a Do Once node to prevent the death code from being executed every tick (this would muck up a lot of stuff) , it then stops all HUD and damage animations like flashes, and the balancing scale animations, after that it disables the player movement.
After that it destroys the player model and creates my DeathExplode particle component which I will explain in a separate post.
After that it plays 2 animations, one animation being a long fading red flash that lasts around 2 seconds, and the other being one that makes the individual scales fly off the balancing scale.
Afterwards it sets the IsDead variable to true to prevent things like damage being inflicted, projectiles being shot and animations being played after the players death, I then print a dev string to confirm the variable is true and then I set a 2 second delay to wait for the particles and immediate death animations to finish.
I then play the final 2 animations, the game over screen then (with a slight delay) the "press any to restart" text appears.
Then we have the restart code, which on a space bar press checks to see if IsDead is true, if it is it reopens the current level and sets IsDead to false again to restart proper gameplay.
0 notes
Text
Arcade cabinet quit after inactivity
When this game is in the arcade cabinet, it needs code that quits the game and goes back to the arcade menu after 60 seconds of inactivity.
To make this I created a new input action called IA_QuitGame that was bound to a random testing key and a controller input used in the cabinet.
After that I created this code to quit the game after 60 seconds of not pressing any key off my BeginPlay event.
0 notes
Text
Creating a timer in the HUD
In order for players to know how deep they are into a run, to make it easier for me to test the difficulty scaling and for players to compete to see who has the best time, I needed to create a timer that displays the current run time.
To do this I entered my HUD widget, and created some text to display the time:
(I made sure to tick the "Is Variable" option to make it directly editable in the event graph)
Next I went into the event graph and inputted this code:
The first box is a on-every-tick check to see if the IsDead variable in my player is true or false, if its true then it doesn't do anything (it actually prints a dev string to show the time of death but that isn't shown in game.) and if its false It executes the second block of code which, in short, get the world time, converts it to a digestible string and displays it through the timer text.
What this does is tracks and displays the time during gameplay and when the player dies (with help from an animation) stop and displays the Time of death.
(The timer displaying 00:24:05)
(The timer on death displaying the time of death: 00:24:49, I know I'm bad :/ )
0 notes
Text
Incorporating Equilibrium into my game
This prompt had me scratching my head for a while (either that or I have a HUGE skill issue), because it just didn't really fit my game naturally to incorporate equilibrium into my gameplay loop, so instead I used it to display player health, and if the player became to "unbalanced" they die and lose the game.
(Notice the balancing scale in the top-left, representing the players HP which at the moment is perfectly balanced.)
(At low health the scales get increasingly imbalanced and the screen flashes red to indicate the player is near death.)
(On death, the scales fly off and disappear representing the death and ultimate imbalance of the player.)
0 notes
Text
Video game characters with shapes in the core design
I feel the obvious character to show here is Pac-Man, like the dude is just a circle with a triangle for a mouth, I could go on about how these shapes represent the appeal of the character or how the creator of Pac-Man thought when creating this design but I think its so basic of a design that there really isn't much to say that doesn't already go without saying.
Once again I feel like its kind of obvious where shapes come into the design of Geometry Dash's default icon, having different squares represent the eyes, mouth, outlines and base cube. Though the design of the default cube (and the game in general) is heavily inspired by "The Impossible Game", I think the customization the player has in Geometry Dash makes this and all other icons in the game an evolution of simply using squares in the character design.
Sonic's design includes triangles in a way not usually seen in most character design in general. It uses triangles in places like his spines, mouth and shoes to portray a sense of speed, precision and agility in a way that other character designs rarely do, there are also other aspects of Sonic's character design that effect his perception but I think that the use of triangles is most relevant here.
0 notes
Text
How can shapes be used in game design?
The basic shapes of squares, circles and triangles can be used in various different ways in game design.
For example if we start with triangles, we of course have the fact that most models in games development are made up of tris/triangles.
Next we have squares, which if you want to take literally are used EVERYWHERE in places like pixels or UI elements in engine like this:
(Note the engine UI is entirely squares with information and editable objects inside.)
Or you could go the metaphorical route like how loops could be a representation of circles in games development, whether it be a code loop or a development cycle, or you could simply use things like unreal engine materials which are depicted as spherical model to view a material:
0 notes
Text
Did I meet 19/01/2024 Goals?
I finished the balancing scale HUD animations, as well as creating extra damage flash and low health indicators.
I did not manage to even start my main menu, as such I have set it as my goal for the week starting 24/01/2024.
I managed to get at least 3 people to look at my game, however I'm going to make a separate blog post discussing this.
As mentioned earlier I did manage to create a damage/low health flash using a vignette.
I did look briefly into randomized spawns and scaling difficulty over time, and I have the logic for that in mind, however I do not know the exact code necessary to create difficulty scaling.
In short, I didn't meet every goal I set myself, however I believe I made up for it in completing most of it, and generally cleaning up my code for readability purposes as well as future proofing most of the code.
0 notes
Text
19/01/2024 Goals
Make balancing scale HUD animations
Make main menu
Playtest stuff yo
Make a low health flash in DMG widget
Look into scaling difficulty and enemy speed.
0 notes
Text
Playing a hit animation
After creating a hit animation using an animated widget, I added it to the viewport on my player and created code on my enemy character to play the animation OnComponentBeginOverlap.
However you may see I have a branch that checks to see if the variable IsDead is false before it plays the animation, this is because if the player was dead and another enemy hit the player, it would play the animation still, so what I simply did was create a variable that tracked whether the player was dead that was set each time the player dies and respawns.
I intend to also use this in my enemy projectile code to check whether to play the hit animation too.
0 notes
Text
Game Inspirations
Upon receiving advice from my tutor on what games I should take inspiration from he provided me with these 3 games to research.
youtube
Firstly, we have OTXO, a top down action shooter that visually reminds me of ULTRAKILL (Layer 7 specifically.)
What stands out about OTXO to me is its creative use of camera controls and colour contrast to portray a sense of violent artistic beauty. What I specifically admire about the animations are the snappy keyframes used to display combos and camera effects.
youtube
Next we have hotline Miami, a top-down neon 80's themed shooter that aesthetically and gameplay wise, seem rather similar to OXTO at first glance. However the immediate distinction for me in the use of saturated neon colour palettes and use of VHS and arcade filters, fonts and pixel art.
youtube
Ape Out is probably the most unique in terms of visual style out of these 3 games, being a 2.5D top down beat-em-up with shooter elements. the visual style is my favorite thing about this game from watching the trailer/gameplay, using strong solid colours instead of complex textures as well as making use of a technique called "masking" to achieve dynamic materials in walls and floors. Another one of my favorite things about this game is the use of "parallax" in the walls to convey the sense of traversal, impact and almost a trapped feeling that's difficult to describe, yet probably an intentional effect.
0 notes