Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Tank-style driving using one joystick (vindicators, ultra tank, battlezone, etc)  (Read 5785 times)

0 Members and 1 Guest are viewing this topic.

chemame

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 107
  • Last login:January 26, 2007, 01:54:05 pm
  • I want to build my own arcade controls!
For years, I've been wanting to play Vindicators with 2 players, just like I remember when I was not the old fart I am today. Problem is, it's driven tank-style (left stick is left tread up/down, right stick is right tread up/down). I find tank-tread controls immensely fun, but problematic if you don't have exactly the right controls. For example, Vindicators, I believe, had four pistol-trigger sticks that could rotate and had multiple firing triggers. There's no way I'll ever have those controls on my cab, so Vindicators was at best a one-player game for me, and even at that, controlling the turret was out of the question.

Anyway... the point... I finally grew frustrated and sat down with a logic diagram to see if I could make each tread respond properly to the direction of a single joystick. It's trickier than it sounds, since (for instance) a tread has to respond differently depending on if one is pushing UP, UP&RIGHT, or just RIGHT.

So, I finally got it to work! These controls allow two player Vindicators with only two joysticks, AND free up one hand for turret controls and multiple firing buttons. Another game for which these controls are useful is Ultra Tank. I could see it for Battlezone if necessary, but not quite sure how much benefit would be had.

LEFT TREAD UP
===============
KEYCODE_R NOT KEYCODE_U NOT KEYCODE_D OR
KEYCODE_U NOT KEYCODE_L NOT KEYCODE_R OR
KEYCODE_U KEYCODE_R

RIGHT TREAD UP
===================
KEYCODE_U NOT KEYCODE_L NOT KEYCODE_R OR
KEYCODE_L NOT KEYCODE_U NOT KEYCODE_D OR
KEYCODE_U KEYCODE_L

LEFT TREAD DOWN
====================
KEYCODE_L NOT KEYCODE_U NOT KEYCODE_D OR
KEYCODE_D NOT KEYCODE_L NOT KEYCODE_R OR
KEYCODE_R KEYCODE_D

RIGHT TREAD DOWN
=====================
KEYCODE_D NOT KEYCODE_L NOT KEYCODE_R OR
KEYCODE_R NOT KEYCODE_U NOT KEYCODE_D OR
KEYCODE_D KEYCODE_L


If you try these controls, please let me know the results!
Also, I'm trying to think of a way to modify this for use with Assault, but the unique "roll over" and "stand up and beg" movements pose a problem. If you should come up with something for Assault, I'd like to try it!

Che

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
...Problem is, it's driven tank-style ...

If you try these controls, please let me know the results!

Can't test at work, but looks good.

Quote
Also, I'm trying to think of a way to modify this for use with Assault, but the unique "roll over" and "stand up and beg" movements pose a problem. If you should come up with something for Assault, I'd like to try it!

How about use two extra buttons?

Button3 = "roll"
Button4 = "beg"

To roll, push button3 plus the direction to roll (left or right).
To beg, push button4 plus down.

That would mean:

Mame's left left
======
button3 left OR
button4 down

mame's left right
======
button3 right

mame's right left
======
button3 left

mame's right right
======
button3 right OR
button4 down

Not tested, though.
Robin
Knowledge is Power

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:April 15, 2024, 10:59:21 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Actually I've got a bluetooth adaptor on order.  My idea for the tank game was simply to use a wiimote and nunchuck attachment along with a custom glove pie script.  Should work fairly well and you could even mount em if you are a stickler for authenticity. 


I'll let you guys know

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
LEFT TREAD UP
===============
KEYCODE_R NOT KEYCODE_U NOT KEYCODE_D OR
KEYCODE_U NOT KEYCODE_L NOT KEYCODE_R OR
KEYCODE_U KEYCODE_R...

Works.  (You had two minor cut and paste errors in the downs, not shown.)  And due to overlap, bold and italics in quote, you can actually simplify all of them as follows:

LEFT TREAD UP  (aka mame's "left up")
===============
KEYCODE_R NOT KEYCODE_D OR
KEYCODE_U NOT KEYCODE_L

RIGHT TREAD UP  (aka mame's "right up")
===================
KEYCODE_U NOT KEYCODE_R OR
KEYCODE_L NOT KEYCODE_D

LEFT TREAD DOWN  (aka mame's "left down")
====================
KEYCODE_R NOT KEYCODE_U OR
KEYCODE_D NOT KEYCODE_L


RIGHT TREAD DOWN  (aka mame's "right down")
=====================
KEYCODE_D NOT KEYCODE_R OR
KEYCODE_L NOT KEYCODE_U

(see my next post for corrections)

How about use two extra buttons?...Not tested, though.

Tested and it "works".  Playing on a keyboard actually wants be to forget the beg button and just use both left and right, changing what I said to:
Mame's left left
======
button3 left OR
left right

mame's right right
======
button3 right OR
left right

Still, rolling is not as easy for me as two sticks like the arcade.  (Of course, I may be "learned into my ways." :) )

edit: spelling, phrasing
edit 2: crossed out some stuff corrected in later post :-[
« Last Edit: January 17, 2007, 03:57:42 pm by u_rebelscum »
Robin
Knowledge is Power

chemame

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 107
  • Last login:January 26, 2007, 01:54:05 pm
  • I want to build my own arcade controls!
OK, all very interesting and I'm excited to try it out. Wish I wasn't seeing your reply so late tonight. Still, wife is going out for a bit tomorrow night, so I can test it all out.

Nice job on trimming down my redunant logic. You seem to have a really keen eye for that sort of thing, that's awesome.

Interesting about the cut & paste errors. I DID rearrange the what was written in the cfg file, just to make it more readable, and it's amazing that (a) you picked up on it and (b) caught such a paste error and knew it to be that. Thing is, maybe because it's so late or something... but I am not seeing it. What's my error? You know, it's quite possible I simply have faulty logic. Brain's been sitting idle since I got a cush coding job, you know.  :)

Che

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Nice job on trimming down my redunant logic. You seem to have a really keen eye for that sort of thing, that's awesome.

Interesting about the cut & paste errors. I DID rearrange the what was written in the cfg file, just to make it more readable, and it's amazing that (a) you picked up on it and (b) caught such a paste error and knew it to be that. Thing is, maybe because it's so late or something... but I am not seeing it. What's my error?

You're right, I'm wrong.  :-[ No typo on your part, just our mappings were a little different.  My mapping worked for me, but your's is more intuitive.

Your's still can be shorted, though.  Here's the two downs redone:

LEFT TREAD DOWN
====================
KEYCODE_L NOT KEYCODE_U NOT KEYCODE_D OR
KEYCODE_D NOT KEYCODE_L

RIGHT TREAD DOWN
=====================
KEYCODE_R NOT KEYCODE_U NOT KEYCODE_D OR
KEYCODE_D NOT KEYCODE_R


I got practice doing "raw 49-way" to 8-way remaps years ago.  Shading 3x3 boxes helps me.
Robin
Knowledge is Power

Djmadmic

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:July 07, 2021, 12:24:26 pm
  • I want to build my own arcade controls!
I know this post is really old but I'm trying to figure out how to add this code  for single joystick control to vindicator. My problem is I don't really know where to put it or how to type it out. I'm comfortable doing this type of stuff just need to be pointed in the right direction. If anybody that knows happens to see this please let me know. Thank you very much.

Splu

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:March 12, 2021, 03:48:15 pm
  • I want to build my own arcade controls!
The same question does not let me sleep.
You can find a hint at:
http://mirrors.arcadecontrols.com/easyemu/mameguidenew/mameguide-controlini.htm
You must open the following paths after a game session you played
for the target one.
(For example I played T.A.N.K., then exit and then configure MAME)
The eventual .ini file configuration should be declared in...
Alt-file >> Properties >> Controllers >> Default input layout >> Sample Controller file
Then push the button Alt-File >> Properties >> Controllers >> Select Joystick Map
It seems that the file extension be .txt or .map (does not matter actually)

But that will require a MameUI32.exe of 2009
Maybe you can find a copy at:
http://old-releases.ubuntu.com/ubuntu/pool/universe/m/mame/
« Last Edit: March 12, 2021, 03:42:11 pm by Splu »

DarthMarino

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 565
  • Last login:Today at 06:46:13 am
I made this video a while back that should cover all tank controls in MAME. The way I did the Vindicators on a single stick is different than what's listed above. To map the "or" commands, just map one button, press enter again and map the other. I hope this helps.