litchie / exult-ios

Exult ( http://exult.sourceforge.net/ )
GNU General Public License v2.0
42 stars 8 forks source link

Long touch circular animation *while* touching #46

Open DominusExult opened 8 years ago

DominusExult commented 8 years ago

in 939dfd548f1cc7fdb3da12d4d6a613b50183b69a I added the possibility to auto-pathfind when touching with a finger longer than 500 ms. When you release the finger I added a growing circular animation (it's a spell effect from the original game). It would be better to have this animation while holding the finger to signal that the long touch has registered. But this would need another timer on the SDL_MOUSEBUTTONDOWN event, similar to the one done in gumps/ShortcutBar_gump.cc (https://github.com/litchie/exult-ios/blob/master/gumps/ShortcutBar_gump.cc#L370 and further). But that is over my head.

agustincordes commented 6 years ago

I've been playing both Ultimas on my iPad this weekend, and this is an exceedingly good work. They both play very well with minimal glitches. The main drawback is precisely the virtual D-pad (feels too erratic) and this implementation of pathfinding (too slow).

My suggestion is to rethink this, and I believe the best solution may be trivial to implement: it's basically what many iOS games do, a kind of "floating" D-pad in which its center is determined wherever you put down your finger and the direction/speed is calculated by the vector resulting from the distance of your finger in relation to its original position. I believe this would make the games far easier to play, and it's even more faithful to the mouse-based interface (the farther away the mouse is from the center of the screen, the faster your party moves).

The problem I reckon is that the interface heavily relies on drag-and-drop and you have no (easy) way to determine whenever the player wants to interact with an item or just walk. A simple workaround is to use two fingers with the above system to perform the walk action.

What do you think about this?

DominusExult commented 6 years ago

It's all true, a good start would be in designing a virtual joystick that emulates the mouse movement (at a fixed spot like the virtual d-pad). The virtual d-pad sucks because it uses the keypad movement of Exult and a fixed speed. Works somewhat with just the avatar/party movement, but shows its horror when you have to move barges. BUT I'm over my head with that, I can bluff my way around with looking at other code and trying to implement that. But my lack of true programming skills hold me back in this case.

DominusExult commented 6 years ago

Two finger movement is not really an option on the iphone screens. Again a big BUT, though, maybe a different two fingers approach could work: A virtual button, that while pressed with one finger, puts you in movement mode, so the second touch controls the party. So the virtual button can be on the left or right of the screen (configurable same as the d-pad) and the other other input leads. Not that I have much of an idea other than how to implement the button, but what do you think of this idea?

It's good to hear ideas from people who have played it ;)

agustincordes commented 6 years ago

I think it's a great idea! So yes, that way you can toggle movement mode with your left finger and move the party with your right one (or vice versa).

I'm not sure the implementation is straightforward, though. On the other hand, I don't think either Ultima is really playable on the smaller iPhone screen -- I already have issues dragging items on a 10.5'' iPad :)