Warzone2100 / warzone2100

Command the forces of The Project in a battle to rebuild the world after mankind has been nearly destroyed by nuclear missiles. A 100% free and open source real-time strategy game for Windows, macOS, Linux, BSD+
https://wz2100.net
GNU General Public License v2.0
3.22k stars 531 forks source link

Destroying skyscrapers creates cliff tiles on Mountain tilesets #2544

Closed DARwins1 closed 2 years ago

DARwins1 commented 2 years ago

Describe the bug Destroying any skyscraper (the feature buildings that crumble when destroyed) converts any tiles under it into cliff tiles if the map has a mountain tileset. Units can still move through these tiles, but structures cannot be built. Saving and reloading the game re-textures the affected tiles to real cliff tile textures, and units will no longer be able to move through them. Tiles are also changed in arizona and urban tilesets, but they have less noticeable effects on gameplay.

To Reproduce Steps to reproduce the behavior:

  1. Play any mountain tileset map with skyscrapers on it (such as Emergence).
  2. Destroy the skyscraper(s).
  3. Notice when trying to move units onto the tiles the skyscraper was, the cursor becomes an X, but units can still move freely over those tiles. Structures cannot be built where the skyscrapers stood.
  4. Save and reload.
  5. Notice how the tiles have changed their appearance. Units will no longer be able to move over these tiles.

Expected behavior Skyscrapers should not convert tiles to cliffs when destroyed.

Screenshots or Videos Skyscrapers destroyed on Emergence: wz2100-20220113_121039-Emergence After save-load: wz2100-20220113_121102-Emergence Skyscrapers destroyed on Aftermath: wz2100-20220113_121721-Aftermath After save-load (Notice the concrete textures replaced with orange dirt): wz2100-20220113_121740-Aftermath Skyscrapers destroyed on Sk-UrbanChasm: wz2100-20220113_121859-Sk-UrbanChasm After save-load: wz2100-20220113_121919-Sk-UrbanChasm

Your System:

KJeff01 commented 2 years ago

I've already explained this to pastdue and I'll also summarize what is happening:

  1. There is likely a regression after 3.1.5. that doesn't retexture the tiles around the skyscrapers immediately (the game does change the texture number and thus so how it should look and what it will act like). And, if not, then the retexture needs to happen regardless anyway.

  2. The game assumes that 2 specific tile numbers (coded in the enum TILE_ID) exist as the same "kind" of tile on all tilesets at the same spot, so Arizona and Rockies will show something unintended. Obviously, Rockies has the worst outcome of this assumption.

KJeff01 commented 2 years ago

This issue is fixed but I'm going to separate out the other minor issue I noticed into a new issue.