pnill / T4MP

T4MP (Turok 4 Multiplayer) is an modification to bring online play to Turok 4 Evolution for PC it's currently not any where near being actually useable for competitive or serious gameplay but it's getting there.
GNU Affero General Public License v3.0
16 stars 2 forks source link

First Person Weapon #1

Closed pnill closed 4 years ago

pnill commented 6 years ago

When re-spawning the second player if there's more than 2 additional players spawned the second player will have a first person weapon model rendered in front of their 'third person' model.

Chances are this has to do with the construct inside the re-spawn probably need to jump over a routine some where in there to take care of this, it'd be best to go back and figure out where the OSD crash was and what all is jumped over there as well as determine if any of the same functions are used during re-spawn chances are it's using something there.

pnill commented 6 years ago

I've introduced this bug now to all players, it no longer applies to only when 2 additional players are spawned.

I've discovered there are separate files for the first person and 3rd person models, I have concerns that if the first person model/actor is removed it will stop the player from being able to attack at all using the specific weapon.

pnill commented 4 years ago

Determined this to be related to current camera hooks, reverting to old camera hooks seems to resolved the issue.

I've managed to narrow it down to this specific patch;

*(BYTE*)0x004DAD49 = 0xEB; // disable OSD weapon related

Looks like I'll have to determine where all this data gets used and try to fix it around where the 1st person weapon is getting spawned or just revert to previous camera hooks.

pnill commented 4 years ago

Found several methods to have this not happen, one of which will cause the camera to lock in place meaning wherever the player goes will not matter; their projectiles would still spawn from where the camera was last locked to so this is not an ideal situation.

The next solution was attempting to modify the original camera loop but with it patched the way I have it currently it appears I still see water effects from other players screen's the odd part about this is even without the camera loop codecave this had previously been fixed so it makes me question what is causing regression.

pnill commented 4 years ago

Was quickly able to determine that https://github.com/PermaNulled/T4MP/commit/0ffb1d64147a6771b30d17911521e923df9f4cc1#diff-3f060c2f9cdb5170e6c1a35ce80540a5R979 causes the regression of the effects on the screen.

I've also made note that while https://github.com/PermaNulled/T4MP/commit/0ffb1d64147a6771b30d17911521e923df9f4cc1#diff-3f060c2f9cdb5170e6c1a35ce80540a5R1199 can fix this, it also disables stuff (particle effects) for our local player as well... this could be in relation to the way the loop is working maybe I can write a better loop like I did at https://github.com/PermaNulled/T4MP/commit/0ffb1d64147a6771b30d17911521e923df9f4cc1#diff-3f060c2f9cdb5170e6c1a35ce80540a5R197 for the other camera fix.

pnill commented 4 years ago

Even with the loop modified to a similar way that the first loop is working it seems as soon as a second player is brought into the game the first looses all particle effects for their weapons with the second camera code cave enabled... this will certainly require additional research and currently disabling their camera isn't an option.

pnill commented 4 years ago

Have a temporary fix in place, https://github.com/PermaNulled/T4MP/commit/23cf32ca4df1fb3d483d2fef8c21ad5f0b1cf5b4#diff-3f060c2f9cdb5170e6c1a35ce80540a5R411 want to clean this up a bit and see if I can rely on something else to identify it as being a weapon other than a string in memory then base it on that to avoid running strcmp so often.