Thursday, 22 August 2019

Magnum foundation: POUCH and Level loading

Hello there!
Here is a blog post on some updates regarding Magnum Foundation like its 'POUCH' and level loading component .

Preface

I decided some time ago that I wouldn't just use "Magnum Foundation" for making Bounty Hunter III or Othermind. I thought about using it to make any game that has a 2D top-down perspective; it could be a mystery game or even an RPG. It would also save me time trying to create the map loader, scripting and movement from scratch.

Cutscene scripting

I've made a lot of changes to POUCH, namely the way that scripting is operated, rather than being stored in the data of a trigger like Bounty Hunter II, it is stored in the data of the map itself. Triggers exist as an instrument to call parts of the script.

The areas which the triggers call in the script are called labels, which are basically entry points in the script. The pointer which points to a specific instruction in the script goes where the label is and one-by one calls the instructions until it reaches a "break event" command. The instructions involve things like moving an object to a particular place, loading a certain map, enabling/disabling an object, putting up a dialogue box etc. The reason I think it's a good idea to put a script in the map rather than confine it in a trigger is if multiple triggers call the same script, it would save me time having to copy and paste the same trigger and events. It's also convenient if I want to edit the event later on, because I only need to change it once.

It looks a little bit hard to understand
One aspect of POUCH I would like to implement but haven't implemented yet is a static script. This script is not confined to a specific map, it can be used anywhere. This would be useful for events such as saving, game overs etc.

This system was inspired by Cave Story's scripting system in its map editor. Labels are called by certain objects and instructions are executed until they reach an "end" block.

Level loading

I've implemented functions for putting in tile objects, characters and triggers into the map based on some JSON data. When the loader loads map data, it calls functions that handle spawning objects and setting parameters for them .These functions can be overridden with functions that check the loaded object's ID and set their parameters accordingly. This can be useful for things like the minigame objects I talked about in my previous post relating to Othermind.

The "override" functions are prevalent here


I also put in custom parameters for level data, it can be a string or a number, associated with a name. I did this because I feel like trying to hard-code all these parameters into the level data itself would be incredibly tedious and make the process needlessly complicated. Custom parameters are much easier and is a far more broad way of implementing new bits of data without needing to write new code to cater to a certain objects data.

I'll write about this idea in action; say I have a character who requires a certain item or an enemy can help the player. Hard-coding is a solution, but is not a great one, since I would need to write more code and would be disastrous later on when I clutter the source code with characters' code which have very few differences from its base. To combat this issue, I would create a parameter called "Desired item" or "Relationship" and put the name of the item or the character. This is then saved in, and the only hard-coding I may need to do is to modify the level loader's function to set one variable in a character's code according to these parameters.

Bounty Hunter II did have specific requirements like these, for example in one boss battle, one character was invincible until their minions were defeated. In that game though, I hard-coded the specific names of the minions into the boss' code so they would keep track of them. Now if I were to do a remake of Bounty Hunter II in this engine, I can just simply use custom parameters to tell what characters the boss needs to keep track of.

Path-finding

In one of my 4 projects I'm currently working on at the moment (yes it is a lot for mostly one guy), I've experimented with and implemented path finding. I've talked about this in one of my updates on Bounty Hunter III.

Unlike Earl's Order, where the nodes are all around, the nodes in this are different. The nodes that this engine uses are manually placed and linked to other nodes, a bit like connecting wires to each other. Another difference from Earl's order is that all the nodes are walkable, meaning that there are no "wall" nodes which can't be walked through. Time can be valuably saved using this approach because you do not need to worry about if the pathfinding character gets stuck in a wall because they will always follow the nodes, and you'd need to be crazy if you were to put the nodes in a solid object or a ditch.

This seems fine for an environment that won't change anytime soon, but what about one that will change? Say, a boulder obstructs a path. What could be done about this? I would simply just re-implement the walkable flag on to the node, and if a boulder falls on to a path, the nodes on that path would be unwalkable. Once the boulder is removed, that node would be walkable.

Early into this project's development, I considered to have characters try to path find based on tile nodes, as I thought manually placed nodes were 'cheap'. I did certainly attempt this, but it didn't go to well since it was very buggy and it would look pretty robotic. I then decided against it, but my opinion on manually-placed nodes being cheap has not changed, it's an efficient time-saver and is still better than having enemies that eagerly run towards a player, despite a wall being right in front of them. I think that manually placed nodes will take up less memory space since far less nodes would need to exist and will allow me to have much more autonomy on where the enemy can go. It can certainly help in avoiding ditches as well.

Conclusion

I've been working quite hard on Magnum foundation and I'm in the process of refactoring Bounty Hunter III and Othermind's code. And every day, I completely regret splitting Magnum foundation into these two games rather than making these two games from scratch using this library. Well I'm doing this with the path-finding game that I've got in development, and I hope progress will go much smoother there.

I'm thinking about writing a short post on an in-house application called "PUPPET" (Pixels Ultimate Proprietary Placement Editing Toolkit), since one of my in development games are using that tool to make levels for it. That game is also going to be released the soonest out of all 4 games I have on the development table, on the date of 15th September.

That's all from me.



Friday, 16 August 2019

Selfish Effective altruism #2:The unfathomed importance of future generations

Hello there!
Here is another installment to my series about "Effective altruism", it is about future generations.

Preface


What do I mean by future generations? And no, I do not mean 'Baby Boomers', 'Generation X', 'Millenials' or 'IGen'. I think these ideas are rather stereotypical and very ignorant of everyone as an individual, Bill Gates and Donald Trump may both be baby boomers and rich, but one is willing to make the world a better place for the greater good and the other wants to make the world a better place for himself.

What I mean by generations are families, for example your grandparents' family or your great grandparent's family and so on. My argument of this article is that the world may most likely become a much greater thing than it is now and we should do something to ensure that this future comes to fruition.

A world bigger than today

It may be hard to believe that this world will probably be more prosperous than it is today, especially towards the incredibly nihilistic people who think that the world is infiltrated by social media and horrible politics. As well as that, over here, Brexit is happening and constantly being pushed back.

There are a number of improvements in society like less people dying from malaria than in the past. There have also been improvements in astrology, like a small set of evidence of water on mars, slightly increasing the likelihood of us moving into another planet before earth perishes, Elon Musk would cry tears of joy upon hearing this. Homosexuality was also far more discriminated 30 years ago than it is now, in the past gay people could have been at best shamed on and at worst discriminated. This is no longer the case as they can even get married - case and point Ellen DeGeneres or Stephen Fry. The world is also much safer now for children than it was in the 1950s and they are less likely to die when they're outside despite the news often talking about children getting raped or murdered. And for good measure, world poverty has also dropped since 1820 and shows no signs of going up.

If you want more facts then watch this TED talk by William McAskhill (co-founder of 80,000 hours). An even greater thing is that we've evolved from a sapiens that were not the strongest, but had a far larger brain size than most other animals as shown in the book "Sapiens" which I have read a little bit. Imagine what we could be like in the next 10,000 or so years - future humans could have even bigger brains than they do now, therefore allowing for more data to be stored and complex thinking systems to be implemented. Granted, I'm no historian or evolutionary scientist so these are mostly just my opinions. Regardless, the possibility of that could certainly make one excited enough to accomplish this vision of a nicer world... even if none of the people from 2019 will be alive in the next 10,000 years.

There are also large advancements in science and technology allowing us to eradicate diseases and use things like google maps to figure out where a hotel, nearest restaurant or even our houses are. This is something that would have been life or death for our ancestors that didn't have such technologies.

Human race extinction

Certainly, the extinction of the human race is possible despite all these advances, in fact much more likely if there is no policy to be implemented, which I'm not going to mention here because it certainly deserves a post of it's own.

This may have had its origins back around after World War 2, I'm not saying that World War 2 or 1 could have not killed all of the human race - very little can be worse than war! What happened after World War 2 was the cold war which wasn't necessarily a war, but more of a power struggle. There were two dominant superpowers in this time period, the USA and the USSR a.k.a. Soviet Russia, in 1945 the USA dropped 2 bombs on Nagasaki and Hiroshima in Japan. This killed over 100,000 people in a short span of time, but this was not the end. This motivated both superpowers to build up nuclear weapons that for the first time in human history, humans can have access to weapons of mass destruction possibly killing all life. Although this never happened (and hopefully never will), there was one time where nuclear weapons were going to be fired.

Because of this man, you are alive today
Credit: New York times
In the early 1980s the USSR found out that the United states had seemingly launched nuclear missiles and the USSR was alerted about this. A nuclear war would have likely come out of this... if it was not for one particular soviet solider. He was known as Stanislav Petrov (1939 - 2017) and he saved your life. Yes you, reading this. He is one of the reasons that we are all standing on this Earth. That seems like a pretty bold statement, so let me tell you what exactly he did. He was on duty in the early warning centre and the computers wrongly interpreted a missile attack from the US, and the alarms were very loud and how long Petrov had to think was pending. On the very last second, he called up his superiors and informed them that this was a false alarm and no action should take place. It turns out that the computers detected sun rays which were confused as components of the missiles.

If this action had not been taken, none of us would be here and the world would have looked like 2300 AD from the video game "Chrono Trigger"; in other words a very unpleasant world to live in. My main point here is that if you want future generations to live, then you need to think about what things may destroy the basic sources of nutrition, environment and shelter. Then try and prevent them by going into relevant careers to solve them. A good example is government work in policy because as I've said before policy is needed to make sure nothing bad happens.

One liberating thing about this is that you don't need to spend a long time training to become a doctor to save many lives. Well, unless you are working on the medical counter measures to stop diseases from spreading, but other than that you don't need the long training. You may not see your impact now, but future generations will enjoy a lot of what good you have given them.

Conclusion

It may not seem important now, but future generations are more so than most people think. Especially if you are one of those people who think that future generations are essentially like people in front of you. For those people who care, some starters could be, for high earners, you could donate to 'giving what we can' to effective charities or do what I'm doing - spreading these ideas via blogs. Or you could do both. Up to you.
Anyway, I hope this blog has widened your visions about the world. Criticisms are welcome as always.

That's all from me!
######

See also:
https://80000hours.org/articles/extinction-risk/
https://www.effectivealtruism.org/articles/introduction-to-effective-altruism/
https://80000hours.org/career-guide/how-much-difference-can-one-person-make/


Thursday, 15 August 2019

Bounty Hunter II - Desert, by Joe

Hello there!
A freind of mine who I mentioned about on my PDII update, decided to voluntarily draw an illustration of my game Bounty Hunter II (because he's played through the first and the second one).
Keep in mind this drawing may reveal possible spoilers since it is based on somewhere pretty late in the game.

Uploaded with his permission.

Draft version: Where's Peast's goatee?


Finished version, a very hot and bright day in the desert
Although this artwork looks very detailed and vibrant, I do have a few critiques to make of his artwork:

  • He missed the collar of Peast's suit.
  • The suit does not look hard enough and is more like a cardigan.
  • There are no buttons on the shirt
  • The lighting on the airship needs to look more bright (i.e. putting light oranges)
  • The ear looks like strawberry jam toast.
  • The hands on the gun look a bit like they are going to slip off it.
  • Peast's face could do with a little bit more expression, for example the brows looking more furrowed to show that he's angry and ardent about getting his money back.
  • The structure of Peasts face looks flat, the nose looks like a skeleton rather than a human beings'.