Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix D2 tiles offsets and other D2 maps issues #32

Open
ghost opened this issue Sep 14, 2019 · 0 comments
Open

Fix D2 tiles offsets and other D2 maps issues #32

ghost opened this issue Sep 14, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 14, 2019

Now that diablo 2 maps can be loaded, there are a few remaining issues with maps.

if you walk to the edge of the map, the player should be on the edge of the map and not outside it.
This is probably because of the offsets being applied right now to DT1 tiles.

d2_offsets

The roofs in Act2/Town are not showing correctly as well.

d2_offsets2

Some other points:

  • in maps that can have multiple tile layers, you can load all of the tile layers textures that the IDs won't conflict with each other, so you can switch the order of this texturePack and the map will always draw the same:
  "texturePack": [
    {
      "id": "town",
      "texturePacks": [
        "treegroups",
        "stonewall",
        "floor",
        "warp",
        "river",
        "objects",
        "fence",
        "objects2"
      ]
    }
  ],
  • Right now, DGEngine is using DT1 tiles that are composed of 5x5 tiles of 32x16 pixels in size. flags are loaded for each of the subTiles so you won't walk through walls. if you walk around, you'll notice that the player is going around empty areas. this is because the offsets are wrong.

  • Tiles in D1 are 64x32 in size, but in D2 they're 32x16, but the DS1 file is loading a tile on every 5th position, since they're bigger. Visually it's the same but it renders faster since there are fewer drawing calls. in my tests it renders faster than D1, even though there are more layers.

  • D2 maps of the same type (ex: Act1's town) can load a different number of layers (floors, roofs, etc). This makes it a bit annoying to set the layer for each map on which to draw level objects (so that they don't apear above roofs or behind floors). Can a DS1 map have 1 floor and 10 types of pillar layers and another have 10 types of floors and no pillars? I was thinking that if we knew there can't be more than, say, 3 floor layers, we could always load the pillars starting on the 4th layer, regardless of how many floors are used and then always draw level objects at a specific layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants