Devlog #4 Player Skills and Enemy Effects


Dev Thoughts:

Well, what's there to say after last post's whole vulnerability? Turns out, still quite a lot. This will, hopefully, be mercifully shorter than the last. 

I have a fear of what I'd call 'Starting Line Syndrome'; where you're always starting projects, never finishing them and going back to the starting line to do something new. I think it comes from a place of fear again. Starting something is more comfortable than getting right into the midst of it, because there's always time to pull back, stop and think 'maybe this isn't the best' and go onto something better instead. Sometimes that's good, but if you're always starting, you're never really making something. 

Thats all I have to say about it really. Something for someone else to chew on. I guess the most reassuring thing I can say is.. someday everyone will finish something. 

Health, Pain and Chills

The fundamental of any game with combat is health and the ability to take that away. The second most fundamental thing, for most games, is to see that health going down. And the third most not really fundamental thing is a whole skill system that applies funny powers and status effects on enemies and players. 

I don't think I need to go too indepth on how health bars work, except that for the love of whatever is out there, please don't update your health bars onupdate! You should not be checking the health every single frame, only when damage is taken. That's just a basic lesson for those completely new to this whole game-making thing. Anyways, below the video for the more fun stuff. 

So, skills, effectors, powers.. etc. (You can see chill being applied in the bottom left corner)

There's a ton of ways to do them, but I decided to snatch up and modify the code from one of my old group projects. Honestly, every new project is an exercise in remaking old code and adding to it to make it new code for the next project to reuse. 

Anyways, I'm going to try and break things down a little for anyone trying to create a power system and who can't read code directly because that's hard. Basically it's split into two things; skills and the effect those skills create (effectors). 

Selecting skills from a random pool of skills is a whole other thing that basically just takes a skill and adds it to a list on the player. Then the main skill script looks at these skills and 'activates' them based on different conditions; e.g an attack skill only activates on attack (this is done with enums). This activation makes them create an instance (clones) a effector on either the enemy or the player depending on which ever one is specified, into an effector list.

Right after, the effector script looks at all these effectors in the list and handles starting them, running them and eventually ending them if they only last for a certain amount of time.'

 In this case, you see Chill being applied to an enemy on attack, it slows them down and turns them blue for a short time, then it ends itself. Simple stuff, minus all the things about effectors being scripts and skills being scriptable objects that takes those scripts and sometimes I get so tangled in trying to understand a system I wrote that it feels like I didn't write it and have never touched a script in my life. Aside from that, easy stuff. Watch how I make it even more complicated in future posts!

Tene out!

Leave a comment

Log in with itch.io to leave a comment.