Closed i30817 closed 5 years ago
There is a crash when finishing the chapter too. To finish the chapter from this save, just 'combine' the key in the inventory with door 5 and wait until the sequence finishes.
backtrace from gdb:
Thread 1 "ags" received signal SIGFPE, Arithmetic exception.
0x00005555556df7e3 in room_to_mask_coord(int) ()
(gdb) bt
#0 0x00005555556df7e3 in room_to_mask_coord(int) ()
#1 0x00005555556ee3e5 in get_hotspot_at(int, int) ()
#2 0x00005555556b9faa in __GetLocationType(int, int, int) ()
#3 0x00005555556b59dc in GetLocationName(int, int, char*) ()
#4 0x000055555574171f in ?? ()
#5 0x0000555555742e98 in ?? ()
#6 0x00005555557430c5 in RunGameUntilAborted() ()
#7 0x0000555555743377 in initialize_start_and_play_game(int, char const*) ()
#8 0x000055555573d162 in initialize_engine(int, char**) ()
#9 0x0000555555625a93 in main ()
(gdb)
A division by zero no doubt. room_mask_to_data_mul must have become 0 somehow, or have been left as 0.
I just avoided the division by zero above by changing this method to add the last if.
Integer division rounds to 0 so...
// Setups coordinate conversions between room and masks
void init_room_coordinate_conv()
{
// Make a multiplier from mask to data resolution for faster conversions.
// Normally a coordinate would be converted first from mask to game res,
// and then from game to data res (and in opposite direction).
room_mask_to_data_mul = thisroom.MaskResolution / game.GetDataUpscaleMult();
if (room_mask_to_data_mul == 0)
room_mask_to_data_mul = 1;
}
Though i'm still not sure this is a good idea because i don't have a good understanding of what room_mask_to_data_mul does.
It should not be 0, this may mean MaskResolution does not get initialized correctly at some conditions.
Integer division with the divisor > the dividend floors to 0 right?
Maybe that too, although it seemed at first that should never happen here, but maybe I missed some case. I will check again.
I think the original repainting bug here does not exist when using opengl instead of software like i was before.
But i saw a bug with Z, where a object was in the foreground to the pc character when it shouldn't logically. Not sure if it exists on the original too.
first save. You should be already be in front of the object (a poster on a pillar).
edit: interestingly this z bug doesn't exist on software, so it seems there are repainting bugs on both renderers.
I did another attempt on the previous fix: 81f8f51a07ed2d573b2dc4bfee0465cb0f99fc4b
Repaint bug will occur only with software renderer, because its related to "dirty rects" system this renderer uses. It also seem to affect only scrolling rooms when camera has moved away from 0,0.
There cannot be repainting bugs in other renderers, because they work differently. The Z-order bug that does not occur in software sounds like a known issue with "Ignore walk-behind" property that is not supported in hardware renderers. But I will double check that.
There cannot be repainting bugs in other renderers, because they work differently.
I just found one in the zip save above? Or maybe it's rather a z-fighting bug, but same difference IMO.
edit: saw your edit then. Alright.
The fix works to fix the crash without my hack btw.
@i30817 , yes, this Z-order bug is the IgnoreWalkBehind problem. In short, the regular z-order may be A -> B -> C, but this property can additionally require object C be above A at the same time, like an Escher's illusion.
In the past we decided to consider this very low priority and recommend developers to not use this property, because it breaks the normal "sprite stack" logic. Maybe it can be fixed by some kind of additional hack, but it's so rare that no one has bothered to do this yet.
Anyway, regarding repaint bug, apparently it was there for a long time, but I did not notice because my test game had a transparent gui covering whole screen, in which case ags just repaints whole screen.
Pushed a fix: 0b2c762fa32dd219519343b93c7c7eb43357e1dc
Good job, it's fixed (checked with forcing software). Now only the z-order bug remains. It occurs a lot on this game (3 times i saw).
I meanwhile finished the game (again). Good game, with some slight stumbles at the end on puzzle design (one puzzle can have you miss a item earlier and then you think it's a bug because you know what to do but the game doesn't let you, and there are a 3 awful sound tone puzzles that can fortunately be bypassed if you know the secret (ctrl+mpo) and there is a password entry screen for a password that doesn't actually exist in the game).
Have you considered a libretro core? This engine seems ideal for it, considering it has about 0 configuration and a lot of games. Or scummvm will make a ags 2-3 engine and it'll get there that way.
Alright, closing this now. Split Z-order problem into separate ticket: #745.
A repainting bug on Donna Avenger of blood.
Load the first save here: Donna Avenger of Blood Saves.zip
Then move right along the corridor. The 'camera' will move horizontally but the pc sprite will 'ghost'.
edit: near the end of the corridor.
Not sure if this is supposed to be a game or engine bug, but here it is. It's cosmetic fortunately.