mardi, mai 01, 2012

BoxWidget ... beyond the code.

I missed a "svn commit" this morning, so all I can do is some mock-up to think about how the "BoxWidget" will be used to define hitboxes in AnimEDS... It seems like I'd rather not jump into implementation immediately and think a little bit about the options: boxes are defined on a per-animation basis, not a per-frame basis, so maybe they could be edited on the FileWindow rather than on the AnimWindow.

Bon, bin quand on a pas synchronisé son code à la fin du week-end, on peut toujours se faire un p'tit mockup pour voir comment le nouveau widget "définir une zone rectangulaire" va pouvoir aider à la définition des zones de collision. Mock-up pas totalement convaincant, d'ailleurs. Fort confus, même si je ne vois pas bien comment faire mieux. Ça me paraissait une bonne idée, au départ, de juste "suggérer" la zone de collision en marquant ses coins, mais la plupart des problèmes de collisions rencontrés jusqu'ici provenait d'un recouvrement entre zones. Du coup, pouvoir en visualiser plusieurs d'un coup ne serait sans doute pas plus mal...

It could also be interesting to be able to visualize more than one box at a time, similarly to what happens with InspectorWidget: many "collision bugs" were due to improperly overlapping windows. That could require another form of display

1 commentaire:

PypeBros a dit…

We want the GOB to be assimilated to [x+0,y+0]-[x+wbox,y+hbox] by the collision engine. It implies that, in the game engine, all limbs coordinates should be expressed relatively to the top-left corner of the 'solid' box.

Because the ANIM data is shared by all the GobAnims using the same data (that should be rare, btw), the .SPR file must contain 'aligned' definitions with offsets of the C_UPDATE|I_COORDS defined relatively to the box.

A C_DEFINE|I_ORIGIN additional entry can be used to keep adjust the sprite's location on the frame editor. It will be applied when un-packing the C_UPDATE commands into a TIFrame list and substracted when packing back into C_UPDATE commands.