diasurgical / devilutionX

Diablo build for modern operating systems
Other
7.98k stars 780 forks source link

[Issue Report]: Firewall Casts on Wrong Tile with Broken Barrels #7323

Closed NiteKat closed 1 week ago

NiteKat commented 1 month ago

Operating System

Windows x64

DevilutionX version

1.5.2

Describe

Some barrels like you cast firewall on them while others don't, and this property persists even after breaking the barrel. I noticed this behavior after a barrel broke and I could not cast firewall on that tile. Taking a TP to town and coming back down does not resolve the issue.

To Reproduce

  1. Find a barrel in the dungeon.
  2. Cast firewall on it. If firewall lands on it's tile, find another barrel to test.
  3. if firewall does not land on the barrel's tile, break the barrel and cast firewall on that now open tile (or tile with a skeleton if one pops out).
  4. Observe your firewall not land on the open tile.

Expected Behavior

There should be consistent behavior for where the firewall will land across all barrels. Either barrels should allow firewall casts on their tiles while solid, or they all should not allow this, and after breaking them they should all allow firewall to be cast on their tiles.

Additional context

Before break: image After break with cast: image image

This is also a vanilla bug and should be tagged as such, as I first observed this in Diablo 1.09 and then verified the behavior is still in DevilutionX.

Bonus images: Solid Barrel blocking FW from its tile: image Solid barrel allowing FW cast on its tile: image

julealgon commented 1 month ago

Did you happen to notice any difference between the barrels? Like the one blocking would always have a monster or drop an item vs the other that is empty or something along those lines? Or did it appear completely random which ones blocked vs which ones didn't?

Also, when finding one such barrel -> tile that would block FW, I assume that tile would still allow FW if you cast on its adjacent tile instead? Or would it even then remain empty?

NiteKat commented 1 month ago

In the last two example photos, the barrel on the left blocks when targeted, but when you target the barrel on the right FW will happily cover the barrel on the left, so it seems to be an issue when the tile (or anything on the tile) itself is targeted. I didn't notice a pattern between the ones that block and the ones that don't.

I also didn't test, but I am willing to bet that you can't target those same tiles with Guardian/Golem either (after breaking the barrel, but I'm curious how the barrels that allow FW to be cast on them would react to golem/guardian). It's also possible those spells behave correctly and it's just Firewall.

NiteKat commented 1 month ago

Spoke with Galaxy about this a bit. I don't have the exact code snippets on hand, but after discussing with Galaxy we think this is due to how the game checks for where to put the control missile for the Firewall. It won't put the control missile in a solid tile (i.e. where the barrel is), but it doesn't actually check for the barrels, just if there's an object in that tile. That means it is blindly assuming all objects are solid, thus the broken barrels still block the cast (since the barrel is still in that tile, just not solid anymore).

A firewall will happily spread to tiles that are solid (thanks to an object) which is why in some of the screenshots it looks like the firewall landed on the barrel, but actually it landed to its right and spread onto the tile with the targeted barrel. Below is a screenshot I was told I can share, not from DevilutionX, but showcasing how a firewall cast can land on a tile next to a barrel, and then spread to that barrel's tile.

image

I guess a proper fix for this would be changing the code for placing the missile to allow tiles where a barrel once was but is now broken, and maybe it doesn't need to change for the spread code to prevent it from spreading onto solid object tiles, or maybe that should kill the firewall's growth in that direction? The behavior is a little inconsistent so I'm not sure what a full fix for that would be, but at least it should allow FW to land on a non-solid tile that previously was solid.

AJenbo commented 1 month ago

similar issue with casting on doors

NiteKat commented 1 month ago

Strangely enough, I never thought of "Can't cast in an open doorway" as feeling off, but it makes sense that probably happens due to the same logic. Honestly the places where you can cast in a doorway (because it isn't a real door, like the side rooms in the Valor quest or the rooms you open up with levers in Bone Chamber) look weird when you get a single tile large firewall.

Do you think if it's changed to fix the barrels here, it should be changed for doors? Would change some dynamics in gameplay with doors, since you could now use a door as a choke and have a firewall in the open doorway. I'm not initially fully against changing the behavior with doors, but we might want input from some players first as I feel like that is more gameplay impacting than just fixing it for barrels.

julealgon commented 1 month ago

Personally, I'd like to see it changed so that casting on any previously-solid tile was allowed, and that spread was stopped if any solid object was encountered in the expansion path.

It would seem simpler, more consistent and more intuitive to me.

Although there is an argument to be made if we started checking what the blocker was made of.... a barrel ideally should just break with the fire and not prevent the spread, but I feel this would be a more advanced mechanic that is not present anywhere in the game.

NiteKat commented 1 month ago

Spells breaking barrels, even if just firewall, is more like a Beelzebub/Tchernobog (maybe it's in The Hell mods too?) thing. I think forcing barrels to be broken with melee only was a design choice, so that should be stuck to; however, making firewall more consistent with its behavior I think makes sense (making barrels block it's spread if they block it's casting, but let it spread over broken ones, etc.).

It would be a silly mechanic though if you could burn doors down with firewall so that they can never be closed again, similar to corpses blocking doors.

kphoenix137 commented 3 weeks ago

Wall casting logic:

Wall growing logic: