Re: Elder-scrolls IV Oblivion
Posted: 10 Mar 2019, 00:38
It's just bullet + ogrebullet which we already had in 0.36. I'll add some more commentary on the videos below.
Workaround to missing bone reference:
The deformed forearms of NPCs in the previous video appear normal here. This proves my theory that the skinned mesh is referring to bones (e.g. Bip01 L ForeTwist) that are not updated in the animation (in this case idleanims/laugha.kf). The workaround is simply changing all those bone references to a nearby bone that should have similar rotations (i.e. Bip01 L Forearm) when assigning bone weighting during the skinning process. However, this hack won't work in all situations and I suspect I've simply not figured out how the NIF and the original engine works.
BreezeHome:
Feeling defeated by FO3, needed a bit of a pick-me-up so I turned to a familiar setting. But there's no letup anywhere. Years ago when I first started working on TES5 NIF loading with OpenCS I noticed that some models are turned around 180 deg (e.g. Architecture\WhiteRun\WRInteriors\WRIntRoofSTCorL.nif) and that there are references that control the loading of objects (e.g. upgrading by paying $$$ to Proventus Avenicci). I had forgotten about these.
I can't figure out what makes these back-to-front NIFs different. So for now the rotations at the root node are simply ignored for all TES5 NIFs. This doesn't seem to cause problems with other NIFs (at least in my limited testing so far). The parent references for controlling object loading is probably a bigger issue. These references can occur later in the ESM than the objects. Which means the loading has to be done in two parses - unless some other workaround can be devised. For the video, these are simply hard coded.
The interior lighting is not yet enabled, so everything is dark.
WhiteRun:
Initially getting out the door from BreezeHome ended up in crashes and half the meshes not rendering. The missing renders were simple coding error where BSLODTriShape were being inherited from the wrong parent class. But this highlights how TES5 tries to squeeze performance out of everything. I've not been able to figure out how the LOD control is done, however. The crashes were due to the NiSwitchNode in Salmon lacking a node name which caused the skeleton build logic to fail.
Once safely outside, had to get rid of the civil war stuff (again with parent references). As people have noted already, the frame rate is extremely poor. I've not bothered to look what's causing that but I suspect LOD has something to do with it. The Furniture Marker near the forge are not handled at all (all the while meshes) and the water shaders are not handled (again white). In fact I don't think any shaders are enabled at all, which wouldn't help with the performance.
Solitude:
This is my second favorite place to grind for gold and skills (and chances to get poison/disease resistance). Initially one could see through the worldspace ground mesh down to the water and terrain (which I might disable in worldspaces to increase performance). This was due to some of the nodes having the same name. To get around this had to add node number to the mesh name. In a similar issue, the Baked potato in Bard's College has two bones with the same name - not sure how to deal with this one.
Bthardamz:
Just your average Dwarven ruin. I just wanted to see if I would encounter major issues but fortunately didn't. The interior lighting is still not implemented so all interiors are bright and sunny just like the exterior cells.
Escape from Vault101:
Here is FO3 defeating me again. Currently the door animations are done using Ogre's node animation with the meshes "attached" to the nodes (bones) as if they are skinned. However this doesn't work in FO3. In fact even when the implementation is changed to attach Ogre::Entities to tagpoints the meshes are not in the right places. Had to abandon working on FO3 once more, it is too depressing.
Nagastani:
Nothing really interesting here but some leveled creatures. I have to say the animation in TES4 is so much better than TES3.
Physics:
Not much to see here, just some havok-like physics. We already had ogrebullet in 0.36 (probably much before that). The havok-like movements are simply enabled by assigning an Ogre::SceneNode to each btRigidBody and getting Bullet to move the SceneNode (which will move the attached Ogre::Entity). The complication here is (at least for me) figuring out what transform to use where. Currently the constraints are not re-implemented so no ragdoll. It is not clear which objects are meant to have "havok" behaviour. The NIF files have flags that indicate this but sometimes unexpected meshes also have this flag turned on.
The objects are in slow-motion due to the scaling factors in Bullet. Bullet calculations are done assuming real-world dimensions but our game world is not (and Havok is 7 times smaller still). So the objects move as if they are on the low-gravity env like the moon.
And we finally have interior lighting (but sometimes the flicker is a bit too much).
Workaround to missing bone reference:
The deformed forearms of NPCs in the previous video appear normal here. This proves my theory that the skinned mesh is referring to bones (e.g. Bip01 L ForeTwist) that are not updated in the animation (in this case idleanims/laugha.kf). The workaround is simply changing all those bone references to a nearby bone that should have similar rotations (i.e. Bip01 L Forearm) when assigning bone weighting during the skinning process. However, this hack won't work in all situations and I suspect I've simply not figured out how the NIF and the original engine works.
BreezeHome:
Feeling defeated by FO3, needed a bit of a pick-me-up so I turned to a familiar setting. But there's no letup anywhere. Years ago when I first started working on TES5 NIF loading with OpenCS I noticed that some models are turned around 180 deg (e.g. Architecture\WhiteRun\WRInteriors\WRIntRoofSTCorL.nif) and that there are references that control the loading of objects (e.g. upgrading by paying $$$ to Proventus Avenicci). I had forgotten about these.
I can't figure out what makes these back-to-front NIFs different. So for now the rotations at the root node are simply ignored for all TES5 NIFs. This doesn't seem to cause problems with other NIFs (at least in my limited testing so far). The parent references for controlling object loading is probably a bigger issue. These references can occur later in the ESM than the objects. Which means the loading has to be done in two parses - unless some other workaround can be devised. For the video, these are simply hard coded.
The interior lighting is not yet enabled, so everything is dark.
WhiteRun:
Initially getting out the door from BreezeHome ended up in crashes and half the meshes not rendering. The missing renders were simple coding error where BSLODTriShape were being inherited from the wrong parent class. But this highlights how TES5 tries to squeeze performance out of everything. I've not been able to figure out how the LOD control is done, however. The crashes were due to the NiSwitchNode in Salmon lacking a node name which caused the skeleton build logic to fail.
Once safely outside, had to get rid of the civil war stuff (again with parent references). As people have noted already, the frame rate is extremely poor. I've not bothered to look what's causing that but I suspect LOD has something to do with it. The Furniture Marker near the forge are not handled at all (all the while meshes) and the water shaders are not handled (again white). In fact I don't think any shaders are enabled at all, which wouldn't help with the performance.
Solitude:
This is my second favorite place to grind for gold and skills (and chances to get poison/disease resistance). Initially one could see through the worldspace ground mesh down to the water and terrain (which I might disable in worldspaces to increase performance). This was due to some of the nodes having the same name. To get around this had to add node number to the mesh name. In a similar issue, the Baked potato in Bard's College has two bones with the same name - not sure how to deal with this one.
Bthardamz:
Just your average Dwarven ruin. I just wanted to see if I would encounter major issues but fortunately didn't. The interior lighting is still not implemented so all interiors are bright and sunny just like the exterior cells.
Escape from Vault101:
Here is FO3 defeating me again. Currently the door animations are done using Ogre's node animation with the meshes "attached" to the nodes (bones) as if they are skinned. However this doesn't work in FO3. In fact even when the implementation is changed to attach Ogre::Entities to tagpoints the meshes are not in the right places. Had to abandon working on FO3 once more, it is too depressing.
Nagastani:
Nothing really interesting here but some leveled creatures. I have to say the animation in TES4 is so much better than TES3.
Physics:
Not much to see here, just some havok-like physics. We already had ogrebullet in 0.36 (probably much before that). The havok-like movements are simply enabled by assigning an Ogre::SceneNode to each btRigidBody and getting Bullet to move the SceneNode (which will move the attached Ogre::Entity). The complication here is (at least for me) figuring out what transform to use where. Currently the constraints are not re-implemented so no ragdoll. It is not clear which objects are meant to have "havok" behaviour. The NIF files have flags that indicate this but sometimes unexpected meshes also have this flag turned on.
The objects are in slow-motion due to the scaling factors in Bullet. Bullet calculations are done assuming real-world dimensions but our game world is not (and Havok is 7 times smaller still). So the objects move as if they are on the low-gravity env like the moon.
And we finally have interior lighting (but sometimes the flicker is a bit too much).