Tuesday, March 05, 2013

Poussez-vous !


Push ... push ... push.
Après quelques "tatillonnages", j'y suis presque: les collisions avec les encriers poussent correctement Bilou, sans le faire se "téléporter" d'un côté à l'autre de l'encrier en cas de contact.
Ce n'est pas encore parfait: je n'ai par exemple pas de "bloquage horizontal" pendant le mouvement vertical (et vice-versa), et les encriers peuvent enfoncer Bilou dans un mur. L'affaire de rajouter le bon cando() au bon endroit ...

At last some time to try and add features in the game engine. After several tweaks, I have the right settings, and Bilou no longer goes through inkjets. Neither "normally" nor through quantum leaps. It still need polish, especially to avoid the case where Bilou gets pushed into walls. Most GOBs won't support that. It would be preferred to have a kind of "squish" animation that hurts Bilou when such cases occur. Funny enough, Bilou's code has not changed, except the addition of a simple collision flag. 

Mais à force de petites touches supplémentaires, ça s'affine. Qui veut donc essayer de jouer les Beta-testeurs pour voir s'il reste des choses para-normales dans cette démo ?

There's one flaw in the design, though: So far, I had "repels horizontally" or "repels vertically" opcodes, and a "completely solid" area was implented as "RxRy". That just doesn't work: it makes Bilou ridiculously align to the top/bottom edges while he's pushing the inkjet from the sides. What I need here is an independent "Solid" opcode that behaves either has Rx or as Ry depending on the direction that sees the largest center-to-center distance.
Moreover, when you look at the captured animation, you can notice that something goes wrong when we fall off a inkjet that moves up. Bilou seems to have super-natural speed! That's because all the "repel" opcode do is to trick your coordinates. That's fine on the ground, but it implies they do not alter your speed, so gravity keeps building up Bilou's speed and everything happens as if he was at terminal velocity, falling from high heights. The proper place to fix this is in Bilou's state machine, adding triggers that resets vertical speed in those cases.
Also, there are two metrics produced out of a collision: center-to-center distance, but also area overlap (signed). The later is used to define by how much pixels we should move one object to separate them. Only one of these metrics is available as "we" and "wf" variables in gobscript, but I'm not sure I was properly inspired when I picked center-to-center for the job, as it depends too much on how large objects are.

No comments:

Post a Comment

this is the right place for quickstuff