afritz1 / OpenTESArena

Open-source re-implementation of The Elder Scrolls: Arena.
MIT License
988 stars 68 forks source link

Implement building and wilderness transitions #126

Closed afritz1 closed 5 years ago

afritz1 commented 6 years ago

Currently the player can only move between interior levels and not between buildings or the wilderness. This will require redesigning the world data a little bit to support different types of worlds (interior and exterior).

The active location ID tells what kind of location the player is in, and therefore what kind of world data is needed to represent that location. Some locations on the world map are purely interiors (like main quest dungeons and named dungeons). The world data storage variable should probably be a virtual class (base WorldData, derived ExteriorWorldData and InteriorWorldData).

An exterior location should be able to store a nullable interior member for when the player is inside a building at that location. It should also store the entrance position and orientation so the engine knows where to put the player when they leave the building.

Exterior locations might need to be split up between cities and wilderness; that'll have to be investigated.

Carmina16 commented 6 years ago

Internally, the game separates cities, interiors, wilderness, dungeons and main quest dungeons.

afritz1 commented 6 years ago

Made good progress in commit e886b3c02632444bd3ae36e6633547c6c101dc93. I'm able to go between interiors and exteriors in cities consistently.

Transitions for palace gates, city gates, and wilderness interiors don't work yet.

No idea if the variants for city interiors are correct yet, but they seem to be random enough in any case.

Allofich commented 6 years ago

Nice progress.

No idea if the variants for city interiors are correct yet

I've been testing and they are not the same as original Arena.

On a somewhat related note I've been testing Arena and the variants for equipment stores (probably all interiors) seem to be the same each play, or at least when loading and testing between 2 unrelated player characters.

Tested:

  1. Imperial City: 1 tavern, 2 equipment stores. Same.
  2. Random village: 2 equipment stores, also the same.

The names of the stores also seem to match between plays.

So the interior variants and store names in the original game are probably constants that can be used for reference.

Allofich commented 6 years ago

Here's a comparison of 3 equipment stores in the upper-left section of the Imperial City as the layouts appear in Arena and in OpenTESArena. The top row of the 2 rows of interior layouts is from Arena, the bottom row is from OpenTESArena. "Elite Armaments" matches, but the two others differ. comparison

Carmina16 commented 6 years ago
Name Coordinates Offset Xform Variance
The Practical Equipment 68, 20 0x1488 0x95c0 0
Rare Provisions 88, 33 0x21b0 0x23ab 3

Oops, I've made a typo in wiki. Corrected!

afritz1 commented 6 years ago

I added @Carmina16's fix in commit 60d3daa8e99da4f4dfbf07fb52fa1c78aad7a4ab and they're all correct now. I still need to implement wilderness interiors, and we won't be able to verify correctness until the wilderness itself is more fully implemented.

And @Allofich, regarding your observation about the persistence of store variants, it's because it's a function of the block's XY coordinate. The offset value that @Carmina16 fixed is what helps determine the variant ID of a menu block.

afritz1 commented 6 years ago

Wilderness interiors can now be entered in commit a47819f69a9e96cb7a10cea8abc82d348fdae4dc, but like I said above, they can't be checked until the wilderness is fully working.

afritz1 commented 5 years ago

The wilderness is working well enough now that I think we can close this.