Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Drahsid

Pages: [1] 2 3 ... 16
1
Turok 3 Shadow of Oblivion / Turok 3 60fps, mouselook, writeup
« on: November 19, 2021, 12:01:16 AM »
HOLD UP
I worked on the remaster for Turok 3, available on all current platforms. Please consider buying the remaster over using this mod!


Original Post
Hey all, this is just a writeup about a modification that I put together ages ago but never got to releasing due to some unfortunate bugs. This supersedes the mod in this thread, as it is made for a much more accessible platform, with much more complicated code.
In any case...

What is this?
This is a mod for ModLoader64 that supports the US release of Turok 3 which allows you to use a couple tools and features:
  • 60* fps (dynamic and static)
  • 60** hz engine tickrate
  • mouselook
  • high level profiling
  • game object debugger

* = when using the static option, the game targets 60 fps, and will run in slow motion of you do not hit this target; when using the dynamic option, the game will run relative to your performance.
** = options are available to dynamically scale the engine tickrate, as well as normalize it to have the same ratio as it (1/2 framerate) does normally.

Where can I get it?
You can download the mod here
To use this mod, you must have ModLoader64 installed, simply put the mod in the mods folder and enable it on the launcher before you boot into Turok 3 US.

Feature Rundown
When you boot into the game, you will see 2 UI with various options on them. In this section I will go into detail about the options.

Controls
Mostly everything is controllable through the options menu, however, there are some functions that I mapped to the keyboard:

/: When pressing / you will toggle mouselook. When mouselook is toggled, the mod automagically binds these keys:
  • Left Mouse = Z
  • Space = R
  • A = CLeft
  • W = CUp
  • D = CRight
  • S = CDown
  • Q = A
  • Right Mouse = B
  • Middle Mouse = L
  • Return = Start
  • Z = DLeft
  • X = DUp
  • C = DRight
  • LCtrl = DDown
  • LShift = Toggle 60fps mode

Additionally, when you have the weapon wheel open, the your mouse can be used to select an item on the wheel.
Another thing that happens when mouselook is toggled is that the mod disables Auto Aim and Lookspring for all players.

Options Menu

60fps
The first option on this menu is pretty self-explanatory. Toggling this enables 60fps mode. If this option is enabled without the following option ("Dynamic Scaling"), then the game will statically target 60fps. This means that if you are not getting 60fps, the game will appear to run in slow-motion. This is extraordinarily likely, and because of this, I highly suggest toggling the Dynamic Scaling option.

Dynamic Scaling
When toggled alongside the 60fps option, the mod will evaluate your performance and using this information, attempt to scale the game to run at the correct speed. I developed this option because the game, even on emulator, unfortunately runs terribly. A quirk of this is that if you make the emulator try to run faster than full speed, it will actually scale the game correctly to any framerate (200+!)

60hz Gametick (!!)
When toggled, the mod will modify the game engine's tickrate to 60 (from the default of 15,) which may improve the smoothness of things that happen in the update loop (as the antitheses of the draw loop). Just like the 60fps option, you need to be running this fast for this option to appear to work at full speed, and as such, if you are using this option, I highly suggest enabling the following "Gametick Scaling (!!)" option, or the "Normalized Gametick" option.

Gametick Scaling (!!)
When toggled alongside the 60hz Gametick option, the mod will attempt to scale the engine's tickrate to match your current performance. This is probably the most dangerous option available.

Normalized Gamrtick
When toggled alongside the 60hz Gametick option, the target engine tickrate that the mod applies will be halved. This means with only 60hz gametick toggled, the engine tickrate will instead be 30, and with the dynamic option toggled, it will be half of your current framerate. This option is here to allow the user to preserve the original ratio of engine tickrate to target fps (which is originally 15 / 30.)

Average Length
This value represents the number of samples that are used to determine your average frametime. The higher this value, the smoother the game will react to performance hitches, however it will adversely react to these hitches less sharply. I suggest keeping this value low, since that keeps the game running at the correct speed most of the time.

Following this is a display of two histograms which detail your frametime history, and the values that are currently being used to average your frametime. These are essentially used for profiling.

Pitch Coef
This value represents the amount of rotation (in radians,) that a single unit of movement from your mouse will move your character's view vertically.

Yaw Coef
This value represents the amount of rotation (in radians,) that a single unit of movement from your mouse will move your character's view horizontally.

(!!) = dangerous

Bugs
There has been a small amount of testing a long while ago from our good friend Badger (Thanks,) so this list may grow:
  • Doors do not work when 60fps mode is enabled. Use the LShift keybind, or the UI to disable it before interacting with doors that are relevant to progression
  • Hit detection was not originally designed for 60fps, and for some reason some of it happens during draw, so in some cases the windows for hit detection may be too short, or may trigger more than normal

Bugfixes
  • The train works correctly. This thing is a piece of garbage

Not sure if this will get updated in any fashion, since I am recently busy with other things, but I've been hoarding this code for over a year, and it's much better than my old mod, so I hope you guys enjoy the ease of use of this in comparison.

2
I might make a video sometime in the future, but if you get to it first, you are absolutely welcome to do it. No skin off of my nose.

3
Kinda sucks that OP's instructions weren't clear at all and left out important information like your post did in regards to the dlls needed.
My instructions were pretty clear.
Quote from: Drahsid
Download any version of Mupen64Plus that is not Mupen64Plus-nx!!
Download and extract this into the root directory of Mupen64. This should replace "mupen64plus.dll", and you should see a new folder called "scripts."
That's it, run Turok 3 in Mupen!
User error does not mean that I wrote unclear instructions.
For example:
What an absolute slog of an emulator, though. What's the point of a piece of software if it lacks even the most basic user functionality?
This is a ridiculous statement. Mupen64plus is pretty good. It has extensive user-functionality. Just because it is CLI doesn't mean it isn't functional; if anything, it gives more power to the user.

If you need a visual tutorial to get this working, maybe I can do that sometime, but it really is pretty simple. The most complicated part ought to be configuring the controls.

4
There is no mouse acceleration. Your mouse input is interpreted linearly.

5
Ehhh, I managed to get it to work with Kil3r setup and GlideN64 4.0, it keeps crashing when choosing Danielle over Joseph though...
Don't run it with the dynarec on, run it in interpreter mode.

6
Turok 3 Shadow of Oblivion / Re: Turok 3 Mouse Input and other goodies
« on: April 19, 2020, 04:57:21 PM »
A "Rage Wars"

https://www.turokforums.com/index.php?topic=747.0
Already done, and even better, 60fps is very stable.

7
Turok 3 Shadow of Oblivion / Re: Turok 3 Mouse Input and other goodies
« on: April 13, 2020, 08:39:28 PM »
I looked the the entire cfg and couldn't find it :(. It doesn't seem like you can customize that anywhere. For now I will map the buttons to Q and E. https://mupen64plus.org/wiki/index.php?title=Mupen64Plus_Core_Parameters

There is a section titled [CoreEvents], below that is all of the hotkey mappings.

Are your intentions to create a port? As a undergrad CS major, being able to create a port using the resources you have is mindblowing. Your work deserves more support, especially on these forums. Infact, I think your script would bring more attention to the game and therefore would increase the speed of us getting a official port.

While I have no intention on making a port, recently a lot of people seem to be expecting me too. I am, however, reverse engineering the game as a hobby. My findings are public, and I update the repository whenever I feel like I've got some good amount more to show off. I'm sure these findings could be useful for the Kex team in the case that they ever do work on Turok 3 EX.
Perhaps I'd make a port for Rage Wars, but even so, it would feel dirty doing such a thing outside of the Kex engine. Beyond that, it is unreasonable for me to commit to such a large project given my underwhelming lack of finances in recent times.
If you're interested in small tidbits of interesting things I do, I post these on the modding channel in the forums' discord server, and Badger posts them on Turok Sanctum.

IIRC, Kaiser (Turok Remastered) had access to very little official code when he was first making his port. T3 unofficial port should be fairly possible right?

Yeah! When he began Turok EX, and even up to where he had a working demo, I'm fairly certain he had no source code. As aforementioned, I can't commit to doing something so big, but it is beyond reasonable doubt possible. Kaiser has actually helped me a bit in what I've gotten done on Turok 3, so credit to him for his patience.

EDIT: Is there anyway to reduce the input lag? Furthermore, i've still had no luck with solving the audio delay. What is your audio setup?

The game runs at low framerates, so you're more than likely just feeling that. The mouse inputs are processed as soon as a frame has ended rendering.
Other than the default settings, the only changed setting that I have is RESAMPLE = "src-sinc-fastest"

8
Turok 3 Shadow of Oblivion / Re: Turok 3 Mouse Input and other goodies
« on: April 13, 2020, 10:32:30 AM »
Secondly, i'm having issues. The camera is always jiggling. Its almost as if the camera is fighting back against the mouse or perhaps its not super smooth.
I can't reproduce this myself. It is possibly related to the QT launcher, or perhaps you have the joystick set to the mouse in Mupens config (DONT DO THIS, the mouse input is not linked to the joystick)

Furthermore, unrelated to this mouse script, my sound is always out of sync.
That's a Mupen issue, I think changing the sound-sync type might have better potential results.

Another thing. Is there anywhere to unbind the number keys from choosing save states. I like to use 1 and 2 as my change weapon buttons.
afaik these are near the top of Mupen64plus.cfg

Here's some gameplay: https://youtu.be/a__BK2yWF5k
I believe this project deserves so much more attention. Its unlikely that we will get a port for T3 and I can imagine that this project must of took alot of time and effort.
Thanks for the support. I dunno if I'll update this in particular, but I am doing a lot of reverse engineering on Turok 3 itself. In the future, I'm sure an official Turok 3 port is possible.

9
Turok Rage Wars / Turok RW Mouse Input
« on: February 15, 2020, 07:25:00 PM »
What is this?
Knockoff Turok RW EX?
This is NOT a PC port. This is merely a collection of memory hacks that have sprung from my reverse engineering utilizing my fork of Mupen64Plus

What does this give you?
  • Mouse input with customizable look-sensitivity

What problem does this solve?
This completely bypasses the joystick, so you are not limited to the game's interpretation of the stick input. You are not limited to the -128-127 range on either axis.

Cool. How do I get it?
Download any version of Mupen64Plus that is not Mupen64Plus-nx!!
Download and extract this into the root directory of Mupen64. This should replace "mupen64plus.dll", and you should see a new folder called "scripts."
That's it, run Turok RW in Mupen!

Note that for proper keyboard controls, you will have to configure the input of Mupen to use your desired buttons. I will not go over how to do that but do highly suggest sharing your configurations when you get something that you like.

How do I configure the options?
In the Mupen64Plus directory, navigate to ./scripts/Turok - Rage Wars (U) (V1.0) [!]/ and edit MouseInput.wren with your text editor of choice. The options have comments describing their relevance.

Bugs
  • If you get an issue related to the input plugin, replace it with this

Other notes
You can press  HOME to lock/unlock the mouse
If you fancy learning a high level scripting language, you can use what I have already set up to make more memory hacks that may do a plethora of things.

Special thanks to Kaiser

10
Turok 3 Shadow of Oblivion / Re: Turok 3 Mouse Input and other goodies
« on: February 12, 2020, 08:09:29 PM »
Editing the "mupen64plus.cfg" here is necessary.
I also used this site as a reference:
http://en.qi-hardware.com/wiki/Key_codes

So far i got "Escape" To Menu, the usual WASD to the C Buttons, Q and E are B and E, Space is "Jump".
Now here is what i don´t get.
Other keys such as "Left Ctrl" for "Control Pad Down" isn´t working.
I´m not really sure what is causing this. Left Ctrl should be "305". Yet it still wouldn´t work for that key. It just baffles me that i "somehow" got the other Keys working so far. I have no clue what is preventing this now. Other sites claim it should be "17" and not "305". Still wouldn´t work either.
Edit:
I got it to Shift (304) instead of Ctrl, which isn´t the way i want but at least it´s working.
Still doesn´t explain why Ctrl isn´t working.
Now does anybody have an idea how the Mouse Buttons are called?
It seems to be the only thing left and i could share my config for the controls.
Yes, I highly suggest everyone to share their input configs because it's not entirely seamless.
Not sure what does and doesn't work, but you might want to consider using device = -2 and name = "Keyboard"

Pages: [1] 2 3 ... 16
SimplePortal 2.3.6 © 2008-2014, SimplePortal