Author Topic: PC Version Multiplayer - Online Modification  (Read 89189 times)

Offline PNill

  • Iguana
  • *
  • Posts: 46
  • T:REP 144
    • View Profile
PC Version Multiplayer - Online Modification
« on: December 13, 2015, 01:17:47 AM »
UPDATE 3/16/2021:
This is still being worked on, just very slowly and the progress is not really there yet; I've reversed a lot more of the engine and have a lot of plans for this.

Some things that I want to do is move to a different networking engine for starters (ENet, or Yojimbo) than writing/using my own raw UDP implementation (If you want to help with this project, and know C/C++ that could be a place to start even if you don't know how to reverse engineer things).

All of that being said I had released a "Pre-Alpha" awhile back that was burried in this forum I'm bringing it up to here now, currently this is the only way to play the MP mod:
Quote
There's now an pre-alpha version of the browser/launcher for the game which can be used to host/join multiplayer games and will automatically install the mod for you;
https://cdn.discordapp.com/attachments/364499772112896001/569032869729533978/SPOILER_T4Browser_-_Pre-Alpha_0.4.rar

This has not be tested much and you will encounter plenty of bugs.

If you have an issue while playing in the game itself report it on this github:
https://github.com/pnill/T4MP/issues

If you have an issue with the launcher/browser report it on this github:
https://github.com/pnill/T4Browser

Thanks and I hope everyone enjoys this, hopefully we can improve this and make things just like the other classics.


UPDATE 10/7/17:
For those of you just tuning in, I've made a lot of progress and have been able to get most of the objects to sync over the network while also fixing some bugs that were present in the game due to the port.

An example of some very early gameplay can be seen here:



First to introduce myself, I'm a random lol... I've never hung out in any Turok communities and I've barely played the game.

I'm an experienced programmer and I reverse engineer as well, I write in a ton of different languages and have experience hacking/modifying games.

Back in about 2008 I had randomly stumbled across a PC port of Turok: Evolution and was intrigued upon looking at the game it was amazing, it didn't make sense that it didn't have online multiplayer and I had discovered Turok 2 and the game that was coming out later that year had it...

Digging around I managed to find various files in the build which was released online documenting object data (not model objects, but class objects/game objects).

Long story short I did have a working multiplayer online modification which was ghetto at best the health was synchronized but the way players were shot and such was pretty rigged we basically synchronized where the player was looking and when they fired and sent the event to the other side, the de-synchronization was crap and caused things to happen like a player wouldn't actually be shooting you even though on their screen they were.

Now to get to this point the first step was modifying the files to allow us to go into multiplayer mode (Split-screen) I had discovered split screen existed due to the fact none of the menu files for it were removed from when it was ported to PC from the original xbox platform.

The way I originally went about this was simply replacing the files in the cheat folder with the files from the Mutliplayer folder, that will get you  into the basic multiplayer screen beyond that there's some additional check I can't quite remember how I got past.

As of today I've started to look into this again and I hate to say all of my original code for that project I called "t4mp" is gone and sadly not even the website which once was, was properly indexed to where you could've seen some of the screenshots and such we took.

Code: [Select]
http://web.archive.org/web/20070801000000*/http://t4mp.org

Though I did happen to make some slight progress reverse engineering the menu format and replaced the cheats Menu with Multiplayer without replacing the files and actually modifying the atr instead.

I'm still trying to figure out what it was I originally did in order to make the "MultiplayerJoin" screen not back out, this was pretty hacky ( I believe I deleted the events for players 2-3 ).

But long story short when this was active we had actually disabled the split-screen view port and could actively spawn more then just the original 4 players, meaning actual online multiplayer support.

I may work on this but I just thought I should share that little story and see if I can help you guys out or if there's anything you know about the game's file formats which I don't currently.
« Last Edit: March 17, 2021, 12:33:08 AM by PNill »

Offline PNill

  • Iguana
  • *
  • Posts: 46
  • T:REP 144
    • View Profile
Re: PC Version Multiplayer - Online Modification
« Reply #1 on: December 13, 2015, 02:27:40 AM »
I'm still working on a way to fix a few things, but I've managed to get it past the player select now by removing the object/event definitions for the additional 3 players.

The method I used when I created this back in 07-08 though actually allowed me to control the first player as well as select a player other then Tal'Set, so I'm still experimenting with how to get this to work the way I want/need it to.





UPDATE
I've got it going into game with the player selection enabled and jesus christ I had forgotten about how much we actually had to fix the last time we worked on this..

I remember the spider control thing we had to fix a crash there, there's a crash with the scope on the pistol.
And the dinos at the bottom of the treehouse map didn't render properly we had to fix the zbuffer stuff to fix that.

Yet I did not remember that the second player didn't render (it's coming back) gonna be hell to figure this stuff out I'm sure if I remember correctly when we fixed it the first time it was by accident.

Anyway here's a video demonstrating the Multiplayer split-screen functioning on PC with me being able to select a character and etc, (I had to disable 2nd player input purposely) I don't plan to support actual split-screen on the PC as going that route is rather difficult and requires more knowledge of the ati layout that I don't have.


Also you cannot re-spawn the 2nd player due to them not having any controls assigned/mapped,
What I did previously was triggered this manually over the network.

Basically once you find the player object in memory back-tracing to the class constructor results in finding the player spawning function, so what I was doing previously was I followed the D3D viewport stuff back and disabled the 2nd player's screen and then manually spawned and controlled players through the player class.

« Last Edit: December 13, 2015, 06:35:40 AM by PermaNull »

Offline PNill

  • Iguana
  • *
  • Posts: 46
  • T:REP 144
    • View Profile
Re: PC Version Multiplayer - Online Modification
« Reply #2 on: December 13, 2015, 07:11:04 AM »
DAMN DUDE! Thats AWESOME! I knew multiplayer was still in there! I have a feeling you and i will become great friends. Turok Evolutions multiplayer is one of, if not the best Turok Multiplayer out there. There are alot of talented people on the forum here so they might help you if you want.
Split screen on PC would not be that bad asuming that the other player could use a controller if properly mapped, but online would be way better. I used to play this split screen on my Xbox with my brothers or friends.

So with the object data I have online should be entirely possible and I've made advancements in my skills since the first time I attempted it,
The first time I was using TCP which was already a no no, as well as a remote server relaying all the packets (Written in BASIC don't ask lol).

Long story short the original implementation that was buggy as all hell was before I knew a lot about game programming and the proper way to handle a lot of the stuff.

It's just I don't really recall how we fixed most of these bugs like the rendering issues and stuff, reverse engineering the rendering loop should be simple enough so disabling the 2nd player's screen shouldn't be a huge issue, I've already found structures in relation to the player's health, spawning and etc so actually spawning players via external code also shouldn't be very tough.

But fixing these graphic bugs are where I'm going to have problems to be honest which I think is where people on the forums will come in handy especially the guy developing the level editor as it's safe to assume he knows a ton more then me about 3D programming in general.

As far as actual split screen on PC there's still issues like the one shown in the image below that need to be overcome, but I'm pretty sure controller mapping wouldn't be too difficult from what I've seen looking at the files.

The only other thing I would have to determine is if the MutliplayerJoin.ati patches would still be required if a controller was properly assigned to the 2nd player, if it wasn't possible without the patch I would have to implement some strange hack to allow the 2nd player to switch weapons or fix the really screwed issues it has where it will knock you out of multiplayer or spam accept buttons and stuff.

But yeah when I first started working on this project in 2007 there seemed to be no one really interested in the development of it so we went quite our domain expired and we stopped development then in 2012 I lost my drives which had the original code and research/fixes on it.


« Last Edit: December 13, 2015, 07:14:01 AM by PermaNull »

Offline PNill

  • Iguana
  • *
  • Posts: 46
  • T:REP 144
    • View Profile
Re: PC Version Multiplayer - Online Modification
« Reply #3 on: December 13, 2015, 07:18:05 AM »
 

Indeed, the game has rendering issues in Multiplayer due to the fact that it was originally built for the xbox and never intended to render on multiple viewports for PC, It's possible by just disabling the extra view port the issue would be fixed.

The issue with the Tal'Set being all deformed I don't believe relates to rendering, I believe that has more to do with the fact there's no input assigned or something isn't happening.

The floating warclub is actually the 1st player (The one I'm playing as, you can see it in the youtube video I've showed), there's more invisible stuff like the dinos on the treehouse level tons of stuff we had issues with early on the first time I worked on this and I believe some of it may have been fixed by actually disabling the spit-screen while leaving the 2nd player spawned.

Essentially just disabling the rendering of the second screen and making the game believe it only has to render the first player's screen.

Currently I'm going to debug the pistol zoom crash and see if I can't fix it,

I'll provide the patched files here (if that's allowed) once I wake up today (haven't slept been working on this all night), and then everyone can screw around with the multiplayer functionality.

Also the ATR viewer does actually load some of the multiplayer maps as well I was experimenting with that a bit.

UPDATE:
Some real quick nops in relation to the area it's crashing and the pistol zoom now works :D, really dirty method I should probably figure out what it was trying to access and why it failed... but regardless it doesn't seem to have caused any additional problems performing the nops that I did.

I could now reverse engineer the viewport stuff.

« Last Edit: January 02, 2023, 12:32:04 PM by Dinomite »

Offline PNill

  • Iguana
  • *
  • Posts: 46
  • T:REP 144
    • View Profile
Re: PC Version Multiplayer - Online Modification
« Reply #4 on: December 13, 2015, 07:32:37 AM »
It helps that I've done it before, and I've actually figured something interesting out there's something that changes once the player is dead that resolves the rendering issues but only for that specific player.

I.E. If player2 is dead player 2 can see player 1 perfectly fine (No invisible stuff, no invisible dinos or etc), if player 1 is dead they can see the dinos and other player as well (I'm talking about in the kill camera that waits till you respawn).

So that may be one route to go about fixing the rendering issues while still having split screen is checking what exactly is changing between when a player is dead and alive as far as camera and rendering flags.
« Last Edit: January 02, 2023, 12:32:21 PM by Dinomite »

Offline PNill

  • Iguana
  • *
  • Posts: 46
  • T:REP 144
    • View Profile
Re: PC Version Multiplayer - Online Modification
« Reply #5 on: December 13, 2015, 07:51:03 AM »
Maybe it has something to do with reseting the player and by doing that, automatically refreshing the renderer.
I don't think that's it because if I die then respawn the issue is still persistent while I'm alive.

It only fixes while you're dead then goes back to the way it was while you're alive.

Offline PNill

  • Iguana
  • *
  • Posts: 46
  • T:REP 144
    • View Profile
Re: PC Version Multiplayer - Online Modification
« Reply #6 on: December 13, 2015, 08:19:57 AM »
Than it probably has something to do with the screen resolution.
Well THAT, or the renderer is still used to the Xboxes unique GPU.

Not quite sure but I've followed D3DCreate9 to the DeviceCreate call and then followed the vtable from there to get where the game is calling BeginScene,EndScene,Present,and SetViewPort so I should be able to reverse how the the rendering is happening for the split-screen now as well as disable the second screen.

Offline Drahsid

  • Endtrail
  • ****
  • Posts: 153
  • T:REP 557
  • That I be considered worthy
    • View Profile
Re: PC Version Multiplayer - Online Modification
« Reply #7 on: December 13, 2015, 04:11:06 PM »
If you need any help, I know many programming languages and whatnot, I also know a lot about communication to the GPU.
Well that didn't work

Offline PNill

  • Iguana
  • *
  • Posts: 46
  • T:REP 144
    • View Profile
Re: PC Version Multiplayer - Online Modification
« Reply #8 on: December 13, 2015, 08:42:40 PM »
If you need any help, I know many programming languages and whatnot, I also know a lot about communication to the GPU.

If you know about D3D programming maybe you can give some insight as to why the players show as invisible some of the time and this changes once the kill camera is active (I.E. a player dies), I assume it has something to do with zbuffers but I truly lack knowledge on the matter.

Here's an example of the Player rendering issues (Ignore the song it was just what was playing on my pandora).

I truly believe this is in relation to depth buffering/zbuffer not being handled properly but I personally don't have enough knowledge on how rendering works to actually solve it maybe someone else with D3D/3D programming experience can offer advice on what to look for ;).

Notice how if the player isn't behind any other objects including the level itself and they're just in front of the skybox they're rendered perfectly fine.

« Last Edit: December 13, 2015, 09:53:34 PM by PermaNull »

Offline Dinomite

  • Ban
  • *
  • Posts: 228
  • T:REP 2223
    • View Profile
Re: PC Version Multiplayer - Online Modification
« Reply #9 on: December 14, 2015, 09:11:06 AM »
So i played around in the multiplayer and ive noticed almost all, if not, all of the shaders were missing but that kind of stuff is accepted and expected.
Another intresting thing is that when you touch the second player, he turns to a non-deformed version of himself, albeit in a falling pose and starts to slide away.
This is most likely because the second player does not have any inputs set up and the game doesnt know what to do.

I ment to post it yesterday but couldnt because of time constraints and because it uploaded so slowly, i had to let my PC on for some hours while i went to sleep.
EDIT: Here is another video showing off the Flight game mode.
« Last Edit: December 14, 2015, 03:09:29 PM by Dinomite »

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal