Jump to content

  • Log In with Google      Sign In   
  • Create Account

Bluefirehawk's: "Path to World Domination"

Game engine architecture, or how to start your own Engine...

Posted by , in Info, Coding 02 November 2012 - - - - - - · 1,950 views

...finally! Finally something I wanted to write about all along!
Why didn't I do it? Well...

... I knew I didn't know anything about designing such a complex system. I tried to find some good examples on the Internet. While one wasn't very bad, it didn't make too much sense to me, I always felt like something was missing.
I finally ordered the book "Game Engine Architecture" by . In short, it is great, it contais what the title says. It talks about the problems in modern AAA game engines and how the different engines solved them.
"I don't want to make a AAA game engine, why should this book be good for me?" Because it talks about everything a game engine has to do, about what subsystems it can have.
If you make your own hobbyist game, you face similar problems, only your solutions are simpler. Plus it orders your code nicely and logically.

So basically, if you own this book, this entry is obselete. Almost. Here, I want to write about the groundlaying decisions you have to make not as a professional, but as a hobbyist, as a guy who just wants to start programming fun stuff.

Starting your own Engine
The first and most important question:What is my target, what do I want to get out of it?
Many starters rush to the next questions about the engine, but most importantly, why do you want to do it? Do you want to get money out of it? Do you want to learn? Do you want to implement your dream?

It was simple for me, I came the other way around. I originally wanted to have a C++ learning project. After some time, it dawned to me, instead of programming some boring shit, I could write a game!

To the people who want to realise their dream... unless you are a senior in gamedev, it won't happen. Or the game would not look like the way you dreamed. If you know this (not simply reading this sentence, but KNOW what concequences this can have on your motivation), then move on.

What game do I want to make?
There is no point making an engine without a game in mind. That's how simple it is. If you have a raw idea, it helped me writing it down, solidifying my thoughts. A good Idea is writing a journal about it ;).

What platforms should it be running on?
This can already narrow your choices. For example: "My platform is IPhone", you are pretty much set.
If you say "Well... uhm... on a PC?" You didn't get much further. You also have to ask what for what operating systems. JUST DON'T ASK ME WHICH!
"So for what operating system should I programm?" ARRGH, alright let's not start a crusade here. It should run on your favourite platform you are developing at. You can put more thoughts into it, what kind of person will download and play your game. But that is only secondary, unless you want to make money out of it.

I chose to tackle the Devil, I went for cross-platform. If you use cross-platform libraries, it shouldn't be a big problem, right? NO!
It is easyER when you chose a higher programming language like java, C#, or python.
In a Language like C++, it isn't too difficult either, when you know how. And you DON'T KNOW how when you're not an experienced C++ developer.
Just for the record, I am NOT an experienced C++ developer, I witnessed first hand how painfull it is.

What Language do I use?
For now I tried to avoid talking about religion, but now I can't talk around it any longer.
From a Theoretical Computer Science stand point, it really does't matter. There is nothing you can do with language A that can't be done with language B. The only difference is, some things might be easier to do in a specific language.
"So what should I choose?"
Oh dear. Ok... just... alright, are you a beginner? If you are, choose anything BUT C++. Go with C# or Java, both work very well, both have a good tutorials and beginner forums. Both have a C syntax and you could even get a professional job as a programmer in both languages. Don't just DON'T START with C++.
"Why?" Let me tell it to you this way: Java and C# are like a good wooden bridge over a deep cliff. It supports your weight and even has a wooden safety railing. You can jump off if you want to.
C++ on the other hand is like a bridge of three ropes, one for your feet and 2 for your hands, with a angry gorilla at the other side shaking the ropes wildly. It also has a sign besides it "Health and Safety Advice: Don't fall off, or you're dead!".
If you say "well, I looked at the C++ tutorials and I thought they are pretty simple", then I can't help you here. Do what you have to. You'll see soon enough.

What libraries do I use?
With your favourite language chosen, you can go out and search for useful libraries. I can't advise you how you chose it, I can only urge you to use one.
You don't have to reinvent the wheel all the time.

What Toolchain do I use?
If you are new to programming, you may ask yourself "what do you mean, toolchain? Like a toolbelt of a construction worker?"
No, with toolchain you refer to the tools you are using while developing your program.

Now you are at a point where sometimes, you already have a common toolchain available, I urge you to use it. Don't try to be different, there is a reason why it is common.

Before you start coding, you should set up your toolchain. I know many don't believe me, but you'll save much trouble later on.

You should at least have a:
  • Repository, SVN and Git are the most prominent. Git is especially interesting with the free online git repository server github.org. check it out.
  • an IDE that is able to compile and debug your program.
While not needed, it is a good idea to have a testing framework.

If you've chosen to go down the path of doom, using C++ in a cross platform project, then here is where a lot of your time is eaten up. I've written serveral posts about it, and about the frustration.

That's it for this week, I wanted to write more about the actual architecture, but will be in an other entry.

Keen on making mistakes

Posted by , in Info, Coding, Rambling 26 October 2012 - - - - - - · 824 views

Sooo... this weeks post will be less structured, it is again more of a "writing thoughts to words" entry than something new to the game... anyways.

I gave more thoughts on the engine design, also how you design as efficient as possible, how do you implement a Entity based design correctly... and it went on and on.
Suddenly it jumped my mind, I wasn't going anywhere with it, even though having experience with business application, being one of the better programmers in my college, I want to have a state of the art AAA engine design on my first try.

It won't happen.

I am young, I have a long way to go, much to learn and much to conquer.
College is a weird thing, you learn so much in a single year, that you are shocked at the stuff you have written a year ago and when you are good in your college, it can happen to you what has happened to me: It gets over your head. You think too highly of yourself.

So you do something very few people ever do on the internet. Put your ego down. You are not the best there is.

Game developing is hard, noone can tell you how hard it is, until you tried designing even a simple Iso game in more detail. The learning curve is steep, very steep and you will produce much much shit. That is how you learn, not by endlessly browsing for the best solution.

I don't say that you shouldn't try educating yourself (for me, this would be the Entity Design), you also don't have to reinvent the wheel, if you can learn from the mistakes of others, GREAT!

But if your learning process keeps you away from the actual task, programming, you should rather go ahead and make bad design choices.
Nothing should take away you actually programming something.
It kinda did for me, so I stop worrying so much about making mistakes and just do them. I will find them soon enough, then I know why the design choices were mistakes in the first place.

So to any other new game programmer: you will do badly, that is why it is called "programming experience". Don't try to learn something from a mistake you didn't do yet.

I can die happy now! For realsies...

Posted by , in Info, Coding, Rambling, C++ Endeavor 19 October 2012 - - - - - - · 1,024 views

...yes, I really am that happy.

"Why" do you ask? Simply put:

(If you haven't noticed already, this entry has the Rambling tag)

It works, I still cannot really believe it, I feel a bit lightheaded from that, or maybe it's the hangover, or the chocolate flash, I don't KNOW and I don't CARE, It WORKS.
I've found my light, my saviour, my knight in shining armour. Alright that sounded a bit gay, but moving on. Hail the almighty QTCREATOR. I finally have everything besides the coding. Everything I that was so nervewracking, i can really start to do what I came here to do: Program a game and chewing bubble gum. And I am all out of gum! DUN DUN DUUUUN!
And to beat ass, never forget to beat ass...

"So why is it so good?" QTCreator WORKS! YES! It is easy to install on all platforms I currently want to develop on (windows+debian), a QMake script is fairly easy to understand and yet the easiest Makefile generator script I've found. It as a powerful testing framework and I think the most intuitive switching between "editing, debug..." views. The editor itself is pretty much what you'd expect in an IDE these days.
It's not without it's faults, the "add library" dialogue only allows for .lib files, whick is pretty anoying for your .dlls. Sometimes the design tries to be too posh, too much "Look at me, I am a hip, cool IDE! Not your nerdy Visual Studio, nobody laughs at you when you use me!" I don't need a good looking IDE. It has to work and be productive, I don't care how it looks.

The next weeks post is a bit more structured and maybe a bit depressive, because it is not the day that you think it is. I write these entries sometimes weeks earlier. My entry two weeks ago "Watching people play games..." was written back in August. But the Context never seemed right to post it, so I always pushed this entry further back. I started writing this entry back in october, but you see this in the middle of october, I am actually writing to you from the past!!
That means, sometimes you have an outdated project update and sometimes posts that follow are older than the current post, like in this case. I actually have the next 2-3 entries almost completely written. Next weeks post is older and maybe a bit depressing, hopefully you still find some value in it.

I'm already rambling, I feel like writing some more: WTF, my post was featured? I don't know what the requirements are to get your post featured, I don't know if a human or an algorithm selects the featured entries. If it was a human, I have no idea why he or she thought the entry "Watching people play games..." was so good. I've written most of it in an hour, didn't put much thought in it and even I thought it wasn't terribly interesting. Maybe mildly entertaining, but that's it.
I don't want to bitch around, I like being featured, it makes me feel important. I just don't understand why this entry, and not one of those I actually put hard work in it.

The boring part of being a Developer or: Why I failed

Posted by , in Info, Coding, C++ Endeavor 28 September 2012 - - - - - - · 1,408 views

Soooo... this week I write again about the boring part of developing: Software Construction

If you've read my ramblings on "The seventh Circle of Dev Hell", know that I have my problems with the toolchains for C++, so this is basically part 2 of the Dev Hell, but more structured and no random sentences. Since I don't think C++ veterans have any interest in a text of my first experiences with different C++ tools. I aim this at the C++ newbie, like I am.
I don't have a lot of experience with the toolchains, all of this are the first experience I had with them, so don't take it too seriously when I write "tool xy sucks", I havent worked with them for more than a few hours.
"What are the best tools to use" you ask? None of them, they all suck.

The Problem with the C++ tools
They are old, mostly.
As I sink more and more time into everything around the coding, I see now why C# and Java use a separate RE. I suddenly like Ant + JUnit. It is just so easy to set up build scripts and tests for your platfom, that happens to work on others as well.
I am very disappointed by the tools available for C++, comparing to what is at Java/C# disposal, they are shabby.
This is managable for a C++ newbie if you get some help from tools, like Eclipse CDT that takes care of your make files.
Good for you, but if your project should be platform indipendent, so should be your makefiles (traditional makefiles aren't afaik). And here is where the pain starts, here is where you sink too much time, here is where you have to learn more than you think.
There are tools around, like CMake or QMake. CMake is fit for the job, but you don't. It isn't an easy tool to work with, at least for me, it really starts to get on my nerves.
That's why you shouldn't use C++ for your first big project. You spend so much time figuring out how everything else besides the coding works, how you install tool XY, how do you link correctly, how the HELL do you set up a good cross plattform build environment??

Setting up such an environment isn't hard, if you have experience how you do it. I would love somebody explaining to me his/her setup why it was done that way and not otherwise...

But alas, there was nothing I could find that satisfied me. So the short story: I gave up.

I decided to not go for platform indipendece, I first aim for Linux 64 bit environment. And if the unexpected happens and the game suddenly gains huge popularity, I can make the project cross platform with roughly the same amount of work. But then, it would be worth the time.

The seventh Circle of Dev Hell!

Posted by , in Coding, Info, Rambling 31 August 2012 - - - - - - · 1,084 views


Soooo in this weeks post I talk about the devil in development: TOOLS!

"Why tools?" you say, "Tools make the life easier" you say. NO! THEY'RE NOT! THEY ARE EVIL!

I started from the C#/Java world, and I naively assumed that there are few good, widely spread toolset that work great together for developing C++ in a Unix enviroment. But I forgot the main problem of Unix: OPEN SOURCE!

You are probably asking yourself what the hell am I rambling on about, open source is great. Let me explain:
I agree, I love the GNU licences but it is not the ultimate solution to everything like some people think. Open source also has its darksides too which I really really tasted while searching for a good workflow developing my game on linux. You have increasingly diverse tools, all working differently and having different levels of sophistication. If you have never set up a dev enviroment for C++ before, this stuff is more frustrating than teaching a cat to roll over. I spent hours searching in the depths of the web how to use different tools, just to find out that for me, they create more problems than they solve. Rinse and repeat.
I didn't get around to code very much, to be honest, i didn't code at all. Until now I had to think about everything BUT the coding. And I HATE IT! Arrrrrgh!

So you can imagine I am mad, mad at everything. Even trees. Why do they just stand around, waiting to get water? Why? GET UP and DO something you stupid piece of wood! At least entertain my when you have nothing else to do, but NOOOO, you just have to keep standing there like I am not talking to you... LOOK AT ME WHEN I AM SPEAKING!


In Java, this is somewhat simpler. Almost everything is open soure too, but you have a handful of widespread toolset with a high level of quality. You can go with either of them. Eventually you stumble over a tool/library that suits you better and will keep using that. So why cannot C++ developers move forward into this century? Why do all the tools have to be so needlessly complicated and sporadically work together?!

Few, that felt good.
Some of the problems are my own fault, I know now why other languages come with their own runtime. Everything gets more complicated when you just try to be platform indipendent.

So if anyone cares, that's what I chose for the moment:
Github repo: wow, just wow. I didn't come around to use it very much before this project. It isn't very easy when you are just used to tortoiseSVN. But man, this is thing is amazing.
QT: this tool sounds stupid, but I need a platformindipendent builder, and I don't seem to understand CMake. Plus it comes with a testing framework. CUTE just didn't want to link properly for me.
IDE: Eclipse CDT. Not what I hoped, but it gets decreasingly anoying. For some reason it doesn't want to remove popup windows correctly under Mint Debian. So I sometimes have half transparent rectangles sitting there.
CI: Jenkins. Well, not at the moment, in the future maybe when I have the rest set up and running.

Since this entry is already structure free, I might as well add this here.
I know this journal isn't the most read compared to other newer journals on gamedev.net. I also know why:
Most journals have some cool footage from their game, or at least some cool artwork to show, but I have nothing. It will take quite some time before I can even post some Techdemo. And no, I won't draw some artwork for you, it would be so ugly not even my mother would put it on the fridge.
So there is just me to entertain you, sometimes trying to be professional and sometimes saying "screw it" and just write about random stuff.

I don't know if anybody views this journal frequently, I guess people are just stumbling over my entries whenever I post a new one.
But if there is somebody who actually LOOKS for this journal: Thank you kind sir or madam, you rock!

Next week I post entries in the usual language, posting about the actual game I am working on.

So long and have a nice weekend.

January 2017 »

151617 18 192021

0 user(s) viewing

0 members, 0 guests, 0 anonymous users

Latest Visitors