After a day of reading and experimentation, I have "process" that allows me to build Urho3D for android. My target device is a tablet with Android 4.0 (IceCreamSandwich). I've have seen and run some of the demos on it. I'm merging in a DroneAnarchy angelscript version (like NinjaSnowWar) and attempting to run it with Urho3DPlayer. The 1st attempt ended up with a DroneAnarchy blue screen and two white boxes. I'll add the ability to output a log and see what's happening.
DroneAndy.zip (135.92 KB) Attempt 1 and attempt 3, 3 obviously being better, as the drones come at you We won't talk about attempt 2. I haven't been able to write a log yet, I may need to do some andriod/java to make that work. It'd be good to know where the hud went. Sadly, it has no user controls, I'll try to implement some touch controls.
The newest can of worms is the touch interface in Urho3D. I've got it so you can aim by touching the screen and have a button for firing not optimal, but you can kill something. I want to use the onscreen joystick for aiming, but it's being difficult. The hud is also having trouble, I'm not sure why yet, I had similar problems in ClientAnarchy, but that solution didn't fix it. No logs, even though I've added android permissions to write stuff, nothing is written, I'm beginning to suspect that the Urho3D log system is not connected to the android log system. If you've got a Android 4+ device, I can emit an apk, but it's pre-demo code.
Fixed the HUD, in ClientAnarchy its turned off while the game menus are up, so simple fix, leave it visible, its all good now. I puzzled out how the onscreen joystick is suppose to work, it magically sends out keys events, so you collect WSAD keys in the keyup, keydown handlers and you feed the results of it into RotatePlayer. Sadly, it does not continously send out these keystrokes, so you need to look at keydown to move the XY position, and keyup to stop. It's working, but the simple move 1 pixel makes it unplayable, you just cant move fast enough, it needs the time based distance easing function from the game controllers. I learned how to use adb to look at the android logs, uninstall and install apks, which reduces the cycle time for changes even more, instead of putting the apk on the sdcard etc.. I have two apks, one with onscreen joystick only play, and one with touch play, still pre-demo, but better.
Lots of things are fixed. -I gave up on the aiming with the onscreen joystick, it was just too flaky. So you aim by touch, I changed the move scaling a little when its android to make it feel more natural and be able to center on a drone. -I figured out how the mobile buttons work, and the top right "gear" pauses the game and you get choices to Quit or see the Credits. If you press it twice, it unpauses, ad infinitum. -It shows up as DroneAnarchy in the device, as opposed to DroidAnarchy or Urho3D. -All the android permissions have been removed, so it wont be looking to use the android internet or write to the sdcard.
Post by BlueMagnificent on Dec 6, 2015 13:26:19 GMT 1
It runs perfectly on my device and I'm so impressed by this. I've been battling a physics anomaly I discovered in Urho3D Physics Component for some days now and it has really distracted me from Drone Anarchy, but I guess its time to push that aside.
Every complex thing is made up of simple little parts
Hey, that's good news, mobile things are notoriously finicky. What needs to be changed or fixed to make it better? These are things I know about... -change "<SPACE> To Replay | <ESC> To Quit" message to "Press Fire To Replay", they'll have to figure out how to quit by themselves. -change touchscreen move scaling again, this time to take into account the screen geometry, which can vary widely.
Post by BlueMagnificent on Dec 9, 2015 21:35:24 GMT 1
I noticed that the "top right" gear is active while game start count-down is going on. Due to this clicking it brings out the other interfaces for "credit" and "quit" and if you don't click to hide it before that count-down ends it remains like that switching the toggle of pause and unpause
Every complex thing is made up of simple little parts
I've updated the code and have prepared version 1.00 of DroneAnarchy for Android.
Fixed the "top right" gear is active while game start count-down is going on. Fixed the you won/lost message to restart, exit. Update credits with source code location, version number. Fixed pressing fire when paused makes noise.
There is a v1.01 prepared... I remembered that I had done a poor job of pruning non-DroneAnarchy assets out of the Data folder, so I turned on engine.DumpResources(true); and everything that wasn't on this list, got removed. This shrunk the apk size from 12.3MB to 9.4MB. And I added more stuff to the credits to say where the asset licenses are, they should really be directly in the credits, if I have to make a better credits window that scrolls I'll put them in there. I was also using this codebase as a prototyping area for enabling the SDL force feedback (Haptic), which was successful, and the test code is still in there for DroneAnarchy, so if you connect a `recognized` game controller to your android device that supports haptic, the controller will rumble a little when you destroy a drone, and rumble more when a drone hits you. It tested ok on linux, but even though the android code works like linux, my tablet doesn't even acknowledge I plug in a `recognized` game controller, let alone support haptic or even vibrate. Once I finish the haptic development ( code, as, lua, sample) I'll see how hard it is to get it back into Urho3D proper.