I-am-Erk / CDDA-Tilesets

Master tileset repository for Cataclysm: Dark Days Ahead
Other
329 stars 175 forks source link

Unknown sprite shown along with animation_hit when monster doesn't have its' own sprite #342

Open int-ua opened 3 years ago

int-ua commented 3 years ago

Like Frog mother or Shoggoth. I cannot find what the id is in CDDA files.

esotericist commented 3 years ago

in cata:tiles::draw_hit_frame() we have a call to:

    draw_from_id_string( hit_entity_id, C_HIT_ENTITY, empty_string, hit_pos, 0, 0,
                         lit_level::LIT, false );

hit_entity_id can either be the id of a monster (in the case of game::draw_hit_mon() being called), or the id of a base player sprite (in the case of game::draw_hit_player being called)

the thing that draws my attention here is C_HIT_ENTITY is the sprite category, and i'm not entirely sure how it plays into things.

i can't find any evidence of anything else being drawn that is going to be specific to when the creature is regenerating.

int-ua commented 3 years ago

Thank you. Were you able to reproduce this problem in latest experimental?

int-ua commented 3 years ago

https://github.com/CleverRaven/Cataclysm-DDA/blob/96f400ee8780b2e0a028569c2ccac3a707fd98f2/src/animation.cpp#L563

void game::draw_hit_mon( const tripoint &p, const monster &m, const bool dead )
...
    tilecontext->init_draw_hit( p, m.type->id.str() );

https://github.com/CleverRaven/Cataclysm-DDA/blob/96f400ee8780b2e0a028569c2ccac3a707fd98f2/src/cata_tiles.cpp#L3123

void cata_tiles::init_draw_hit( const tripoint &p, std::string name )
...
    hit_entity_id = std::move( name );

https://github.com/CleverRaven/Cataclysm-DDA/blob/96f400ee8780b2e0a028569c2ccac3a707fd98f2/src/cata_tiles.cpp#L3437

void cata_tiles::draw_hit_frame()
{
...
    draw_from_id_string( hit_entity_id, C_HIT_ENTITY, empty_string, hit_pos, 0, 0,
                         lit_level::LIT, false );

It tried to draw creature type? Why?

esotericist commented 3 years ago

huh. i glossed over the type part there. that does seem weird, but it gives something testable.

int-ua commented 3 years ago

https://discord.com/channels/598523535169945603/598529174302490644/791030023737704508

It's a monster type id. Monsters don't have ids, but they have types which have ids

I'm still confused but I guess we should try unknown_mon_frog_mother? Or unknown_MONSTER (I don't think so, but, again: confused) ? I'll try that now.

int-ua commented 3 years ago

Defining mon_frog_mother worked. So that's not about regenerating creatures, it's about creatures that don't have a sprite yet. And the upstream bug is that the ASCII fallback is not displayed. Looks like it's not displayed even if creature has a sprite through looks_like/copy-from connection (judging from hitting one of the pupating zombie types).

int-ua commented 3 years ago

Closing as it's an upstream issue.

int-ua commented 3 years ago

It still affects Ultica so I've decided to re-open it until upstream is fixed.