attach

blocking GOBs(fr+)

Vous vous souvenez peut-être d'un commentaire de mon frère CJ comme quoi "il faudrait quand-même à un moment donné qu'on puisse avoir des ennemis à travers lesquels on ne passe pas même si Bilou est invincible... une chose que je n'avais pas vraiment prévu de rendre possible dans le moteur de jeu de "Apple Assault": Bilou ne sait pas traverser Funky Funghi simplement parce que dès qu'il le touche, il est blessé et repoussé en arrière. Mais pour les encriers et les plate-formes mobiles, ça risque de causer bien d'autres soucis.
It may look like Bilou can't walk through Funky Funghi in the released demos so far, but I'm actually cheating. What happens is that every time Bilou touches Funky, he's hurt and slightly bounce backwards. It wouldn't be possible that have an harmless, blocking sprite with the Apple Assault engine ... fairly annoying to implement inkjets in the schoolzone, isn't it ? I't's been a background question for a while now, and many solutions have been dismissed already, but I quite like the latest one: have object-to-object alignment primitives in GobExpressions so that you can say "hero is moved out of inker's area" between "play a 'ding' sound" and "shoot a sparkle"
Du coup, pourquoi ne pas simplement prévoir quelques actions "de base" d'alignement au niveau des expressions gobScript ? Plus besoin de définir des flags "sprite solide" ou "non-solide", "solide uniquement de haut en bas", pas besoin de venir bricoler les contrôleurs de comportement: on prévoit simplement qu'un des personnages impliqués dans une collision puisse donner l'instruction "repousse l'autre hors de ma zone de collision verticalement" ou "centre l'autre sur ma zone de collision horizontalement". Même la création d'un lien "transporteur/transporté" peut s'y retrouver. Chouettos.
Personnally, I like how "clean" this approach is. No need to hack something about the collision classes, no need to hard-code some directions of collision, no need to expose more things like absolute location or area properties to the gobScript. Just "block-x, center-x, attach" instructions that will be interpreted in a context where both areas are known by the engine. Just one little detail shows up when reading back the code of the collision engine: only "passive objects" will be capable of using those new operations, because state transitions for the "active object" in a collision are taken after collision tests for that object. Who had collided is no longer known. on found [...] (...) is thus not allowed to use any of the 'extra context' information.

Par contre, en relisant le code, je me rends compte que seul l'objet "passif" dans une collision aura la possibilité d'ajuster sa position ou celle de l'autre objet. Toutes les notes on found sont donc en réalité impossibles à moins de changer aussi le coeur du système de gestion des collisions: il faut les ramener à on hit[]. On garde les plate-formes passives même si c'est elles qui contiennent le code qui aligne les objets.
Conséquence: si je veux qu'à la fois l(a plupart d)es ennemis et les personnages puissent déclencher une réaction avec des plate-formes "passives", il me faudra une classe "Solid Moving OBject" en plus de "HERO" et "EVIL".
That may have some impact on the way we script those objects. Most of the use cases do not cause strong problem, except the "platform that carries both heroes and foes". There, I'd love to make sure that 1) the platform is passive, so that it holds the collision logic 2) I don't end up with O(#foes²) tests in collision tests. It sounds like I'll need a SOLID class in addition to HERO/EVIL, so far...
Small battle plan:
  1. add a "transported" state. (e.g. standing on platform)
  2. enforce coordinates alignment.
  3. make sure you're free to move when transported
  4. handle disappearing platform.

(2011-09-29) [todo][collisions][attach][sketch][choice][newcollide][platforms]

branches/newcollide(?)

So I finally started a new SVN branch with the collision engine modification that I sketched in the train. It's not going to be testable anytime soon, I'm afraid. The current collision engine was already abusing some "setContext(...)" calls to set static variables into GobExpression so that you can e.g. shoot things despites the eval() has no such thing in its argument. With the new "attach" and "align" features I want to develop, that becomes a huge mess of things to capture at various places in the GOB -> GOB -> area -> state -> expression call chain that happens at every collision. I bet the best move will be to extract all this context (including some of the things that are currently plain arguments) into a GobCollision structure which would have temporary lifetime (i.e. allocated on the stack) that would be passed around ...

Well, that'd be better unless the compiler is able to keep all the arguments in registers otherwise :P


Je dirais bien "assez causé, implémentons ces fameuses nouvelles collisions". Sauf qu'en fait non. Les petites modif' faites par-ci par-là dans le Boutdlard Express ne compilent pas, et si je fais ce qu'il faut pour qu'elles compilent, ça va être une véritable pagaille dans le code. Genre "la famille araignée en vacances dans une boites de spaghetti géante", voyez? J'ai une petite idée pour rationaliser tout ça sans perdre en souplesse ni (trop?) en performance. Je vous en dis plus après avoir fait le test.
(2011-10-18) [planning][cxx][collisions][attach][newcollide]

gob->attach(that)(fr+)

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ3Knl3lAqWg_hJCz7qf30Bun_DDCW74Ods3V-hp0M-xyMkyKzqVqC_coWTN1aA8hklI1bbmLwBEWXJHQKDCOGWCTthYDXdUGwQ47co8Z-bIe2cDVrDrNiQJa0glHMUGwYT5sx/s320/tech-blador-feet.png ; tech-blador-feet.png
J'ai trouvé un cas de figure pour tester la fonction "attacher un GOB à un autre" qui doit me servir entre-autres pour transporter Dumblador ou pour faire de SpongeBob une plate-forme mobile. Je veux dire, "un cas de figure qui ne dépende *que* de cette nouvelle fonction".
Starting to work on a set of new features such varied as "grab bladors and throw them onto other ennemies" usually raise the problem of "where do we start". Among all the features (aligning Gobs onto each other, tracking them, etc.), I need a first one that is simple enough and demonstrate the bare bones needed in the code logic: attaching objects at run-time. It seemed that bladors feet could be a candidate. When I draw Bilou bopping a dumblador, blador's feet are stretched away from its body. And when Bilou throws bladors at pendats, the feet are gone, leaving just a large chunk of steel ... a living weapon.

It would be easy to have feet "thrown away" when blador gets bopped on, but then, what should we do when the blador recovers? It magically rebuilds up wherever its feet are gone, like New Super Mario Bros' drybones ? I'd rather not.
Actually, I'd rather have feet attached to their blador although they have been thrown, and guided by a controller that pulls them back in place. The blador's body (the initial GOB) would then stay stunned until both feet have returned. Not only that sounds funny to do and play with, but it also means that the terrain surrounding the dumblador will affect how long it will stay stunned if you stomp it, and thus how tricky it is to grab it before it recovers. A nice interplay approach, imho.


Je m'étais amusé à imaginer Dumblador perdant ses pieds au moment où Bilou lui saute sur la tête ... eh bien, c'est exactement ce dont j'ai besoin. Les pieds deviennent des GOBs autonomes, mais restent "attachés" à leur Dumblador d'origine, ce qui permet de définir des contrôleurs qui les ramènent vers celui-ci. On verra par la suite si celà crée un gameplay intéressant, mais pour l'instant, ça semble un test prometteur.
(2012-11-19) [coding][gobscript][english][monster design][dyngobs][dumblador][attach][sketch][newcollide]

walking on platforms(fr+)

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi57fM35fabSIhbrA1f3JQgjMsd_iG7N-loCJ3Eh-zXvsDmgQbOH3_sAqPbFko3dxmKnvjGjk2qs6Val1llWuYjYiPQk6VxsiI2OI_rM60XGlzrElDo_An5iq49AKPikgasYOJ6/s200/techplatforms0001.png ; techplatforms0001.pngI was somehow 'home alone' Wednesday evening. But my eyes were stabbed by my laptop's backlit. Perfect mood for some thinking on game engine features with some pens & paper. Theme ? How to enable Bilou walking on platforms. I initially hoped that a GOB reference would be sufficient to "walk on a platform", but that would restrict us to "platforms that have just the shape of the object's bounding box, while there is much more I intend to do with a generic "dynamic path" abstraction!

Cette fois, je pense que je tiens enfin le bon bout. J'ai réussi à fusionner la notion de "chemin" modifié dynamiquement (pour les cordes qui se balancent, entre-autres), et de plate-formes.Tout ça en prenant le temps, pour une fois, d'y réfléchir en cherchant quelles sont les questions auxquelles il faut apporter une réponse plutôt que d'essayer de construire une solution en partant d'une page blanche. Un système efficace qu'il faudra que je réutilise plus souvent.
And for once, I didn't started building a solution, but rather by writing down the questions that need to be answered. Once again, it proved being a powerful exercise. The questions were:
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdk3cKGwDEG0uVwDMNcHdZHCC6YrWfkvdJDDowm-OOrn5TZWOOKmDukD9J5u1GOip3G7yWHvg-yUGgIEjRhGstmhCLQOsnOctQb_1C7FkBfnnagoLnDngYRg5WUNBJ5IZ2yZEv/s200/mario_slanted_platforms.png ; mario_slanted_platforms.pngNow, it's time to be more precise. The path is redundant with collision box in the very case of an horizontal platform. Yet, collision boxes (GobAreas) are not easily accessed from a GameObject reference. For once, I recall of Super Mario World's slanted platforms in the Chocolate Zone. It's still linked to a GameObject, but it will require a dedicated y=f(x) function.

La clé, c'est d'arriver à la formule "l'objet GPath est redondant avec la GobArea -- les zones rectangulaires utilisées dans la détection de collisions entre sprites -- dans le cas précis où l'on veut que le chemin aille de (gob.x+area.left,gob.y+area.top) à (gob.x+area.right, gob.y+area.top)". En d'autre termes, GPath est une abstraction générique, et le GobArea contient les données nécessaires pour cette abstraction dans un cas précis, mais on ne souhaite pas que le code utilisateur soit exposé à ces données. L'exemple-type d'une classe implémentant une interface ^_^. Il me faudra bien sûr d'autres implémentations si je veux des plate-formes inclinées, rotatives, basculantes, et tout ce que NSMB a apporté aux jeux de plate-formes ... mais le code de base "marcher sur une surface" restera là.
I also think the "path" we walk on must be potentially dynamic, that is, manipulated by a controller, for swinging ropes (example of a vertical path) or those NSMB dancing giant mushrooms. Writing it down as "only in the basic case (GobArea), but as a function of what I already have" made the bell ringing: GobArea is a specific implementation of the GPath interface. Virtual methods and inheritance are what I need to avoid cluttering controller's code with interpretation of coordinates array.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxM4Embv8FGIzzw1gYkJEnMCsvyrtNyA1HXNoHhypzzOtY0dwdySSeUoADs2TfLZifWRf95IP_kgZE0yaFDiZYLv10CKA2joSj51Z47HnbhQxo1E4iVJRyV_wzAXOS0s_kuNyr/s320/techplatforms0002.png ; techplatforms0002.png
It also nicely solves the "ownership" (and thus allocation) issues. I know that things like huge mushrooms would have their Path allocated with level-scope, and then manipulated through a controller. The Gob that runs that controller is likely to be permanent as well.

Path for a platform, on the opposite side, are required only as long as a character interacts with the platform. By making GobArea ISA GPath, and stating that all coordinates resolutions are relative to the owner's coordinate, it means that all the platforms in a current state may share the same "path" information (offsets to their local coordinate) and  function implementation. Nice. They stop being "transient/temporary" structures and get level-wide scope as well: the allocation problem disappears ^_^. It do mean, however, that the "gobs" that control movement of multi-segment, dynamic paths will not be able to be themselves on a path, as they'll need their "path" reference to define what path they're altering ... unless I find a better solution, I can live with that.


L'autre bonne nouvelle, c'est que celà règle également les problème de "responsabilité" entre objets. Je trouve cette notion de responsabilité fondamentale en C++: une fois qu'on a pu définir qui est le seul et unique responsable d'un élément, alors on peut gérer beaucoup plus facilement son allocation, surtout lorsque les durées de vie coïncident. "Un chemin pour marcher sur une plate-forme", à priori ça a une durée de vie assez brève: du moment où Bilou entre en collision avec la plate-forme jusqu'au moment où Bilou s'en détache (de son chef ou de celui de la plate-forme, d'ailleurs). Un vrai cauchemar, surtout si on commence à se dire qu'il serait sympa qu'un autre ennemi arrive à la rencontre de Bilou sur cette même plate-forme!
En revanche, dès que GPath n'est qu'une façon de regarder la zone de collision (GobArea), tout s'arrange. Les "GobAreas" ont une durée de vie identique à celle du niveau et sont sous la responsabilité des états des machines d'état (et donc partagées par tous les objets d'un même type). C'est tout à fait satisfaisant si on considère qu'elles définissent des fonctions y=f(x) dans des coordonnées relatives à l'objet auquel Bilou est attaché.

All I still need in addition to the existing Attach, Detach and AttachToPath 'interaction opcodes' in GobExpressions is a 'IsAttached' test that will allow me to craft "force-detach" collision boxes that won't detach objects from other platforms ^^".

(2013-06-07) [coding][sidescroller][english][attach][sketch][platforms]

Spongebop Rodeo(fr+)

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJpknMa6Rneqhj7LgH_BfMz7Vs6zVhhk5bRGimq9De6rArLnWOVuz2Hq0XWGZrFTE3WiXzYZnx_eROosQN3tQw-1HWZ1qNlZYL2AcLaoSIA-tBxLs8aWMcMz2j3nbrf2YlVKgG/s1600/spons6.png ; spons6.png
I now have a (partly-)working prototype where Bilou can grab a Sponge bop and stay hooked while swinging, but I have to hard-code the offset between Bilou and the Sponge as arguments of the copycoords controller. Not so elegant. Plus, if I also allow to grab on Bladors (granted, that's a silly idea, but it helped for debugging :), those offsets are no longer correct and we're rather grabbing some point in the air over Blador's top-right corner >_<

Bien. Bilou peut maintenant s'accrocher aux éponges en balance. Il y a encore des soucis non résolus avec l'animation prévue à cet effet (d'où l'absence de démo jusqu'ici) et un désagrément mineur: il m'a fallu ajuster à la main et préciser dans les paramètres du comportement "accroché à X" la position relative de Bilou et de l'éponge. Au moment d'ajouter le comportement "assis dans un encrier", ça me démange un peu.
I initially had plans for making those "grabs" act on an are, and it would make sense to actually state "copycoords(a.bottom=b.top ; a.center=b.center)", but I've just said that accessing GobAreas within a controller isn't practical.
Expressions handling a collision have access to some extra-context variables (wc-wf) which were just involved in that "repel" behaviour that made inkjet "solid".

 The idea would be to use some GobScript to compute/force the desired location, possibly record it in some GOB variables and have the CopyCoords controller simply enforce that offset from the GOB variables.
Il y aurait bien des solutions techniques pour automatiser ces coordonnées relatives en "alignement vertical, centrage horizontal", à la façon des éditeurs de diagramme ... il y aurait même un "chemin de moindre résistance" pour construire ça dans le contexte actuel. Mais soyons honnête: ce n'est *pas* un élément nécessaire pour le programme. J'ai un seul objet auquel Bilou puisse s'accrocher de la sorte (l'éponge) et je dois de toutes façon utiliser une autre animation pour Bilou-dans-l'encrier (donc, autre état et autres paramètres). Ce serait donc de la généralisation intempestive et prématurée! Caramba! Ça le ferait pas!
I could thus extend the "interaction opcodes":

  • D: detach evaluating object (works in any transition)
  • R[xy]: repels context object away from the evaluating object (works in hit and found) [only along x/y axis]
  • L[xy]: line up the evaluating object with context object (mirrored repel)
  • C[xy]: center the evaluating object with context object (wish)
  • Now, let's be honest. That's a "wish", not a "todo". I only have one grabbable ennemy so far, and only Bilou grabs it. "hard-coded" offset are just fine in that context, and alternative are "premature generalization". I thought about all this because I'll also need a "copycoords" when Bilou sits in an inkjet, but that will be another animation and another state, so other copycoords offset is just fine.
    (2013-06-17) [wish][coding][school zone][MyEngine][attach][kiss][spongebop][GRAB][inkjet][newcollide]

    Stack'm'up!(fr+)

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb8PTY_SvkPFUS7_tLTLeVQqZe6m2TJ77-9ZVaAlYZP0-SFuxpn3nfF4VVkrnWvYRwWujpCbxZS9su4xXqX2-E2gKhFm970Iek2wcnHOhsAZ94nxZb1RLgM8_KJKMDxSKNl3E3/s320/bladorstack.png ; bladorstack.png
    totally totem !
    Commencer par les choses simples. C'est ce qui m'a permis de progresser en fin un peu sur le systèmes des plate-formes dans mon moteur de jeu, malgré des semaines bien remplies. L'objectif: permettre d'empiler des dumbladors l'un sur l'autre pour que plus tard, Bilou puisse lui aussi grimper sur un dumblador puis sur des objets qui bougent.
    C'est un bon premier pas, même si dans l'immédiat, le taille-crayon du dessus ne se rend pas compte du "démarrage" de celui d'en-dessous, ce qui m'a permis de l'envoyer à son tour par-dessus le premier.

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghyKQ7XBuc7HqC9x2TVJx3ToyyE-ybCJDruFXJS4B_ux2IXr842vnEo4hp5F90PcKZr8NaZ3i6xZZMUkuvbwc6OLkyfr_IAcdC2i5b8OE3x3isgswVOrZL7PJ76LNQQJE2f2xp/s320/notes-platform.png ; notes-platform.png
    that was too much for one chunk.
    At last, I've got one more step performed on the game engine. Too many times, I picked up my laptop after the kids when to bed to end up watching things on youtube or hunting for a new car. Somehow, getting at once into "Bilou riding some platform" was intimidating and I couldn't get things in place. When picking up my notes again this morning, I wanted to come back to small steps that can be chunked with a single tea cup. How about having Bilou able to stand on a stunned blador and call it a milestone ? As I started converting blador.cmd into the new cpp-assisted format, it turned out that I could get something even simpler to check the bare mechanisms: having stunned blador stacked onto each others. Well, tonight it's done.

    Oh, and I'm afraid you'll have to wait somewhat for my "Critical Link" series comparing the gameplay of 2D Zelda games: my scanner has apparently entered the dark world of non-functioning appliances.
    PS: it's easy to explain the fact that the "stacked" blador stays in place: I was missing the "attach to path" statement. More annoying: the new GameObject::ride() method was built under the assumption that Gob's movement in (dx,dy) would be consumed, which is not the case with dumblador's stepped movement.
    (2014-03-22) [coding][dumblador][screenshot][attach][platforms]

    Game scripts todo list(fr+)

    Beside the current "moving ink" target, there are a number of things that don't (or no longer) satisfy me in the current School Zone prototype:

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_shRP39ScAPtavlW7oZ72wWVWv-vNz1AaC_BSi8-18dykFucH3-pAmbDBtSFe2Zhc6S4QrMuK2QI9ce1VPqpSMWfcSTcUhyphenhyphenMCpOmoq6_jb1XAh8zYP3uea_5NbBlkNfGRxvKp/s1600/doh.png ; doh.png
    Ça comme à faire un peu trop de choses qui ont été testées mais qui n'ont pas vu leur potentiel pleinement réalisé et qui réduisent la qualité du prototype de la SchoolZone au lieu de l'augmenter. On voit que je ne fais plus assez souvent de démos auprès de mes collègues ^^".

    (2014-05-07) [todo][scrolling][school zone][dumblador][attach]

    Et zou.(fr+)

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmIDLwdJZgP3eII8hdsi0dT8KqPWlXWPbpf-scE_Zv53s_C6VaGWXChI987ds8PhhHnLIVCA-jNcZ4p7jXx7N6uRR2GshJa1tAyCEL5N9iDvCzqOTEgykQzKl3933Crbc2WF7q/s320/Photo-0261.jpg ; Photo-0261.jpg Cette fois, je pense que j'y suis. Il m'aura finalement fallu sortir l'ensemble de mes techniques pour que cette histoire de lancer de taille-crayons empilés fonctionne correctement. Pas de demie-mesure: It's been a hard day's night. And I've been coding like a dog ... At last, I can safely pick up and throw bladors even though they're stacked up. I initially thought a few alterations to the copycoords controller would do it and I end up with a combination of an all-new test-a-bit-in-your-attach-target controller and a filter that makes areas only collide when Gobs are attached to each other. But at least, that allows me to keep both states synchronized and got me rid of those "not quite thrown, sorry, but you'll have to get hurt before you can use your hands again" glitches.

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk2RJ8GDg-Y76J6aQZE6vZV4wfZuGhx2sYoGjZq25y1GTzcdCiYkX54737cG5PKcmxmD2b0USNosEC_us6tMBPqAbsMIBBBfF3WtLqdGXVxBWkV97z-BGTVi9PCQnVZB-O2tl7AQ/s1600/Koopa+Interplay2.jpg ; Koopa+Interplay2.jpg
    PS: J'imagine que ça va encore sembler "beaucoup de complications pour quelque-chose de simple", mais la richesse du gameplay que j'envisage repose beaucoup sur le nombre d'interactions possibles entre les éléments du jeu. De même que le fait de passer de dangereux (en marche) à inoffensif (dans sa carapace) puis à utile (lancée), puis de nouveau à dangereux (demi-tour) rend le Koopa-Troopa génial, c'est la richesse des états que peut prendre "dumblador" sur laquelle je parie pour faire de la school zone un niveau intéressant dans Bilou's adventure.
    If that feels like much work for a small modification of the behaviour, I invite you to read the "interplay" posts of R. Terrel on the critical gaming blog. I expect higher interplay with monsters in the school zone to highly increase the interest of my game under progress.
    (2014-06-21) [collisions][throwable][english][state machine][dumblador][attach][iGobController]

    attach/deleteme explain the double-free issue ?(fr+)

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1mtbwAWjYSbg4WCtjKDWl52YHPg-XNKSyfcowrP9VvkfXRzEgLDQKQfliNaqCvH7fNc9I_vOf1zjYfawPnHaSbL_9Jp1h4GdKpFohfj2vMS9d9I0UR96hSCz01MUElSMHIiEQ/s320/Engine-animate.png ; Engine-animate.png 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.

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0oHYOtyX22mboS4MVmcftvhR1rdrd1zfZ9VaHg8TrUrWkZ4RHrJZEhkCafl7uLeTJidDJlSNS7cNew7nEIPvv_VrWW7rwHhtyEynoIYcFPLUL7NpiWoyEqeIm11AHrw3cpB__/s1600/safecheck.png ; safecheck.pngBut 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.
    (2015-05-02) [guru meditation][cxx][english][attach]

    A dos de blador.(fr+)

    https://i.imgur.com/9hOGY.gif ; 9hOGY.gifMes taille-crayons, une fois en mouvement, font d'assez mauvaises plates-formes, en vérité. Celà vient de leur animation. D'abord (comme la plupart des animations de marche), elle va retarder certains mouvements pour consommer d'un coup 2 pixels de déplacement après être restée immobile pendant 4 images si la vitesse de consigne est d'1/2 pixel-par-60eme de seconde. Ensuite, parce que contrairement à Bilou, le déplacement de dumblador s'interrompt pour une courte pause avant de reprendre: non seulement ce taille est trop "dumb" pour mettre un pied devant l'autre, mais en plus, il lui faut un moment pour se souvenir de ce qu'il convient de faire pour finir le mouvement qu'il a entammé. Autant dire qu'il vaudrait sans doute mieux pour une "pile de dumbladors" de tomber d'un étage quand un des tailles-crayon se remet en mouvement plutôt que de jouer à rajouter des "selles invisibles" pour offrir quelque-chose de plus souple.
    Non. Je préfère tenter maintenant de faire tenir Bilou sur un taille-crayon à l'arrêt. Et là aussi, j'ai du travail: il faudra veiller à This has been a "known issue" since April 2014, and it still wouldn't be easy to fix it today: you can walk on a Dumblador (after stunning it) as if it was a platform, but as it wakes up, weird things occur that make Bilou slightly slip forward and eventually fall of the blador. Initially, it was also affecting stacked dumbladors, so I added a rule to "break" the stack as a blador wakes up.

    The core of the problem comes from the fact that a carried GOB will adapt to the "moving platform"'s speed in order to give the illusion of friction, but when it comes to dumbladors, the speed and the effective motion quite disagree. First because - as with any WALKing GOB - the horizontal speed isn't constant, and second because I introduced a small pause between two steps for the blador, to reinforce the feeling of "dumbness". As a reminder, the GPath abstraction is as follow:

    I gave path-capable engine a try back in february 2013, but that was nothing I could test. The idea was to support both NSMB-like angled mushrooms and (softly) swinging ropes. The current code with dynamic GPath comes from June 2013 and has still to be complemented with a controller that uses it.
    It's all described and motivated in http://sylvainhb.blogspot.be/2013/06/walking-on-platforms.html
    (2018-01-03) [dumblador][attach][walk][platforms]

    GameObject::useEvent() should go away.(fr+)

    https://sourceforge.net/p/dsgametools/hg/ci/refactory-engine/tree/libgeds/include/GameObject.h#l175
    That shouldn't happen. The way controllers fire an event is not satisfying. A static pointer set by class X so that it is used by class Y with no restriction on who does what and that merely works because we know X calling ::useEvent() and Y checking *::doevents happens to take place with the right timing ? No.

    I mean, look at the documentation: "assumes no re-entrance until gobRunController". That has turned false the minute I introduced 'attach-to-other-game-object' feature where you might have to run the object you're attached to before you can run yourself.
    I'd like to convert {NONE, FAIL, EVENT}  enum into something else that allow "EVENT" to carry the list of transitions to check by itself.

    (2018-06-08) [refactoring][attach][iGobController][done]

    crocform #1(en+)

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdGoW4sYryrj1sYfNoadHuEp2Dv1fIvlYXP_Wo0vAraXq0pSsTqQc4ZzZjfQ_ykegiwjfJjoGUc2_PxO0bYOYqPZe5SuwkwNZTc_TnrSQoSG8wpNNwnmeSOEn_2nrXrg-cvqGXKr6nB-1-Q5sKuhY6RjAr4bd77q4skV82Lo9wsVSyhmoeZdg/s1600/Screenshot%202022-12-29%20at%2014-40-55%20Latest%20Tweets%20_%20Twitter.png ; Screenshot+2022-12-29+at+14-40-55+Latest+Tweets+_+Twitter.png
    You may remember I had plans for a larger variety of platforms in the desert/pyramid zone of Bilou Dreamland. There's a second flavour of the crocodile-inspired platform that I barely shown so far, but which got a significant role to play in the work-in-progress level design. Unless you have some sandfall around, it is merely behaving as a "disappears after some time" platform. With sandfall, it adds "respawn" to the mix.

    Last week end, I finally got to the point where I wrote some script to give it existence in the ongoing 3-room demo. There's a thing that went significantly wrong, though: Bilou couldn't notice when the platform is gone.

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfwwpQx3gHxkWneMEt8T1wbNqX_UdQBjCMsUGdv2-A1np8nCO1N1Pti2GGoS6gFdOenH_-D2UUP-ZCWU9KhA3lQOoZXkp0cCstdnfIax_eWDCBNVF75n9f3TQKWsQZpVu3MgfwXuZIXleHkCe5vy_bguwquMzs0wzpNUNz7kLPMpi7ZnKO7dI/w400-h224/Screenshot%202022-12-29%20at%2014-41-25%20Latest%20Tweets%20_%20Twitter.png ; Screenshot+2022-12-29+at+14-41-25+Latest+Tweets+_+Twitter.png

    La pyramide, c'est l'endroit idéal pour des plate-formes un peu particulières. Qui croulent, par exemple. Ou qui changent d'orientation. Mais quand j'ai voulu faire un p'tit essai dans ma démo actuelle, Bilou est resté gentiment à attendre que la plate-forme revienne, flottant dans le vide. En réalité, il me manque un évènement capable de "décrocher" Bilou de la plate-forme: puisqu'elle existe toujours, pour le jeu, on peut toujours marcher dessus.

    Il y aurait plusieurs moyen de régler: Bilou peut déjà se faire "propulser" par une collision (hic: seulement s'il n'est pas au sol). Les dumbladors empilés détectent quand l'un d'eux s'en va (hic: seulement grâce à un contrôleur dédié et l'ajouter ici décalerait tous les évènements de Bilou). Au final, c'est le contrôleur testant si on est sur une plateforme que j'étends pour qu'il puisse tester un bit d'état de l'objet auquel on est attaché..

    I've had a similar issue with dumbladors when time came to 'stack' them: when one recovered, those stacked on top of it had somehow to detect they'd no longer have a platform behind them. It would be trivial if the gameobject implementing the platform was destroyed, but here it stays around.

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZbRCz_5MGVUUy3_sm_BIhh4mTLcDPJLmNu3k81jsayjuC6KgClFFhIGdR9VVixmZOx6PSoCViWI2Ar7AxifXfac22_dpMJJFoKdZpw5VqH_ks7zhMDdIdNYbtDaY_gu2hIXfBr1hjDzyhxNwJ3sbwKG35JH8ww7BdEWN4ZSM_QHfJ-qeP53U/s1600/Screenshot%202022-12-29%20at%2014-41-04%20Latest%20Tweets%20_%20Twitter.png ; Screenshot+2022-12-29+at+14-41-04+Latest+Tweets+_+Twitter.png
    The temporary hitbox seemed to be the least-resistance path, so I gave it a go. But unfortunately, it led nowhere. Mostly because the already-implemented collision I was trying to reuse (that use to make Bilou bounce of erasers, for instance) is only tested in states where Bilou is airborne. Here, I'd need it in states where Bilou is supposed to be on the ground.

    Yet, I hesitate going for an additional micro-controller gobbit (despite it already has C++ code) because that would introduce new events to deal with. I'd rather have the onpath controller be able to fire an event when the platform-object it is attached to signals it is no longer a platform, the same way the controller can signal the object no longer exists.

    I could try having some automated test into 'onpath' that would ensure the current state of the 'platform' object still has the area active and using the proper flags, but that would require extra care if I don't want Bilou to behave weirdly when the platform turns back or does any state transition that don't actually imply losing its 'platform' behaviour.

    reality check: using onpath(when w7.2); (from the worst-possibly-named commit)


    (2022-12-29) [dr22][pyramid][ThreeRooms][attach][platforms]

    using between(fr+)

     

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyEqAisnmwrMMPIV-pVSrVrbzoZCl-io4MvkkreEn1HNN-OmpmBfDZxofChjFrZURxvc4GxAUfrYPAhf2WmclHgARsXcU51U5huTwTBsJ6R1BhMuSiTCmVF8Sa5UBiXADNKJ4Px0XLHc1NJVonLX1y3fexZhKyw-uNKuSaVLJcJiT5prQwm90/w640-h270/Screenshot%202023-05-12%20at%2022-05-56%20Pype%20(@pypebros)%20_%20Twitter.png ; Screenshot+2023-05-12+at+22-05-56+Pype+(@pypebros)+_+Twitter.png
    Bon, imaginer un gameplay sympa avec des ponts, c'est une chose. Mais comment programmer le comportement de ce genre de ponts au fait ? hein ? La bonne nouvelle, c'est qu'on a re-fait un passage dans une autre pleine de jeu avec encore plus de ponts, de cordes, et j'en passerelles et des meilleures. Une image comme ci-dessus, par exemple, suggère que Bilou est nettement plus massif que le reste des rondins, sans quoi il ne perturberait pas autant la répartition des charges sur la corde.

    So, I now have fun ideas of how to use bridges in Bilou: Dreamland. Sounds like it could be a good idea to also figure out how I'm going to implement such things with my game engine... One thing is almost obvious: the bridge will be made of a set of independent-but-interacting game objects. I'm not going to try and make it one big animated object. If I did, I'd have to manually adjust collision boxes for segments for every frame. That's not what it is for. Same observation applied to the Green Zone boss: Big Caterpillar. And much like the bridge, Big Caterpillar is made of segments that must be able to interact to give the illusion of a single object.

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNNzEjv-JWPOCZ5bng9AuCNNZuzqh4AteXDbkpIYEBvPLgD_fwuYho6CH2D2IFRKr677iErNOslo0OkWmbc--XqQJV1twsqchIQT4zLfuSaoaGW32rTMeBQBTgsfaMRRyI6q7MYpuM1VcbZ_4bAXmWIzZ8Oz3Rv_zbAYKmBv78CLASjzvnUjQ/s320/Screenshot%202023-05-12%20at%2022-03-37%20Fv0noL1WYAM-Xgr%20(JPEG%20Image%201404%20%C3%97%201872%20pixels)%20%E2%80%94%20Scaled%20(48%25).png ; Screenshot+2023-05-12+at+22-03-37+Fv0noL1WYAM-Xgr+(JPEG+Image+1404+%C3%97+1872+pixels)+%E2%80%94+Scaled+(48%25).pngMais revenons un cran en arrière, voulez-vous ? Alors que J.L.N était face à son premier mini-boss dans Minish Cap, je me suis mis à prendre quelques notes sur le type de contrôleurs qu'il faudrait ajouter à mon moteur de jeu pour pouvoir faire quelque-chose de ce genre. Puis, sur la lancée, à ce que je pouvais en tirer comme conclusions pour la réalisation de Big Caterpillar, le boss de la Green Zone.

    Il y a déjà une chose que le moteur de jeu de School Rush peut faire: c'est attacher un Gob (objet mobile fait de sprite(s)) à un autre, et utiliser sa position dans certains contrôleurs. C'est ainsi p.ex. que la chauve-souris-baie se dirige vers Bilou. ou que SpongeBop sait se balancer au bout d'un clou. C'est encore comme ça qu'on peut transporter un dumblador et que ses pieds le suivent à la trace. Mais dans tous ces exemples, on a un seul objet de référence et un objet référent. Quand il y a plusieurs référents (3 BerryBats) pour un même objet de référence (Bilou), ils s'ignorent les uns les autres. Or, pour permettre de positionner les segments internes de Big Caterpillar entre sa tête et sa queue, il faut les coordonnées des deux autres. C'est forcé :P

    So since I've just been studying a bit how BC could be implemented, let's see what it can teach us. The game engine can attach one Gob to another one. That's how SpongeBop swings and how BerryBat aim at their target. It is quite clear that those "attach" links will play a role in animating BC, but the question is "who should be attach with whom, and why". When BC will be crawling, for instance, it is easy to make his head move forward during the "expanse" phase and then make the tail move forward (while the head is stopped) in the "contract" phase. As the distance between head and tail shrinks or grows, the location of other segments should adjust.

    It is quite easy to find math expression for those locations based on head and tail coordinates. Unfortunately, that'd require *two* attach links per segment, and the game engine only handle one (including in expression opcodes to attach and detach things when collisions occur). I either have to revise the whole engine and break the assumption that One Attach Link Shall Be Enough For Everybody, or I have to come up with some clever way out. That way out could be how a between(...) controller could use not only the attached gob as a reference, but also *the one to which that is attached*. I.e. segments are all attached to the tail, tail is attached to the head and when segment is processed, it reads segment.attach == tail and tail.attach == head to get the data it needs.

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsqzxQP_cizJaVQuUwr4H8EThVyfijtYuNVwP8gNpBXy_mvxVArwuN_FEHF-kaC50eU22QgR11ByCfNobeul_66BRrjrB5wnSF-tVEtvKhwtLH1JFnMBeMNA9HugL_nUjahqSO88MNxB2T9UZb-NLfKQW4j4AzN0PuLFlY-bmB5_X6en5AEbE/s320/Screenshot%202023-05-12%20at%2022-06-22%20Pype%20(@pypebros)%20_%20Twitter.png ; Screenshot+2023-05-12+at+22-06-22+Pype+(@pypebros)+_+Twitter.png
    Mais gérer deux pointeurs (un "avant" et un "arrière"), ça compliquerait méchamment les choses. Entre autres, ça rendrait difficile le choix de 'qui doit bouger le premier", et ça demanderait une série de bytecodes supplémentaires pour les opérations "attache, détache" des expressions de la machine d'état (que j'aurais cru plus nombreuses. [ ] à vérifier).

    Let's see whether that can be enough. I also long for the opportunity to have swinging vines in some Bilou game. They could also be made of chained Gob through attach links. At least when they're hanging free. But as soon as Bilou is using them, I'd like the rules to change. Now Bilou's position dictates how one part of the vine behaves because of tension. If we can use collision to re-write attachments when that happens, that turns into a job for between(...) again.

    Retournons vers le pont en faisant une halte à une autre mécanique que je tiens à faire apparaître dans Dreamlands: pouvoir s'accrocher à des trucs qui pendent. J'aimerais depuis longtemps que ce genre d'objet dans Bilou soit au moins aussi bien animé que dans le remake de Pharao's Curse par Lazycow. ce qui suppose

    Si j'essaie de dessiner des petites flèches rouges sur ce schéma pour représenter "qui a besoin de connaître la position de qui", on voit que la corde devra réorganiser ces liens quand elle passe d'un "état" à l'autre. Normalement, c'est jouable avec des collision. Et ça confirme mon intuition construite avec Big Caterpillar: le jeu, c'est d'avoir les deux points de référence (début et fin) qui sont directement liés l'un à l'autre (fin->attach == debut) et un contrôleur between() qui suit segment->attach pour trouver fin puis fin->attach pour avoir début et détermine la position-cible à partir des positions de fin et début.

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyEqAisnmwrMMPIV-pVSrVrbzoZCl-io4MvkkreEn1HNN-OmpmBfDZxofChjFrZURxvc4GxAUfrYPAhf2WmclHgARsXcU51U5huTwTBsJ6R1BhMuSiTCmVF8Sa5UBiXADNKJ4Px0XLHc1NJVonLX1y3fexZhKyw-uNKuSaVLJcJiT5prQwm90/w320-h135/Screenshot%202023-05-12%20at%2022-05-56%20Pype%20(@pypebros)%20_%20Twitter.png ; Screenshot+2023-05-12+at+22-05-56+Pype+(@pypebros)+_+Twitter.png

    Et pour le pont ? Va-t-il forcément falloir deux liens par bûche ? Je crois que non, mais ça supposera de faire apparaître à la volée deux objets "coincés" par collision sous la bûche qui a reçu un poids, chacun étant la fin d'une chaîne qui remonte jusqu'à un des points d'attache du pont. Et donc que la largeur maximale pour les zones de collision déterminera la largeur maximale du pont.

    In Theory, it should be possible to do something similar with the bridge, at least to get a nice alignment of the logs when the force applied is so strong that logs' weights becomes neglectible in comparison. Yet, it's obvious there will be two chains here, both using the same "origin" location (the log on which the force is applied). I thought it could be fixed by creating temporarily two GOBs (red dashes) that are pushed by a collision box of the weighted log (red hatching), each being attached to either side of the bridge (red circles). "slave" logs that must just align would then attach to the dashed-GOB that's on their side (green arrows). But maybe we could even do it without the dashed-GOBs if sides attached to the weighted log and not the other way round.


    (2023-05-12) [dr23][boss][vines][greenzone][attach]

    Newer collision flags(?)

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6iJQE1gBGhA2Llmfs-ibtDlLSFJ2cchNLfBkQMkCNNktqoZqMbPq3m8iS_MC1gmVA17PVWGfv4o0n7zpX0igUIVtcnYlw6ARiHP3SopEeUXLliSpiy_YGTVkMSMopMd3SD0sxDnkXaz0qHMzV5mogcocdu_ZUH-HBhb3GeLmX0CEWN2ODSOZAvg/s320/Screenshot%202024-10-19%20at%2010-42-32%20Home%20-%20Mastodon.png ; Screenshot+2024-10-19+at+10-42-32+Home+-+Mastodon.png
    It wasn't as easy as I wanted to make the "soft land" mechanism work, and knowing that Bilou will have to attach to an invisible block for it to work with the "bumping branch" rather than to the branch itself will make it even a bit harder. The issue is to allocate new "kinds of collisions" in an already crowded 16-bit space.

    That issue is not new: it already appeared when I wanted to add pick-and-throw mechanism together with get-your-feet-back while I was just done with direction tiles for inkjet. Each of these would require about 4 different type of "messages" exchanged between game object and I had barely more than 8 flags left... And the solution had been to use some combination of bits for the different things. So you'd still have 0010 saying "up" and 0020 saying "down", but that would only be valid in connection with 0100 that says "direction tile" and not with 0400 that says "interplay" or with 0800 that has been used to collect feet and animate ink level in pipes.

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCMom3nBJ2JThhuAIeYD-o1rxZpYCeAHgD-Up7CesvPgDnBQOgNhPONZD2XW8_uvf6qlZRhXWSmFKIrLGauGpqUbsZwOXP2iPql0GPrIjsju-dqqyNrYzWln_9gYWAite9HUEn34N1YUXScllSG3vmqr_de1cwaRlThKXgFAgcrt8MUJlhopF_Jw/s320/Screenshot%202024-10-19%20at%2010-41-45%20Home%20-%20Mastodon.png ; Screenshot+2024-10-19+at+10-41-45+Home+-+Mastodon.png
    I've got notes already about addressing that, but they mostly question the fact that there are only two "casts" (read game object lists) in the engine: heroes and foes. And that actually address a different issue (collision performance) although they somehow partition "messages" as well: almost only Bilou can receive a "HURT" collision (well, blador receives it too from spiky pencils tiles so it can align with them and this is likely BadDesign ^^")

    And well, introducing bridges and things like that could easily use more casts to keep good performances: both heroes and baddies will collide with bridges, but that doesn't requires baddies to test each others to work. And likely only part of the bridge internal.

    I had collected a set of questions on my new notes, and one of the first one got its answer: despite we have only 16 bits communicated to the script about what truly happened in a collision, a full 32-bit number is stored internally. Some of the high bits are already use for special purpose such as "keep checking collision even after a first item was found" or "only consider objects attached to me", but plenty others could be used to restrict the scope, e.g. creating a private "namespace" between blador and blador feet so that the feet cannot accidentally attach to an inkjet (although maybe that's redundant with "must be attached to me"). It makes little sense to keep the upper 16-bits as "flags" and process them the same way the lower 16-bits are processed (a single matching bit and bingo, we have a collision) because we would be unable to identify which flag had a match. Did we caught fire ? or get smashed ? or got an electric shock ? no way to find out.

    So the plan would be the following:


    (2024-10-19) [collisions][attach][dr24]