Thursday, April 15, 2010

Bat Attack!

Almost everything is in place to build Apple Assault except arenas. Yet, I only had "little stars" to check I can shoot something... So I did a silly thing and started shooting berrybats out of applemans when the appleman is surprised to see Bilou. You may think of it as a performance test ... somehow.

Eh bien voilà: techniquement, le code est prêt pour un "Apple Assault". Je n'ai plus qu'à faire quelques "arènes" à coup de level editor. En attendant ... eh bin, j'ai bidouillé le code de l'appleman pour qu'il jette de petites étoiles et des berrybats lorsqu'il apperçoit Bilou. Ca ne sert à rien, mais c'est marrant, et ça me permet de tester les performances du moteur de jeu. De ce côté-là, rien à signaler.

Par contre, dès que j'appuie sur "START", c'est la galère. Avec autant de GOBs qui apparaissent, et vu le comportement des BerryBats (suivre Bilou), je suis régulièrement en contact avec une demi-douzaine d'entre-elles ... Et InspectorWidget essaie de remettre à jour son affichage à chaque fois, avec un "trashing" inévitable, puisqu'il ne peut m'en montrer plus que 3 à la fois. Je prends donc note de ces 2 ou 3 petites choses à règler mais qui n'empèchent pas pour autant de se lancer dans la réalisation du mini-jeu.

A few things have to be fixed, though they do not prevent the Apple Assault game to be started.

  • [done] Appleman remains too often "stuck in the air" after a fall.
  • [done] InspectorWidget should not break more than once per frame when a new monster enters the collision area. Plus I implemented a simple way to switch the focus to other GOBs (just click their "headline").
  • [wish] I need to randomize somewhat the behaviour of berry bats, which tends to "glue" to each other rather than tracking Bilou individually.
  • [done] make sure I can step-debug without having Bilou to jump. now START = debug, L (when debugging) = step and L+START = continue. That allowed me to inspect the stop and to figure out that the "slowing down" of Bilou was not accounting for walls. So you indeed receive a "stop" signal when hitting a wall, but still advance by one pixel into that wall when "stopping". That was enough to have Bilou then "glued" to the wall. It interferes with usual "L+click" commands, though... maybe I should've used R+START.
  • [done] When something land on ground, its speed is adjusted so that it exactly hit the ground. The "impact speed" -- that we'd like to use for bouncing -- is lost. We should keep that in a specific var. Bounces make Bilou harder to control, though.
  • [done] there is a 1-frame lag between sprite positioning and screen positioning that gets visible when falling at high speed (baddies get 'sucked' by the ground). We may want to delay camera move by one frame so that computed GOB coords is indeed valid.
  • [wish] replacement of a "gun" by a new one doesn't seem to work very well. I've got enough "spare guns", though.
  • [done] I miss something to perform x-align-against-block when a horizontal move is cancelled. That's why it's so hard to climb in the tree. There's interference with animation-controlled movements here.
  • [done] Work out a fail-proof initial state for Appleman and Funky Funghi. such failures interfere with game debugger.

3 comments:

PypeBros said...

J'ai une zone de 128x128 pour afficher l'environnement de Bilou, avec un zoom x4. L'idéal serait d'exploiter ça pour faire une version "graphique" de GameObject::dump() ... non ?

cyborgjeff said...

Lol... en te lisant, je visualise une nouvelle vision du Bilou's Book... où Bilou devient tributère des tes "erreurs" et tests de programmationsch

PypeBros said...

while (tile(new_x) != tile(hx)) {
/* in this first loop, we advance horizontally, making sure we keep
* track of which tile (vertically) we'll be on.
*/
gh = world->groundheight(eotile(hx,dx), hy, tileprops /*out*/);
if (sloped=(gh!=0)) { hy = eotile(hy,1) + gh; }
hx = nextile(hx,dx);
int r=cando((hx-old_x)<<8,(hy-old_y)<<8,thru);
if (r != thru) {
/* maybe we could try and reach eotile(hx), instead ? */
hx = eotile(vx,dx);
gh = world->groundheight(hx, hy, tileprops /*out*/);
if (sloped=(gh!=0)) { hy = eotile(hy,1) + gh; }
if (cando((hx-old_x)/256,(hy-old_y)/256,thru)==thru) {
if (focus) iprintf(CON_GOTO(9,9) "wall ahead %i - %i",hx,old_x);

vx = hx ; vy = hy;
}
/** we can't do that move */
cdata[GOB_XSPEED] = (vx - old_x)/256;
cdata[GOB_YSPEED] = (vy - old_y)/256;
if (focus) iprintf(CON_GOTO(8,9) "cancel slope");
return (sloped)?1:((vx-old_x)?0:-1);
} else {
if (focus) iprintf(CON_GOTO(8,9) "slope, contd.");
vx = hx; vy = hy;
}
}


^ détecte correctement les murs, mais ça ne sert à rien si on a une anim qui 'impose' dx>=2 pour qu'un déplacement ait lieu. Il me faut absolument une anim "je pousse le mur" pour faire l'ajustement précis.