Page 1 of 2

Twin stick mod and FULL XBOX controller support

Posted: 24 May 2018, 22:44
by Dege
Hi all, in the last weeks, since the last MISI release I worked on a Twin stick mod for GTA2 (like the controls of games like Hotline Miami), and now the work is complete!
This first release contains only a modified MISI.ASI and an alternative_controls.lua script.
To use it you should:
-install MISI
-replace MISI.ASI in the gta2 directory with the one in this release
-insert the alternative_controls.lua script in the scripts directory
-plug an XBOX controller in your PC and play!


The controls are:
A - Jump - brake in car
B - Enter/Exit car
X - Shoot/Punch - Brake in car
Y - Special 1: Car Horn
LB - previous weapon
RB - next weapon
LT - unused (maybe I'll use it to change radio station)
RT - Shoot/Punch - Brake in car
Back - Special 1: Car Horn
Start - exit menu - to confirm use the A button, to stay in game press B or Start again
Left Stick/D-pad - walking direction of the character - in a car works like the normal controls
Left Stick Click - Special 2: you can use the stick movements to control the effect of the special 2 command
Right Stick - direction of bullets

In the next days I'll release the source code, a standalone ASI and some videos.

Thanks to all the awesome reverse engineers that published offsets on this forum, in particular thanks to:
Sektor - various offsets and really useful answers to other users on the forum
robotanarchy - for the input offsets and for the idea of a twin stick mod for GTA2
Logofero - for the awesome library that he wrote, for the source code of the library and for a little bit of support in PM
without MISI.ASI I would never have even tried to make this mod

Let me know how it works, and if you have any suggestions or bug reports!


Update 2018-07-09:
I've released the sources of the mod and you can download them here: http://gtamp.com/forum/download/file.ph ... ew&id=1891

Re: Twin stick mod and FULL XBOX controller support

Posted: 25 May 2018, 05:07
by Logofero
If I had a controller I would check it but it's not. I can only imagine.

Good job. Especially for lovers of joysticks is very useful.

Also you can add a display resolution setting. Author ThirteenAG provided the sources in the repository https://github.com/ThirteenAG/Widescree ... llmain.cpp

This is for all MISI users:

Just want to mention. When using MISI.ASI, you do not need to download ASI Loader. Some authors have a tendency without permission to send statistics on the use of the plugin on the Internet resource of its author. MISI never collected statistics. Moreover, I am against the connection of local libraries connecting as demons with the servers of the software authors. Do not use ASI Loader, you do not need it.

Re: Twin stick mod and FULL XBOX controller support

Posted: 27 May 2018, 07:21
by Sektor
It works nicely on foot, circle strafing is fun!

Re: Twin stick mod and FULL XBOX controller support

Posted: 09 Jul 2018, 13:34
by Dege
I've released the sources of the mod and you can download them here: http://gtamp.com/forum/download/file.ph ... ew&id=1891

Re: Twin stick mod and FULL XBOX controller support

Posted: 03 Aug 2018, 06:44
by Devastator
I'm definitely gonna have to check this out if I can get a 360 controller set up with my laptop. Been looking at some of the maps I quit working on last year & definitely want to get back into scripting & map design when viable, & given that my maps aren't meant to play like a practical GTA2 death match something like this could be fun for a map, does this work for multiplayer?
& so it's fair to assume this allows the player to strafe / tank strafe? Man the potential for this sounds pretty awesome.

Re: Twin stick mod and FULL XBOX controller support

Posted: 03 Aug 2018, 07:05
by Dege
Devastator wrote:I'm definitely gonna have to check this out if I can get a 360 controller set up with my laptop. Been looking at some of the maps I quit working on last year & definitely want to get back into scripting & map design when viable, & given that my maps aren't meant to play like a practical GTA2 death match something like this could be fun for a map, does this work for multiplayer?
& so it's fair to assume this allows the player to strafe / tank strafe? Man the potential for this sounds pretty awesome.
I don't know what the clients communicates to the server during multiplayer. If they send the keypresses, this will not work (but a limited version without the aim stick separated from the walk stick could be made), if the clients just sends raw player objects and bullets it could be modified to work fully in multiplayer as well.

At the moment with a controller you will always strafe while walking and always tank controlling while driving.

If you get that controller let me know how it works for you ;-)

EDIT:
In alternative if it's possible to transfer data between clients by some side channels it's possible to get the full support even with only the keypresses commands sent.

Re: Twin stick mod and FULL XBOX controller support

Posted: 24 Aug 2018, 15:55
by Cuban-Pete
It worked right away, nice work! and better than 'built-in' controller support. Thanks! :)

But to be honest it plays a bit weird and looks also a bit weird when aiming with right joystick. Entering a car did not always work/trigger. Also once in the car one cannot push on gas and steer at the same time... which does work with arrow keys.

Is it possible to have different controls when in the car? Maybe left joystick for gas/brake and right joystick for steering...

Edit: Also somehow I find Y more logical for entering a car. Most games (newer GTA) use that.

Re: Twin stick mod and FULL XBOX controller support

Posted: 24 Aug 2018, 17:27
by Cuban-Pete
I made you an icon for the program script. Don't know why, just wanted to play with GTA2 icons again. Hope you like it.
TwinStick3.png
TwinStick3.png (13.64 KiB) Viewed 46668 times
Edit: This bloody new 4k screen makes pixel graphics (like GTA2) look ugly and its hard to get correct 'look'.

Re: Twin stick mod and FULL XBOX controller support

Posted: 26 Aug 2018, 11:04
by Dege
Cuban-Pete wrote:It worked right away, nice work! and better than 'built-in' controller support. Thanks! :)

Thank you for your kindly words and for your feedback!

But to be honest it plays a bit weird and looks also a bit weird when aiming with right joystick.

How do you suggest that the right thumb-stick aim can be made better, and what are the issues for you?

Entering a car did not always work/trigger. Also once in the car one cannot push on gas and steer at the same time... which does work with arrow keys.

Is it possible to have different controls when in the car? Maybe left joystick for gas/brake and right joystick for steering...

I totally agree with you on car controls, I feel like the cars are even more difficult to control than the base game!
I'm not a big fun of racing games, but I'll look into how modern top down racing game manage their controls schemes to draw inspiration :D (and I'll also try with your suggested control scheme)


Edit: Also somehow I find Y more logical for entering a car. Most games (newer GTA) use that.

I admit that I picked some controls very randomly and I have no issue with changing them in a future release, so if you find something else not working nicely feel free to give your feedback ;)



I made you an icon for the program script. Don't know why, just wanted to play with GTA2 icons again. Hope you like it.

Thank you for the icon! I'll surely use it for the first standalone version!

Re: Twin stick mod and FULL XBOX controller support

Posted: 27 Aug 2018, 08:57
by Cuban-Pete
I think one of the issues is with the animations. If you walk a direction and aim the other way, the character is floating and gives a feeling of disconnection with the game ('realism' is gone).

I played in the old days besides offline also some time online and there you have 'walking illusion' with for example the rocket launcher or with throwing molotov cocktails. The "walking illusion" (thanks to animation) of going a direction and suddenly changing direction (going backwards with a turn for example) and shooting a rocket was a big part of the game mechanics (for online anyway).

Maybe just using the left joystick for walking forward/backward (like up and down key) and using the right joystick for looking left/right (like left and right arrow key) will work, but I'm not sure and perhaps isnt the 'twin stick' you imagined.

I don't know, I just really your idea of good (xbox) game control support and a new way to control the game, but I also like to stay with 'old school'. :)

How were the controls on all the different console gta2 versions? (never really played it on console)

Re: Twin stick mod and FULL XBOX controller support

Posted: 27 Aug 2018, 22:33
by Dege
Cuban-Pete wrote:I think one of the issues is with the animations. If you walk a direction and aim the other way, the character is floating and gives a feeling of disconnection with the game ('realism' is gone).

I played in the old days besides offline also some time online and there you have 'walking illusion' with for example the rocket launcher or with throwing molotov cocktails. The "walking illusion" (thanks to animation) of going a direction and suddenly changing direction (going backwards with a turn for example) and shooting a rocket was a big part of the game mechanics (for online anyway).

Maybe just using the left joystick for walking forward/backward (like up and down key) and using the right joystick for looking left/right (like left and right arrow key) will work, but I'm not sure and perhaps isnt the 'twin stick' you imagined.

I don't know, I just really your idea of good (xbox) game control support and a new way to control the game, but I also like to stay with 'old school'. :)

How were the controls on all the different console gta2 versions? (never really played it on console)
On console the controls were tank controls for driving and for the player. And that's the reason I decided to mod the game instead of playing the game on my PSP :D

Re: Twin stick mod and FULL XBOX controller support

Posted: 28 Aug 2018, 21:23
by Drury
This makes combat much more fun, great mod!

Here's my suggestions for more intuitive bindings (in Foot/Vehicle format):

A - Jump/Handbrake
B - Attack/Attack
X - Special 2/Special 2
Y - Enter/Exit Vehicle
LB - Previous Weapon/Previous Weapon
RB - Next Weapon/Next Weapon
LT - Special 2/Brake
RT - Attack/Accelerator
LS - Walk Direction/Steer Vehicle (horizontal input only)
LS Click - Special 1/Special 1
D-Pad - Walk Direciton/Steer Vehicle (horizontal input only) and Change Radio (vertical input only)
RS - Aim/Tank Turret Control? Could you make this happen?
Back - Quit (Esc)
Start - Pause (F6)

I had a look at your source code but I couldn't make the heads or tails of it... I'm not great with computers :D

Re: Twin stick mod and FULL XBOX controller support

Posted: 29 Aug 2018, 13:21
by Dege
Drury wrote:This makes combat much more fun, great mod!

Here's my suggestions for more intuitive bindings (in Foot/Vehicle format):

A - Jump/Handbrake
B - Attack/Attack
X - Special 2/Special 2
Y - Enter/Exit Vehicle
LB - Previous Weapon/Previous Weapon
RB - Next Weapon/Next Weapon
LT - Special 2/Brake
RT - Attack/Accelerator
LS - Walk Direction/Steer Vehicle (horizontal input only)
LS Click - Special 1/Special 1
D-Pad - Walk Direciton/Steer Vehicle (horizontal input only) and Change Radio (vertical input only)
RS - Aim/Tank Turret Control? Could you make this happen?
Back - Quit (Esc)
Start - Pause (F6)

I had a look at your source code but I couldn't make the heads or tails of it... I'm not great with computers :D

Thank you for the suggested modifications to the control scheme, everything should be really easy to implement, except for the Tank Turret Controls on the right stick.
I'll surely implement even that one because I find it a really neat idea!

In the next days I'll probably release a version with an alternative control scheme to use.
For the turret controls I'll need some more time to find the right offsets to use ;)

Re: Twin stick mod and FULL XBOX controller support

Posted: 01 Jun 2020, 18:54
by TempUser_
Am I right that updated configuration layout wasn't uploaded after all?
Previously I asked for mouse aim/look in another thread, but once I got gamepad I play games mostly with it, and GTA2 with this mod runs surprisingly well. Only layout is different from what are used to experience in games from 3d era.

Re: Twin stick mod and FULL XBOX controller support

Posted: 03 Jun 2020, 10:25
by Dege
Yep, I totally forgot to implement it, I can probably do it this weekewnd. If you have particular requests for the controls feel free to ask ;)

Re: Twin stick mod and FULL XBOX controller support

Posted: 03 Jun 2020, 15:36
by TempUser_
Dege wrote: 03 Jun 2020, 10:25 Yep, I totally forgot to implement it, I can probably do it this weekewnd. If you have particular requests for the controls feel free to ask ;)
I hope this time "probably" wont mean another 2 years of waiting. :D

Re: Twin stick mod and FULL XBOX controller support

Posted: 13 Aug 2020, 09:27
by Dege
I've altered the lua script according to the control map suggested by @Drury, here (
twin_stick.7z
The updated lua script with the new gamepad control scheme.
(2.2 KiB) Downloaded 972 times
) you can download the updated lua file that you can use to replace the original one. Unfortunately I forgot the gamepad at home, so the script is untested, let me know how it works.

Re: Twin stick mod and FULL XBOX controller support

Posted: 15 Aug 2020, 11:27
by TempUser_

Code: Select all

[15.08.2020-14:23:23] Total scripts loaded: 1 of 2000
[15.08.2020-14:23:23] * LUA Script (0) G:/Games/GTA.2/scripts/twin_stick.lua loading...
[15.08.2020-14:23:23] ERROR in LUA script: G:/Games/GTA.2/scripts/twin_stick.lua:327: 'end' expected (to close 'if' at line 53) near <eof>
[15.08.2020-14:23:23] * LUA Script (0) G:/Games/GTA.2/scripts/twin_stick.lua unloaded.
[15.08.2020-14:23:30] **** MISI library: G:\Games\GTA.2\MISI.ASI unloaded.
FIXED.
LUA script needs few additional "ends" in radio section.
This is how that block should look like.
Image

Only currently looks like there are problems with reverse driving.
Once in a car, you press LT to brake, but once stopped, car refuses to drive in reverse gear.
It sounds like car is revving up engine, while car is in neutral gear.

Re: Twin stick mod and FULL XBOX controller support

Posted: 24 Aug 2020, 18:56
by Dege
Thanks, I was programming in python that week and totally forgot to close the ifs :D
I fixed them and the car reverse. Now it's tested but let me know if you find any other issue ;-)

Re: Twin stick mod and FULL XBOX controller support

Posted: 25 Aug 2020, 19:04
by TempUser_
No issues so far, but I play only for short periods.

Minor issues were:
1) sometimes once game is started, script sometimes does not load (LOGS show that main MISI is being unloaded, so same applies for stick mod).

Code: Select all

[25.08.2020-21:58:15] **** MISI library: G:\Games\GTA.2\MISI.ASI loaded.
[25.08.2020-21:58:15] Total scripts loaded: 1 of 2000
[25.08.2020-21:58:15] * LUA Script (0) G:/Games/GTA.2/scripts/twin_stick.lua loading...
[25.08.2020-21:58:30] **** MISI library: G:\Games\GTA.2\MISI.ASI unloaded.
Once game is restarted it runs correctly.

2) Probably this thread's MISI is slightly outdated and maybe this is the reason why first problem appears.
Recently I tried to run "latest" MISI version, and seems like it blames mod's code syntax.

Code: Select all

[25.08.2020-22:11:37] * LUA Script (0) G:/Games/GTA.2/scripts/twin_stick.lua loading...
[25.08.2020-22:11:37] ERROR in LUA script: G:/Games/GTA.2/scripts/twin_stick.lua:220: attempt to call a nil value (global 'GetXInputAxes')
[25.08.2020-22:11:37] * LUA Script (0) G:/Games/GTA.2/scripts/twin_stick.lua uloaded.
[25.08.2020-22:11:45] **** MISI library: G:\Games\GTA.2\MISI.ASI unloaded.
3) With current non-latest MISI mod, once you are in game, when user quits to menu, sometimes I don't get into menu, but level restart happens.
Feels like once I press (A) to confirm quit, menu should appear, but even if it appears I automatically select option (Replay previous area), and I'm back to game.
And when this happens movement controls refuse to work, and player runs only upwards.
Image