Tuesday 25 June 2019

Bounty Hunter III Update #1: Combat update

Hello there!
Today, I'll be giving you an update on what has been happening on Bounty Hunter III's end.

Preface

I've finally managed to solve the hitting invincibility problem, as well as adding in a feature that will make combat much juicier. I also have a few ideas about AI and what progress I have made on the ally character that I have mentioned some months ago.

The hitting invincibility problem


The last time I blogged about Magunm foundation, I mentioned about how I didn't know how to not constantly damage an enemy with one attack. Now I implemented an invincibility timer every time the character gets hit (including the player), which is quite similar to the solution from Bounty Hunter II.
This might be a decent idea for melee attacking but for shooting, it can be quite annoying since 2 out of 6 of your bullets shot in a short span of time would hit the enemy and the rest would pass through without even dealing a scratch of damage to the enemies. Fortunately, I found a way to solve this too, which was making each attack have its own damage timer, the offended enemy's invincibility time will be dependent on the attack's damage timer.
To put things into perspective, a normal melee attack would have a target being invincible for 0.4 seconds whilst a bullet would have the target being invincible for 0.1 seconds. This can allow for a rather flexible and fast-paced combat system which can balance attacks.

For good measure I came up with another solution on top of this one: force.

The power of the force

When a character gets hurt they would enter a hurt state, when their invincibility timer goes down and where the character in question does not do anything. Before they enter the hurt state some force is pushed on to them (in the direction of the attack). This could be a pretty useful strategy for when the player wants a little bit of extra time to dodge some attacks. For the player as well this will add an extra layer of challenge as they would avoid getting knocked back too.

If you think, however that you can just constantly hit an enemy and push them off into a ditch or just infinite them with the melee attack, I have another trick that counters this problem.

With Bounty Hunter II's AI, the characters had an "AfterDash" function which would be called after a dash ends whenever it is the dash timer being reduced to ~0 or interrupted by a crash into the wall. This function was used for instructing what the AI does after a dash, determined by the state of their AI, because a lot of their melee attacks composed of them dashing.
With this one, along with the "AfterDash" function I'm also adding in an "AfterHurt" function which could steer the AI to do something once their invincibility timer is up. They might release a small attack or retreat somewhere.

This was inspired from the AI of Sly 2: Band of thieves, where they would rise up by attacking after getting hit stunned. When I played through the 1st game, most of the enemies were cakewalk to defeat as they could be defeated in one hit. Though some of them threw knives, breathed fire or did melee attacks, I would usually spam the attack button, rush over to them and they would no longer be a problem. They were more of an obstacle than an actual threat. When I started to play Sly 2 on the other hand, the enemies were much harder, they took more hits to kill and you couldn't just mash the attack button. As I've said before, they would kick themselves up, thus damaging anyone in front of them.

This would add a great layer of difficulty to Bounty Hunter III, and could also be useful to one character who assists the player.

Progress on the Ally character


I have mentioned a few blogs ago about an AI character that I was working on that would help the player on certain bits. I have made progress to it.

I added in the ability for them to attack any enemy that they are assigned to. For now, you press the 'R' key to move the character where you want them to be, you press the same key whilst hovering your mouse on an enemy to have the ally fight it and you can press the same key if you want them to stop attacking said enemy or attack something else.
The AI on this ally character is very aggressive and will attack the target relentlessly and mercilessly, I'll change this soon to a more strategic approach like running back if low on health or walking back after attacking, much like Bounty Hunter II. I may also have them notify the player to cover them using the "AferHurt" function I mentioned earlier and have them avoid any enemies.

However, it would be tedious to have to make the ally backtrack to the player if they are stuck anywhere; you would need to constantly press the 'R' key on places and wait for them to arrive. I have therefore come up with another idea to solve this problem.

Pathfinding AI theory

I have a theory of how I can make pathfinding easier: rather than checking individual blocks, I would set up a network of manually-placed nodes, so that loads of calculations do not need to happen. This can also help with AI characters going anywhere they are not supposed to.

In Bounty Hunter II I tried to have the enemy detect the last seen position of the player, but this did not go well as sometimes they would get stuck in walls or in the case of the player actually being in sight, follow the last seen position of the player rather than the player itself. Now I think it would be a good idea for some calculation to happen where the last seen position is assigned to the node it is nearest to and the enemy path-find their way towards that node rather than specifically the last seen point. Then they could preform a check to see if they player is actually there.

Story Progression

This will be the smallest section of the post, but I have actually started implementing some of the story I have written into the game. Since the game is much more non-linear than the 2nd one it could give me much more options to make the story a much more personal experience where you could talk to a number of NPCs just for the fun of it rather than going from one area to the next and having a scripted sequence happen occasionally.

Conclusion

A pretty decent amount of progress has been happening on Bounty Hunter III, combat has been vastly improved since I last wrote a post about it. Perhaps on this game, my biggest priority should probably be focusing on the AI and refactoring the game's codebase.

I recently learned how to create class libraries (thanks to another untitled MonoGame game I'm working on), which I wish I knew a year ago and would save me all the fuss of having to hop between changing this game and Othermind's codebases. To those who do not know what a class library is, a class library is a load of classes and functions which one can use in different projects without having to tediously implement its code (much like what I did with this game and Othermind) every time a new project is started.

I've created a "Magnum foundation class library" which contains all of the features Othermind and Bounty Hunter III have in common. I've also started development on a game which will hopefully be the first one to be completed and released that uses this library.

Expect in the next month to get an update on Othermind as well as a few other posts on other topics than Game Development, into another avenue which I have been quite interested in for a year.

With all that, I hope you have a good morning, evening or afternoon.

That's all from me!


Wednesday 12 June 2019

Digital escapism

Hello there!
A few months ago I was contemplating quitting DeviantArt, and then later on I decided I was going to quit it. Despite what I wrote about twitter, I don't think that social media is all bad and that isn't the reason that I'm quitting DeviantArt, neither was it the reason I quit Twitter or YouTube (I know I said I was not going to quit YouTube, but my opinion have since then changed) for that matter.

Preface


Social media in all fairness is useful in a way, for example you could use Facebook to hang out in certain communities, with LinkedIn you can make networks (very valuable for applying to jobs), Instagram and DeviantArt is quite useful to those artists who want to connect with other artists. I myself met a few of my friends on DeviantArt, so it would be pretty silly of me to say that DeviantArt hasn't helped me gain some friends at all. However it has come to this point that its use has expired and even having it around just feels like a burden.

Digital escapism


When I first joined DeviantArt in Christmas 2013, I couldn't relate to a lot of the people I had at school and had a small, closely-knit group of friends. Most of the people in my year group weren't too interested in the stuff I liked or really liked who I was, I had good intentions but I was often weird and a bit annoying. The internet played quite a large role into filling these voids, I met people who I could relate to.
Since I did not need to interact with them face-to-face, I could bypass a lot of posture and  facial expressional checks which made me comfortable with talking to people online, including people of the opposite gender to me (which very few, if any opened up to me in school). 

Later on, I told my real-life friends about my online friends and they didn't really seem to like the fact that I was talking to the online friends rather than them. Some called me 'anti-social' for not speaking to them. At the time I thought they were just desperate for attention and I continued spending more time with my online friends. There was also a lot of back-stabbing in my small real-life friendship groups, one of them would annoy the other and they would usually take it out on me. They ridiculed my interest in retro gaming (which I still like but not as ardent over) making up silly jokes about how I was stuck in the past. Unfortunately this kind of bullying, although it declined from there, was still active until the end of high school. I'm not trying to say that these people are horrible, they have, for the most part changed their ways and have matured.

What I am trying to say is that, this is quite important because it may reflect the reason people, especially teenagers and possibly young adults, may have much more pleasant experiences making friends on-line and perhaps how social media can be an escape to some from the horrific realities of their lives.

The spotlight effect


If you do not know what the spotlight effect is, here is a good post on what it is.
I often talked to the people I knew on-line in a very over-familiar way often saying things which I wouldn't even dare to say IRL. There was no kind of real life response like the intonation of their voices or facial expressions. Especially in 2014, I was incredibly rude and a lot of what I wrote was incredibly cringe-inducing, in fact felt like I had panic attacks when I was deleting that load of toxic waste. 

I became much more aware of this when I talked to some of these friends on a voice chat, I was often very shy and awkward and both of us were just waiting for one or another to speak. Even writing messages felt like I was talking to a brick wall, with me writing jokes and funny messages and the other person responding with emoticons. To an extent this can happen in real life, for example in sixth form I would tell a joke to someone in my class and they would giggle a little bit, the difference was that things felt much more like you could understand what the other person was thinking. I have found out the brain does not fully comprehend a "like" or an "emoji" and could signal a social approval which would make my brain associate the like with the fact someone cares about a joke I said rather than an actual social component.

Maybe they did, however due to the VC experience with a few of them I have some doubts, hence explaining the spotlight effect I had, when these people seemed to care much less about me than I had thought. The most embarrassing comments were usually the ones that were long lines of embarrassing jokes and nobody responding to them (in retrospect, I can see why), the worst thing about these is how it would be impossible to know how they would have reacted. In real life, this may happen to a certain degree but it is more obvious since they may have some odd look on their face or be very evasive towards you.

However in real life, what you say doesn't stay up forever unlike its on-line counterpart which would make the conversation in the latter all the more awkward.


Deep values behind real world interactions


Funny thing was that during the time I often used DeviantArt, I frequently thought of meeting my online friends in real life (to be honest I would still like to), I even spoke about it to them a good amount. Now I can really see why I wanted to meet them in person, because real-life interactions are far more valuable than writing/texting to them. I skyped one of my online friends and I really enjoyed it, I made a lot of jokes and we had a good laugh together.

Meeting up with people in real life, although it is a very hard thing to do and I even still struggle to this day with trying to set up a day out with some friends. I am hoping to get better at this, but what I have learned from being in Italy with the sixth formers was that I felt happy hanging out with them, the real-life interactions were very valuable even when I wasn't talking, just over hearing their conversations. Things like Twitter or Instagram do not provide these kinds real life interactions and rather replace them with a like or a re-tweet as social approval indicators.

As I have mentioned before in this post, there are also real-life indicators to if what you say was uncomfortable or odd, therefore there is far more of a way of receiving feedback. I can also see why my friends hated me messaging my online ones. Although they were quite aggressive and idiotic about what they were saying, I now know that they were on to something and my reflections now are a kind of "I told you so" moment.

Conclusion


I'm not trying to say on-line or real-life friends are intuitively bad, better or worse than the other. The real life friends I had have changed and have formed different opinions, in fact a few months ago I even hung out with one of the friends who called me anti-social previously and we had a good time. He also understood why I had these online friends; he seems to have these kinds of friends right now as well.

What I'm trying to say is how the online world can be such a great place to escape to and potentially meet great people to those who may have had bad experiences IRL like I did. The interactions feel like a nice dream, but eventually we will need to wake up to the cold-or-liberating reality that real-life interactions are far more rewarding than its on-line counter part.

And maybe at some point, you could schedule a day out to meet these online friends in real life and have a nice cup of tea or the such like.
With that being said, I will watch the sun descend into the sunset as my DeviantArt account does the same.

That's all from me!

P.S.
I don't know what deleting my DeviantArt will do to the traffic of my blog post, but if it reduces it, I'll try finding another way to gain traffic.