Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Caliber Mengsk and RyanAvx's game (better name coming..... at some point... I promise)

A topic by Caliber Mengsk created Aug 01, 2020 Views: 287 Replies: 5
Viewing posts 1 to 4

Devlog 1 - And so it begins (first night, August 1st)

Hello everyone. This is the first of many devlog posts. I had the idea coming into this jam that I would be doing a beatemup, akin to Double Dragon or Streets of Rage. Story? No, none so far. :P For the most part, I try not to have any intentions in art, story, and honestly normally even the game genre. I tend to a bit more on low rez jams as normally I work on them on my own. This year, I have RyanAvx helping me with audio, so I shouldn't have to use random tracks from random asset packs from random humble bundles this year, so that will be nice. Anyway, ONTO THE LOG!

Quick Note:

So it's the first night. I made a unitypackage before the jam to just drag a camera in and have it just work. I did find a problem though. I made a script to keep everything on pixel units. This works ok in some cases, like things that don't move, but on things like cameras or players, you have to move at a specific speed or higher, so I had to remove that script from all the prefabs and such before I could really move on.


The Start (Art)

I started with a smidgen of art just as a mockup on a 64x64 pixel canvas.


This took all of about a half hour. I do art, I am not an artist, and as such I don't do this all that often, so I can be a bit slow with it sometimes, and others I can be fast. After making the mockup, I made a very simple character placeholder. While I intended them to just be a placeholder, I am starting to like them more and more. I also made a trash can for sizing and testing reasons. May get modified to be a bit more fancy, like popping out pieces of trash when hit/destroyed.



Start of a world (basic code and art in the scene)

At this point I threw in some code and had walking and a basic camera movement.



A problem with trash

As you can see, there is a problem with the trash can. It kind of wobbles instead of staying in place. This took a fair amount of time to track down what had happened. In preparation for animating it to take damage, I had changed the pivot point. What you are seeing is the fault of bad subpixel alignment. This trashcan is not save in a multiple of 8, which is my pixels per unit. Since it was 18 pixels tall, I had just dragged the pivot up a little. Problem is, as shown in the gif, this means that it's off by a percentage of a pixel. What I ended up doing was making the image 24 pixels tall and just having the extra transparent pixels be above it. After that, I could do math to figure out the pivot point. I have to do this math, because Unity doesn't set it's pivot points by pixels. it does it by percentages. So I have math. (24 pixels tall / 8 pixels per unit = 3 units total, 1 unit / 8 pixels means a pixel i .125 units tall. To get the percentage for the pivot I just need to divide 1/3 to get the scale of a single pixel tall, and multiply that by how many pixels I want to move it in unit sizes. So, .33333 * .125 = 0.0416)

 So now I have the number and it's simple to move the pivot to the right pixel. Just multiply 0.0416 by the number of pixels I want to move the pivot. Anyway, that fixes the trash can and I now have this.


Break Time

At this point, I took an hour or so break. I had to work today, and I program as my day job, so I'm a bit worn out at this point. (time invested, about 2-2.5 hours) After watching a few videos and getting some food, it was time to return. I decided to start with a swipe animation and make attacking the trashcan possible. So I made a few generic scripts. "DamageDealer.cs", "SimpleWorldObject.cs", and "SendCall.cs". Damage dealer, as you can imagine is a script that deals damage. I try to make scripts as generic as possible. 


Damage Dealer (script)

The DamageDealer is put on an object with either a trigger or a collider (normally trigger) and has the option of dealing damage to either a player or enemy or both, and on trigger enter or collision enter. With this, things like the player's punch/swipe/anything can simply have this script thrown on it and it activated when attacking. This can also be put on things that are still, like spikes. It also works with animations, so you can have something like an explosion happen, and in doing so, you can change how much damage it does from the start to the end of the animation. Things close to it get hit by full damage, things further away get hit by low damage. It's all up to the animation system or just what you leave it at default. I probably won't be using ANYTHING but this damage dealer.


Dealing damage with Simple World Object and Send Call (scripts and animations)

A simple world object is going to be anything that's in the environment that doesn't do anything complex. I started by adding this simple world object script to the trash can, adding an animator, and making a simple animation to take damage. At the end of the animation, an animation event trigger was added to call a function that allows the object to take damage again. The problem is, I moved the position of the trash can in the animation editor, and it wasn't a child of another object. This means the animation moved the trash can to wherever it was when I animated it instead of using local space whenever it took damage. Not a big deal, right? Make a child object, copy the animator and sprite renderer components to the new child, delete them from the parent. Animation plays correct! BUT the take damage function is on the parent now... You can't call the function of a parent with an animation trigger event like that. THUS SEND CALL! Send call is an EXTREMELY simple script. I calls the command SendMessageUpwards and takes in a string. When the event is triggered it calls the function on any script going up the line of parenthood. This means it can call the ResetTakeDamage function, and better yet, doing it on any script means if I make an AI script and it handles the health, as long as I keep the same function naming convention, it will still work! Generic scripts are great, aren't they?


Swipe Right! (putting it all together)

After completing the code to deal the damage, and accept the damage, I had to make a little placeholder swipe animation.


Now the player instantiates a game object of the swipe, it animates, the animator calls the destroy function on it using the send call script. Everything is now good to go! 


The Day's Summary

This is now the ending point of the night and I have a basic character that moves, animates, and punches, a basic environment to walk around in, and something to hit (the trash can) and kill. This segment also took 2-2.5 hours, so the total time at the moment is around 4.5-5 hours of effort and an hour-ish to write this blog. Anyway here it is in action!


Yeah, it's not a game, but it's a GREAT start for the first day in a jam. Especially since I did the art and the code on my own. Comments or suggestions are appreciated. (I do these write ups and never know who reads them) Should I keep the little spirit as the main character? Does the speed look good? Etc. Anyway, thanks for reading if you did!

This is good progress! The 'swipe' animation feels a bit off colour-wise since it does not have the same border as the main character (or perhaps the otherway round? character's border are the same as colour of the road); Not sure if 'swipe' is temporary but I would add in a 'downward' swipe animation (flipped vertically basically) to give feel of hitting with other hand and see what it feels like.

Yeah. The swipe will most likely just be a placeholder. Enemies and the player are both using it right now. Multiple attacks are also intended if I have time. (I'm doing everything on my own except the music, so it's a bit slow)

Solid start, great amount of progress for just 1 day! As a side note, I do think you should stick with the ghost character... It reminded me of Casper the friendly ghost. Maybe Casper has finally had enough and is going for some beat em up revenge?

Pretty much have decided to stick with the spirit at this point.

(+1)

Devlog 2 - Another day, another progress?.............. (August 2nd)

So today kinda sucked for me for the most part. Not cause of the gamedev stuff, but I woke up with a bad headache and it lasted most of the day. I didn't start work until around midnight. I did end up getting a decent amount added. Still a sucky day cause of the headache. Anyway, onto the development.

An enemy to be. (Art and Code)

At the end of the day yesterday, I had the player being able to do an attack. Nothing fancy, but still, I can kill TRASH CANS!!! THE MOST EVIL SCOURGE!!!!!!.... Ok, so not really all that evil, but they do have the enemy tag so they can be hit. BUT I need an actual enemy, so I started the day making a simple enemy that "fits" a city environment like the mockup I made.


Nothing advanced. just two walk frames and a take damage. Technically these guys will never not be walking, so no need for an extra idle frame. After the basic graphics I start wiring up the animations in unity. I can actually copy almost all of the code from my player script, and just replace the movement input to instead get the direction of the player (player position - the enemy's own position, normalized, then multiplied by speed). This is a pretty dumb ai at this point. Most games of this sort will have the enemies walk in a straight line only, vertical or horizontal, and normally won't allow multiples of them to attack at the same time. At the moment, I don't have time for the advanced stuff. I just need to get a full game loop happening. Anyway, enemies are added.


What about the player? (code and animator work)

Yeah? What about them? Oh.... you want them to take damage too? Ok, at this point, the player actually can take damage, he just doesn't show it. Also, he can punch over and over super fast. No delay what so ever. The enemies also have a random bug where they do the damage animation twice when they die. The player was simply adding a timer after swiping before he can attack again. Since it's already taking damage, it's simply adding some code to make the player stay in place and add the animation. 

The enemy bug took a few short minutes to figure out. Ended up being that in the animator, I had the flag for takingDamage and isDead both being set to true. So it was randomly selecting between the take damage animation and the die animation. All I needed to do in the transition from the any state to the take damage animation, was to add in the flag for if isDead is false. Fixed the problem.

Add in a health bar and you have a decent looking game now!


Get a hold of yourself! (quality upgrade)

It's coming along nicely now. There is a little tiny bug I have to figure out. One where it looks like the enemy is sliding when they first start moving. I think that should be a simple fix of swapping the walking animation frames around. Past that, when attacking, the little spirit feels a little off. Why? Well, I think it has to do with swiping at the enemies, but having no hands. So, I take the hands from the enemies and add them to the player. Do a little animating with them, and they look pretty great. :D

I haven't decided yet, but at the moment, the hands are actually doing subpixel movement and are smooth and such, though it looks all pixely like it should. It's cool cause it adds a bit of dynamic visuals to the player. Every time you move, the hands will animate slightly different depending on where they are in the subpixel. The problem with this is sometimes the animation will have an extremely short frame due to rounding being  like .499 one rendered frame, and .501 the next, then back to .499 again. This kind of bothers me, and if I go back and make the curves be a constant so that the hands instantly move, it will look more repetitive. Not really a major problem since everything else is already that way, but sometimes being dynamic is cool. Anyway, here they are with hands!

Final thoughts of the day.

I'm pretty much decided on keeping the little spirit as the main character at this point. As far as story, I'm possibly going to try to make basic cutscenes where the spirit is playing with something and the bad guys break it in some form or fashion unintentionally and the spirit just gets mad and starts taking them out. Don't know. There's also some quality of life that needs to be done as far as animations. At the moment, both the trash can and the enemy when dying are kinda just scaled down and faded out. I should probably have an actual death animation. I also need to work on chopping up the mockup and adding environmental pieces. Would also be nice to add specific animations for the different character's attacks, instead of a generic swipe for everything. I think my current minimum requirement goal is 2 enemy types, a boss, and getting the entire game loop finished. As in win/loss, exiting properly, respawn life, menus, etc. If I get a super polished first level and it be an actual level, I'd be super happy with that.

Anyway, that's it for today. Hopefully I don't get a bad headache over night again XD