Thief 1/2 & SShock 2: DDFix and Enhanced Resolution Patch - discussion - by bikerdude
Timeslip on 4/4/2008 at 18:30
Quote Posted by ZylonBane
BTW, does this play well with animated textures? If memory serves, the Dark Engine has a 64K(?) limit on animated texture sequences.
Not sure. Are there any animated textures around that don't use alpha? Replacing the clouds works, but that's just one texture moving and so presumably it's not animated in the conventional sense.
Nameless Voice on 4/4/2008 at 18:43
You never did say if you would be able to easily find the appropriate code for Shock2.exe / Thief.exe / DromEd.exe if you had .exe files?
Or give specifics so that someone who does have them could find the appropriate code locations.
ZylonBane on 4/4/2008 at 18:58
Quote Posted by Timeslip
Not sure. Are there any anmated textures around that don't use alpha?Replacing the clouds works, but that's just one texture moving and so presumably it's not animated in the conventional sense.
I'm at work right now so I can't cite any specific textures, but just search in the FAM directory for anything ending with _1. That'll be part of an animated texture sequence. Dark supports up to 20 frames per sequence.
Nameless Voice on 4/4/2008 at 19:13
In thief 2: nearly everything in the "Mech" texture family.
Near the very start of Framed (Thief 2 mission 3 (technically Miss4.mis)), there is a room full of machinery that has a lot of animated textures in it.
Timeslip on 4/4/2008 at 19:17
Quote Posted by Nameless Voice
You never did say if you would be able to easily find the appropriate code for Shock2.exe / Thief.exe / DromEd.exe if you had .exe files?
Or give specifics so that someone who does have them could find the appropriate code locations.
There are 7 code locations I modify in thief 2. You'd need to find the equivelents in the other exe's. Assuming that the dark engine hasn't been modified in any of those places, it could be as simple as looking at each address in thief 2, searching for a few dozen bytes around the area in the other exes and then changing the addresses. If the engine behaves differently, there'll need to be code changes.
Code:
//Where world textures first get loaded
SafeWrite32(0x0041D948, (DWORD)&CopyTex - 0x0041D94C);
//Where mip maps for world textures are generated
SafeWrite32(0x0041D96B, (DWORD)&MipMap - 0x0041D96F);
//Execution reaches here when thief tries to copy a system memory texture into video ram.
SafeWrite32(0x0062A67C, (DWORD)&CreateVidTextureHook);
//Hooks the level loading code to release all loaded textures
SafeWrite32(0x0040FCA4, (DWORD)&LevelStartHook - 0x0040FCA8);
//execution reaches here when a thief 2 is looking for an unused video mem surface to reuse and finds one. I free it, and then send execution back to where it would be if no suitable surface was found.
SafeWrite32(0x005BD427, (DWORD)&TextureExistsHook - 0x005BD42B);
//Override CreateFile to check for .override files first.
SafeWrite32(0x0060015C, (DWORD)&CreateFileHook);
//Not related to the texture fix; this is a function I force to return immediatly because it tries to blt from a null pointer each time you alt tab, which screws up ida
SafeWrite32(0x00591440, 0x000008c2);
Quote Posted by ZylonBane
I'm at work right now so I can't cite any specific textures, but just search in the FAM directory for anything ending with _1. That'll be part of an animated texture sequence. Dark supports up to 20 frames per sequence.
Yup, they appear to be working. I'm not 100% sure that they all are though; I didn't check many.
Hiatus on 4/4/2008 at 19:52
Quote Posted by Nameless Voice
You never did say if you would be able to easily find the appropriate code for Shock2.exe / Thief.exe / DromEd.exe if you had .exe files?
AFAIR Timeslip mentioned that he had Thief (I assume Dark Project, not Gold) copy lying around somewhere, waiting to be found :) (Timeslip, have you found it?). As for SS2, I don't think he has a copy of it (Timeslip: why not? :)) so we should get him one, really (and TG as well).
I'm afraid we won't be able to find these mem locations/offsets for other games/editors ourselves :( (which would be a real shame, now that we're so far along (ok, Timeslip is ;))).
Quote Posted by Timeslip
There will be stuttering when an object comes into view for the first time; whereas world textures are all loaded from disc at the start of a mission, object textures will only be loaded when used for the first time. Once loaded, they stay in memory until the mission ends.
you mean there'll be stuttering with *all* objects in a level, or just with ones with replaced textures? Will the stuttering be severe? Would you think of any way to reduce/eliminate it somehow?
Timeslip on 4/4/2008 at 20:30
Edit: (
http://timeslip.chorrol.com/ddfix.html) New download link.
Quote Posted by Hiatus
you mean there'll be stuttering with *all* objects in a level, or just with ones with replaced textures? Will the stuttering be severe? Would you think of any way to reduce/eliminate it somehow?
Just the ones with replaced textures. Fixing it completely would require finding additional hooks for where the object textures are loaded at the start of each level, which is time consuming. (And was what I was moaning about having to do earlier. :erg:)
You can reduce it by making sure that multiple retextured objects don't come on screen at once, or by using smaller textures.
ZylonBane on 4/4/2008 at 20:47
Quote Posted by Timeslip
Just the ones with replaced textures. Fixing it completely would require finding additional hooks for where the object textures are loaded at the start of each level, which is time consuming.
Would doing an initial preload of everything in the high-def object folder be... dangerous?
Timeslip on 4/4/2008 at 20:53
@BikerDude: Mind if I use the screenshots from your opening post for my website?
Quote Posted by ZylonBane
Would doing an initial preload of everything in the high-def object folder be... dangerous?
Depends what was in there. Thief ate 1GB of ram just from preloading the stuff from mission 1 when I replaced all objects with 1024x1024 textures, and I doubt that that mission uses more than half the objects in the game. With slightly saner replacers it would be a possibility.
Proper hooks the same as what I do for world textures would be the best option, as soon as I fiond where to put them. :confused:
Hiatus on 4/4/2008 at 20:54
Quote:
whereas world textures are all loaded from disc at the start of a mission, object textures will only be loaded when used for the first time.
Q: and in vanilla T2, how obj textures are handled? Also preloaded at level start, as world textures? (hence no noticable stuttering on 1st seeing them? and of course smaller size). Just making sure..