Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / AGK Joystick

Author
Message
7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 8th Oct 2012 11:04
Hi,
we are ready to release our game but we are still not happy about the control system AppGameKit offer, anyone wrote a different control ? The virtual joystick work very bad and i would like to know how many game had been released without change the joystick and if people wrote something in the review.

I'm not looking for amount of sale or similar but i'm curious to know if a game had a decent amount of unit sold how many are the comment about the control.

We are really upset about this because if we need to code our new joystick we need to delay the game a lot on mobile devices and tablets.

I really appreciate much if someone can suggest or have a different solution or a way to improve the internal joystick.

The response of it seem to be very poor, if you make it smaller it lose the focus pretty easy and soon, if you make it a bit bigger is difficult to control. Our character just use 2 directions, left and right but with buttons is bad more, any idea ?

Thanks a lot.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Oct 2012 11:25
I haven't really used it much myself but coding your own version is not so hard. That way you can decide when it loses focus or whatever you like really.

All you need are two sprites. Detect if the joystick is hit when you get a new touch event and keep track of the distance between the current touch position and the start touch position. Then you just need to limit the distance of the joystick control from the background.

I don't have any code as I haven't needed to make one yet but if I get time I'll do a quick example tonight maybe... I have a bad cold though so I might end up going to bed instead but if I make one I'll post an easy set of functions to use here for you. Personally I would do it myself if I were you.


this.mess = abs(sin(times#))
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 12th Oct 2012 18:20
I have never liked the standard virtual joystick as is, but find it more useable if you play about with some of the settings. For instance most examples I have seen are analog so it can be a bit sluggish as you say to respond. Changing to digital on of off, 1 or 0 makes it far better. You can also adjust the dead zone to work better. An on screen joystick is never ideal, but there aren't many other ways on mobile phones. I have used the accelerometer in Moon Snaker as well as the joystick option for instance.

I would like to see support for some of the joypad addons for iphone and android as they would make shooters and any arcade games way better.

MarcoBruti
13
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 12th Oct 2012 18:50
my advice is to use virtual buttons, if your need is a digital joystick: left button to the left and right button to the right.
Native AppGameKit Joystick do not work well at all.
Or, using virtual buttons, create a joypad similar to Nintendo DS or Wii one, putting 4 buttons in a cross position.
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 12th Oct 2012 23:52
The virtual joystick is common between all platforms even if not programmed with agk. For good quality response you better make the joystick range small enough.

Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 13th Oct 2012 03:09
I moved to 8 virtual buttons for control. i set it up to move one grid space just like a board game.
7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 13th Oct 2012 20:38
@DVader, how i can set the Joystick in digital ?

@basjak, you mean the dead zone ?

@Kobaltic, you made it in t1 or t2 and it work really well ? i don't need analog but i always worry about the space between buttons, im a real pad like for DS you yeas put the finger but after you move, in touch just after the positioning of the finger you already get all pressure. Do you can share an example code ?
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 15th Oct 2012 19:26
I made it in T1. It works perfect. I can get some code together over the next few days.
7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 15th Oct 2012 22:31
Thanks a lot.
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 16th Oct 2012 20:29
In the main loop I call this function to check direction. This should be a select statement and not a bunch of if statements I am working on changing it over.



Here is the setup


in the main loop:



Here is the main movement with some notes. I was told I shouldn't have this running in a sub loop but I don't know how else to do it and it works great. This is only two directions you repeat for the rest and just change the X/Y for direction.

7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 16th Oct 2012 21:43
Thanks , i will convert to t2 and check it..
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 17th Oct 2012 16:14 Edited at: 17th Oct 2012 16:15
@7RS, simply use something like.

if getjoystickx()>0
x=x+1
endif
if getjoystickx()<0
x=x-1
endif

This then works like a digital stick on the left and right, rather than using the exact analog output such as 0.1 to 1,-0.1 to -1. Obviously the same goes for the y axis. You can also use the setjoystickdeadzone command to give a little leeway between switching from left and right also.

Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 17th Oct 2012 19:57
Quote: "if getjoystickx()>0
x=x+1
endif
if getjoystickx()<0
x=x-1
endif
"


Even simpler as a boolean expression.


Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 17th Oct 2012 20:09
A minor mod for less core work:


The expression "GetJoystickX()>0" is not guaranteed to return exactly one or zero. If you want to use the boolean shorthand you need to do the full syntax "<bool test> ? <if true> : <if false>".

Cheers,
Ancient Lady
AGK Community Tester
7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 17th Oct 2012 21:05
@DVader, i have tried this long time ago but the result i had wasn't good enough, maybe i have to try again and make some new tests. the game now is ready and i should found a solution for the controls.

Thanks.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 17th Oct 2012 21:56
@ 7RS, I use it in Obliteratpr for movement and it is the best I have had so far for control using the joystick provided with AGK. Either of the other variants should do the same job I think, I just quickly typed up that example as an idea. I also have a bigger radius for the joystick than the image size so it is easier to use also. The standard setting is flaky imo.

@Ancient Lady, it just checks if the joystick is above 0. It matters not whether it is .1 or .9 It works the same either way because the code then treats it as 1 or -1. It only needs to be above or below 0.

7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 3rd Nov 2012 16:41
@ DVader, how you change the radius of the AppGameKit joystick ?

http://www.7ravenstudios.com
https://www.facebook.com/pages/7-Raven-Studios/102567824318?ref=hl
https://www.facebook.com/groups/391126020940838/
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 3rd Nov 2012 21:35
Simply use SetVirtualJoystickSize( index, size ) with the size you want for the joystick to respond. Then make the image of the joystick outer smaller than the original, you must have a larger clear border, or it will just scale up to the joystick size. You can do the same for the inner if you want also.
This way you are checking further out than the actual image suggests (joystick size), because of the larger border on the graphic. Giving it a bit more leeway than the standard set up. That was the only way I could think of to improve what was there beyond investigating a different method. It works ok on my phone, and is less easy to lose than standard.

7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 4th Nov 2012 17:44
ohhh ok, is a trick... understood. thanks.

http://www.7ravenstudios.com
https://www.facebook.com/pages/7-Raven-Studios/102567824318?ref=hl
https://www.facebook.com/groups/391126020940838/

Login to post a reply

Server time is: 2024-11-24 01:18:57
Your offset time is: 2024-11-24 01:18:57