Previous Thread
Next Thread
Print Thread
Page 1 of 2 1 2
Oversteer for relative analog wheels #112960
03/25/18 08:15 AM
03/25/18 08:15 AM
Joined: Sep 2014
Posts: 96
Netherlands
P
phulshof Offline OP
Member
phulshof  Offline OP
Member
P
Joined: Sep 2014
Posts: 96
Netherlands
i was recently asked on the HyperSpin forums to add a feature to MAME 0.195 to support proper handling of relative analog wheels. They basically act as a single axis mouse, which causes the current code to lose the center position of the wheel if you steer beyond the game's limits. Is this a feature you would consider allowing in the MAME code? If so, what other issues should I take into account before adding it to my development fork, and send out a pull request?

Re: Oversteer for relative analog wheels [Re: phulshof] #112961
03/25/18 10:42 AM
03/25/18 10:42 AM
Joined: Feb 2004
Posts: 2,003
Sydney, Australia
Vas Crabb Offline
Very Senior Member
Vas Crabb  Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,003
Sydney, Australia
Well, from experience, arcade hardware actually does lose the centre position if you turn a relative analog wheel past the game's limits. I remember this vividly from an Atari cockpit cab. It had full force feedback, allowing it to drive the steering wheel during attract mode to match the demo gameplay. When you started a game, wherever the wheel was would be the initial centre position. If you turned the wheel too far, you'd still be a fixed number of turns from the centre position. So suppose you turned it 180° past the limit to the left, now the centre position will be 180° to the left of where it was initially.

Re: Oversteer for relative analog wheels [Re: phulshof] #112962
03/25/18 05:23 PM
03/25/18 05:23 PM
Joined: Apr 2013
Posts: 71
G
geecab Offline
Member
geecab  Offline
Member
G
Joined: Apr 2013
Posts: 71
Hi! If we are talking about the same thing (which I think we are), then I think it would be a good feature to have in mame. I have an upright driving arcade machine that has a free spinning steering wheel (I connected it up to the x-axis of an old mouse). For arcade games that used free spinning wheels (pole position, supersprint) it is great. For arcade games that used limited turning wheels (OutRun, WecLeMans, Harddrivin) it isn't so great. After a tight corner, you can't help but "oversteer" past the boundaries of the game, then you'd be fighting to find the steering's new center position (And frustratingly crash in the process).

A while ago I hacked the mame source to fix this and now things are perfect.

I posted a thread about this a while ago but nobody commented:
OutRun/HangOn/WecLeMans etc.. mouse steering hack

Also, discussed here:
Mame hacks that make driving games play better with mouse/spinner/360wheel

On these threads I also posted a video of myself showing how games play before after my hack.

Re: Oversteer for relative analog wheels [Re: geecab] #112981
03/28/18 04:58 PM
03/28/18 04:58 PM
Joined: Sep 2014
Posts: 96
Netherlands
P
phulshof Offline OP
Member
phulshof  Offline OP
Member
P
Joined: Sep 2014
Posts: 96
Netherlands
We are indeed talking about the same thing. Some users on the HyperSpin forum tried to port your feature to MAME 0.195, and were having some trouble doing it. Since I'm not in favor of using global variables I took the general idea behind your fix, and applied it to the current MAME structure. So far it seems to behave exactly like your fix, so I figured I'd offer it as a feature (-oversteer) to the MAME team.

Vas, would you consider allowing this feature to be added by me?

Re: Oversteer for relative analog wheels [Re: phulshof] #112990
03/28/18 10:07 PM
03/28/18 10:07 PM
Joined: Feb 2004
Posts: 2,003
Sydney, Australia
Vas Crabb Offline
Very Senior Member
Vas Crabb  Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,003
Sydney, Australia
Can you describe exactly what it's supposed to do here and how it works, what combinations of host control and emulated control it applies to, etc? Talk about global variables and hacks is scaring me.

Re: Oversteer for relative analog wheels [Re: phulshof] #112992
03/28/18 10:32 PM
03/28/18 10:32 PM
Joined: Apr 2006
Posts: 628
Fort Worth, TX.
D
Dullaron Offline
Senior Member
Dullaron  Offline
Senior Member
D
Joined: Apr 2006
Posts: 628
Fort Worth, TX.
I gave my wheel and peddles away while back to my step dad and my mom. I felt like it wasn't good enough to use on MAME because some of the racing games wheel behavior.

I do have a spinner though.

Last edited by Dullaron; 03/28/18 10:33 PM.

Windows 10 Pro 64-bit / Intel Core i5-4460 3.20 GHz / 8.00 GB RAM / AMD Radeon R9 200 Series
Re: Oversteer for relative analog wheels [Re: Vas Crabb] #113000
03/29/18 07:21 PM
03/29/18 07:21 PM
Joined: Sep 2014
Posts: 96
Netherlands
P
phulshof Offline OP
Member
phulshof  Offline OP
Member
P
Joined: Sep 2014
Posts: 96
Netherlands
Originally Posted by Vas Crabb
Can you describe exactly what it's supposed to do here and how it works, what combinations of host control and emulated control it applies to, etc? Talk about global variables and hacks is scaring me.


No worries, I have no such intentions. smile The feature is implemented in the apply_min_max function in ioport.cpp. Normal functionality is to maximize/minimize the value based on the min/max values of the game, and discard the excess value. This -oversteer feature, when enabled, stores the excess value in an m_oversteer class member variable, and reapplies it the next time the function is called. This allows the analog_field to keep track of the oversteer, and keep its center position.

Re: Oversteer for relative analog wheels [Re: phulshof] #113004
03/30/18 06:21 AM
03/30/18 06:21 AM
Joined: Aug 2002
Posts: 350
Melbourne, Australia
H
Heihachi_73 Offline
Senior Member
Heihachi_73  Offline
Senior Member
H
Joined: Aug 2002
Posts: 350
Melbourne, Australia
On a slightly related note, I had to repair a mobility scooter (a CTM Shoprider) a few years ago with a very similar overflow issue. The spring-loaded forward/back paddles (which are one piece) are connected to a potentiometer using a small key (which is actually a very small hex screw jammed against the pot shaft), if the key becomes loose the scooter becomes uncontrollable and won't stop if it was currently moving*, unless it is shut down. If the pot goes out of bounds (too far left or right e.g. too close to 0 or 50 ohms, if it was a 50 ohm pot) the machine will enter an error mode and will not move at all (IIRC a similar protection mechanism occurs if the machine is turned on while one of the paddles is being pushed, which will require the rider to let go of the paddles and turn the scooter off and back on to reset everything). The valid region is about half of the pot's actual range with neutral (no movement) being in the middle.

* What's worse is that when this happens the paddles can also become loose enough to drop down below the pot/spring housing and let go of the spring, disengaging the paddles completely, which would be a pretty frightening experience if it happened e.g. near a road crossing with the person being unable to stop it and ending up in the middle of the road (if they panicked, they probably wouldn't be thinking of reaching for the key to turn it off).

Anyone want to emulate a mobility scooter or electric wheelchair in MAME? It has to be up there with an eye test machine. smile

Re: Oversteer for relative analog wheels [Re: phulshof] #113064
04/07/18 07:44 PM
04/07/18 07:44 PM
Joined: Sep 2014
Posts: 96
Netherlands
P
phulshof Offline OP
Member
phulshof  Offline OP
Member
P
Joined: Sep 2014
Posts: 96
Netherlands
Shall I work on a pull release for you to have a look at? You can always turn it down after you've seen the code. smile

Re: Oversteer for relative analog wheels [Re: phulshof] #113069
04/08/18 01:03 PM
04/08/18 01:03 PM
Joined: Feb 2004
Posts: 2,003
Sydney, Australia
Vas Crabb Offline
Very Senior Member
Vas Crabb  Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,003
Sydney, Australia
You didn't actually answer most of the question.

Re: Oversteer for relative analog wheels [Re: Vas Crabb] #113070
04/08/18 01:24 PM
04/08/18 01:24 PM
Joined: Sep 2014
Posts: 96
Netherlands
P
phulshof Offline OP
Member
phulshof  Offline OP
Member
P
Joined: Sep 2014
Posts: 96
Netherlands
Originally Posted by Vas Crabb
You didn't actually answer most of the question.


My apologies; what more information that what I wrote in http://forums.bannister.org//ubbthreads.php?ubb=showflat&Number=113000#Post113000 do you need?

Re: Oversteer for relative analog wheels [Re: phulshof] #113071
04/08/18 01:26 PM
04/08/18 01:26 PM
Joined: Feb 2004
Posts: 2,003
Sydney, Australia
Vas Crabb Offline
Very Senior Member
Vas Crabb  Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,003
Sydney, Australia
Well for one thing, "what combinations of host control and emulated control it applies to," was a pretty key part of the question

Re: Oversteer for relative analog wheels [Re: Vas Crabb] #113092
04/10/18 07:15 PM
04/10/18 07:15 PM
Joined: Sep 2014
Posts: 96
Netherlands
P
phulshof Offline OP
Member
phulshof  Offline OP
Member
P
Joined: Sep 2014
Posts: 96
Netherlands
Originally Posted by Vas Crabb
Well for one thing, "what combinations of host control and emulated control it applies to," was a pretty key part of the question


I'm sorry, but then I fear I do not understand your question. What do you define as "host control" and what as "emulated control"?

As far as I can tell, the ioport.cpp part I changed simply handles the analog input by placing a maximum and minimum value depending on the game. The feature I add simply stores the cut off part of the value so that it can compensate next time that same function is called. It stores this oversteer value in a private member of the analog control object, so it's limited to that particular object.

Re: Oversteer for relative analog wheels [Re: phulshof] #113093
04/10/18 07:34 PM
04/10/18 07:34 PM
Joined: Mar 2001
Posts: 16,058
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,058
USA
"Host control" is the real physical controller. "Emulated control" is the virtual cabinet's virtual steering wheel.

Re: Oversteer for relative analog wheels [Re: R. Belmont] #113101
04/11/18 07:38 PM
04/11/18 07:38 PM
Joined: Sep 2014
Posts: 96
Netherlands
P
phulshof Offline OP
Member
phulshof  Offline OP
Member
P
Joined: Sep 2014
Posts: 96
Netherlands
Originally Posted by R. Belmont
"Host control" is the real physical controller. "Emulated control" is the virtual cabinet's virtual steering wheel.


I'm not 100% sure, but if I'd have to take a guess this feature would be fully in the host control part. The ioport.cpp handler handles general analog inputs, and only minimizes/maximizes it based on the game's parameters. Other than that there's no game specific handling in that code as far as I can tell. It didn't even have the machine reference I needed to pull the configured options (in this case, the -oversteer parameter).

Re: Oversteer for relative analog wheels [Re: phulshof] #113102
04/11/18 08:16 PM
04/11/18 08:16 PM
Joined: Dec 2015
Posts: 86
A
AJR Offline
Member
AJR  Offline
Member
A
Joined: Dec 2015
Posts: 86
Have you tested the effect of -oversteer on pedal inputs?

Re: Oversteer for relative analog wheels [Re: AJR] #113105
04/12/18 07:57 AM
04/12/18 07:57 AM
Joined: Apr 2013
Posts: 71
G
geecab Offline
Member
geecab  Offline
Member
G
Joined: Apr 2013
Posts: 71
Originally Posted by AJR
Have you tested the effect of -oversteer on pedal inputs?


When I did my 'oversteer' hack originally, it fortunately didn't effect pedal inputs.

In my original hack, I only apply oversteer in apply_analog_min_max IF the host control is IPT_PADDLE (I.e. What OutRun/HangOn/WecLeMans etc... uses for steering) or IPT_AD_STICK_X (I.e. What SCI etc... uses for steering). For most driving games, I think accelerator/brake pedal inputs are set to something else other than IPT_PADDLE or IPT_AD_STICK_X, so I got away with it.

In summary, you only really want to do oversteer if the answer to the following is all YES:
- Does the original arcade machine have a steering wheel (or handle bars)?
- Does the original arcade machine restrict you from turning its steering wheel (or its handle bars) if you try to turn them in a particular direction (I.e. does it have limits, rather than being free spinning)?
- Are you trying to control it (emulated control) with a mouse X or mouse Y axis?


To ensure this happens, perhaps in apply_analog_min_max, you could have logic along the lines of:-

if((oversteer_enabled) && (HostControl == oversteer_host_control) && (EmulatedControl == oversteer_emulated_control))
{
do oversteer here...
}

Where it is possible for the user to specify (via command line) their choice_of_host_control (E.g. IPT_PADDLE ) and choice_of_emulated_control (E.g. MOUSE_X_AXIS)? Just a thought anyway smile

Re: Oversteer for relative analog wheels [Re: phulshof] #113107
04/12/18 12:31 PM
04/12/18 12:31 PM
Joined: Mar 2001
Posts: 16,058
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,058
USA
The control mapping in the tab menu does that. You pick for each analog axis what controls it (MOUSE X, MOUSE Y, Xbox 360 left stick X, etc).

Re: Oversteer for relative analog wheels [Re: phulshof] #113108
04/12/18 02:22 PM
04/12/18 02:22 PM
Joined: Apr 2013
Posts: 71
G
geecab Offline
Member
geecab  Offline
Member
G
Joined: Apr 2013
Posts: 71
So maybe if there was just a configuration option that users could tell mame which emulated control (say, MOUSE X or MOUSE Y) should get the oversteer treatment in apply_analog_min_max, then I think that should be enough as far as configuring it goes smile

Re: Oversteer for relative analog wheels [Re: phulshof] #113118
04/15/18 09:04 AM
04/15/18 09:04 AM
Joined: Sep 2014
Posts: 96
Netherlands
P
phulshof Offline OP
Member
phulshof  Offline OP
Member
P
Joined: Sep 2014
Posts: 96
Netherlands
I don't really see the problem to be honest. If you don't enable it, things work just like they currently are. If you do enable it, you have a few options:
1. Your controls (pedals, wheel, etc.) do not go beyond the min/max value: nothing changes.
2. Your controls do go beyond the min/max value: the base position of the control is maintained.
All in all: it's a very minor change to the code, that only has impact if you actually enable it, which is what you can do on a game basis.

Page 1 of 2 1 2

Who's Online Now
2 registered members (Duke, 1 invisible), 31 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,600
Posts112,408
Members4,821
Most Online283
Oct 11th, 2018
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.037s Queries: 14 (0.011s) Memory: 5.8205 MB (Peak: 6.1019 MB) Zlib enabled. Server Time: 2018-11-21 12:53:19 UTC