Thursday, 18 July 2019

Othermind Update #2: Minigames + Art

Hello there!
Today's post will be about Othermind, although it will be short.

Preface


Quite a bit of progress has been going on, on Othermind's part. Although much of this progress is adding all the maps the game will need, which I won't blog about here because I feel like I'm just going to mention the same things I have elsewhere, I'll mainly talk about another feature which I think will give the game more variety which is minigames. I also have some news in terms of this project's art department, if you want to know stick around to the end for that.

Minigames


In the first Pipe dreamer game, there was a section in a city area where you delivered clothes and food to proceed to the top of the mall and a few other minigames as well in the other worlds. Minigames will be returning in the second game, and I'm planning them to have more variety than the first game. They do use POUCH (which I may write a future blog on since quite a lot of progress has been going on there), to be activated. Thanks to POUCH, it has given a far more modular way to activate the objects that run the minigames which is initializing them through the scripting of POUCH. Once they are activated, they start updating and they have a number. This number is used to determine which state the minigame object is in, for example if the minigame is a racing game, it switches to a start state which sets the timer, then an ongoing state which is responsible for reducing the timer. POUCH can check the number of this specific minigame object to see what state it is in and act accordingly.

The minigame also has to store data on which objects it uses if it uses any, and this is done using custom types which is saved into the file and read by the level loader. This data could be particular names of entities it needs to keep track of like their score if it is a minigame involving competition.

I'm also planning the minigame to also activate POUCH upon what happens when it reaches a certain state.

Art assistance


When I was working on the artistic assets of Bounty Hunter II, there was a lot of work I had to do. I had to draw, animate and implement every single sprite into the game and, as you can imagineit was quite intense, especially for one person who also works on the coding and the level design. Luckily I have a Discord friend called Joe (blog linked with his permission) who I've known for around a year was willing to lend me some of his talents to this project (and maybe other projects) when I asked him. I email him what I would like to have in the game and he usually finishes pretty quickly. When he finishes, I would critique his art and see things he needs improving on, I tend to show him my crudely drawn pictures to show a rough idea on what I would like things to be. I don't really try to be too specific on details, because part of the fun is seeing how he draws things, and as long as it looks nice, it's going into the game. He usually looks up reference images based on my examples and draws his art using them.
He's not going to do all the art but if things go well (which is quite likely since there were no arguments between us), he is going to at least take some of the workload off my shoulder. Although, my main concern is that I don't want to have unstructured communication with him. Because if I just spend a lot of time emailing him, not enough work will go into the game's coding or level design.
Funnily enough Joe did suggest an idea for a boss fight in Bounty Hunter II last July, with art of the boss' face, which I rejected, due to the fact that a lot of the game was already finished, albeit very unpolished, at that point. Despite this, the enthusiasm he had was one of the reasons I offered him to volunteer in this project.
In order to make him comfortable with helping me, I ask him if he's able to manage the workload and if he can't I'll take back some of it. This level of flexibility is crucial to ensure things will go smoothly and to maintain good relations with him.


Conclusion


Sorry if this post has been rather short, but progress is, at least on the surface, quite stagnant due to me just trying to implement levels as well as working on 3 other games, including Bounty Hunter III. Hopefully the next time I update about this game, it may be a bit longer and more about the level design. The next post I will publish will be about the Magnum foundation framework and its components.
That's all from me!




Saturday, 6 July 2019

Selfish Effective Alturism #1: Why I don't give money to beggars on the street


Hello there, in my last post where I talked about Bounty Hunter III, I mentioned that I was going to put out a blog about something that isn't game development. Here it is.

Preface


Most may have gone into a situation where you see a sad person on the street who is seemingly poor. They may have a sleeping bag, some food from the local 'Sainsburys' or 'Tesco' and a hat, flipped over with some coins inside. Some may feel some pity for them and give them enough to buy a freddo... or two. Others tend to just pass by as if that stranger did not exist at all. Whether or not this is a good idea is quite a debatable matter. Schools tend to encourage people to give to poor people in assemblies and tutor times. My high school/sixth form was a church of England school so clearly they would share the story of the 'good Samaritan'. If you don't know the story of it, watch this video.
I have always been a bit skeptical about the story, since I usually just walk past beggars (as the title suggests). This isn't because of the story itself, I think the story presents a very charitable deed, but rather the application of the story. Not all beggars are like the one in the 'good Samaritan'.

Shady strangers

I remember a few years ago, on my way to one of the sessions in the art class I was in, I stumbled across a sad-looking woman. She seemed to have been pregnant and she begged me for money because she seemed poor. I had a £20 on me. When I lied to her that I didn't have money she asked me to use the cash machine, I told her that I didn't have a bank card and then she asked me to check my wallet, when I lied about that, she asked me about the cash machine again. I ended up in a catch-22 for what felt like an eternity, which eventually annoyed me. I eventually decided to give her the £20 note because I felt bad for her and she thanked me with incredible happiness. If you thought this conundrum ended here, she had a sister who also begged me for money.

She was far more suspicious because she didn't seem like she was pregnant and she begged me for money even though I gave the £20 I had to her sister (which looking back, is a complete mystery why she didn't share that £20). She annoyed me even more than the last one and I even shouted at her that I didn't have any money, but she just kept on begging. She eventually stopped begging and went off. I was in a bad mood and had slightly more to fear when coming to the outside world, I didn't attend the class on that day. In retrospect, the latter action was a bit of an immature move on my part.

This wasn't the last time I would see these kinds of people. I encountered another one months later. Over time I've just learned to lie and ignore them, I wouldn't recommend lying in most other scenarios, but just to protect yourself from potential thieves, lying may be the most sensible course of action.

With that being said, I have several reasons why I wouldn't really help these kinds of people.

Firstly, I have no idea who they are or what they work as. This makes me very weary of who I give my money to, even though the pregnant woman in question was pregnant - nowadays I wouldn't give £20 let alone £50 to these kinds of people. They might spend it on drugs or even if they were going to spend it on something good, it's most likely not going to help them long-term. £50 probably won't pay the rent for one month, even if you live in a studio apartment. Though, it might help you pay for a months worth of basic food, if you are lucky. Sometimes I give a poor person a chocolate bar or a water bottle I won't miss, in fact that would be a better option than giving them any money.

Secondly, I'm only helping one or two people which is nothing considered the fact that the world's population is over 7 billion, and this number will only go up as time goes on. Furthermore I think there would be negative consequences if I donated my money to just one person, they might rely on me to constantly give them money and become a leech. They should know that I'm not someone who makes £90,000 a year let alone is Bill Gates or Jeff Bezos (the latter of which being the richest man in the world). I wonder why some beggars pick on young people who probably don't have any jobs (like me at the time), rather than a rich-looking 45 year old with a suit. Maybe the 45 year old knows that these people are just leeches, whereas a young person are easy to sympathize with therefore can be fooled into giving money to them.

Quite suspicious, huh?

However, I have learned a way to have a much larger impact and not have to go through that terrible episode.

Effective altruism

Over a year ago, I started reading blogs from a non-profit organization called 80,000 hours. The name is based on how many working hours the average person has in their lifetime. Quite a name indeed. The blog's advice, although at first was a bit demoralizing, has some of the best career advice I've ever heard. If you want to know about the organization, here's a TED talk by Benjamin Todd, the founder of said organization. As well as very thoughtfully debunking the idea that "Follow your passion" is good advice for having a good career, it also emphasizes on how much impact you can make as an altruist.

80,000 hours got a lot of coverage in the news back in their early days due to the fact they encouraged "earning to give". Basically, you get into a high earning career and donate a certain fraction of your income to an effective organization that is low on funding - examples of achieving this could include finance, software engineering or consulting. I can see why they got a huge amount of coverage, when many think of making a difference in the world, they think that being a doctor is the way to do it. I too was enamored when I learned that an individual doctor has a very modest impact on society and earning to give was higher impact than an individual doctor's efforts.

Linking this with my example of the beggars, I'd be better off donating a consistent amount of money to effective charities that can help people like those 2 strangers I mentioned earlier (and much more than just 2) rather than random people I can't really help directly in the long run. It's also a better use of that £20 and I can console myself that I would have helped more skilled people save more lives than if  I gave the same amount of money to each poor person on the street. It's also better than giving food I wouldn't miss or buying food for beggars because I could donate money to a soup kitchen to hire several cooks to feed a larger share of the population.

With that being said, 80,000 hours recommend that only a small number of people should earn to give in the long run, since the world's most pressing problems are far more talent constrained (as in specific skills needed to solve the problem) than funding constrained.

What do I mean by pressing problems? What I mean are problems that could have a devastating long-term impact on humanity, they're often not the first things you would hear, like improving education. Things like AI, biotechnology and developing nuclear weapons could have devastating long-term effects on humanity if they were to go haywire. AI could be negatively influenced and possibly exterminate us all, biotechnology could release horrible diseases which could kill billions. Therefore these are far more pressing problems which are far less funded or worked on compared to funding in something like global warming or cancer research (though they are quite pressing too).

Conclusion

The reason I wouldn't give money to people on the street is that I would make a rather modest impact and it would even be negative in some ways. Instead I think it would be far more wise to give money to organizations that can help a larger amount of people or better yet do more direct work for the organizations if you have the needed career capital/skills. Because being an effective altruist isn't about doing good, it is about doing good on a much larger scale than one might think.

If this blog piques your interest in reading about effective altruism or 80,000 hours, you can start to read their key ideas. Although I do think their career guide is also pretty good, it's quite outdated as their ideas have changed since then, so you should read it in conjunction with their key ideas.

I'm hoping to write more on the subject area of effective altruism, because it has really made me think about what to do with my own future.

I'm far more ardent about this kind of lifestyle than the conventional one of going through education, obtaining a fancy degree, getting a 'good' job, working hard, earning lots of money to buy a large house, two cars and support a family that will in turn most likely do the same thing. Actually I was never really into that average lifestyle to begin with. Being an effective altruist (or just an altruist in general)has also been shown throughout millennia to deeply satisfy people on a personal level - a life committed to helping others.
The next blog I write in this series will be on future generations, because I found out that they were more important than I thought. Until then...

That's all from me!

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.

Thursday, 30 May 2019

Prownie's art #3: Mountains

I wanted to exercise my artistic muscle and draw backgrounds, fortunately I knew the perfect person to help with this, a man named "Bob ross". I watched a random episode of "The joy of painting" and following along and the art above was the result.

Tools used: 
  • Wacom Intuos pen & touch
  • Krita

Monday, 20 May 2019

Easy Maths: Vectors

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

This post will cover the topic of vectors, a topic I really enjoy since I use it a lot in game development. I will show you what they are, how they can be used to draw shapes, finding out the length of them and why multiplying them together gives pretty cool results.

How to think of Vectors

I tend to think of vectors as a point in space away from the centre, think of a line that goes from the centre to that specific point. In terms of adding vectors, you could think of it as taking one string and adding it to the position at the end of the string. Or you could just quite literally add the two x's and y's together. Subtracting the two is quite self-explanatory. That is it. They are just points in space.





The power of Pythagoras'

Anyone who has ever heard of that maths question where you need to find the hypotenuse of a triangle, has probably heard of the term Pythagoras' theorem (or the 'Pythagorean theorem' if you have lived in the United States). The way they do it in school is so impractical and shoe-horned that it would put anyone off the whole thing, couldn't one just use a ruler to measure the hypotenuse? Not all triangles are right angled in the real world, in fact very few of them are.

With that being said, it can be very useful in terms of finding the magnitude of a vector (length of the vector), you plug in the X and the Y (if either are negative, make them positive) into Pythagoras' theorem and you have your magnitude!
Now that we have established that, I'll introduce you to another type of vector which is a unit vector, it has a magnitude of 1 and is useful for wanting to move in a certain direction. The way that this is calculated is by dividing both x and y by the magnitude of the non-unit vector. The result is that the two points would either be no more less than -1 or 1.

If you tested this in a game however, the movement speed would be very slow, therefore you would need to multiply it by a single number i.e. (0.5, 0.9) x 20 = (10, 18).

Geometry

Vectors can also be used to make shapes that have vertices, a good example is a triangle or a polygon. More complex examples can include 3d shapes where each vertex is a point that has variables x,y and z. The way that you can turn a bunch of points into a shape is by drawing a line from one point to another much like those drawing books which have you connecting the dots together. You can scale these if you want by multiplying the vectors by one number (similar to increasing the speed of movement). Multiplying a vector by another vector is not what I mean here, but would nicely lead into the next section.

Dot product


When I first heard of this, it was a seemingly simple idea, multiply 2 vectors together.
The formula for this is:
(X1 x X2) + (Y1 x Y2) = Dot product of V1 and V2. 

It doesn't seem too practical. How can I ever use that for anything useful? That kind of thinking is very mistaken, namely because it can be used for a lot like collision detection. A good analogy I came up with is a rod. A pretty long one, in fact one that stretches to infinity in both negative and positive direction. The direction of the rod is determined by a directional vector, ideally a unit vector, since it is very easy to measure. And there are points around it.




Here's where the interesting stuff comes in, imagine that the points fire lasers perpendicular to the rod and they are so hot it leaves a mark on the rod. To make things simpler, lets rotate this whole rod (along with the points) so they all sit in a line.
Let's get rid of the lasers and just focus on the rod.
All that is there is a rod and the red marks. The very useful thing about this is that you can compare where the 'lasers' are relative to that point using these red marks. You could use this to project a shadow from a shape to the rod using said shapes' vertices.




Conclusion

Vectors are pretty cool in my opinion, in fact they are one of my favorite parts of maths (that was, after I stopped doing compulsory maths and actually learned it 'on my own'), it makes me think about how objects are moved or what causes them to move in the first place.
Even if you never use it, just remember that you can at least view the world in a more interesting way if you know vectors.
That's all from me!

Thursday, 9 May 2019

Othermind Update #1: Reverting to pre-made

Hello there!
Progress has been recently picking up a little bit of speed lately, I'll tell you why.

Preface


Remember last update, when I mentioned about the fact that I was running into problems with making my own custom collisions? I ran into more problems than I had initially thought so I had to scrap everything I made and revert to Unity's built-in Rigidbody 2d. I also switched part of the level-editing into Unity's Tilemap, due to performance reasons. I have also made updates to PUPPET (Pixel's Ultimate Propeitary Placement Editng Toolkit), which will probably make my life much easier when I put in collisions.

Custom collision colossal


Yes I have made an alliteration. I couldn't help it.
I was trying to implement the custom collision system I talked about last time, but there were a lot of strange problems that I had. For example the character would keep jittering all over the place when they detected a wall and keep teleporting back, sometimes the character would be pushed through the wall they were supposed to be pushed back by. I would spend days trying to figure out a decent solution, and when I actually them in to the game they don't work out.

By this point, if I kept tackling these problems, I would spend more time doing that then actually making the maps of the game, characters and polishing the game (which are more important). I then decided to give in, and switch to the built-in rigidbody. I may have less control, but I don't have to worry about having to refine collisions in the long run, I have used it for a lot of the games I've made in Unity so its always a reliable back-up option.

Not saying that I can't make separation collisions a reality, but in Unity making your own can be frustrating. Especially if you have the rigidbody2d right up the corner begging you to use it with its diverse functionalities, tailored to any kind of game. If this were something like Monogame, I would have done this much easier, although the only game by far I have made with it (Catwalk), does not feature separation collisions, the player gets pushed upwards instead if they touch a wall.

I'll make a blog soon about how to make these kinds of collisions a reality, just to confirm that I'm not showing off. Honestly, they took me the longest time to figure out and I'm aching to share it with you.

Anyway, I've also changed how the player interacts with certain collisions that determine things like falling, ditches etc. Rather than being objects spawned in the scene they are kept inside the map data. There is a calculation that goes on to round the player's position to the position of the 'objects' themselves, so when it is rounded it checks the player's position relative to the objects, if the two's positions are equal, the offended collision preforms its function. Rather efficient, I'd say.

Overfilling the scene with objects


When I try to test the game, I have to spend a good minute waiting for the engine to load, why? Because the object pooler has to spawn a lot of objects. A lot of these objects were decoration tiles, which I have added in to the game to give the world some texture. I have found out that these were probably what consumed a lot of time, since the pooler has to spawn over 300 of these on startup. This is quite large relative to every other object like triggers and entities which have about 5-20 of each spawned.

This is when I decided to use unity's built in tilemaps to cover collision areas and visible tiles. The whole system seems so much more efficient than mine, it was much faster and did not create so much objects. It has given me much less stress now, so I can actually focus on designing levels, which I will talk about later. The fact that the other aforementioned collisions are also not spawned can save performance too.

Scribbling to fill need not apply


In terms of my custom level editor, I have written a flood-fill tool which covers an entire enclosed area. I eventually got sick of scribbling the whole enclosed area by hand, especially as the editor kept slowing down, having the mouse movement lag and thus making me have to move the mouse slowly so that I can draw the areas more accurately.

The way the algorithm works is a bit like A* but far less complicated, the full explanation for the algorithm is beyond the scope of this post. Although in the previous point I have discussed that I use tilemaps for loading collisions, I still use my own tools for saving collisions due to the fact that there are also the different kinds of collisions which I've described about several times on this blog.
But at least I have learned something cool! And that's what counts.
You never know, I might use this on future utilities (like something using the Windows Forms library).

Level production is starting to come in


I've been starting to slowly put more focus on adding in levels, so I don't have to worry about implementing them later on. One goal I have for what the areas will be like is that they will all feel somehow connected to each other, like in the original Pipe Dreamer where certain areas would transport you to other worlds. Banjo-Tooie has this as well, where you can transport to a sectioned-off area of another world from one world. It gives these areas a very inter-connected feel to them, they aren't' just a bunch of random areas strewn to a hub-world. It's also a convenient way for those who can't be bothered to go back to the hub area to go to another.

At this point I have also implemented all of the controllable creatures from the first game, albeit there were only 3 (one for each world). There will hopefully be much more than 3 in this game, there will also be more than one type of character for each world, some of which are hostile to the player.

Conclusion


Development is slowly starting to catch up now, as I'm starting to worry less about trying to implement my own stuff. This is especially important since I've set myself about half a year to finish this game, I think I should spend more time at this point at refining the game's code, like the event system, level loading and character physics and the such like.

I've got exams in a few weeks (thankfully only two timed ones, both from History). As of writing this I will probably be working on my graphics exam which is done before study leave (after 17th May). I've done my photography though. So development might be a bit slow for now, but hopefully it should pick up soon. Lately I've also been experimenting with other tools as well like Monogame and Windows Forms. I'd like to make another Monogame project soon, I enjoyed using it when I was developing 'Catwalk'.

That's all from me!