Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Kinoko on Fri 24/09/2004 04:08:22

Title: SUGGESTION: Joystick compatibility
Post by: Kinoko on Fri 24/09/2004 04:08:22
Joystick/controller pad compatibility - Because I don't really understand how it works, I'm only suggesting it if it's not something incredibly complicated. It's not necessary at all but just something that I think would be a nice feature. I notice only one person (that I can find) has asked about it before and only got a very short answer so I didn't know if there was any particular reason this wasn't implimented yet.
Title: Re: SUGGESTION: Joystick compatibility
Post by: Gilbert on Fri 24/09/2004 04:49:22
Yeah it's brought up several times before, but I think the problem was that it didn't draw enough people's attention, afterall it was intended for making point and click adventure games. But it would be cool if joystick support is added.
Title: Re: SUGGESTION: Joystick compatibility
Post by: Phemar on Fri 24/09/2004 06:40:47

In a sense the joystick would only really be used to control the character, unless you used it to move the mouse around, which would be rather unpractical.
Title: Re: SUGGESTION: Joystick compatibility
Post by: Gilbert on Fri 24/09/2004 06:49:14
Well actually as far as I remember (I can be wrong), you can config some of teh SCI games to move the cursor via keyboard or joysticks, it's crap but vintage fun.

Anyway, allowing joystick controls can help in action sequences, etc.
Title: Re: SUGGESTION: Joystick compatibility
Post by: Gregjazz on Fri 24/09/2004 06:54:34
Joystick ability would be cool, but I think it's a bit too specific to be put into AGS. It is "Adventure Game Studio", after all.

If anything, maybe someone could come up with a plugin for you.
Title: Re: SUGGESTION: Joystick compatibility
Post by: Gilbert on Fri 24/09/2004 07:10:19
Well it just add more capabilities to the engine. I think it's not a good idea to make such basic stuffs a plugin, as it's not really that difficult to add (I think), moreover, plugins are teh EVIL beasts that break compatibilities.
Title: Re: SUGGESTION: Joystick compatibility
Post by: Pumaman on Sat 25/09/2004 23:00:35
This has been discussed before; the general feeling was as Gilbot and Geoffkhan have said, that it was not really necessary functionality for an adventure game engine. Although it could be handy for a couple of minigames, the vast majority of players wouldn't use a joystick in an adventure game.
Title: Re: SUGGESTION: Joystick compatibility
Post by: Kinoko on Sun 26/09/2004 12:03:35
Understood ^_^ Again, it's not like my game will suffer for it, I was just curious.
Title: Re: SUGGESTION: Joystick compatibility
Post by: darkx5 on Mon 04/04/2005 18:10:58
ok so how it is done i wanna make a game that can use a controler or a mouse
Title: Re: SUGGESTION: Joystick compatibility
Post by: strazer on Mon 04/04/2005 18:14:35
Joystick control is not directly possible at the moment. I think there are some programs out there that can translate joystick movements to keyboard keys. Try your favorite search engine.

And as CJ said, it won't be natively supported. I guess in theory someone could write a plugin.
Title: Re: SUGGESTION: Joystick compatibility
Post by: darkx5 on Mon 04/04/2005 18:17:57
ok so were do i go to learn how to make & write plug ins?
Title: Re: SUGGESTION: Joystick compatibility
Post by: strazer on Mon 04/04/2005 18:26:20
The plugin API is explained here (http://www.adventuregamestudio.co.uk/acplugin.htm).
I don't think it's a trivial task and you'll have to have some programming experience.
I'm no programmer so I can't help you there. Maybe some plugin authors care to chime in?
Title: Re: SUGGESTION: Joystick compatibility
Post by: Rui 'Trovatore' Pires on Mon 04/04/2005 19:18:52
QuoteI think there are some programs out there that can translate joystick movements to keyboard keys. Try your favorite search engine.

Hmmm, this does interest me - I always liked experimenting, and making an adventure game which can be played via joystick à  la Grim Fandango (only not 3D) is... interesting. But I couldn't find any program, because I didn't know what to search *for*. "Joystick to keyboard" is the only thing I could think of, and I got zero relevant results...

EDIT - ...meaning, can anyone help me find it? Or at least suggest different ways to word the search?
Title: Re: SUGGESTION: Joystick compatibility
Post by: Pumaman on Mon 04/04/2005 20:51:42
It'd be interesting to add joystick support to AGS at some point; as Gilbert says, it's extra functionality that can't hurt, and the older Sierra games did allow you to use a joystick.

However, it's low low low priority, plus the fact I don't have a joystick would make it rather difficult :P
Title: Re: SUGGESTION: Joystick compatibility
Post by: strazer on Mon 04/04/2005 21:27:18
Tracker'd: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=518
Title: Re: SUGGESTION: Joystick compatibility
Post by: on Tue 05/04/2005 00:40:01
Quote from: Rui "Frank-N-Furter" Pires on Mon 04/04/2005 19:18:52
QuoteI think there are some programs out there that can translate joystick movements to keyboard keys. Try your favorite search engine.

Hmmm, this does interest me - I always liked experimenting, and making an adventure game which can be played via joystick à  la Grim Fandango (only not 3D) is... interesting. But I couldn't find any program, because I didn't know what to search *for*. "Joystick to keyboard" is the only thing I could think of, and I got zero relevant results...

EDIT - ...meaning, can anyone help me find it? Or at least suggest different ways to word the search?

http://www.softwarevault.com/Download/JoystickCursor-Control-Tool-Download
Title: Re: SUGGESTION: Joystick compatibility
Post by: Ashen on Tue 05/04/2005 00:48:44
quintaros beat me to it, but:
I Google-d the phrase "translate joystick movements to keyboard key (http://www.google.co.uk/search?q=translate+joystick+movements+to+keyboard+keys&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-GB:official)", and came up with a couple of results, of which this one (http://atzitznet.no-ip.org/Joy2Mouse3/index.html) (via Tucows.com) was most immediately promising. Most of the others look like pay programs, or even hardware.
Title: Re: SUGGESTION: Joystick compatibility
Post by: Rui 'Trovatore' Pires on Tue 05/04/2005 07:27:25
Ah, thank you so very much! Now I can finally perfect my template. I don't suppose anyone remembers it, it's quite old and experimental and had graphics from Police Quest 2 and you controlled the player via mouse movements, not the mouse cursor? ANyway, I COULD have done it with keyboard keys (and will have to program in keyboard keys anyway, of course), but a joystick is SO much nicer! Maybe I can even make a "Shadow of the Comet" template...? ::) (BTW, I NEVER got the mouse to work on that game, and always wished I had a joystick back THEN. :P )

EDIT - Ok, I'm doing it, and I'm having a lot of fun! I'd just like some feedback. How does this sound for the average 2-button joystick?

Things are somehow marked when the player is near them (BS3-style stars?).

Up, down, left, right:
--Normally moves character
--In INV, changes between selected items and "save/load" general options*
--In action-list, change between the actions

Primary button:
--Brings up a list of actions to be done: "Look at thing, talk to thing", etc.
--In action-list, choose one such action
--In INV, choose an item OR an option
  --Inv items also have ACTION lists
--If an INV item is being carried, try to use it on the current thing


Secondary button:
--Toggles the INV/MENU screen on/off. This menu includes the INV and all game options: Save, Load, Restart, Quit, and More Options (volume, speed, and whatnot go in a separate screen).
--If an INV item is being "carried", remove it

*I know it sounds iffy, but I've got a good layout planned, methinks

How does this sound? Like a nice interface? Any suggestions? Incidently, it's child's play to add "Configure Joystick: 2/4/6" buttons and such, so don't pick on that. :=
Title: Re: SUGGESTION: Joystick compatibility
Post by: GarageGothic on Wed 06/04/2005 16:58:11
Who uses joysticks these days anyway, except for flight sim geeks? Aren't gamepads a lot more common? I would probably never use the option, but full gamepad support would be an intersting addition. With two thumbsticks you could add ultimate confusion, with one controlling the cursor and the other controlling the character :)
Title: Re: SUGGESTION: Joystick compatibility
Post by: Dan2552 on Wed 06/04/2005 23:21:50
a gamepad and joystick are the same to the system (except the drivers and stuff...)

adding joystick to AGS would also add gamepad

just, if AGS does ever have joystick support - make your games have keyboard support too!!!
Title: Re: SUGGESTION: Joystick compatibility
Post by: Rui 'Trovatore' Pires on Thu 07/04/2005 01:41:44
QuoteWho uses joysticks these days anyway, except for flight sim geeks? Aren't gamepads a lot more common?

Like I said, it's easy to make it use more buttons, and what's a joystick if not a gamepad with more buttons, as far as the computer is concerned?

Quotejust, if AGS does ever have joystick support - make your games have keyboard support too!!!

That's the beauty of the programs Ashen and quintaros have been so generous as to look for. :) It's programmed in keyboard, and also available as gamepad.
Title: Re: SUGGESTION: Joystick compatibility
Post by: Blaquesmith on Sun 25/07/2010 22:09:42
I know this is from looooooong ago, but... anyone gave this issue further consideration?

Gamepad support could be very handy, since modern pads have 8+ buttons AND the direction keys, which could mean that you can have many actions just in the pad, with no need for a GUI at all, and you could have a big game screen with a full background (I'm thinking the 1024x768 resolution, wich is the maximum that AGS supports, but if it was ever scaled up, it'll look even better.)

In my case, i have a PS2 gamepad hooked to an USB adaptor. I get 4 directions and 12 buttons in digital mode, and 4 directions, 12 buttons and 2 analog joysticks in the analog mode. I could have the 9 basic SCUMM commands, plus main menu, inventory, and game log buttons. I think it could be really handy.
Title: Re: SUGGESTION: Joystick compatibility
Post by: GarageGothic on Sun 25/07/2010 22:36:28
How ironic to see my own reply from five years ago. Ah, but what would youth be without its foolish arrogance? At the moment I'm actually I'm hoping to implement gamepad support myself through a plugin - eventually that is, it's quite far down on my priority list. But it's definitely possible, most standard C++ libraries like Allegro and SFML have functions to poll various input devices, so passing that info to the game through the AGS plugin API shouldn't be that big a deal (I'm sure I'll eat those words once I try it myself ;)).

Not sure how well analog stick control would go together with AGS' walk animations though (since you can't change walking speed while the character is moving), so you'll have to write your own animation code if you want variable speed depending on analog input. BTW, mapping 9 SCUMM commands to buttons sounds quite confusing - personally I would try to reduce it to four interactions (mapped to the cross, circle, square, triangle buttons) and handle inventory switching with the triggers.
Title: Re: SUGGESTION: Joystick compatibility
Post by: Shane 'ProgZmax' Stevens on Mon 26/07/2010 02:21:25
Since ags is using directx CJ would need to open up directinput so you could write a hook function to the controller.  It wouldn't take much effort at all once this was done, just a few wrapper functions in a module script to access the computer hardware and poll the gamepad and allow the user to load and edit the button/hat/analog/trigger values.  I suggested this ages ago and would love to see it happen but it's nowhere near a priority since it's not strictly an 'adventure game' feature.  There are some third party programs that will let you do this (like JoyToKey) but I have found them to be pretty clunky and prone to issues like losing focus on the inputs.
Title: Re: SUGGESTION: Joystick compatibility
Post by: Wonkyth on Mon 26/07/2010 09:26:20
Since C# is now an option, using XNA for gamepads would be easy.
Title: Re: SUGGESTION: Joystick compatibility
Post by: Wyz on Mon 26/07/2010 16:09:01
Actually I was already working on a plug-in, it's nearly done :D