Credit to SadGrl for helping out with tutorials and the layout builder! >Their site here<

Welcome to my devlog archive!

My gamedev projects:

  • Magnet Gun: super slow development. Its a big project for me okay?
  • 2D-SURVIVAL-ROGUELIKE: On hold. Just play dwarf fortress.
  • YAABR: Abandoned/finished. Yet another what now? Got the level management stuff i needed out of it.
  • P&P (Pink and Pissed): Active development, upcoming demo.



Please note: this is my first time actually blogging, im literally copy pasting my notes with little to no editing or refinement.

I deleted the original systems and basically redid the prototype from scratch. My reasoning behind this was simply that it didnt work the way i thought it would in a 3D environment, and porting the physics from M.G. was a little too lazy.

I decided to instead go with a more modular approach, i intuitively made a class (Movement module) to control every single movement, with no dependancies at all. After that i made the Entity class which also has no dependancies and simply calculates damage values in a very abstract way. I inherited the entity class both onto a player class and an enemy class, these classes simply input a "Desired direction" value into their respective movement classes. The only difference between these is the player takes input directly from a keyboard, while the enemy automatically calculates the direction it has to go to reach the player.

Now, with movement out of the way, lets get to programming projectiles.
Most of the time when i design a projectile system (im not a big fan of hitscan) i use rigidbodies with colliders, and then calculate the damage based on velocity of impact, this is very unreliable, and i know a lot of you (the 5 of you still there, that is) are facepalming at this horrible solution. I have decided to go for a simpler approach, a hybrid of hitscan and projectile based, if you will.

Very professional illustration based on my notes, which simply said "stabby stab" with shitty ascii art next to it:

= - 0 = - 0 =0 0 stabby stab!

As you can see above, the idea is to make projectiles simply check one unit or two in front of them, if a collider is in front of the projectile, damage will be added to it and the projectile will be destroyed.
Now onto movement, projectiles have to face the direction they are moving towards for collisions to work as intended, so whatt im gonna do is add the desired movement direction (From now on we will refer to this mouthful as wishDir) to the current position, this should give us a good target to look at. This is perfect for projectiles because they move in a linear and predictable path.

First solution: Find a deviation and then use mathf.Atan2 to find the desired angle. This did not bring expected results.(WHAT THE FUCK ARE YOU TALKING ABOUT?) Second solution: "Simulate" a forwards movement and then use transform.lookat to look at its x and z position. Entity looks up no matter the direction of movement, with slight changes in Y axis rotation. After further research into the topic, i came across a solution:
Calculate the trajectory one unit forward then find the deviation, just like before, and simply set transform.up to this deviation. Now, with visuals out of the way, its time to implement pooling and spawning of these projectiles. I simply take a prefab of the projectile and instantiate it an arbitrary amount of times to keep it in a pool, for the player to access. I also used the opportunity to fix the knife hitbox, as it was too large and half of it was inside the blade. This fixed the "stabbing yourself with knife handles" bug, although not running around with knives in the first place solved it too.

Day 2:

I replaced distance checks with a "lifespan" system, automatically disabling all projectiles past a certain time. I also decided to add explosion damage, a quick overlap sphere + particle system and a bit of bloom were enough. So yes, your fists now explode once they move far enough. Dashing now also provides a HUGE armor boost (damage is divided by 5) i also made it so theres no control over movement when dashing. Fixed a small division by zero error in armor calculations.

Note: this very blunt section of the notes seemingly doesnt go into armor calculations at all.
Armor is simply a sort of "overheal" mechanic, the damage formula being "damage / armor + 1", then once damage is received a singular point of armor is lost. The problem was being caused by a slightly different (damage / armor) formula, which didnt take 0 armor into account.

The dash ability comes with roughly 5 frames of invulnerability out of 9 frames of speed boost. During testing, i noticed swords and other projectiles were causing damage if i stood right in the middle of the arena.
I solved this by not overthinking it and simply pooling the projectiles outside of the arena.

Now onto enemy pooling and spawning. -Procrastinated, added blood splatter and spawning particles, also messed around with visuals a bit. Implemented spitter and enemies.

I feel you, past me.

Day 3:

Well if im not a procrastinator, i picked the game back up and implemented a customization system in mere minutes, im gonna add a shop for cosmetics and paints, tf2 style (no microtransactions, its a score shop)
Now, implementing wave spawning. I decided to go for a point based spawner, each enemy has a "weight" or "value" and each wave has a set value, the system purchases as many enemies as the credits allow and then spawns them in, while still having some hardcoded in "scripted waves" or "special waves".

Some pseudocode for that convoluted explanation:

                //This will be called again once theres no more enemies remaining
                if(current wave is a scripted event)
                  //this makes it so theres no random generation
                  credit = 0
                  add all enemies from scripted event to the spawn list
                While Credit > 0
                  Pick random enemy
                  //This is the "shopping" function
                  //It compares enemy prices with available "credits"
                  //Then "buys" the enemies.
                  If (enemy.value < Credit )
                    Add enemy to enemies to spawn list
                    subtract enemy value from credit
                Generate wave
                  for every object in enemies to spawn list:
                  after spawning all objects:
                  empty enemies to spawn list
Day 4

Added a rudimentary score system, along with an invisible wall around the arena and blood splatter fading out over time. I also added a hidden "performance bonus" system, with some goals in mind: Punish players who only use one ability, by slowly decreasing their "Freshness" bar down to 0.5x, reward varied use of abilities by slowly increasing the score multiplier to 3x. And encourage proper use of dashing, by giving you a score multiplier of up to 6x if you manage to consistently dash without overusing it.

Up next: On a proper score system and character customization, game is nearing its completion.


This article is under construction.