Thursday, 28 March 2019

Magnum foundation's two games + Priotity troubles

Hello there!
I've made some progress towards the two games although they are somewhat minor. In this post I'll also be revealing the two games. Without further ado...

Preface

Just before I reveal the two games though, progress has been a bit slow with them due to me not knowing which features to priorities. It's a bit of a mess at the moment, but I'll get to that later on in this post, now I'll reveal the two games.

The reveal

One of the games I'm working on is "Bounty Hunter III" which I plan to release in late November of next year (2020), I intend this to be the final installment to the Bounty Hunter series. This motivation came from wanting to finish what I've started so I can move on to something different, and Bounty Hunter is no exception. Should I decide to make a follow up, it will be with different characters and continuity, whilst retaining core gameplay mechanics and some enemies like the yellow snakes.

The other game is called Othermind, a sequel to a game called "Pipe Dreamer" which I released in summer 2017. I thought that a sequel could do the first game justice since I've improved my programming skills, there were more than enough features I could think up to do this sequel justice. I plan to release this in December of this year, a little tight, but hopefully manageable.

Exclusive features

In terms of Bounty Hunter III, the game has a half-functional combat system which I've started to garner more attention to. I have been working more on trying to facilitate the existing features and test out certain scenarios like shops and cutscenes, as well as creating new collision types. The most interesting feature I can mention here is an ally character who helps the main character in his quest. Though I won't reveal who they are, I will mention that you can have them on three modes:
Automatic: The character follows you and fights any nearby enemies. I have not implemented the latter yet).

Semi- Automatic: The character follows walks to wherever you click in the order of where you clicked first - this can be useful if you want the character to attack certain enemies, press certain switches and so fourth, much like this. In terms of targeting certain enemies, let alone the aggressive AI, I have not implemented that yet.

Manual: The full control is transferred from the player to this character, this is probably the feature I may scrap at some point, because you can accomplish a lot of what you can do in the Semi-Automatic mode. Maybe I'll change my mind but for now, this mode will probably not make it far.
I know... the graphics look rubbish here.

I did try adding in an ally into Bounty Hunter II, but it did not fit in with the game's story so I scrapped it. There were also a lot of considerations I had to make like whether or not the ally was vulnerable or not, as well as trying to make them be able to transverse through the map without issues. This time, the ally is much more involved with the story so it would be more likely to be a feature I take further. I've also realized that I can design maps that are tailored to what the AI is capable of, since I'm not planning them to appear in all parts of the game (a hero always needs moments to himself, doesn't he?). This would save valuable time since I need not stress about thinking "What if this situation happens?" all the time. I could just make the AI capable of several specific things and leave the rest to scripted events.

In terms of the combat, I've made the main character have a melee attack (something that was not present in the predecessors) which is pretty much like shooting a bullet except it doesn't move and appears for only a split second. This may seem simple on the outside but I'll explain the problems I've been having with this in a later section.

Moving on to Othermind, the possessing mechanic makes a return where you shoot a beam at a character and you take control of it. This one does still retain elements of the first game, for example there is no combat or a solid story. The difference between this one and the first game is that it is not set in a dream world, but rather a strange island.

There are some returning creatures as well as a palethora of new ones, some of which are hostile towards the player and will knock the player out for a bit when in contact, or in the case of the Player possessing a creature, they will be de-possessed. I was originally going to add hostile creatures into the original but I didn't know how to implement them in, questions like "What if the player is possessed? How will they know that a certain possessed creature is the player?" or "If the player de-possesses the hostile creature won't they be knocked out upon de-possession".

Fortunately, I managed to answer both of these questions with this installment: The manipulated hostile creature will be knocked out upon de-possession, this will allow the player to escape (if the creature is hostile) and not get knocked out. But being knocked-out is more of an annoyance rather than a way of a threat very much like Wario Land 3.

Changes to the level editor

There were a few changes I've made towards the level editor, for example I've categorized brushes depending on which layer is selected. The reason you select layers is so that you can place certain objects into them via brush. This makes life a lot easier since the game saves levels into chunks of layers like tiles, triggers, entities, decoration tiles, etc. For example it wouldn't even save a trigger if it was on a tile layer, it needs to be in a trigger layer or else precious time creating the events that pertain to the trigger would go to waste.

The game also has a specific way of loading each layer from the JSON files (the format of the game's save files), so that is also important to keep in mind.

Previously, I've had to be careful of which object and layer I had to select to make sure it does not create a million copies of itself on the same spot. An example of this is putting a trigger into a tile layer, since it is not classified as a tile and the extra code, that checks if an object (in the layer) at the position of the cursor exists, wouldn't even pick on the object.

Now when I select, for example the tile layer, the brush menu shows all of the tiles so I know which blocks I can use on which layer.

Another change is implementing level sizes, this may sound silly at first, but I didn't implement a level size. The reason this could be a problem is that if I wanted to implement something like a flood fill (so that I don't have to hover my mouse everywhere just to fill a certain area), the algorithm wouldn't know when to end so it would keep filling everything until Unity crashes. I haven't fully implemented a flood fill yet, but I am doing so as I'm writing this post, but I have the theory that this tool will do me good later on.

A few obstacles

At this point I've encountered a lot of difficult obstacles, for example the collision system, I've been encountering a lot of issues with the characters sticking in the walls and not managing to get out. There are also the issues of the different types of collisions conflicting each other. I'm in the process of rewriting this system and replacing it with a much simpler one (resembling Temple of Chamber's collision system) because as far as these two games are concerned, there probably won't be any kind of advanced geometric collisions or advanced physics systems.

This might sound a bit lazy, but I'm trying to save time so that I can reduce the amount of workload I need to do (which is still a good amount). Maybe I might make the collision system more advanced as Bounty Hunter III goes along in development. In terms of Othermind, I'll most probably keep it the same.

Earlier I mentioned that I had issues with melee attacking, I'll tell you exactly what I mean. When the main character attacks once, a single invisible "bullet" should appear directly in front of when the player attacks. Much like a bullet, when it touches an enemy target, it detects the enemy and damages it accordingly. Where the problem lies is exactly how long the bullet should stay for. Because if the enemy has 20 health and the attack does 1 damage, if the attack lasts for one second and detects the enemy every single frame, it would die immediately.

The solution to this issue would just have the attack appear and disappear after one frame. This way it deals one damage every time it is summoned out. That may seem fine, until you get into attacks where one character charges. The attack hitbox should be on at all times or else it would be a bit silly if the offender passes through the offended without the latter taking damage, however if the hitbox was there at all times then all the enemies on the path would die due to the immense amount of "On hit" functions being called every frame.
A potential solution would be to put an invincibility timer on the characters. The player/Ally? Fair enough. The enemies? Well, it wouldn't be fun having to wait for them to become vulnerable after waiting a few seconds. A solution to this could be reducing the timer on the enemies, but even then, if several bullets (i.e. a shotgun) hit them at the same time - once one hits the enemy becomes invincible allowing the other bullets to pass through.
As you can see, it's quite hard deciding things like this - I've had this same problem in Bounty Hunter II and sadly it was never really fixed, although I made the shotgun's bullets penetrate the enemies on impact.

I'm also not sure which feature I should put on a top priority or when I should start creating maps, hopefully it should all come together soon though.

Conclusion

At the moment, it does seem like development is a bit on the slow side as priorities keep changing from time to time. But I'm trying my best to prioritize which features are the most important to develop. It does help to simplify some features which seem quite unnescacary at the moment (i.e. geometry based wall collisions), so I can focus on the features that matter more.

That's all from me!

Saturday, 23 March 2019

Forest of the uncanny

Disclaimer: This story may have some grotesque themes and graphic imagery, so do not read this if you are sensitive to somewhat graphic imagery.


The sun was shining fiercely on to the emerald grass, the grass was evenly cut and showed a consisting pattern of this throughout the land. The distance saw lines of trees separating the land from other bits of land. One of these areas of lands, had a small isolated cottage with a stable in the back which lived a euphoric farmer and an equally happy Mule. The former was named "Neil", the latter was named "Eli". It was lunchtime and Neil sat on a brown wooden bench and munched on a carrot. He held out his left hand, where another carrot was, to Eli - he rushed with a boisterous gallop. He quickly bit the carrot and proceeded to gnawed it down. Neil took another carrot out of the metal bucket next to him and held it out to Eli, and that too was bitten and eaten.
"Eli, do you want to have a walk in the forest today?" Neil asked looking at the sky, "The weather's pretty nice, no?"
Eli nodded ardently as he was chomping down another carrot.

As Neil finished his carrot, he jumped onto Eli's back and off they went from the muddy pathway that connected the small field leading into the gravel road. As they followed the trail, there appeared a series of trees adjacent to them, there was an opening in the forest with a muddy path. Neil got off and took Eli with him and walked into the forest. There were many pathways leading into many different areas, some of the trees had small brown mushrooms growing on them. Some of these mushrooms were alone in the dirt. Flowers of varied warm colours were disseminated through the forest in different shapes and sizes. Eli put his head down and started sniffing the flowers, but he quickly wrenched his head around rapidly in response to the strange and strong smell.

"Let's follow the trail with the colourful flowers" said Neil. Eli and Neil followed the trail of the flowers. As they walked through the muddy path, they saw a few other people around. They seem to really like the place... although a little bit too much. They saw one young girl hugging a tree and treating it like it was a real person and another of an old man kissing his wife. Eli and Neil proceeded anyway, in fact they rather enjoyed the happy nature of the forest.

"Y'know Eli, I think we should live here someday" mentioned Neil, "Wouldn't you think so?"
Eli nodded with a somewhat flustered look on his face, as he contemplated about where else he could have had those nice carrots he had at lunchtime, or even where else he could have had some nice apple pie other than home. However Neil was too enthralled in the forest and Eli was also starting to feel an infatuation for the forest, as his thoughts were starting to wander all over the place.
"You mind if I go to that tree?" asked Neil, "It looks really cool!"
Eli nodded with a look of prudence. Neil ran off into the forest, leaving Eli behind, Eli didn't mind this too much since he was used to Neil running off on to walk on his own or when he hangs out with his other friends. And Eli knew he would always come back. Always. Even in the most dangerous of times.

Eli wandered around in the forest, he looked at a group of children in Victorian clothing. They seemed like they were playing with jubilation. One of them went up to Eli.
"Can I ride on you?" she asked eagerly, jumping about.
Eli nodded happily and stood still so she could go on. Eli walked around with the girl laughing.
"This is fun!" she yelled with incredible joy, "Run faster"
Eli was a bit nervous since she was not annexed very strongly to him. Eli shook his head.
"Come on, you are so boring!" She moaned, banging on the back of Eli.
Eli grunted, and suddenly that girl slapped him hardly in the flank which made Eli panic. Eli ran all over the place and she was really enjoying the ride, the other children chased after him saying 'Can I go on?', 'Let me ride!'

Eli fell over in panic and inadvertently launched the girl onto a tree branch where her head popped off. Her torso and head fell onto the soft grass with brown leaves scattered, oddly enough no blood came out of the head. Eli was shocked and stayed in place to see if his vision was tricking him. He closed his eyes and shook his head violently for good measure. He still saw the torso and head, sticking out still on the ground.
However the torso's hands moved and pushed itself up to stand.
"Now where's my head?" asked the head in the distance.
Eli was even more shocked, he was tempted to run back and look for his owner but he needed to see if she found her head.

Eventually the torso found the head and put it back in place.
"Oh sorry, that happens sometimes.", responded the girl, "What's wrong, why do you look so scared?"
The other children came to look at the horse, one of them said "It's okay, it's safe here, you can play with us forever and ever".
The girl did a very cutesy smile along with the other children, although people would normally be happy about this, Eli was far too scared to even accept such a smile. Eli scrambled away as fast as he could across the forest. He tread across countless pathways, trying to remember where Neil was. The other people were starting to look concerned with Eli's panicked look, and not in the sympathizing or curious kind of way...

Eli finally arrived at the area near the strange tree, which had an opening a bit like a mouth. He saw Neil by the opening.
"Should we get going back?" asked Neil, "The sun's going down - What's with the concerned look?"
Eli couldn't explain what he saw other than the fact he wanted to go back home.
"Oh... I guess you didn't like this place huh?" asked Neil, "Maybe you're a bit homesick..."
The two went back to the way back home as the sun was starting to rise down and everything was starting to become orange. By the time the two arrived back home, the sky was a nice dark naval blue colour, Neil took Eli back to the stable he slept in.
"Well good night little buddy" responded Neil as he went into the house. Eli started to feel sleepy and drowsy and went to slumber.

In the middle of the night Eli could hear some odd voices, they seemed like the Victorian children he met before. Eli was too asleep to be aware of anything, however he heard the voices of Neil and he sprung up rather slowly.

He saw Neil walking with the Victorian children, and he slowly chased after them, though he was quite tired and could barely walk at all. He followed them into the same forest he was frightened of, although all what Eli could think about at the moment was finding Neil. Neil and the Victorian children took notice of him.
"Oh hi there, Eli. You ready for a party? We gonna do some good stuff tonight!" yelled Neil crazily as he took off one of his limbs and his head and juggled them together, "Huh? Where's my head? Oh! Here it is! I found it! I found it!"
Eli screamed in the most hoarsely tone imaginable. Was his owner possessed? Eli shook his head for good measure and even banged it on a nearby tree. His owner was still juggling around his body parts and dancing like a clown.
"Hey Eli what's wrong there?" asked Neil, as Eli ran for his life into the forest. He ran into that strange mouth-shaped tree in fear. Before he could even think, he saw a light inside the tree as well as what seemed like an alluring horse further into the tree. Eli then started to become enamored, to the point where it brought several feelings of confusion, like whether or not he should even be scared at all. Eli chased after her as she ran deeper into the tree's seemingly endless corridor. Eventually she outran him and was out of sight, Eli gave up and decided to head back, however...

He saw a huge wall in the tunnel made out of wood, he halted and headed the other way but that was blocked too. Grotesque images of wasp heads with their compound eyes, glowing eyes in the dark and smiling trees sparked into Eli's head, he panicked and screamed to the top of his lungs. The walls started to constantly change texture with the small barks growing bigger and turning into dust, then turning back into odd flower-like shapes. Eli started to get squashed and clustered as he struggled through the walls. As the odd shapes were starting to engulf him, he caught a glimpse of that female horse's head - which had no pupils and smiled as it got closer to him. The head did not have any body, but Eli's vision was fading...
He felt himself escaping from his own body and completely froze in his own grave.

He now could not feel, see or touch anything.
As he is now a part of this forest.

The forest of the uncanny.

Monday, 11 March 2019

Easy maths: Sin and Cosine

Hello there!

Today's blog is about maths, more specifically - the rather interesting side of it and what I have learned. Keep in mind that I am not an expert in the subject, so any kind of criticism is more than welcome. With that being said, let's get into the maths.

Preface

Sin and Cosine are the concepts you may have first heard when you were being taught how to find a certain side/angle of a triangle. The phrase "SOHCAHTOA" often tends to pop up, and a lot of the questions you were given you just had to use this formula to answer them. As well as explaining what this phrase means, I'll also explain why you use this to find sides ,something your maths teacher probably never explained.

Relations with the Axis

Sine = X and Cosine = Y. I've pretty much told you the answer right there. So, next section....
Actually, I jest.
Look at the triangle below:
It has the hypotenuse, adjacent and opposite side labeled for your convenience, so you don't need to crack open your maths book.

If we want to find, for example the adjacent, we will need to use SOH (Sine, Opposite and Hypotenuse). Why?  Because the adjacent is a horizontal line, and Sine is used for working them out (think: the X axis).
Now, we're not going to do a maths question, so don't panic. I'm just telling you a theoretical example. Anyway, Sine is the thing you would use to work out the horizontal parts of the triangle. As you can imagine you would need Cosine for the Vertical axis (or the opposite in this case), therefore you need to use CAH. I'm not going to talk about TOA because I'm not talking about Tangents in this blog, only Sine and Cosine. But hopefully I've made your maths homework a bit easier. Sin for finding out the horizontal side and Cosine for finding the vertical side.

Okay, at this point in time, you may wonder "Right, I know that Sine is used to work out the horizontal and Cosine for the vertical, but why? What is the relationship between these?"
I'll tell you in the next section.

Angles to Vectors

You may have also encountered angles at some point in your maths career, the things you use a protractor to measure or what you have to figure out in a triangle, on the opposite of the right angle, (using Sine and Cosine). I'll tell you why:
As you can see, in Desmos this is what Sine (Red) and Cosine (Blue) looks like in a graph. It produces quite a wavy pattern, which looks quite nice. This wavy pattern is far more than just a beautiful little pattern, it also shows how Sine and Cosine functions, in the graph, Cosine is a little bit more delayed than Sine in terms of reaching its top and bottom, but by how much exactly, and why?
If you look below at the two diagrams, the top point is 1 and the lowest is -1, the more interesting point is the horizontal point, which is half of PI (3.142...). If you multiply this by 57.672 (to convert radians to degrees), you get a number which is ~90. Sounding familiar?


If you quadruple 90 you get 360, which a full circle is 360 degrees (or 2 PI radians). The relation of this to Sine and Cosine is that the distance that they are apart is equivalent to a quarter of a circle. I'll demonstrate what I mean below:
Make sure the setting is in degrees rather than radians.

As shown, B is 90 and the point on the circle is where 90 degrees would be going, and the number '1' is shown again, much like the previous diagrams. The reason that Sine is used for horizontals and Cosine being used for Verticals is shown in the example, due to the aforementioned separation by half a PI. If we swapped Sine for Cosine, then the point would be on the top rather than the right side and that wouldn't look like 90 degrees. Since these two operate in a wavy pattern where the highest value of Sine and Cosine is 1 and the lowest is -1, they can be a useful way of converting angles into a unit Vector. I hope you are starting to see how Cosine and Sin can be used to be turned into vectors.

This is especially handy if you want to simulate rotations via having degrees rather than vectors. 

Conclusion

This is my first time explaining mathematics to you, and I feel a bit nervous doing so, since I don't really have much of a formal background in the subject beyond GCSE. But as I've stated before I welcome any form of criticism.
Sine and Cosine are quite useful things, probably more than you thought - it can be used for things like converting angles into vectors, rotating matrices (which I know the barebones of), items that bob up and down in Minecraft or even chiptune music (stuff you would hear on old game consoles like the Gameboy).

That's all from me!