Friday, May 08, 2015

Hi. I'm Bilou.

Salut à tous! C'est un peu la pagaille dans le "moteur de jeu". Permettez que je laisse Bouli s'occuper de tout ça et que je vous raconte un peu comment tout a commencé.

Hi there. It's me, Bilou. Bouli says the "game engine" is wrecked, but since I'm just the pilot here, there's little I can do to help, so why wouldn't we use that time to know each other better ?


On est en 1993. Deux potes se rencontrent à l'école. Ils partagent une passion pour la musique et le désir de créer des jeux vidéos. Le frère de l'un va se retrouver l'interface entre le PC familiale, les idées de gameplay et les conseils de programmation du nouveau mentor pour tenter de donnée vie à tout ça à grand coups de DATA ...

It all started in '93, with two class mates sharing passion for music and video game design that turned friends. One's younger brother will become the idea-to-machine interface to convert all those ideas into a bunch of GOTOs and DATAs to bring the game to live. His handle was 'Pype' so far, and he's our host today.

Pour une raison nébuleuse, le frangin en question. Notre hôte, connu aujourd'hui sous la signature de "Pype" manque d'être rebaptisé "bilou" pendant cet après-midi. Si bien que c'est automatiquement en "BILOU.BAS" que seront sauvés mes premiers pixels sur processeur Intel... Encore quelques heures et le nom de "Bilou" sera définitivement transféré de Pype a ma propre bouille ronde.

But on that very day, he was about to be re-named "Bilou" by the two friends. That nickname was used so much on that afternoon that he used it when it was about to save my very first implementation on PC ... "BILOU.BAS". Hopefully, with a few more hours, *I* turn to be Bilou and he can remain "Pype".

C'est le début de l'âge d'or. Quels que soient les projets qui trottent dans la tête des membres de la toute nouvelle équipe -- PPP Team -- c'est moi, Bilou, qui suis au centre. Bilou Ski, Bilou Karting, Bilou's Adventure, Bilou's Quest, Biloutris. Tout y passe. Les lignes de code se cristallisent ... les démos deviennent jouables.

Somehow, it was the golden era. Whatever game the team dreamt of, I was the star in there. Bilou's adventure, Biloutris, Bilou Ski, Bilou Karting, Bilou's Quest, Bilou's Sky Quest ... name it, you'll have it. Code line piles up and demos start to be playable.

Malheureusement, les outils de développement de l'époque sont loin d'avoir la flexibilité et la convivialité des Unity d'aujourd'hui. On se bat tantôt avec l'espace mémoire, tantôt avec le nombre de couleurs, tantôt avec la puissance de calcul insuffisante... les grands projets piétinent.

But unfortunately, even the compilers that turned "calimero" into an executable will fail on the increased complexity of my world. Every additional colour on the gamefield requires a re-write of the engine and of all the level designed so far. Despite an all-shiny Master Boomer, they struggle to bring background music to the game ... It all looks unfinished to the foreign eye.

Les potes de PPP Team mettent alors la main sur un outil qui va les occuper pendant près de 2 ans: le RSD Game Maker, qui permet de suivre une nouvelle idée de jeu dans la semaine où elle germe... On dessine ses niveaux directement ... on les teste dans l'après-midi. Mais les interactions sont limitées et ce type de gameplay n'est pas pour moi. Mon destin est de sauter sur la tête de chenilles géantes et de me faufiler sous des champignons et des gommes sauteuses... Pas de tirer au lance-flamme sur des tronc rampants.

A few month later, the PPP Team get their hands on another tool that will keep them busy for 2 years: the RSD Game Maker. With a few clicks and some improved understanding of English, they can build a 4-level game in a single afternoon, and a Commander-Keen-sized quest in a couple of months. New heroes appear, pastiche and tributes alongside original characters. But the engine cannot be bent to my signature move of caterpillar-stomping and my world of bouncing mushrooms and switches: it's an engine for flamethrowers, weapon level ups and locks.

Quand j'y repense, je me console en me disant que le game-maker lui-même portait dans ses limites sa propre obsolescence. En 1997, Pype se met en tête d'exploiter ses nouvelles connaissances en Assembleur pour construire un Ultimate Game Maker, haute résolution, son HiFi stéréo, plus de couleurs, des monstres au comportement dignes de Super Mario World ... et la liste s'allonge au fur et à mesure que le jeu vidéo vit sa Grande Mutation de la IIIeme Dimension. Ça tourne à la définition d'un OS complet, qui aurait les bon format de fichier pour tout ... qui serait moins lourd et plus convivial que Windows ... Je me retrouve à jouer le rôle de simple mascotte en attendant mon heure.

But even that was meant to end at some point. In 1997, as the PPP Team is about to split, Pype has gathered some assembly language tools and decide to start designing and building the Ultimate Game Maker, with high definition graphics (that is, 800x600 by then), millions of colours, hi-fi stereo Impulse Tracker modules with up to 32 tracks, parallax scrolling and large sprites with behaviour comparable to Super Mario World ... And the list keeps growing as the video game industry's IIID revolution is re-shaping the platforming genre. And rather of growing bottom-up, all this digs deeper and deeper towards the building of a full operating system kernel that could run either the game, or the development tools... And I'm left being a mere sketch on the logo, even though I'm at the top.


Et puis un jour, un coup de crayon un peu plus affirmer vient me sortir de l'oubli. A court d'idées de griboulliages en attendant un cours de réseaux, Pype se dit "pourquoi pas faire un mini-strip qui raconte le parcours de Bilou".

And then, all of sudden, a line of pencil draws me out of the shadow. Out of T-shirt design ideas while he's waiting for a course to begin, Pype wonders "why not a comic strip that relates Bilou's adventure ?". Old characters get a revamp, New non-playing characters appear, a back story grow up ... and a couple of pages appear on a website -- although it never quite turned out into a web comic. This is the first milestone towards an art blog that will then host some Nintendo DS sprite editor developments before this very blog spawns to bring me back to full activity.

Les anciens personnages se font un lifting. De nouveaux intervenants apparaissent... L'idée plaît. Un mini "web-comic" vient s'ajouter aux réalisations de la branche "demoscene" de PPP Team. Plus tard, ça tournera au blog et sur ce blog, on se dira que, quand-même, ce serait rigolo de se faire un Sprite Editor sur Nintendo DS .. la boucle est bouclée.





Tuesday, May 05, 2015

reverse emulator bug ?

Je connaissais le bug d'émulation. Vous savez, ce genre de bug qui ne se produit jamais quand vous testez sur émulateur et qui crashe lamentablement le programme dès qu'il tourne sur une vraie plate-forme (généralement parce qu'elle a de la vraie mémoire).

Why? I can explain easily a bug that happens only on bare metal, but not in an emulator, but this time, it's the opposite. I spent 3 evenings trying to figure out why the emulator crashed before I could explore any issue with DDD. However, on the Real Thing, I can play the game without any issue... 

If I find a way to re-build that emulator from its source, it could be interesting to implement a ring of last N jumps/calls so that we can actually track the reason of such crash. But do I still have the source+compiler combination do to so ?

Là, il semblerait que je viens de passer 3 soirées à tenter de comprendre l'inverse: un bug qui ne se produit que sur l'émulateur. Mais qui crashe l'émulateur, pas le programme émulé, sans espoir de placer des breakpoints ni rien de ce genre. J'avais fini par m'imaginer qu'un vrai "guru meditation screen" serait plus instructif que ce rapport de crash généré par desmume. Et euh ... rien. Pas de bug. Je fait les 4 niveaux deux fois, avec des morts ici et là. Sans que ça ne s'arrête. Au moins, le nouveau système de gestion de mémoire (merci, PAdM) m'a sorti d'un mauvais pas.

Saturday, May 02, 2015

attach/deleteme explain the double-free issue ?

There are a number of things that looks odd in the current animation management code. Why do we try to unregister a new animation every time we're done testing a special block ? How comes Engine::delanim() is invoked both at GameObject destructor and Animator destructor.


But that wasn't enough to fix the NastyBug I had, that jammed the game as you approached the end of level 1. At that point, I knew that some object -- the power-up at the end of the level -- was restored with a invalid state and animation. I mean, that wasn't even a true state. Parts of it made no sense, while other parts were perfectly sound. I wrote a safetycheck functions that confirm some memory area can be a valid GobState or GobArea, using virtual table addresses as a signature, then scanned every states when the level is ready.

But quite mysteriously, although all the states were valid, the powerup was still waking up with invalid state! In fact, I had *two* of them -- and that explains why the bug did not occurred when you'd beat the level at once -- that had the same identifier "33". One, listed from GameScript's static list of objects, and one that triggered the bug. You can guess what happened from there: the power-up actually survived the level reboot, but because I re-parse all the game logic when the level is rebooted, all the state machine that phoenix-object was referring to had gone, swallowed in the bowels of the memory manager, recycled into other parts -- which precisely depending on the number of inkdrops and other dynamic objects alive when the level is terminated.

I feel better now. It will take some time to come back to a list of things that need some polish, but at least, I can envision a release of School Rush soon enough.


Je pense avoir enfin mis le doigt sur l'horreur qui provoquait l'arrêt complet de Bilou: School Rush dès qu'un jeune joueur s'approchait de la fin du niveau 1. En fait, le power-up ajouté en fin de niveau était en mesure de survivre à la destruction du reste du moteur de jeu lorsque le joueur échoue. Une particularité liée au fait qu'il s'agissait d'un objet statique, mais qui n'était ni HERO ni EVIL. Résultat, dès sa ré-activation dans la "réincarnation" du niveau, il était toujours là, mais son environnement -- animations, machine d'état, etc. avait été réaffecté à un autre usage. Résultats: comportement incohérent du moteur de jeu, voire accès mémoire invalides et écran rouge "guru meditation" qui me pourrissait la vie depuis les premiers essais du "big punch"...

Sauf qu'il y a encore quelque-chose ailleurs ToT.

Thursday, April 30, 2015

Vieux vieux pixels ...

Quand je vous disais qu'au début de l'aventure de Bilou, je réalisais mes décors sur des feuilles millimétrées. Je vous ai retrouvé le tout premier "tileset" de la green zone...

Here come some oldies ... tiles on a millimeter-grain sheet of paper, waiting to be converted into list of numbers. 

That's how you develop video games when you're allowed to use the computer at most 1 hour a day... and don't have a colour screen. 
Monsters were designed in the same way, but it wasn't easy to make sure animations would work well. That's why I shifted to modular animation instead for the BASIC version.

Et en bonus, le tout premier appleman, le boss de la green zone et SpongeBop du temps où elle trainait par terre.

Monday, April 27, 2015

Wonder Girl ?

Il y a quelques semaines, Super Papa Bros regardait avec *deline l'intégrale de "Monster World IV", un jeu intermédiaire entre Wonder Boy et Shantae, avec de sympathiques petits personnages ronds, "les pepelogoos" que *deline a beaucoup apprécié.

Je n'ai pas eu l'occasion d'y jouer, je ne suis pas sûr que je chercherai à le faire -- le gameplay à la Wonder Boy ne m'a jamais vraiment attiré. Mais il y avait quelques éléments graphiques qui m'inspiraient bien pour mes temples perdus.

A grand adventure, cute fellows and a heroine. Monster World IV -- afaik one of the last episodes of the Wonder Boy franchise -- had everything to please *deline. It isn't exactly the kind of gameplay I'm after, but it was definitely entertaining to watch on youtube, and there were a couple of nice background design elements that I sketched in my game-art-study book.

However, I am quite puzzled by the similarity between MW4's pepelogoo and Ardy Lightfoot's companion. I should dig that further ... It's interesting, too, to see how that game seems to set up the basics for the Shantae series, as if WayForward tried to make a tribute game that surclassed the original some 8 years later.


Le look des pepelogoo m'a particulièrement surpris, puisqu'identique au petit perso qui accompagne Ardy Lightfoot dans ses aventures. Même son rôle dans le gameplay est similaire, lancé à l'attaque des ennemis.

A la mi-1997, je construisais un dernier jeu Game-Maker avec un personnage au look saïyen du nom de "Futurboy", évoluant dans un décor apocalyptique qui était accompagné par une boule sauteuse tout à fait sur ce moule-là. Mais moi, je savais que je cherchais à reproduire le duo Ardy-et-son-ami. Il n'en reste que le modèle du personnage au bandana mauve, repris dans "4 to save toonland", qui lui, avait survécu.

Tuesday, April 21, 2015

Salut, vieux.

T'as pas pu t'en empécher, hein ? Tu es encore revenu dans les archives perdues de ton blog pour essayer de te souvenir comment il est possible qu'il y ait eu un "trou" de plusieurs semaines entre la version 0.8 et 0.9 que tu n'as d'ailleurs jamais pris la peine de numéroter d'un petit jeu baptisé "School Rush". Et tu vas nous pondre un article nostalgique sur le thème du visiteur temporel. Forcément.

Eh bien, je vais te rafraîchir la mémoire.

Tu vois, c'est sympa, le développement pour le fun. On code un p'tit bout par ci, un p'tit bout par là. Mais voilà, à force de construire des étages les uns par-dessus les autres, tu t'es retrouvé avec une sorte de tour de Pise qui a terriblement besoin qu'on revoie ses fondations. Il y a trop de choses que tu as perdu de vues, au point que tu t'es retrouvé avec du code redondant ou incohérent. Tu étais bien décidé à ne pas baisser les bras. Le projet en vaut la peine: c'est juste un contretemps. Mais là où tu mettais un point d'honneur à te montrer à toi-même que tu étais capable de relever ce genre de défi quand tu étais chercheur universitaire, tu es maintenant dans un job où ce genre de défi, c'est aussi ton lot quotidien dans les semaines de release.

Alors, la prochaine fois que tu éprouveras du dédain pour ceux qui construisent un jeu dans un moteur "2 minutes au four", rappelle-toi qu'ils font ça exactement pour la raison qui fait que tu compiles avec GCC : pour avoir une base solide sur laquelle s'appuyer.

Maintenant, éteins ton ordinateur et monte te coucher: la journée de demain pourrait bien être pas mal gratinée. Moi, demain, si j'ai un moment de calme, je vais en profiter pour gribouiller un peu et continuer à chercher ce qui me plaît dans les "déviations" que j'aime bien. Ça me changera les idées.

/Toi-même du passé.

Thursday, April 09, 2015

iScriptException ...

Something uncomfortably wrong occurs in the game engine. Objects I'm trying to restore have invalid state attached. I believe this is the reason why there has been "guru meditation" screens during last playtests with friends. It seems linked to abnormal use of the memory: while the infringing object seems to have proper structure, it seems linked to a state that is absolutely not looking like a state structure, but rather some animeds content...
That could quite match with some earlier dig into the issue where I had invalid pointers at some delete() operators, leading to red "guru meditation" screens. I unpacked my gdb-remote-analyzers-and-setup-perl scritps. It takes ages to launch the game in that fashion, but I should get a list of stack trace for those locations that shouldn't have been released. I may need to find a proper path to reproduce the issue first.

Meditate on this I will...

3 days later, with 2 runs on the first level, I managed to trigger the exception again in the "demulator", producing 1GB worth(?) of log. I have hopefully a shorter summary of the 11 addresses involved in operations that looked suspicious. I need to program the software eyes that will scrutinize those operations and explain what happened.

2 more days and "PERL's eyes" are ready. I get detailed reports with stack trace of the last allocation, the last sound deletion and the offending "double-free" issue. But what should I think about some memory block that is first allocated in "GobState::addOnDone" (thus should be a transition, somehow, or the vector of transitions), gets deleted as GobState is destroyed, and then destroyed again as a GobAnim ?_?

Finally, one object, shot during some state transition is delete twice, with a time locality pattern that makes it look like a real issue, not some side-effect. Both deletion happens during Engine::animate(), likely at a few frames interval. How has that occured ?

What transition create that object ? What object is it ? Which object created it ? ... At least those questions can be answered with the whole recording of memory allocations. I know from stack trace the address of the transition that created the "faulty" object. From there, running "Perl's eyes" once again, I find it belongs to a "fall->hit" transition of Bilou, and the object generated is a "power-down" object. That might help reproducing the error ... tomorrow.

Question: while there has been only one "constructor" call, could there be two "reganim", making the object linked twice in the objects list ?
Question: if there's a single "reganim" for two "delanim", what is the cause ? Who messed up with the list's invariant ?