Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003707 [DCSS] Bug Report minor always 2011-04-02 18:36 2012-05-24 17:15
Reporter ghend View Status public  
Assigned To edlothiol
Priority normal Resolution done  
Status resolved   Product Branch 0.8 ancient branch
Summary 0003707: orc tiles acting strange in arena
Description when you have a large amount of orcs fighting in the arena, their tiles flash into those of random artifacts every couple of turns. to reproduce, go test 99 orc v 99 orc.
Additional Information
Tags No tags attached.
Attached Files gif file icon orcs_as_armor.gif [^] (207,055 bytes) 2011-10-18 06:45
png file icon My orcs are now items....png [^] (850,998 bytes) 2011-10-28 04:30
png file icon beogh.png [^] (269,476 bytes) 2012-01-05 04:11

- Relationships
has duplicate 0004054closedSamB Large amounts of the newest monsters make Windows Tiles vomit up unrandart, weapon tiles 
has duplicate 0005280closededlothiol Tiles corruption 
has duplicate 0005285closededlothiol orcs show up as items 
has duplicate 0005382closedGalefury Orc follower tiles replaced by artifact tiles 
has duplicate 0005644closededlothiol if i have many zombies and undead slaves my zombies look like artifact 
has duplicate 0002987closedjpeg Recalling orcs makes some of them look like artifact armour 
has duplicate 0005696closededlothiol Orcs allied to a player Priest of Beogh have item tiles and it spreads to enemies 
has duplicate 0005924resolvededlothiol Orc Allies and Raised Orc Zombies images appear as random randart items 
has duplicate 0006267closededlothiol Orcs doll error 

-  Notes
(0012055)
ghend (reporter)
2011-04-02 18:57

Actually, with further testing it doesn't seem confined to orcs. 99 everything seems to flash into artifacts.
(0012066)
jpeg (manager)
2011-04-02 19:34

It only appears to happen with monsters that use equipment, e.g. snakes, rats and cockroaches (vermin exterminators, rejoice!) appear to work fine. So does Sigmund, which leads me to the conclusion that the common denominator is that all these monsters have got a wielded weapon drawn onto their tile. Not all monsters wielding a weapon are affected, but those not wielding a weapon invariably aren't.

Also, once a couple of those humanoid monsters get killed, the odd tiles disappear, so the large number of them also plays a role. It doesn't have to be the same type of monsters, i.e. "33 hobgoblin, 33 orc, 33 gnoll v 33 ogre, 33 kobold, 33 goblin" shows the same result.
(0012069)
jpeg (manager)
2011-04-02 22:44

Extending my previous observations, this only affects cached monster tiles, that is monsters that get their weapons displayed and presumably also ghosts and panlords (though I haven't tested that).

What happens is that in tileview.cc:699, tile_place_monster(), the monster is added in the cache registry. The returned value is then modified by any applicable flag to form the new tile value. Later, when the tile needs to be drawn, it is split into the base tile (t & TILE_FLAG_MASK) and the flag part (t & (~TILE_FLAG_MASK)). However, if the value returned by mcache.register_monster(mon) is greater than 2047, then (t & TILE_FLAG_MASK) loops around and starts back at zero.

Since TILEP_MCACHE_START currently resides at 1851, this leaves space for 196 cached monsters within los; all monsters beyond that value use item tiles instead. Apparently, the cache is recalculated anew every turn, but there still might be a connection to those tileref assertions we get occasionally (maybe if the same mcache index is shared by several monsters). I also don't understand what causes these odd flips where monsters are displayed properly at one point, and then shift to artefacts, and then back to monster tiles - all without a single monster leaving or entering los.

Apparently, tileidx_t being unsigned int is too small...
(0014012)
dolphin (reporter)
2011-07-29 23:06

A friend was playing a priest of Beogh on -b1-29-gc0c5ec4 yesterday and saw the same thing after running into a large room of orcs. Just FYI.
(0015281)
XuaXua (reporter)
2011-10-18 06:45

I can confirm this is happening in crawl_tiles-0.10-a0-1305 with my orc priest of Beogh

Screenshot attached.
(0016157)
Stormphoenix (reporter)
2011-12-07 21:53

Also happening to me with large numbers of equipped orcs on Webtiles 0.9.
(0016412)
edlothiol (developer)
2011-12-28 15:50

OK, I looked a bit more into this. The flipping happens because while the mcache entries for monsters in LOS are recreated on every viewwindow(), they can't reuse the same indexes because the old index for a monster is only freed _after_ its new mcache entry has been created (since the old index is freed when the new index is assigned to tile_fg). So the mcache indexes for the monsters basically flip between two values on every redraw.
I'm really not sure how to fix this. One additional bit for TILE_FLAG_MASK would probably fix this for a long while, but it doesn't seem like we have room for it, and there should be a better way anyway.
(0016530)
Bubu (reporter)
2012-01-05 04:10

I encountered this also with webtiles 0.9. Screenie attached.
(0018130)
edlothiol (developer)
2012-05-24 17:15

Fixed in 4537fb6.

- Issue History
Date Modified Username Field Change
2011-04-02 18:36 ghend New Issue
2011-04-02 18:57 ghend Note Added: 0012055
2011-04-02 19:10 jpeg Status new => confirmed
2011-04-02 19:34 jpeg Note Added: 0012066
2011-04-02 22:44 jpeg Note Added: 0012069
2011-07-29 16:18 galehar Relationship added has duplicate 0004054
2011-07-29 23:06 dolphin Note Added: 0014012
2011-10-18 06:45 XuaXua Note Added: 0015281
2011-10-18 06:45 XuaXua File Added: orcs_as_armor.gif
2011-10-28 04:30 BackslashEcho File Added: My orcs are now items....png
2011-12-07 21:53 Stormphoenix Note Added: 0016157
2011-12-28 15:26 edlothiol Relationship added has duplicate 0005128
2011-12-28 15:50 edlothiol Note Added: 0016412
2012-01-05 04:10 Bubu Note Added: 0016530
2012-01-05 04:11 Bubu File Added: beogh.png
2012-02-01 18:21 edlothiol Relationship added has duplicate 0005280
2012-02-05 17:51 edlothiol Relationship added has duplicate 0005285
2012-03-04 02:37 Galefury Relationship added has duplicate 0005382
2012-05-06 11:07 edlothiol Relationship added has duplicate 0005644
2012-05-21 14:56 KiloByte Relationship added related to 0002987
2012-05-21 23:24 edlothiol Relationship replaced has duplicate 0002987
2012-05-24 06:49 edlothiol Relationship added has duplicate 0005696
2012-05-24 17:15 edlothiol Note Added: 0018130
2012-05-24 17:15 edlothiol Status confirmed => resolved
2012-05-24 17:15 edlothiol Fixed in Branch => 0.11 development branch
2012-05-24 17:15 edlothiol Resolution open => done
2012-05-24 17:15 edlothiol Assigned To => edlothiol
2012-07-13 10:53 edlothiol Relationship added has duplicate 0005924
2012-09-27 21:43 edlothiol Relationship added has duplicate 0006267


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker