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

Sunday, November 2, 2014

Homebrew Brawling

Fading memoires
In the digital ages, all of our work is stored on hard-drives, clouds and floppy- wait- USB mediums. Too bad for the photographic developer branch, but the days of bringing film rolls -no idea if the photos you took wouldn't suck too much- are over. Or well, too bad... since that every telephone contains decent photographing hardware, people tend to capture more nonsense than ever. New shoes, selfie of weird me + GF's, selfie of me standing in front of some uninteresting building, baby doing funny things (hundred times a day), mass murders in the desert, the size of your doodle, et cetera. It's a good thing though. At least our fond memories don't fade away together with a handful of yellowed photos. When asking my girl for photos of her childhood for example, she really only has a few tiny (poor quality) pictures. In contrast, our little ape has been snapped a billion times; selfie of scary me + crying baby, baby walking, baby laughing, baby falling, baby crying again, size of her doodles, et cetera.

So it happened that friends and I were spitting through the photo-vault, looking for youth pictures of two good friends that recently got married together. Not a surprise, besides a few (analogue) photos of them sitting on donkeys, giving very first kisses to another boy/girl, smiling to the camera in Mickey Mouse shirts, and measuring their doodle sizes, 98% of the other photos were digital ones, starting somewhere in the late nineties when -exactly- the digital camera and mobile phones were invented. Being a teenager by then, donkeys were exchanged for scooters and cars, ice-cream for beer, Mickey Mouse shirts for shirts with puke, and as for the doodles... well nothing changed really. Anyhow, we had a good time sorting out the photos of course. If one of your friends will marry one day, do yourself a favour and make a photobook.


Analogue or digital, photos still get lost though. When I started programming, somewhere in the late nineties -yes, when the digital camera became popular-, I made a wild variety of games. 7% finished, buggy games, I must say. Shooting Galleries, Command & Conquer attempts, top-down view racing games, Bomberman clones, R-Type flying arcade games, side-scrollers. You name it. Comparing to Tower22, the cool things about them was that you could actually make a playable (prototype) game within a reasonable amount of time. Read days/weeks/months, not years. Nevertheless, pretty much all of them died sooner or later. A combination of losing interest, lack of experience, and getting in love with another idea. It's a darn shame, but most of these old games just disappeared. Like tearing, burning or throwing away the photographs of your ex-girlfriend, most of my old source code got "erased" after a hard-disk or computer replacement. There were a few CD-ROM backups (no USB yet), but being in love with another project, I usually figured we wouldn't need that old crap anymore anyway.

This is one of the few games that survived, and still works! Level 1 at least... sort of... It was inspired on Contra (Probotector).

A big mistake. Maybe your current girl/wife disapproves, but wouldn't you like to see back all your ex-girlfriends? On photo I mean, just for having a laugh and bringing back good or bad memories? Honestly I can't tell because I don't have any ex-girlfriends (still together with the first one), although I do have some ex-gameproject loves. They say your first true love is the strongest one, and maybe that is true for games as well. Once I knew a bit how to make (flickerless) animated sprites and some sounds, using Delphi4 and "DelphiX", a DirectX component library, I tried to realize my first *serious* game idea. An idea I had for a longer time, as that particular genre died out with the arrival of 3D consoles such as the N64, Saturn and Playstation. I'm talking about the brawl, aka "Beat 'm up" genre.


Fuck'm up!
If you didn't grew up with the (S)NES or Sega, you may not recognize the term. A "Beat 'm Up" game can be best described as a side-scrolling fighting game. You would walk through a street, bar, ninja Dojo, train, bus, Technodrome, whatever, and beat the shit out of every foe on screen. Except for your buddy of course. Beat 'm up games typically had a 2-player mode, which would double the fun. Unlike Street Fighter or Mortal Kombat, you were usually able to walk up and down as well, and had to defeat a whole army of weaker enemies instead of a single foe. A good excuse to smack everyone in the city was usually to safe your daughter or girl. Business as usual for guys like Arnold Schwarzenegger and Jean claude van Damme, in the eighties / early nineties.

Gems in this genre are games such as Double Dragon, Final Fight and TMNT - Turtles in time. My first experience with them was probably in an Arcade somewhere in a German vacation park, where the Arcade version of Final Fight asked me to throw in some coins. Holy shit, after 2 minutes (when the stupid timer ran out) I got stabbed with knifes, pile-drived punkers, threw telephone cells to slutty women. Final Fight was one aggressive piece of game! If it only had a 2 player mode... My all-time favourite beam 'm up game must be Double Dragon for the SNES. How many times did my little brother and I play this game? I used to borrow that game from a guy every once in so often. Whether my little brother liked it or not, had had to help me finish that game for the 8092th time. We got so good in throwing monks from balconies, using nun-chucks against clowns, and enclosing foes to make a 300 hit combo's that we could finish the game without losing any lives. One of the most addictive SNES games in my opinion.

Just an average afternoon in our alley.

The genre faded away though. I'm not sure why, but I think "3D" killed it. The transition from 2D to 3D didn't quite match with the genre's gameplay. Filling the screen with multiple enemies hogged resources, producing fluent 3D animations was hard, and navigating / hitting somebody in 3D felt unnecessary difficult. Of course, many of the issues have been fixed with improved hardware, development skills, and tricks such as auto-aiming and improved shoulder camera's. See PS2 titles such as The Warriors, Mortal Kombat Shaolin monks or God of War. My guess is that companies at the time just didn't have the experience to produce a proper working beat 'm up game in 3D. And honestly, I think 2D still works better. Mainly the (auto)aiming is an issue. Enabling it makes it too easy to strike, disabling it makes it too hard.

Hey, here is an idea... Why not just do it in 2D again?! You are reading my mind. But 2D was not-done end-nineties. Buying an expensive "powerhouse" like the N64, then play simple 2D prehistoric games again?! Blasphemy! As with ex-girlfriend photo's, Nintendo/Sega/Konami/Capcom/.../ burnt and buried their old loves. It remains a mystery why the genre never really revived though. Nowadays 2D is Retro and cool again, but for some reason you will rarely see such a title. Maybe I'm just got stuck in the past.

I felt the same about it in 1998/1999 though. Making 3D was still out of my reach, so what would be the most fun, addictive, awesome type of game to make with good old 2D graphics? Of course, a Beat 'm up. And I would pick our school & village as a theme. Inspiring environments, ahum, beating up our teachers... Actually we had a teacher for English who looked awfully close to "Mike Haggar", the moustached hero (and mayor) in green corduroys, playing in the Final Fight series. I imagined two of them dropping down in a cage, in the labour classroom, fighting with lead pipes... Oh joy.

Face-Turkey-plant.


Make it clay
I was planning to mention this project earlier on this blog, but -surprise- I couldn't find any screenshots anymore. Indeed, the entire thing got flushed in the digital toilet. A bit odd though, as I snapped hundreds of photographs for this particular project. But guess what, searching old photos from my friends for their marriage, I stumbled over a couple of project snapshots as well!

As said, 3D was out of the option, and drawing everything as 2D sprites was just too much. Not that I didn't try though. Fighting games like these, were typically made of a layered background (street, buildings, far background, sky), a simple HUD (health bar, ugly mug shots of the current foe receiving whoopass), some foreground objects to destroy or collect (steak & pizza for health), and of course the puppets themselves. I started drawing backgrounds with either paint or pastel, and then scanned the images. That on itself didn't look too bad, but it turned out to be extremely difficult to mix it with the other sprites consistently.


The problem with sprites is that you'll have to draw frame by frame. The mister Miyagi crane kick for example would need 5 or 6 frames at least. Unless you're a skilled animator/drawer, it's extremely hard to draw the contours and colours consistently, using paper and pastels or paint. Computer programs like Flash would make life easier with vector graphics, but I never really liked the simplistic cartoon look in (Indy) games or cartoons. The animations themselves were hard enough already, but the result didn't blend with the background either. Weird perspectives, different colouring, no shadows. Just not good. If I wanted to make a game without help of pro animators and pixel artists, I had to come up with a different technique... Eureka! Clay!


The size was a bit (too) small to make a detailed environment, but all we had was some clay I got for Christmas.

I always loved clay, as you can create a puppet or object within no time. Ok, it may not look super realistic, but that is exactly not what we want anyway; the clay look itself, with its fingerprints and clumpy chunks, is charming by itself. And a bit scary too. Think about Nina Simone - My baby just cares for me, The Neverhood, Clayfighter, or Jackie Wilson - Reet petite. So, the plan was to model both backgrounds, objects and characters out of clay. Then make digital photographs, and edit them. Easier said than done, the early digital cameras had a low resolution and bad exposure, resulting in blurry/grainy pictures. But fun we had! I would make a piece of scene in clay, and snapshot it from the front (in side-scroller perspective). Only problem was the lighting, which always looked the same more or less. Didn't have coloured spots or mini-electrics to decorate the scene, plus I would need a bright spotlight to get a somewhat usable photo anyway. Editing the lighting was done in Paint Shop Pro afterwards, though my skills were still premature.

More spectacular were the animated guys. First I would make a clay model, 15 cm tall or so, then impale it with a metal-wire skeleton. This skeleton was used to make the model stand on its legs, and keep it in a certain pose. For each move, I would animate the skeleton and capture the model frame by frame. On a white background, to make it a bit easier to remove the background in Paint Shop using the flood-fill tools. It would still take many hours to brush away all background pixels though. And that wasn't the only problem hehe. There were so many moves -stand, walk, punch1/2/3/4/..., get slapped, get kicked, die, fly away, get locked in a wrestle grip, ... that it was impossible to snap all photo's at one time. And due all the movement, the clay joints would eventually tear apart. Knees cracked, hands and heads fell off, bodies got disfigured after squeezing and shaping it too many times. So it would happen that one animation would look a bit different than the other. Different camera distance, different environment light (day and night affected the attic where the shots were taken).


Nevertheless, the results were quite satisfying. The guys walked as drunk idiots, and some of the fighting moves didn't look powerful at all. But the clay-setting is forgiving. Another issue was still the perspective. In traditional beat 'm ups, the streets/floor is just a rectangular shaped area where you can walk up/down/left/right. But the clay worlds were more rounded, and more arbitrary. They had platforms and differences in depth. Via an editor I divided the photo in small tiles that told the game where you could walk, and how high you were. Also the sprites would scale a bit smaller when walking upwards. Yet, the result was a bit weird sometimes. Sprites getting too small compared to the environment, or not very clear where you could or couldn't walk. When ninja-kicking away a foe, it could fall in a pit (read drop below the screen), or get stuck behind an invisible column.

Oh well, recording punch & ouch sounds and seeing it all happen in your (first) game was magic anyways. After half a year or so, I got pretty far with the game actually. There were about 20 backgrounds, an overworld map (in this game you could decide where to go, rather than just finishing levels), an inventory (it was a puzzle-fighting-horror-beat'm up game, of course), several characters "finished", and computer AI that didn't work too bad. Oh, and best of all, one stage had a blue hill-billy pickup truck driving by randomly with "The Fresh Prince of Bell Air" theme song. The trick was to paralyze your enemies in the path of that truck so they would get hit and launch in the air.




Bye my lover
Of course, it also had its share amount of bugs and shit. Nostalgia tends to get blurry by warm memories, but there were reasons I stopped the project at some point. Or, lost interest so to say. When I started this game, "TMC Rumble" (TMC was the name of our school), I only half understood the principles of OOP programming and generic design. Every bit was hard-coded, so the entire thing quickly grew to a gigantic if (level = level1 and enemy = ninja512)...then...else mess. The game rules felt too random. Sometimes you would break your neck when getting smacked of the stairs, other times only a few damage points were given. Enemies would react somewhat randomly to your actions, making it hard to generate an addictive "learning curve" in this game, where the player can discover and exploit weaknesses of enemies. But moreover, I fell in love with glScene, a Delphi component library to make OpenGL applications. Just like the rest of the gaming industry dropped 2D like an old overdue stepmother, I did the same to my 2D toys. And forgot to make at least a proper back-up.

So, all that remains, are a couple of production-photographs (no in-game shots... probably I didn't even knew the PrtScr button back then). Probably for the best, as that amateur code would get me stuck sooner or later anyway. But at least I should have made a back-up. Thinking about all the complexity of making a game like Tower22, where you would almost forget the innocent fun of realizing your silly fantasies with rather simple tools, doing test-plays, and being proud of your quick progress, I'd definitely would like to do a "remake" one day. With clay of course. I would still need some help though, but at least making a beat 'm up is far easier than a full 3D game, plus there still aren't too many good titles around. So, who knows.


Last but not least, an enemy-sheet a friend, my little brother and I did for the "Contra" look-a-like game shown above. The best part of making games is drawing bullshit together. Programming everything on the other hand... sigh.