Friday, September 13, 2013

Missing monsters

A bug in pokemon. Here be
a no-such-monster exception
Latest tests seems to claim that upgrade LEDS is trust-worthy enough to start manipulating my precious level maps (or at least their Lime copy -- more to come soon). There's one last thing I would like to fix: making sure that we can detect missing monsters, which may occur if some "input/import" statement has been stripped from the GobScript .cmd file that describes the level. Right now, they'll likely don't show at all, giving you very little opportunity to select them (you don't know where to click) and change their type.

Lors des dernières tentatives de donner vie à la "school zone, level 1", je m'étais heurté à deux problèmes: des incohérences entre le nom de fichier de la map et celui réclamé par le script définissant le niveau et l'absence de certains monstres faute du fichier de comportement correspondant. Le deuxième point était d'autant plus gènant que le moteur de jeu refusait alors tout simplement de faire tourner le niveau ... et que l'éditeur de niveau rendait impossible l'édition de ces "monstres manquants" pourtant présents dans le
niveau. Vous suivez toujours ?

Bien. Trop occupé à faire le design du "langage secret" employé sur la planète 24.3-lxxix ce midi, je n'ai pas encore codé les dernières retouches sur LEDS avant de repartir dans les comportements de monstres et le dessin des maps, mais j'ai au moins pu dégrossir le terrain. Voilà qui présage un week-end bien rempli :)

It would be neat to take advantage of this last fix to also ensure that a decent number of animations can be used, without forcing them to be all on "sheet 0".

  • the pages corresponding to the .spr file need to be present in RAM so that we can tell location of "old" animations in VRAM. That's handled completely with Set::Load;
  • the code handling "anim%ano = spr:%sno" could allocate thumbno++ rather than using %sno directly, and then set thumbrq[%sno]=thumbno.
  • that allows animeds thumbs to be cherry-picked when thumbrq[%sno] is defined.
  • either the page carrying thumbs is created and filled *after* parse()
A missing .cmd file will result in monsters with no corresponding states[no] entry. We can prepare the states[] array so that all entries are ready to display the "missingno" icon. We should ensure at display() that the OAM is not in 'disabled' state, though.

Here comes the week-end ... take the dishwasher to warp 4 and let's make it so.






outcome: MonstersManager::display now forces the ATTR0_NORMAL bit on all the "state thumbnails" OAM in the rendering box, even when no state is defined. Monster's width/height used in which() is forced to 8 when a value of 0 (depicting a missingno) is found, making the bogus monster selectable for edition.

"Missingno"s are still quite oddly rendered: they use tile#0, but that tile is typically some empty placeholder in every spriteset generated with SEDS. Well, it should be empty, but what it truly holds is some leftover content that gets interpreted as a single, 8x8, 16 colors tile. All we need is overwrite that location with the icon for a missingno when entering the editor.

(apologises for the true missingno hunters. I hope you'll love exploring this redux of the original blue/red pokemon instead:-)

No comments: