Post new topic    
Chemical Slime
Send private message
buttons on android/mobile 
 PostSat Apr 22, 2017 7:56 am
Send private message Reply with quote
how do buttons work on android/mobile?

On the wiki it states:

"The Android port overlays a virtual gamepad on the screen consists of up, down, left, right buttons on one side and between zero and six buttons on the other which can be mapped to keyboard keys of your choice."

I want to add buttons.
How does one do this?

EDIT
How does diagonal input work on a touch-screen? Well?
Metal King Slime
Send private message
 
 PostSat Apr 22, 2017 8:43 am
Send private message Reply with quote
To change the button mappings, go to General Game Data -> Platform-specific options, and change the Phone/Tablet virtual gamepad options.

Moving diagonally might require pressing two arrows keys at once, requiring a multi-touch device. Or maybe not, I don't know. Try it.
Liquid Metal King Slime
Send private message
 
 PostSat Apr 22, 2017 1:26 pm
Send private message Reply with quote
Diagonal movement just means touching the space between two arrow keys. They both get activated.

You can see it in action by playing one of the ohrrpgce games already in the app store.
Chemical Slime
Send private message
 
 PostMon Apr 24, 2017 7:30 am
Send private message Reply with quote
Thanks guys!

When I play OHRRPGCE games on my tablet, it looks blurry!
Is there a reason for this? Can it be changed? Could an end-user toggle this, for example?
Metal King Slime
Send private message
 
 PostMon Apr 24, 2017 8:25 am
Send private message Reply with quote
I guess you're talking about the upscaling of the graphics. How bad is it? I was originally worried about it, but at least on my own phone, which has a 320x240 screen, the upscaling only affects every 5th row of pixels, and is rather difficult to notice and probably looks better than nearest-neighbour interpolation would. Maybe on a high-resolution device it's a completely different story.

There's currently no option to switch to nearest-neighbour interpolation, but it would probably be possible to add one if needed.
Slime
Send private message
 
 PostMon Apr 24, 2017 11:56 am
Send private message Reply with quote
Button placement and scaling should be an option for the end user if the dev enables it. At least have a few options and support vertical screen orientation. I tried to play Vikings and the dpad covers the character portraits. It didn't respond anymore after the first few text boxes but that's probably another issue.

I'd really like a 1:1 scaling option and a Game Boy looking overlay.
Metal King Slime
Send private message
 
 PostMon Apr 24, 2017 2:33 pm
Send private message Reply with quote
Hello;
An option for users? Do you mean something that can be added to the game's main menu, like Fullscreen/Windowed and Volume? Or something that lives in a separate engine builtin menu? (The SDL Android port does actually have an options menu, displayed before the game starts, which we disable since not many of the options are appropriate and it looks awful to put a config menu there.)

Displaying an overlay on the screen would be easy, but then we would need to make the effective position of the buttons match where they are drawn on the overlay, which could be a pain.

Allowing vertical orientation and using 1:1 scaling are things that can be enabled when packaging the app, by editing a config file. I think they might also be options in that SDL config menu. Creating a way to toggle them at run-time is not very trivial.

There is a setting in the Platform-specific options menu called "Touch Textboxes", which causes the on-screen gamepad buttons to disappear when a textbox is up. I don't know why this is off by default, but as can as I can tell (James implemented this), all OHR RPGs will want to turn it on. I assume you just downloaded the regular copy of Vikings, which was never adjusted for Android (which probably just requires turning on this one setting).

I strongly dislike having the buttons overlaying the screen; if you have a phone or tablet with a large screen then it would certainly make sense to devote screen space to the buttons, or maybe a way to hide them. Which should definitely be player options, since we can't easily tell if it's appropriate.
Liquid Metal King Slime
Send private message
 
 PostMon Apr 24, 2017 3:10 pm
Send private message Reply with quote
Welcome, Rogissidor!

I think the quality of the scaling varies from phone to phone and tablet to tablet. It looks pretty good on my devices (not particularly blurry) but I have only tested a few different devices

I would love to make the positions of the buttons and virtual gamepad customizable in the game-- but I have not yet figured out how exactly they work in sdl-android. I don't think sdl-android is currently capable of changing them at runtime, I think they can only be changed at build-time (and I haven't figured out that yet either). I think that sdl-android had a half-finished re-write of virtual gamepad customization, which got abandoned, or something, because a lot of the virtual-gamepad related code that I was able to find seemed to do nothing when I tried modifying it.

Yes, the "Touch Textboxes" feature should probably be turned on by default, as well as the option to hide the virtual gamepad when suspendplayer is active (which gets ignored when a script is checking keypresses)

I did not turn them on previously because they needed more testing, but I think they are probably tested well enough now that they are safe to be default.
Chemical Slime
Send private message
 
 PostMon Apr 24, 2017 11:39 pm
Send private message Reply with quote
I think I asked this before but: can slices appear outside of the screen bounds?
For example, to create a frame?

EDIT
Yeah, I tried playing Void Pyramid on my tablet, and it looks really blurry!
And it has no display options!
It'd be good to have options for mobile users to sort out their screen issues, such as resolution, orientation, padding, button placment, scaling etc.,

EDIT
On a similar note, would it be possible to have map movement via clicking?
I made a script that allows a hero to move into an adjacent tile when it is clicked, but I think actual pathing would be too complicated and intensive. Could we have something, like, how NPCs chase the player, but instead for a hero to walk to a clicked tile?
Red Slime
Send private message
 
 PostTue Apr 25, 2017 12:09 am
Send private message Reply with quote
I don't think that's possible but you can easily simulate it by putting a slice border around the screen. It wouldn't shrink the screen down, though, so you would be blocking tiles. You could also raise the resolution, although that comes with its own issues depending on what you're doing.
Metal King Slime
Send private message
 
 PostTue Apr 25, 2017 12:33 am
Send private message Reply with quote
Yes, you could easily script a frame around the screen yourself by increasing the resolution and using slices, but there are lots of problems: doesn't show in battles, fades out when the screen fades, can't see the edge of maps set to "Crop", and not visible on the titlescreen.

It sounds like it would be better to default to nearest neighbour scaling. Alternatively, use smooth scaling at low resolutions (say <= 2x or 3x the game resolution) and NN at higher resolutions. I'm not sure where to put the threshold.
Does anyone have a phone with resolution in the range of roughly 640x400 to 1000x600 who can report whether it looks blurry?

OK, let's just turn Touch Textboxes on for all games (since it's impossible to have explicitly turned it off).

Map movement via clicking is planned, especially for use on phones. James has been talking about implementing pathfinding for that purpose.

It sounds like we do need a whole builtin menu for these sorts of options. It could be displayed as a regular in-game menu which you could add to the main menu, but I'm not sure how to allow access to it in existing games (if you're just using the generic android OHR player). Hmm, maybe it could even be added by default to all existing games: it'll be hidden in non-Android games, and Android games need to be repackaged when they're updated, so you can change it then.
Meat, Cheese, and Silicon
Send private message
 
 PostTue Apr 25, 2017 4:57 pm
Send private message Reply with quote
My screen res is 960 x 540, and Void Pyramid looks like this for me: http://i.imgur.com/mVEBELy.png

Not particularly blurry, unless you're talking about the bilinear filtering. Tbh, I've never been a fan of it either, but I feel like most people don't like to have the game letterboxed on all sides so ymmv.
Sent from my iPhone
Display posts from previous: