AGS engine iOS port

Started by JJS, Sun 13/05/2012 16:41:09

Previous topic - Next topic

cianty

I got to test my game with an adjusted version of this on my new ("unjailbroken"!) ipad. So the app is currently for iPhone only - and the "zoom" for iPhone apps on iPads looks really horrible. Will you make this an universal app in order to support a "clean" scaling for iPad resolution?
Also, the curor @ touch position doesn't work in practice for me one bit. You have the "move finger to move cursor" control (see e.g. scummVM or MI iPad version) in the Adroid version - will you do this for this too? Or can it be configured?
ca. 70% completed

JJS

I will make it a universal app. Up to now I wasn't sure if this had any benefit, but I guess it has.

The engine supports the same configuration file as the Android port. You have to create a file "ios.cfg" in the Documents/ags/ folder like this:
Code: ini

[misc]
config_enabled = 1
rotation = 0
translation = default
[controls]
mouse_method = 0
[compatibility]
clear_cache_on_room_change = 0
[sound]
enabled = 1
threaded = 1
cache_size = 10
[midi]
enabled = 1
preload_patches = 0
[video]
framedrop = 0
[graphics]
renderer = 0
smoothing = 1
scaling = 1
super_sampling = 0
smooth_sprites = 0
[debug]
show_fps = 0


Set "mouse_method = 1" for relative mouse movement.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

JJS

The app now has native iPad support. Please let me know if there are issues with it.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Grim

Quote from: JJS on Tue 15/05/2012 09:48:25
As for what's next? I think I am done platform-wise (unless someone donates me a PS3).

I have a spare PS3! If you can make my game run on that I'll let you have it (and buy you 10 more PS3s!).

JJS

Thanks for the offer! Don't mind if I take you up on it. I send you a PM.

It would mean that bigendian platforms will be actively maintained again, so this riddle would get solved. :=
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Legba

First off, holy shit, this is amazing. I stumbled onto AGS like two weeks ago and I'm continually impressed by the work people are doing with it. Also, holy crapcake, you've done a lot of ports.

I was wondering if anyone had a more detailed tutorial for how to use this little bugger to get any given game onto an iPad. I'm not entirely sure what game files need to be moved over and how (I did test the app and ran the rest gam and it worked wonderfully). I'd like to try and stick Gemini Rue on this thing and, from the specs listed above, it *seems* like it would work. Any help would be awesomepossum. (It's an iPad 1 on 5.01 and it's already jailbroken. I'm assuming I need to change some file permissions but that's about as far as I figured it out).

Thanks! <3

Crimson Wizard

#26
Quote from: JJS on Sat 16/06/2012 15:08:59
It would mean that bigendian platforms will be actively maintained again, so this riddle would get solved. :=
Just FYI, I made an experiment and simply put Steve McCreas's "big end" read and write functions into use by disabling ALLEGRO_BIG_ENDIAN macro there. They seem to work nicely for Windows version (functions they use are actually std file routines, which are redefined for big-end case only).
I had to write my own implementations for little-endian getshort and putshort, however, but later I found they were already written in wgt2allg unit.
At the moment there are only few places where I cannot just plain "merge" Steve's code into default code, namely in compress.cpp and also in wfnfontrenderer implementation where you (or tobihan?) used psp_get_char function in little-endian version. I mean, it should certainly be possible, but I haven't tried yet.
Also in some cases there was big-end read/write functions prepared for a struct, but for some reason they weren't actually used; GameSetupStructBase struct for instance.

I guess CJ and Steve were couple of steps away from implementing endianess-independent code to the engine, but just did not finish this job.

JJS

Legba, the game files go into /var/mobile/Documents/ags/game/

The main game file ("Gemini Rue.exe") has to be renamed to "ac2game.dat". You can take a look at the sample game files to get an idea.

The file permissions for the "ags" and all subfolders must allow writing by a standard user.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Legba

Figured it all out. Honestly, I should have tested some tinier games first to figure out what I did wrong before bothering you. Super thanks for taking the time to respond anyway. It works brilliantly (and significantly faster than the wine wrap I did to run it on my mac).

For anyone else concerned about how to right-click: It takes a little getting used to but you tap with one finger and then tap a second finger to bring up the menu. The trick is to bring down the first finger on the object which you which to right-click on and then immediately bring and adjoining finger down (i.e., so the second finger quickly falls right next to the the location of the first).

I've run this on 11 different games of varying size and I've had zero flaws. The key (for me, at least) was using iFile to set the permissions properly and make sure to wipe all the old files in the /games directory before putting a new one in.

Igor Hardy

Are all AGS games resolutions supported and working at decent speed? I wonder how would Snakes of Avalon work.

JJS

All game resolutions are supported and they are scaled to the screen size as necessary.

Speed of course goes down with higher resolutions. On my iPod 4g Snakes of Avalon still gets > 35 fps with the OpenGL renderer in the bar. The downside is that the OpenGL renderer does not yet support tinting of sprites and plugins that draw to the screen (like the D3D renderer on Windows).

Also the memory consumption goes up a lot with the resolution so it is possible that a hires game runs out of memory.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Igor Hardy

Thanks for the info. Shame about the resolutions as I've been meaning to focus on much higher resolutions in the future. Then again, maybe there will be already a new gen of iOS hardware before I'm ready to release.

Legba

#32
Interesting. So literally everything works perfectly except for one problem I've run into.

A few games require navigation through keyboard inputs and, unfortunately, sometimes they require keys that aren't present on the iOS onscreen keyboard. Gemini Rue, for example, requires you use the CTRL key during combat and there's no CTRL key on the keyboard. There's actually a point where you have to hit CTRL or else you can't continue in the game, effectively making the game unplayable on iOS.

Trying to see if there's a tweak out there to allow you to remap the keyboard so as to use other keys to send the CTRL command or if there's something I can put into the ios.cfg file referenced above. Anyone have any ideas?

EDIT: I also tried hooking up a bluetooth ipad-specific keyboard that had a CTRL key and still didn't work. The only keys that work on the physical keyboard are ones that exist on the onscreen keyboard as far as I could tell.

Crimson Wizard

This is a problem the engine would run sooner or later, since it wasn't made with having portability in mind.

Unfortunately my only suggestion is rather for the future versions of the engine - to implement totally virtual controls that could be rebound from game setup, for example.

JanetC

Quote from: Legba on Fri 29/06/2012 21:05:20A few games require navigation through keyboard inputs and, unfortunately, sometimes they require keys that aren't present on the iOS onscreen keyboard. Gemini Rue, for example, requires you use the CTRL key during combat and there's no CTRL key on the keyboard. There's actually a point where you have to hit CTRL or else you can't continue in the game, effectively making the game unplayable on iOS.

Heh, that's why I'm overhauling the Gemini Rue control system right now so that we can port it to iOS. :)

Joseph DiPerla

Quote from: Crimson Wizard on Fri 29/06/2012 22:24:36
This is a problem the engine would run sooner or later, since it wasn't made with having portability in mind.

Unfortunately my only suggestion is rather for the future versions of the engine - to implement totally virtual controls that could be rebound from game setup, for example.

Much how c++ has a way to check which OS its executing an app from, can AGS do the same? Perhaps a script function that checks which platform its running under, and if its running under a mobile OS, functionality can be customized to work with that platform right from within the game. For older games that did not do this, maybe the engine for ports such as Android and IOS can have a default custom keyboard that implements shift/CTRL/ PG up or dwn, Home, End, F1-F12 keys, etc...?
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

JJS

#36
AGS has a script function to check for the underlying platform. But at the moment it returns "Windows" on all mobile platforms because I noticed that games make assumptions based on the reported operating system that don't hold true (e.g. that plugins are not available).

Both Android and iOS ports have a way to invoke the standard system keyboard and to press the function keys and ESC. Adding more buttons is a bit difficult and in the end action scenes like in Gemini Rue will be difficult to play on them anyway. What would be possible is adding customizable buttons that are overlaid over the game and that can be bound to any key. If someone wants to implement that, be my guest.


Edit: Just for reference, this is how the iOS virtual keyboard looks like in AGS:

Ask me about AGS on PSP, Android and iOS! Source, Daily builds

pcj

Just curious - is the only thing holding this back from working on non-jailbroken devices the cost? Nice work, man.
Space Quest: Vohaul Strikes Back is now available to download!

JanetC

Quote from: pcj on Fri 03/08/2012 15:52:01
Just curious - is the only thing holding this back from working on non-jailbroken devices the cost? Nice work, man.

Yep. I've got it working on non-jailbroken devices, it was easy enough. You just need to give Apple $99 to get a developer account!

zaphod_beeblebrox

Can anyone confirm if the recently released 'Resonance' works properly on the Ipad 3 using this AGS port? Thanks!

SMF spam blocked by CleanTalk