onsdag den 21. september 2016

Inheritance – Always good?

Hello, it’s the lead programmer of Headless Hobo with another post. A little delayed, but here it is.
This time I’ll talk about our old combat system in our game Molith.
Figure 1: Simplified overview of the combat system
When you damage someone in our system, you damage through lots of different damage types. As we can see above. There are two main damage types. Base, and the elemental types.
Base always damages the enemy defense. Elemental types only damage, if the defense has a weakness for that elemental type.
In our example above we can see that there also is STR (for strength), which just add extra damage to base.
When the damage reaches the defense, the defense checks if anything goes through and if it does, it sends the damage to the life which then subtracts it.
Figure 2:Overview of the combat system with modifiers
What is a modifier, you might ask? Well it’s anything, that needs to modify the damage. Its most common use is in the different attributes, for our equipment. E.g. we have a broken sword attribute, which modifies the swords damage, by subtracting damage.
In the example above we can see that first the player attack sends the damage to the modifier manager, which then sends it to all its modifiers. Then after the damage has been modified, its sent back to player attack, where the damage is used (as seen in previous example).
As we can see it’s no longer “Damage” its “Copy of damage” and why is this?
Well it’s because that when we modify the damage each frame, we need to have something that is unmodified, else we would keep modifying something, that is already modified. E.g. If we had a modifier, that adds 2 damage each time, then if we don’t make it a copy, the damage would grow by 2 each time it runs. Therefor we need to save the unmodified damage and modify it each frame.
We went to work on getting the system implemented.


Figure 3: Overview of our first idea of the modifier system
So basically everything inherits from the modifier class. What does inherit mean?
Well, it means that if a class inherits from another class, then it gets everything from that class, and can do anything that class can. It has a Is a relationship. Let’s say we have a dog and a cat class, which both inherits from the animal class.
Every animal eats, drinks, mates and so on. Without inheritance, we would have to write the dog class and cat class from the ground up, but with inheritance we only have to write, what they do differently and can save a lot of code by that. The downside to inheritance is, that you lose a lot of flexibility. So if there a day existed an animal, that didn’t eat, then since, we assumed that all animals eat, then we either have to write this new animal class from the ground up, or make a hacky solution.
Using inheritance removed a lot of code that would else be duplicated in the modifiers classes, but also removed a lot of flexibility. We ran into a problem, when we wanted to implement a new change to the system and because we could see that without reworking the code, we would have to implement a hacky solution, we decided to rework the system and make it more flexsible.
Figure 4: Overview of our current combat system.
So previously which class the modifiers inherited from, decided which modifier it was. This was the biggest problem and what changed in the new system. As we can see each modifier has a modifier type, which is now what identifies the different modifiers. Because of this, we could make our modifier class into an interface. What is an interface?
It’s when you need all classes that inherits from it, to do something, but not specify how it does it. E.g. all animals eat differently, so if the animal class was an interface, you would make the interface say that the class should eat, but not how it should eat.
With this new system, we added our feature and in the future it would be easier to make a change. So lessons learned is, be careful about using inheritance, it's good at removing duplication, but it can make it hard to change things, if you don’t use it right. Remember composition over inheritance.
As always I hope you have enjoyed the post and learned something you can use.

Philip Ullersted – Lead programmer at Headless Hobo

tirsdag den 13. september 2016

Loading stats in our game

In many games, there are different stats, that need a lot of tinkering and balancing before its in a good state. Weapons can easily be over powered or can be under powered and end up not being used.
Therefor it needs to be easy to change and it needs to be easy to understand what everything is. To contain data, there are a few different methods. You can use a database or save to a file(using a data type). Pro and cons of them both comes here.
Database
Pros
- Its easy to withdraw data and search for data.
- There is an existing GUI for it.
- Has good support for many entries, without it getting messy.
Cons
- Have to use a GUI, can't edit the file directly.
- Most existing GUI's don't deliver a good enough editing and reading experience.
- Its a hassle to work with(we think).
File
Pros
- Its easy to edit directly from the file.
- We can develop a GUI easier.
Cons
- Have no existing GUI's. We have to write our own, or edit directly in the files.
- Can quickly get messy, if you edit directly in the file, and there are lots of entries.

We wanted to make a custom GUI, that was a breeze to use. Saving via a file, was the best way to do that.
There are also multiple options for how you can save. We considered xml and json. We went with xml, since we liked its syntax better, which is the main difference between all the different data types. There are small other differences, but what really matters is the syntax.

We were a little lost as how you should import the values from the xml into the game. We had no experience with importing xml. Because of this we chose a sub optimal solution. We had to rewrite it, when we started designing our custom GUI. Its was not flexible enough and there was duplication all over it.

The way it worked was that we had a class(XmlSearcher), that did all the work(too much) and then every time, we needed something from the xml file, we called it and it usually returned a XmlNode. Then you called it again with the XmlNode and asked it for something in regarding that XmlNode.

With our previous experience with importing xml, we took to designing a new and better design.
The new design is much simpler and works much better.
Our current system

When you want something in the xml file, you call the class XmlPath's constructor with parameters describing your path to your desired node. Then you can get all the data you want via the XmlPathData, which XmlPath returns. The previous XmlSeacher class, still exists but does far less and is used by XmlPathData and XmlPath.

Its now much easier too work with system and we can design our GUI easier. We hope some of this was useful and makes it easier for you to work with importing xml.

That was all for this weeks blog post! Return next Tuesday for another.

lørdag den 21. november 2015

Something is happening at the studio.

It's two years ago since last time we updated the blog? Quite a while, uh? Well, we are still here and something is happening at the studio.

Click the link below to watch the timelaps.

https://www.youtube.com/watch?v=dXO6-ElYgFU&feature=youtu.be




Keep an eye on the blog as we will update with more stuff and information on our new project.

torsdag den 7. november 2013

A year of game jamming


It's about a year ago we started making video games and so we felt it was time to celebrate it with a video that would show you guys what Headless hobo had managed to make. Now, that's just the birth of headless hobo and we will Participate in many more Game Jams to come. 

onsdag den 30. oktober 2013

So yes, it has obviously been a while since we updated the blog and we are truly sorry, especially because so much has happened since the last update.

We've participated in two Ludum dare games. You can find a link to both games here.

Blub





















Try it here
http://www.ludumdare.com/compo/ludum-dare-27/?action=preview&uid=27420

Total Viking Power

























Here's a little video that follows the making of the graphics through out the development.


Try the game here.

http://www.ludumdare.com/compo/ludum-dare-26/comment-page-1/?action=preview&uid=20524


We will be talking more about the development of the games through this month.

We've also participated in two other Game jams here in Denmark and both of them won a price.

USU Minijam copenhagen.

Here we had an experienced Sound  designer join the team and to be honest which was quite a releaf since one of our Team members got sick and would have left the team to only consist of the Graphic Artist and the Programmer.

Luckily, that wasn't the case and the game turned out to win the price for the Best Game.

Common Sense











The next one were at Indie9000 in Aalborg.

Here we won a price too: jury's favorite... and an Xbox Sponsored by Microsoft














Try it here.
http://www.unicorn7.org/games/game/167/

___________________________________________________

Last but not least, here's our latest game from Bacon Game Jam 6#

The Robo Rainbow Initiative








While this was supposed to be a 48 hour project, it was changed to 24 hours instead. This was because we had to go to Netherland that day after the start of the Game Jam. More the development of the game in a later post.

If you want to play it you can go to this link:
http://bacongamejam.org/jams/bacongamejam-06/170/

fredag den 26. april 2013

Lair of the squirrel hell - DEMO

This is NOT the game, that we are making for ludum dare.

Now you can play the awesome game "Lair of the squirrel hell" as a demo.
We hope you'll play it and have fun.

If you feel in a good mode, you could give us some feedback via the document, that you can get on our blog or on facebook. We'll appreciate any feedback we can get, good or bad. We deeply want to make this game, truly awesome and that can only be done with YOUR help.

You can download the game to your browser here :
https://www.dropbox.com/s/v9frj7dtd7db6c1/TheLairOfTheSqurrielHellWebplayer.zip
And the pc version here
https://www.dropbox.com/s/ulqxlfqt1tvzt2y/TheLairOfTheSqurrielHellPc.zip

The document link, if you want to give us some feedback.
https://www.dropbox.com/s/ae2wfdclq6muei5/Feedback.docx

If you have any problems download or installing, send us a mail at headlesshoboentertainment@gmail.com or write a comment.

- Headless Hobo


lørdag den 6. april 2013

Pathfinding - Performance, a tough one!







When I first got pathfinding to work, like you saw in the prototype and had made somemore work on it, I though well now there can't be much more work, but there were and is still much more work, cause I underestimated how hard pathfinding is!

The performance issue

Pathfinding is very cpu needing, becuase of that you need to write your algorith, very good. There can't be anywere it will take too much time on something or else it will lag and it will lag more the more you get into the game!
That was something i found out, when I tried my pathfinding more. It lagged, so I had to fix it, because if it could lag, with a little testlevel as that, then it was going to be a nightmare, when we started making real levels.
Performance is hard!

onsdag den 3. april 2013

A taste of what's coming. (Music)



Just a short, but very awesome update.
Today, our music composer Mikkel Laynes gave us a few demo versions of the music he is currently working on.

Enjoy. :)





fredag den 29. marts 2013

A* Pathfinding - How does it work.


What is pathfinding?

If you don't know, what pathfinding is, it is when you want to calculate the best road from one place to another. 
It is used in lol(Leauge of legends), when you want to move to another place and pressed at a point with your mouse, then lol uses pathfinding to move you to that point. 
So pathfinding is finding the best route, from one point to another point.

Example from our game! 

Here is an example from our game on how pathfinding can be used in a game.

Bringing characters to life Part 1-3

Today we will try to explain a little bit about how our NPCs work. However, there's just way too much content to just put it all in one post, so we will make this a three part article.

But just before we begin, we are happy to announce that we have gotten Dani's brother, Mikkel Laynes on the team. He will be the one responsible for the music and we are really excited about this. :)

Actually, we are so excited about it that we have already finished the cover art for the soundtrack, so we can share his awesome work with all of you. :)

So remember to check here for updates, because once in a while, we will post a track.


Anyway, let us begin talking about the NPCs
The Work Cycle.
In our game "The Creature" We want the player to experience being the monster in the horror movie/game instead of the Hero. But where's the Horror without the drama and people. To get the best feeling and to make the gameplay more interesting, we need our NPCs to Interact with each other. All their actions should be based on what they've seen, experienced and what influence and relationship they have with one another.

torsdag den 28. marts 2013

So what's going on? A new game you say?


Yes, It is true. We are working on a new game.

- "But you guys haven't finished "De Forbudte Bjerge"!

Yup, That's true. And here's the reasons why we've already started up a new project.

1st) We can't really work on "De Forbudte Bjerge" at the moment, mainly because we are not in charge of its future.

Currently, the guys at Pallesgavebod are considering weither we are allowed to make the game for them or they will hire another team to do so. It might even happen that they decide not to keep the concept which means we will have to change the characters in the game in order to ship it.
And shiping the game is probably our biggest wish.

onsdag den 20. marts 2013

Our game for kids

We are at GameIT College, where we are making a game to children between the age of 8-12 years old.
Our menu

We have made the game for something called "Palles Gavebod" in Denmark.
It is a website for all the kid libraries in Denmark. When the kids visit their site, they do not come back to the site and that is was our game is suppose to do. To get kids on the website to come back to the website and not just visit it one time.

So how was our approach to it?
Well we know that kids love fun and they at that age want to be social. We also know that they are very competitive.
So we needed to get those thing into our game. We have tried to make it as fun as possible and we have highscores in our game. Everything in our menu, has some sort of feedback, so that the kids are never bored.  The game is as fun and challenging as we could do it.