OpenTESArena icon indicating copy to clipboard operation
OpenTESArena copied to clipboard

Some raised platforms have different texture scaling than original game

Open Allofich opened this issue 5 years ago • 11 comments

While testing the latest transition code, I found a spot in one of the temple interiors that looks different in original Arena and OpenTESArena. There is a short wall here at the edge of the map. Here is how it looks in OpenTESArena.

opentesarena

And here is how it looks in original Arena.

arena

The texture is cut off in OpenTESArena, and it's scaled to the wall in original Arena. Also the blue ceiling ends and there is a black void in OpenTESArena, while the ceiling continues to stretch on in original Arena.

Location in the temple: arena2

You can find one of these temple types at "Brotherhood of Faith" in the Imperial City. It's near the southwest corner. a_009

Allofich avatar Jul 09 '18 12:07 Allofich

The difference in look for those two textures is because the texture coordinates for raised platforms aren't properly being used yet (box3a, box3b, and box4 in ExeData.h). Those values should be used in the level construction code in LevelData.cpp.

I'm on the fence about replicating the out-of-bounds map behavior because it appears that Arena uses some data that's not defined in the .MIF file, perhaps a byproduct of the game having a chunk-based system for level presentation (64x64, etc.). I don't know how to define the out-of-bounds part because it's not obvious what it should be (some default value?). The level code and software renderer would need some redesigning to compensate for the levels not being a static set of voxels.

afritz1 avatar Jul 09 '18 16:07 afritz1

Ceiling can be infinite in Arena, as it is just a texture drawn in the top of the screen.

Carmina16 avatar Jul 20 '18 19:07 Carmina16

Yeah, the ceilings are easy like Carmina16 said. I'm assuming everything in MAP1 is just air, too? Not sure about default values for the floor.

So like I said above, it's going to involve some redesigning of the level data to get the "infinite" behavior of interiors in the original game. I still don't like it conceptually (why would an interior have infinite floor/ceiling?), but if the original game does something as obvious as this then OpenTESArena should do it too. Moving over to a chunk-based system will take some time but I think it's doable. Probably won't get to it soon because of higher priority things, like those for 0.8.0.

afritz1 avatar Jul 21 '18 05:07 afritz1

Almost got the rendering to work in PR #200. Currently dealing with some ray casting math errors but the floor and ceiling of adjacent chunks should be working soon. I'm testing with TEMPLE8.MIF. Any idea what texture IDs they should be? I tried voxel IDs of 2 for floor and 14 for ceiling (only relevant to my engine I guess, since 0 is air) but some interiors don't seem to have that many textures, so it doesn't work. Hoping that they are specified in the .MIF header or something.

afritz1 avatar Mar 02 '21 05:03 afritz1

This image is after sidestepping through that half wall with collision turned off while facing north. The bending is due to the ray casting error I mentioned. Still working out some other chunk-related math issues too. screenshot000

afritz1 avatar Mar 02 '21 05:03 afritz1

Oh right, the ceiling ID is just whatever *CEILING is in the .INF file.

afritz1 avatar Mar 02 '21 05:03 afritz1

Okay the ceiling rendering is working like it should now. screenshot000 Here is what it looks like from outside the level: screenshot001 Texture coordinates is a separate issue I'm not looking at right now. Trying to get all the chunk system stuff done. (Also, the entities are temporarily disabled, that's why the brazier isn't there)

afritz1 avatar Mar 03 '21 04:03 afritz1

The chunk system part of this issue is done (#200), so renaming this issue to be just about texture coordinates.

afritz1 avatar Mar 27 '21 23:03 afritz1

Still seeing this texture scaling issue on my rendering branch.

afritz1 avatar Dec 11 '22 06:12 afritz1

I have some ideas to test about the texture placement.

Carmina16 avatar Dec 11 '22 09:12 Carmina16

Okay. This issue is related: https://github.com/afritz1/OpenTESArena/issues/101

afritz1 avatar Dec 11 '22 18:12 afritz1