Sunday, November 30, 2014

Eat, Sleep, Cry, Repeat

Welcome back again, apologies for the little break. Got some good and bad news. The good news is that we bought ourselves a new baby. The bad news is that we don't sleep anymore.

No but seriously, say hello to Jan, who was born two weeks ago. Mom is doing all right, his proud big sister finally has a super realistic baby doll, and as I said, I'm just tired. Or well, I shouldn't exaggerate. Never needed that much zzz-hours anyway. But still... babies can cry until your ears bleed, or let your brain explode like that Akira kid. Fortunately for us, Jan happens to be a crying expert. We tried cuddles, breasts, magic drops, manboobs, meat, whiskey, cigarettes. But it seems he just wants to get cradled by mama all day. Eat, sleep, cry, repeat. That's how babies roll. But before you know, they walk and talk again. Hence, before you know they come home with girlfriends, come home drugged, and eventually don't want to come home anymore because parents are lame.

There are much worse things than crying babies. At the same time we were blessed with a healthy boy, an old pal of me lost his girlfriend of leukaemia. It's unbelievably unfair that such a young person, who gave everything to overcome that horrible disease, still had to give up and leave this world. We're not talking about Amy Winehouse here, but a healthy 25 year old girl. Rest in peace girl.

So yeah, I'm the last person who should complain. 10 toes, 10 fingers, the good looks of his dad of course, and hey, it's a boy! That means legally buying ourselves the Lego Millennium Falcon, watch soccer, do technical son & dad stuff, and hopefully get drunk together in a far future. Not that I don't like my little girl -we played Final Fight together recently- but you can clearly see a shift in interests. She is not really into Barbie and stuff, but you won't make her happy with stories about Space Shuttles or Dinosaurs either. She just wants to become a pink princess-animalpet studio-kindergarten teacher-miss unicorn when she is grown up.

What’s in a name?
Any reason why we called him Jan then? Hmm, yeah, actually there is. First of all, because I couldn't find anything else. Because I'm ultra-critical when it comes to names. Which is also the reason why there is no Tower22 team-name either by the way. In 50% of the cases somebody or something else already has that name. The other 49% is either too difficult, too stupid, or too tough. I mean, you could call your baby Rambo III or Dollar mcCool, but c’mon, it’s a baby. A crying one for God sake.

Second reason is because Jan is a simple, short, old robust Dutch name. Uhm, oh, and they use it in Poland too. Good for grandpops and grandmoms over there. I imagined myself calling him over after he did something naughty: "Jan! Hierkomme Godverdomme!" (= "Jan! Come here Goddammit!") sounds way better than "Jacob-Floris junior! Hierkomme Godverdomme!". I mean, he's a working class man. Not a fairy-tale figure, not a Christiano Ronaldo, not the eight world-wonder.

Talking about men of flesh and blood, maybe the real reason is my grandpa, who carried the same name. Grandpa passed away two years ago, at the respectable age of 91. Not that he wanted to go. No. No. Grandpa was made of reinforced concrete, and survived pretty much everything. It's a shame that I'm not that much of a social family person, and so I wasted all those chances to know my grandpa better. It wasn't until his end, when stomach cancer caught him, that I found out more about his kinda extraordinary life. Which had been hard and bitter on him.

When I was twelve, I played Donkey Kong on the SNES and went to school. When grandpa was twelve, his mother died and he had to carry bricks on ladders to make a small income, far away from home. When I was a young adult, I played Donkey Kong again on a Gamecube, went on with school and learned the joys and hangovers of alcohol. When grandpa was a young adult, World War II broke out, he was captured by the Germans and forced to work in Dresden. Making tank parts, and shortly after that, cleaning rubble and burned bodies after the Allied bombardments. When I became an adult, I found love, and planned our first house together. When grandpa returned from Dresden, people would spit and turn their backs to this "traitor", he didn't find a home, and wandered the streets. I found a comfortable desk-job I enjoy, grandpa joined a circus and travelled through Europe. My girl and I got a wonderful daughter, and a stable life. Grandpa got 8 kids not long after he met grandma. If not driving the car and staying home lazily, I should be sporting 1 or 2 times a week and drive about 80 km on a bike each week. Grandpa made long days, had to bike ~50 km each day, and had difficulties feeding all 8 mouths. My girl helps me a lot with taking care of our two little apes. Grandma got Polio and wasn't very mobile. The burden was mostly on grandpa’s shoulders.

Yet, although grandpa could be strict (8 noisy kids requires discipline!) and a bit surly sometimes, I never experienced him as an bitter old man. He enjoyed playing board games with his family, made jokes, enjoyed a cigarette and a beer (straight from the bottle, always), loved to go fishing on the open sea till his late ages, and still won a few (small) trophies at the age of 89 playing billiards! He peacefully lived with grandma on a camping site during the spring and summer months. And on birthdays, he could look satisfied over his offspring; eight kids, many more grand-children, and even great grand children including my daughter. Like an old proud lion resting on the top of the hill. It fills me with pride to be his grandson, and although my offspring won't be that big, I'm hoping to stand on that hill one day as well. Respect for the old man!

So what better name could I give my son? Although he is crying quite a lot now, that name should guarantee him to become a real man ;) And hey, if you still have grandparents, why not visit them one day? I’m pretty sure they can tell you a thing or two about “real life”, putting things in perspective.

Tower22 news?
Yes, sort of. First and most important, as announced here, I'll try to upload the "music demo" before 2014 ends. With or without music. Of course I'm hoping the guys who made the particular song will give legal permission, but otherwise we'll release it anyway. Keep in mind this is not really an "official" demo. Just a personal play thing. The real T22 demo probably takes some more time.

Second little newsflash; particle-collision testing has been added. Stuff like raindrops would simply check if the Y coordinate would be lower than a given height level, before splatting/bouncing. But now particles can use the scene depthMap to test if it collided with the floor, a wall, pipes, a moving character, or whatsoever. The screen normalMap can also be included, to bounce back in the right direction, or splat properly. It's nothing revolutionary, but still. Doing the small things properly can be more important than you think.

Engine Rebuild?
Last, I'm thinking about re-doing the entire engine. Say what?! Yes I know, that is asking for problems. But building further on code dating from ~2008 is giving me more and more issues. Things have changed so much through the years. Very different lighting systems, 64 bit processors, OpenGL4/5, Compute Shaders, the GPU doing more and more, and so on. And of course, the skills have been improved drastically as well. If had to redo it now, the whole engine would look very different. Much better.

But likely I would say the same thing in another seven years. Restarting every time won't bring us a finished product either. Nevertheless, besides techniques also my tools are aged. Having played with Qt/C++ a lot last years (for work), I must say I produced much cleaner code on a much quicker pace, comparing with old Delphi 7. We Pascal boys don't like to admit it, but... choosing Delphi isn't always helping. Mainly because the majority of tutorials, books, examples and libraries come along in C++ style, or other popular languages. And Delphi isn't popular. I could close my eyes and stick to Delphi7, OpenGL, OpenCL, FMOD and Newton physics. But times change. Maybe choosing C++ and DirectX for example would increase my chances.

I'm not saying I'll be switching though, as I would like to continue with the current T22 developments simultaneously. Finishing a demo, then create a playable demo, eventually with some Kickstarter help. If I had to completely start from scratch all over again, it will simply take way too much energy. No surprise, that's why real companies have a team of programmers, instead of Han Solo doing it all alone in his free hours. I could ask for your help of course, but yet again the current state of the engine(code) will become a problem. It hasn't been built in a very modular way, making it hard to split up in chunks and delegate.

So, here's an idea. Instead of dumping the whole engine, I'll be replacing parts from the "old core code" with newer modules. Programmed in a newer version of Delphi. I could also pick C++, but I still believe Delphi deserves more attention. Asides, the newer (not the newest) XE3 version I previewed, fixed some of the lacking features. Multiple projects in a workspace, 64-bit compiler, operator overloading, et cetera. Too bad the code auto-competition is still ancient compared with Qt though... But anyway, it's a step forward.

The old code should be taken over by newer modules step by step. And at some point, the old code can be fully replaced. Easier said than done, but it's the only somewhat smooth method I can think of. Once te modules (think about DLL's) are there, it should be easier to involve other programmers, specialized in specific matters such as Sound, Physics, Editing tools, or A.I.. Hence I may even decide to make the code open-source. Obviously there are (far) less experienced Delphi game coders than C++ game coders, but opening the doors for the public may help.

These plans are far from final, but I'm trying to think some steps forward. As much as I would like it, you can't do everything at your own. Not at this scale. Well, this is certainly "to-be-continued".

* Edit
Well f* me. Used Delpi7 for ~12 years, and never knew that it always had an auto-complete function: type a word partially -doesn't matter what- then press "CTRL-Space" to get a list of proposals. Still not as smooth as Qt, but useful nevertheless


  1. Firstly, congrats because of Jan! :)

    Secondly, I think changing engine at that time is insane, you will never ever finish your project in this way:)

    Finally: "Well f* me. Used Delpi7 for ~12 years, and never knew that it always had an auto-complete function:" Say what!? :) You should install GExperts and CnPack (or Castalia) and DDevExtensions right away. You have enormous amount of features in this addons. It will make you so much more productive. I've never used qt IDE but using VS 2013 (C++) does not stand a chance to any Delphi IDE with above addons.

    Install them, now! ;)

  2. Thank you, thank you. I'll have a look for the tool you just mentioned. I never really missed such a function, until I started to use Qt which has a nice integrated complete function. Especially when having more and more types/variables/functions, it's easy to get lost in your code.

    Which is also partially one reason to "upgrade"/"rebuild". Not to re-write every single piece, but mainly to clean up and re-locate and rename code. Problem with, especially graphics, is that new features keep on coming. For example, the engine has 2 or 3 different particle systems, and 3 or 4 GI systems when you include the older techniques. Of course I'll try to get rid of old code, but it's cleaning the toilet; some bits keep sticking (and litter the engine).

    If, IF, I'll upgrade, it will be in smaller parts. For example, first pull out the (old) OpenGL code and move it to a separate (GL4+) module. Yes, it is a @#$ load of work but in the longer term it should save time.

    But moreover, if I ever want help from others on the coding part, I should be able to give them a clean & organized codebase, instead of 1 huge pile of files.

    It's not a huge priority though. Far more important is getting sufficient help of artists. No maps/textures/models/sounds/animations = no game, no matter what kind of engine you have. That's a matter of searcing, making teasers, having solid plans, but also providing them proper tools which indirectly boils down to having a working engine again. Well, let's first focus on finishing some demo's ;)

  3. Hey Rick, Congratz for your newborn son

    I always wanted to help tower22 but I don't know a bit about delphi, i think if you could introduce a plugin system, you could attract more programmers to help this project.

    Btw, just letting you know the comments input box is completely broken on iOS 8 chrome browser, I had a rough time typing this on my iPad

  4. Thank you too!

    >> Plugin system
    Well, with DLL's it is indeed possible to pick C++(or another language) instead of Delphi as well. In fact, currently some small parts of the engine are written in C++. I would first go for Delphi nevertheless, to keep things uniform internally. And just for warm feelings.

    >> broken input box on iOS 8 Chrome - had a Rough time!
    Hehe. Never had an apple besides the fruits, so it's a bit difficult to reproduce the problem. I would guess it's a more general issue then, as the website code is just a standard template from "blogspot". Anyway, I'll check if there is some info about that.

  5. Congrats! Welcome to the fatherhood club!

  6. Mate, you will never keep up with current technologies but I am sure you know it already. Look how all todays big games started, like GTA for example. Remember GTA 1 and its graphics? Game must have that something which makes you want to play it. In 99% this is not the graphics but and idea.

    First you are making a relatively small game based on a good idea. Game solds enough so you can make sequel, bigger, better. It solds enaugh so you can make third part, bigger, better. And you are in this loop, something like "Eat, Sleep, Cry, Repeat" but in making computer games :)

    Assassins Creed, GTA are perfect examples of such loops :)

    Exporting parts of the game into dll is good idea. Lately I am playing Witcher 2, very nice game but on the start I see that they use like 8 external libraries. QuadTree optimization - library, pathfinding - library and so on and so on.

    Keep on blogging :)

  7. As much as I would love to, trying to beat "the big boys" (graphically wise) is a lost battle. A next demo (not talking about the movies we're trying to finish now) should focus on something playable, something you can download indeed.

    But even so, having a solid engine matters. If it doesn't run on half of the computers due driver issues, if the performance sucks due messy code, or if players fall through the floor because of buggy physics... well you know what people will think then.

    Not saying the current engine is swiss cheese filled with bugs, but it isn't exactly solid either. That is partially simply a matter of completing stuff, partially a matter of code that got littered through the years. As the size increases, it really becomes more and more important to have the foundation clear and robust.

    An eventual rebuild wouldn't mean each letter has to be retyped though. But all the code would be reviewed, cleaned, moved over. Which is still quite some work. And... possibly some techniques might be replaced. For example, should I continue with Cg Shaders, or GLSL? Switching over should be avoided, but if there are very good reason, then that would be the right time to do so. Same thing for OpenGL vs DirectX, Delphi7 vs Delphi X? / Delphi vs C++, OpenCL vs CUDA, FMOD vs some other sound system, Newton physics vs other physics library, et cetera. I often have a feeling I'm betting on dead horses. Or at least my chosen libraries aren't public favours, making it hard sometimes find resources and be comfy it will still exists within X years.

    Don't worry too much though, I won't drop the code tomorrow and restart for fun ;)

  8. I agree with your approach, I think its called iterative model and its good for big (relatively) projects like yours. I almost use this model in all of my projects when I need to have something quick (but rough). Then I start refactoring code to add both missed details and enhance system flexibility. Of course you need to get down the big parts right at start or you will (almost always) need to rewrite everything from scratch.