Author Topic: Turok 3 Mouse Input and other goodies  (Read 16515 times)

Offline Nutshot

  • Iguana
  • *
  • Posts: 37
  • T:REP 129
    • View Profile
Re: Turok 3 Mouse Input and other goodies
« Reply #10 on: February 12, 2020, 10:32:09 AM »
So i tested out yesterday this thing and it does indeed works with some Mupen Frontends too.
But every single Frontend has a flaw that other don´t have and vice versa.
So i ended up using just the standalone Mupen64 with some Command Lines.
All in all, it´s running superb. The only thing yet i have problems are the controls themselfes.
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.
« Last Edit: February 12, 2020, 12:36:43 PM by Nutshot »

Offline MecaCool

  • Raptor
  • ***
  • Posts: 120
  • T:REP 435
  • Trying to be as Humble as I can be to Others.
    • View Profile
Re: Turok 3 Mouse Input and other goodies
« Reply #11 on: February 12, 2020, 11:03:07 AM »
@Drahsid Some advice if you do some coding in not just the "dll" project but also the modifying of the application project then you need to release the new build.
You, can't expect someone to use an outdated Mupen64Plus with your "dll" because it shares as a reference and called from the application project no matter if you just did code from one project alone.

This is absolute nonsense, you don't understand how Mupen64Plus is structured. Go ahead, compile my fork. You'll realize that the output is just the dll. Most front ends are garbage, but should still work if their executable is from the latest version of Mupen64Plus. All you need to run this is the dll and the script, exactly what I provided. There is no mistake in what I released.

The only issues that is related to Mupen is with the input plugin, which seems to be an SDL problem. Nothing to do with having a more up to date library.

@Drahsid compile your fork and update your post with new links to the new fork build project so people will not have issues with your mouse input goodie ;)
He should have known that prior before he released this @Drahsid. But a simple mistake I'm sure.
You should try it. It might clear up your confusion.

So you only did modify the code from the dll project if so then I'm wrong but usually the dll works as a reference and is called by the application project aka exe.
Either way, all most every project code I've dealt with always has a dll as a reference and is almost always called by the exe.

My mistake sorry observing the wrong way.
A c++ and c Programmer.

Offline Drahsid

  • Dimetrodon
  • ****
  • Posts: 276
  • T:REP 946
  • That I be considered worthy
    • View Profile
Re: Turok 3 Mouse Input and other goodies
« Reply #12 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"
Well that didn't work

Offline Kil3r

  • Iguana
  • *
  • Posts: 6
  • T:REP 28
    • View Profile
Re: Turok 3 Mouse Input and other goodies
« Reply #13 on: April 13, 2020, 05:01:35 AM »
Is this program like the mouse input injector from Carnivorous (Goldeneye)?  In other words, is it as close to native mouse support that we can get in Turok 3?

EDIT: Yes it is.

Firstly, I like it! 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. Furthermore, unrelated to this mouse script, my sound is always out of sync. 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.

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.

My setup is this:
Quote
Latest Mupen64Plus + Mupen64PlusQT launcher + GlideN64 + Input Plugin from this thread's OP(in the bug list).

DPad R = "mouse(2)"
DPad L = ""
DPad D = "key(306)"
DPad U = ""
Start = "key(8)"
Z Trig = "mouse(1)"
B Button = "key(50)"
A Button = "key(49)"
C Button R = "key(100)"
C Button L = "key(97)"
C Button D = "key(115)"
C Button U = "key(119)"
R Trig = "key(32)"
L Trig = "key(120)"
Mempak switch = "key(44)"
Rumblepak switch = "key(46)"
Quote
Controls:
Left Mouse: Fire
Right Mouse: Sniper Zoom
1: Change Weapon\A Button
2: Change Weapon\Activate Gadget\B button
Spacebar: Jump
Ctrl: Crouch
WASD: Move
Backspace: Pause
« Last Edit: April 13, 2020, 08:54:44 AM by Kil3r »

Offline Drahsid

  • Dimetrodon
  • ****
  • Posts: 276
  • T:REP 946
  • That I be considered worthy
    • View Profile
Re: Turok 3 Mouse Input and other goodies
« Reply #14 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.
Well that didn't work

Offline Kil3r

  • Iguana
  • *
  • Posts: 6
  • T:REP 28
    • View Profile
Re: Turok 3 Mouse Input and other goodies
« Reply #15 on: April 13, 2020, 04:08:03 PM »
Quote
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)
Thanks! Your second point was the reason behind the issue.  For anyone having the same issue, make sure "mouse = False" in mupen's cfg.

Quote
That's a Mupen issue, I think changing the sound-sync type might have better potential results.
Sounds good i'll be tinkering with that.

Quote
afaik these are near the top of Mupen64plus.cfg
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

Quote
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.

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. Maybe https://www.youtube.com/user/Gggmanlives would be interested in visiting T3 again with the script as he talked about Goldeneye's mouse injector in his review. As someone who started Turok on PC, playing Turok 3 with a controller is just not an option haha. I'm sure other people feel the same way.

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?

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?
« Last Edit: April 13, 2020, 06:01:16 PM by Kil3r »

Offline Drahsid

  • Dimetrodon
  • ****
  • Posts: 276
  • T:REP 946
  • That I be considered worthy
    • View Profile
Re: Turok 3 Mouse Input and other goodies
« Reply #16 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"
Well that didn't work

Offline Nutshot

  • Iguana
  • *
  • Posts: 37
  • T:REP 129
    • View Profile
Re: Turok 3 Mouse Input and other goodies
« Reply #17 on: April 19, 2020, 04:32:15 PM »
Oh boy.
A "Rage Wars" or "The World is not Enough" would be great.
I´m still so surprised how this Turok 3 "Hack" feels so much like a proper PC Port which we never got.
All feels so smooth.
« Last Edit: April 19, 2020, 04:33:52 PM by Nutshot »

Offline Drahsid

  • Dimetrodon
  • ****
  • Posts: 276
  • T:REP 946
  • That I be considered worthy
    • View Profile
Re: Turok 3 Mouse Input and other goodies
« Reply #18 on: April 19, 2020, 04:57:21 PM »
Well that didn't work

Offline Party Boy

  • Iguana
  • *
  • Posts: 4
  • T:REP 12
    • View Profile
Re: Turok 3 Mouse Input and other goodies
« Reply #19 on: May 07, 2020, 03:54:26 AM »
Hey, I've just registered to thank you...

However, I did this comment in Kil3r's video:

Quote
Hey, can you post which version of GlideN64 are you using?, I'm using one dated May 6 2020, using your same setup crashes on start up, Glide64 and Rice crashes after choosing a character...

I originally tried to use it with an m64p dated April 9 2020 and it just doesn't work, it's probably something to do with m64p though...

I've read that thread in the Turok forums like 20 times...

I've also added the corresponding [Input-SDL-Control1] to the .cfg (I didn't even know you could do that)...

I've also used the scan codes posted in that thread, I just don't know what I'm doing wrong...

Kil3r setup is: Mupen64Plus + Mupen64PlusQT launcher + GlideN64

tl;dr

I can't make it work, Kil3r setup crashes, mine using m64p does nothing input wise...

Here it is what I added to the .cfg:

Quote
[Input-SDL-Control1]

# Mupen64Plus SDL Input Plugin config parameter version number.  Please don't change this version number.
version = 2
# Controller configuration mode: 0=Fully Manual, 1=Auto with named SDL Device, 2=Fully automatic
mode = 0
# Specifies which joystick is bound to this controller: -1=No joystick, 0 or more= SDL Joystick number
device = -2
# SDL joystick name (or Keyboard)
name = "Keyboard"
# Specifies whether this controller is 'plugged in' to the simulated N64
plugged = True
# Specifies which type of expansion pak is in the controller: 1=None, 2=Mem pak, 5=Rumble pak
plugin = 2
# If True, then mouse buttons may be used with this controller
mouse = True
# Scaling factor for mouse movements.  For X, Y axes.
MouseSensitivity = "2.00,2.00"
# The minimum absolute value of the SDL analog joystick axis to move the N64 controller axis value from 0.  For X, Y axes.
AnalogDeadzone = "4096,4096"
# An absolute value of the SDL joystick axis >= AnalogPeak will saturate the N64 controller axis value (at 80).  For X, Y axes. For each axis, this must be greater than the corresponding AnalogDeadzone value
AnalogPeak = "32768,32768"
# Digital button configuration mappings
DPad R = "mouse(2)"
DPad L = ""
DPad D = "key(305)"
DPad U = ""
Start = "key(13)"
Z Trig = "mouse(1)"
B Button = "key(101)"
A Button = "key(113)"
C Button R = "key(100)"
C Button L = "key(97)"
C Button D = "key(115)"
C Button U = "key(119)"
R Trig = "key(32)"
L Trig = "key(108)"
Mempak switch = ""
Rumblepak switch = ""



EDIT:

I want to clarify, it doesn't move at all, and yes, I'm pressing HOME...
« Last Edit: May 07, 2020, 04:05:23 AM by Party Boy »

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal