Showing posts with label Magnum Foundation. Show all posts
Showing posts with label Magnum Foundation. Show all posts

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!


Tuesday, 18 December 2018

Magnum Foundation: The foundation of a plan

Hello there!
Since exams are over, I will discuss what has been happening on the game development end. I've been working on two projects in little chunks at a time. One of them is a small JavaScript game which I plan to release (hopefully) in February of next year; the other one is a far bigger project which I have been working on since April, shortly after Red-Blue Adventures was released. This project has the codename - Magnum Foundation.

The (very tentative) plan

I intended to have this project's development started right after Bounty Hunter II, but I thought it would be a better idea to work on it whilst Bounty Hunter II was being developed. With hindsight, I feel like I may have been putting too much on my plate as BHII was mentally taxing enough (as well as a cancelled project I worked on at the time as well). Development also was not too smooth as I would encounter quite a lot of road blocks due to me overestimating my skills. However, I think I was better off doing this than having to experience all these roadblocks at a later point. Plus most of the basic gameplay features are there in a very infant state.

Anyhow, about the plan of this project: I plan to have this project create the foundation for 2 new games (hence the name 'Magnum Foundation'), one which I'm estimating a Q4 2019 release (December to nicely conclude the year as well as the 2010s) and another which I'm estimating a release in Q4 2020. I do plan both games to be sequels to previous games I have made.

Level editor

This project also contains a custom-built level editor which I try to make easier to use than something like Bounty Hunter II's fiddly one. The design of this editor looks more intuitive, as it has a save button, a brush, eraser and a object selector. The least functional of all these features is the eraser since it's quite a time consuming process to add in a way to erase tiles on a certain layer or even switch layers.
Although I do hope to fix these problems at some point in the future, I still think this level editor is functional. The best thing by far about the level editor neatly ties in to the next section.

POUCH 2.0

If you do not remember from my previous blog posts what this stands for, it stands for "Prownie's Amazingly Ultimate Cutscene Handler" (pretentions I know). I remade it with what I learned from Bounty Hunter II's cutscene handler and another open source game called "Pokémon Unity" which has a really cool looking cutscene editor which helped me make this one. It is far easier to dabble around with than Bounty Hunter II's editor as you can just move the cutscene elements around by clicking arrows rather than having to do complicated procedures and dealing with messy UI which I could not blame anyone but myself for adding in. Here is a visual explanation of what I'm talking about (along with the level editor):
I have also implemented a number of new features to POUCH like checking certain event flags (which are basically numbers) and checking items, enhanced the dialogue system to include pictures of characters. These features are essential if you want to work on a story-oriented game since things change around the player depending on what they do.
I have also created Utility events which can be activated by POUCH which I will discuss in the next section.

Utility events

These events are basically events that seem far too complicated to create in POUCH, examples can include a shop or a way to check if enemies are defeated. These are triggered by POUCH which pauses its execution to poll this event. For example if you activate a shop the cutscene will pause and bring up the shop menu.
The build I fully implemented the shop was on the 2nd Year anniversary of 'Evermoral'
 You can use the arrow keys to navigate through the menu and buy the items you want. I might talk about inventories at some point in the future (although I don't know if it will persist in the final game).

Conclusion

I do expect to talk more about this project in the future and I do plan to reveal one of the projects, in maybe March 2019 and the other one later in the year. Admittedly, I'm not sure if half of the features in Magnum foundation will make it into either one of these projects but that's the nature of creativity and knowledge work. Despite the fact that I've recently released Bounty Hunter II, I still get worried that development of these projects may wain down or get cancelled completely since these are more ambitious than most projects I embark on. But still, completing Bounty Hunter has somewhat given me confidence that I am capable of finishing such things and I may be more intermediate with the processes of creating such projects. It's also not just the workload of finishing these projects that worries me, there is also the need of balancing things like a day-job (something I honestly want to get for the experience and a bit of cash too) and also living a life, because I don't want to just spend all my time developing games and looking like some shut-in, I would also love to travel.

However, I am hopeful that I will balance all these activities, after all Einstein managed to publish a bountiful amount of thesis's whilst working as a patent clerk. This may sound cliché, but if he can do it, I could do it. 

That's all from me!

p.s.
On an entirely unrelated note, since early 2018, I've been following a blogger by the name of Cal Newport who is a Computer Science professor at Georgetown University who writes blogs about topics that are full of things that bash on conventional wisdom like. He is infamous for having no social media, yet living a happy and successful life. He is publishing a book called "digital minimalism" which centres around using less technology which I defiantly suggest you check out. Or you can read a decades worth of his blogs which will may motivate you as much as it did me. http://calnewport.com/blog/2018/12/04/my-new-book-digital-minimalism/