Pages: [1] 2 3 ... 5
  Print  
Author Topic: OpenArena Ouya port  (Read 137522 times)
gamesboro
Nub


Cakes 0
Posts: 30


« on: August 10, 2013, 02:13:19 PM »

Over the last few weeks I've been working on porting Open Arena to Ouya, based on Pelya's android port.  I have been talking to him over the last couple of days and he mentioned bringing our conversation here so that the information can be used by anyone that may need it for the future, or in case we need advice on something.  This is the important parts of our correspondence.

Quote
me: Hi Pelya, I've been doing a lot of work with Android OpenArena and I hate to bother you but I just can't seem to figure something out.

The main.xml file seems to be ignored by the application after its compiled, and I really need to add about 10 pixels of padding to all four sides of the game.  I think I found in MainActivity.java where you programmatically set up the rules for the display but can't figure out how to add a border/margin/padding to it.  Any guidance you can give me will be greatly appreciated!

Quote
pelya: It's not in XML or Java code - OpenArena has it's own GUI, written in C, inside game sources, which are compiled into .qvm files and executed in Quake3 virtual machine. It's located here:
https://github.com/pelya/openarena-vm/tree/android/code/q3_ui
You can also try to apply custom glScale() inside renderer init code, this will resize everything:
https://github.com/pelya/openarena-engine/blob/master/code/renderer/tr_init.c

Quote
me: Wow, I'm a little out of my element when it comes to C...  This is what I've done in tr_init.c, is this the correct placement and integers?  I hate to bother you again, but I'm doing all of the modifications needed for an Ouya port according to your notes, and Ouya's guidelines.  I'll be giving all the credit to you and the OpenArena team of course, you guys did the hard part!

I'm guessing I need to compile the Q3 source first, is that what the makefile is for I'm guessing?

If you can give me a little guidance on these last couple of details I'll get out of your hair.  Thanks for the help Pelya, your OpenArena android port is a masterpiece!
--------------------------------------------------------------

static void InitOpenGL( void )
{
glScalef(-.10, -.10, 1);
   char renderer_buffer[1024];
----------------------------------------------------------------

Quote
Pelya: Yes, like that, maybe with glLoadIdentity call before glScalef()
I'll try to do that myself the proper way, I have a bit of free time today.

Do you intend on using Android or PC servers? Or host your own Ouya-exclusive servers? Gamepad is better than touchscreen, but still way worse than mouse. Also, any server will force it's own .qvm files, so unless it's your own server, you'll lose part of touchscreen functionality, like selecting weapons from the weapon bar.l, that doesn't matter for Ouya though.

I would also recommend using 'touch to shoot' aiming mode, so you can aim with both analog stick and with touchpad. I've heard that touchpad lags though.

BTW you'll probably need to hide controls section altogether, because one of reasons OA was rejected was 'PC settings in the menu', so you will have to hide those Alt and Ctrl button names.
You may use getenv(”OUYA”) != NULL to determine if you're on OUYA or not (I did not test that method yet, please tell me if it works, also you'll have to export it via CVAR for .qvm files).

Quote
me: I plan on using the android servers for the first release, but I would also like to have it so that users can create a server in the game like you can on the PC version.  After the first version gets launched I'll start working on Ouya specific servers that I'll host here so that the balance isn't destroyed on the android servers.

I've remapped the controls so that everything is Ouya compliant, including the Ouya button.  I removed the dpad and buttons overlay, turned off the accel/gyro support (since they aren't needed), put the pak files in the initial apk, and added a better Ouya icon so far.  

The only thing I have left is the screen resize and altering the "controls" section.  At least for this first release.

Quote
Pelya: Then you just need to merge my commits from today from these repos:
https://github.com/pelya/openarena-engine
https://github.com/pelya/openarena-vm

Android servers have very little players anyway, so I don't mind if some Ouya players will use them.

Are there any issues with starting your own server from the game? It should be possible out of the box, so to say.

Quote
me: It finished downloading!
I must have killed the create server option somehow because it is working on the apk you just sent.  The UI is now working correctly! You went ahead and altered the controls menu, thanks bud, that was next on my agenda.

Only a couple of adjustments need to be made.  Both are related to the display.
#1: The screen is off center by about 5 pixels.

#2: While the UI is now set up correctly, gameplay still has screen bleed.  If this is brought in about 5 pixels on each side it should do the trick.

I can't find my bluetooth headset so it looks like I'm heading to the store.  I'll give you a heads up tonight once I can confirm that it works or not.  I'm still waiting on approval from the open arena forums, but I'll transcribe all of this ASAP.  If you have the time for the above two adjustments I believe I can handle the rest!  Thanks again for everything.
Logged
pelya
Member


Cakes 6
Posts: 399


WWW
« Reply #1 on: August 10, 2013, 04:23:41 PM »

I've kind of fixed the bleed in gameplay, however only 2D elements are resized - I hope that will be enough, because I've tried to resize everything and messed up, it's too complicated. Also the touchpad should be more usable now. Relevant commits are here:
https://github.com/pelya/openarena-engine
https://github.com/pelya/openarena-vm
You will need to change variable OUYA_BORDER inside engine/code/qcommon/q_shared.h, because I've made border 50 pixels for debugging.

This is how it looks:


BTW I'm really disappointed in the fact that TV manufacturers are gouging those 30 pixels at the edges (yes 30 not 5, the screenshots clearly show that). It's like, your 1080p HDTV is not as HD as advertised, because you can see only 1020 pixels. And you cannot justify it, because the HDMI signal is digital, and you got exact pixel-to-pixel mapping, unlike ray tube. Are those pixels lost because of lousy glued thick edges, or did they actually put less pixels into the matrix? Anyway, it's a conspiracy - if anyone would try to do that to PC display, oh they would get a shitstorm of complaints, just imagine your "Start" button off-screen.
Here's the screenshot in question:
« Last Edit: August 10, 2013, 04:38:45 PM by pelya » Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #2 on: August 10, 2013, 06:51:10 PM »

Oh wow I didn't know Ouya had an artificial overscan issue.
Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
pelya
Member


Cakes 6
Posts: 399


WWW
« Reply #3 on: August 10, 2013, 07:01:25 PM »

It's not artificial - it's just that all TVs are crappy. If you plug it into PC monitor, the picture will be fine, without any overscan.
Logged
gamesboro
Nub


Cakes 0
Posts: 30


« Reply #4 on: August 10, 2013, 08:33:24 PM »

This is perfectly fine.  I'll put it all together with what I've got over here.  Thanks again man.  

I picked up a bluetooth headset on my way home from work, so I'll test that as well and give you a heads up.

---------------------

Just got the headset linked to the Ouya and started the game.  When pushing in the left analog (great mapping by the way) the "speak" text appears but I don't see a volume level anywhere on the screen, no matter how loud I got.

I found "OUYA-BORDER" in q_shared.h but what should I changed the pixels to?

I've had some trouble compiling, I got a copy of your updated engine and vm code from github.  I then tried to run "make" under engine and under vm, but it didn't seem to have an effect.  Under engine I found your note and followed the directions.

Quote
   $ sudo aptitude build-dep ioquake3
    $ git clone git://github.com/undeadzy/openarena_engine.git
    $ cd openarena_engine
    $ make

Of course, I didn't need the clone part since I had the updated code.

I've tried make under vm, engine, and I've tried AndroidBuild.sh under src.  I know I'm missing something small, any tips would be appreciated.
« Last Edit: August 11, 2013, 03:10:38 AM by gamesboro » Logged
pelya
Member


Cakes 6
Posts: 399


WWW
« Reply #5 on: August 11, 2013, 05:54:40 AM »

That's sad - OUYA does not support recording audio, as it seems, but it's possible they'll add that functionality in the future.

OUYA_BORDER sets the thickness of empty space near TV borders, I suggest you to decrease it until GUI will fit your screen neatly.

You don't need that readme - you just need to launch build.sh from SDL root directory - it launches AndroidBuild.sh from OA directory itself. You may also launch that AndroidBuild.sh script by hand, but you need to supply one parameter - "armeabi" or "armeabi-v7a", and call the script two times. But you still have to call build.sh from root directory, so that it will assemble an .apk file (or launch "ant debug"/"ant release" from "project" directory).

Here's an updated .apk file to test

BTW please update SDL repo - I've found that SDL was sending "dollar" keycode instead of "backquote" for tilde key, that's why you could not toggle consolde with a USB keyboard. Sometime in the future I'll have to brush through that file with SDL leycodes, and make sure that standard QWERTY keyboard sends standard QWERTY keycodes, not some random remapped keys. Android itself has some funny keycodes, like TV_POWER or MEDIA_EJECT or CAMERA, currently they are returning random F1-F12 keycodes
Logged
gamesboro
Nub


Cakes 0
Posts: 30


« Reply #6 on: August 11, 2013, 09:29:46 AM »

Does build.sh also compile the qvm files needed?
Logged
pelya
Member


Cakes 6
Posts: 399


WWW
« Reply #7 on: August 11, 2013, 09:32:14 AM »

Yes, it should do that, and also pack them into file 7-android.pk3 in assets.
Logged
.Luke
Nub


Cakes 2
Posts: 38



WWW
« Reply #8 on: August 11, 2013, 03:40:45 PM »

That information was useful indeed. I've been trying to figure out what exactly QVMs are for ages, and that chat log told me exactly what I needed to know; written in C and compiled into a QVM from there. The Quake III engine is already far less mysterious to me thanks to that.

Back on topic, the android port was pretty exciting, (Don't have an android tablet myself yet, but OA's one thing I look forward to playing on one!) but an Ouya port too sounds interesting. It's great to hear that it's already running on the system, give or take some issues to iron out. This definitely makes me want one now, especially if I could also run Quake III on it as a mod; I like having tons of maps to play on.
Logged

|
gamesboro
Nub


Cakes 0
Posts: 30


« Reply #9 on: August 11, 2013, 04:31:14 PM »

OK, I cloned the latest SDL, moved your new engine and vm code into the appropriate directories under src, ran changeappsettings and build.  It compiles an apk but it doesn't seem to build the 7-android.pk3.  If I put the old one in the changes to engine are working well, but of course all of the awesome stuff in vm doesn't work. 

Any idea on why it isn't building 7-android.pk3?  Once this is done I can start adding my stuff in.
Logged
pelya
Member


Cakes 6
Posts: 399


WWW
« Reply #10 on: August 11, 2013, 04:50:57 PM »

You can build .qvm files by hand, using 'make' inside VM.directory, then just copy over .qvm files into existong .pk3 file (it's just a zip archive) - the virtual machine bytecode is all the same on PC and Android.
Or if you don't need any changes to the game code - just take 7-android.pk3 from the .apk file I've posted earlier (it's also just a .zip file)
Logged
matija123
Half-Nub


Cakes 1
Posts: 63



« Reply #11 on: August 12, 2013, 10:37:23 AM »

Can we join the servers like ROFL Allrockets Huh Cheesy
Logged

“If you tell the truth, you don't have to remember anything.”
― Mark Twain
pelya
Member


Cakes 6
Posts: 399


WWW
« Reply #12 on: August 12, 2013, 10:59:47 AM »

Yes, there is a switch in server list to list Android or PC servers, so you can connect to PC servers.
Logged
matija123
Half-Nub


Cakes 1
Posts: 63



« Reply #13 on: August 12, 2013, 11:33:46 AM »

Can we download it now or? Link?  Afro
Logged

“If you tell the truth, you don't have to remember anything.”
― Mark Twain
pelya
Member


Cakes 6
Posts: 399


WWW
« Reply #14 on: August 12, 2013, 11:53:00 AM »

Here
Logged
gamesboro
Nub


Cakes 0
Posts: 30


« Reply #15 on: August 12, 2013, 01:31:10 PM »

OK, I got your stuff and my stuff together.  Moving all of that stuff around took forever!  I added some more tweaks as well.  I've got an artist coming by my store in a couple of hours to draw up a controller overlay.

I found 3 big bugs.

#1: Player name



This one has a couple of problems, the first one is that you have to use the mouse cursor to bring up the on screen keyboard, its counter intuitive on the controller since no one ever uses the trackpad (it isn't very good).  The next problem is pretty obvious, if you backspace over "UnnamedPlayer" all the way it produces this message.  Also the first two letters of the name are offscreen.

#2: PC server menu



When you pull up the menu the controller will not select the option, you have to use the touchpad.  Same issue as before, users won't understand.  Also, when accessing the android servers it forces players to download pak7. I'm guessing because it is different than the one in the install.  Can this be avoided somehow or is it just the way it is?

#3: Graphics Settings



This is a big one, and plagues the standard android release as well when it is output to a TV.  If you choose "high quality" or above it does this.

Outside of these things everything is really solid.  I mean REALLY solid.  
« Last Edit: August 12, 2013, 01:41:36 PM by gamesboro » Logged
matija123
Half-Nub


Cakes 1
Posts: 63



« Reply #16 on: August 13, 2013, 07:00:59 AM »

Can we open consoles, and can we put color name ^6Like this?



Logged

“If you tell the truth, you don't have to remember anything.”
― Mark Twain
pelya
Member


Cakes 6
Posts: 399


WWW
« Reply #17 on: August 13, 2013, 10:24:14 AM »

Bug #1 is because of Android native EditText, it's semi-transparent without native keyboard overlay, so you're getting this. The solution would be to create your own simple text editor with solid background, forced keyboard overlay and thick borders, and I would rather make it the default for generic Android release, because standard EditText became kind of boring.
I'll try to find some time this weekend to implement this, if you want to do that yourself - modify method MainActivity.showScreenKeyboard() in Java code. Also, grey text hint is used to show last console output, this can be moved to a separate list, since we're creating our own text editor anyway.

Bug #2 won't be fixed - each server uploads to you it's own .qvm files, if checksum of your files differ, and they of course do not contain my touchscreen optimizations when you connect to PC servers. When you'll decide to publish a release I'll just update .qvm files on my Android servers, and publish an update to Google Play, so everyone will use the same .qvm files (and Ouya is detected dynamically, so non-Ouya users won't see Ouya-specific stuff). And if you insist on connecting to PC servers, well, nothing I can do, also you'll get pwned and called n00b, because you'll never be as good as players with mouse with your gamepad. BTW did you try to play with USB or Bluetooth mouse connected to Ouya? You should be able to aim much faster than with gamepad.

Bug #3 - please never ever change screen resolution, it won't do anything good. Probably we need to hide that setting altogether, along with "video quality" option, which also tries to change resolution.

@matija123: yes, color codes in your name work all the same way, and you can open console, if you attach USB/bluetooth keyboard to your Ouya and press tilde (but you cannot do that with just a gamepad, sorry).
Logged
matija123
Half-Nub


Cakes 1
Posts: 63



« Reply #18 on: August 14, 2013, 03:36:15 AM »

Thanks Smiley
Logged

“If you tell the truth, you don't have to remember anything.”
― Mark Twain
gamesboro
Nub


Cakes 0
Posts: 30


« Reply #19 on: August 14, 2013, 06:06:04 PM »

Just wanted to give you a heads up.  Just finished with Bug 3.  I left the graphics settings section in, but I made it so that options can only be changed manually and that dictates what "graphics settings" is set to.  As opposed to being able to choose "Very High, High, Medium, Fast, Fastest".  I fiddled with all of the options in every combo that I could think of, no problems!

I took a look at the EditText, but I'm lost on that one.

I tried out mouse mode, I'm a controller guy myself but I like that you found a way for keyboard/mouse players to play.  Even if it is different than what people are used to.  It works perfectly fine on the Ouya by the way.

« Last Edit: August 14, 2013, 06:15:50 PM by gamesboro » Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #20 on: August 14, 2013, 06:28:05 PM »

I do think the graphics presets do need to be changed. They're only relevant for PCs in 1999 (from P2 233MHz w/ Rage Pro to P3 800MHz w/ Geforce256 considering) and don't take in account for the other cvars in OA (r_bloom, r_flares, r_detailtextures)
Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
gamesboro
Nub


Cakes 0
Posts: 30


« Reply #21 on: August 21, 2013, 01:09:20 PM »

I found something else that is troublesome.  When you press "CHAT" in the in game menu it puts a string of "////////////" and doesn't stop until you click "done".  I've been looking around and can't seem to figure out why it is doing that.  Anyone have any ideas?
Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #22 on: August 22, 2013, 01:10:56 AM »

Sorry for the OT, but I did not want to open a new thread just for this:
It looks like that next-gen Sony and Microsoft consoles will open the door to "indie" games... May be an interesting thing...

http://www.computerandvideogames.com/425711/sony-welcomes-dozens-of-new-indies-to-ps4-and-vita/
http://betanews.com/2013/08/20/idxbox-gives-indie-developers-the-chance-to-sell-games-directly-on-xbox-one/
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
gamesboro
Nub


Cakes 0
Posts: 30


« Reply #23 on: August 22, 2013, 04:25:12 PM »

Scratch that last bug "/////", got it fixed.  It was just a controller remapping problem.

UPDATE:

I have submitted OpenArena: Ouya Edition for review.  Source will be posted shortly to http://www.gamesboro.net/openarena.  We have fixed all the major stuff, so if we get a new edittext going we can put it in the next update.  Expect a slew of new people coming in, both PC and Android servers.  I'm guessing that it will get approved on Monday. 
« Last Edit: August 24, 2013, 03:28:01 PM by gamesboro » Logged
pelya
Member


Cakes 6
Posts: 399


WWW
« Reply #24 on: August 24, 2013, 03:36:52 PM »

I've fixed the bug with text input - I've just made it non-transparent, and added thick borders, and also disabled OA console logs. On-screen keyboard is still not shown until you click the text input field with mouse, and I don't know how to fix that. How are other games doing it anyway? Could you please ask on forums?

Well, let's see about "slew of new people coming in", we're not releasing Shadowgun you know - Android release on Google Play got 3 764 activa installs / 29 948 total installs as of now, and Ouya up to date did not even sell a million devices (they are not revealing that statistics, but I think we'd get some news about next-round-number of devices sold).

BTW I would like to merge your patches, at least for VM code, because we'll need to have pak7-android.pk3 synchronized on both client and servers.
« Last Edit: August 24, 2013, 03:43:23 PM by pelya » Logged
Pages: [1] 2 3 ... 5
  Print  
 
Jump to: