Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / fyi on ouya development

Author
Message
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 2nd Nov 2013 03:49 Edited at: 2nd Nov 2013 03:52
I heard allot of people complaining about ouya being slow with agk.

From my findings its actually just the 2d commands such as sprites.
(I know its also linked to the system upscaling it to 1080...)


My original hockey game "ice brawlers" crawls in 2d on my ouya game system.....however

My new 3d version is screaming 60fps and looks great.

If you want to develop for ouya....try something 3d! (if you care about fps)

Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 2nd Nov 2013 09:07 Edited at: 2nd Nov 2013 09:08
Can I ask how many 3D objects you are rendering and if they are using transparency etc.? My WIP is rather slow (17-32 fps) on the Ouya, while it runs at 60 fps on my Android-phone. I really like the way your game is turning out btw.. looks like a lot of fun!
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 2nd Nov 2013 09:44
The problem we have with Ouya is that we can't change the framebuffer size and can only render directly to 1080p. Ouya is limited in fillrate so this is bad. For example: If you changed the framebuffer to 720p you would theoretically double your FPS.

AGK 2 will have a render to image command, that will help a lot. I still wish for an easy way to alter the framebuffer.

SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 2nd Nov 2013 15:15
humm....good question.

first off I have several objects that are loaded but set to not visible.

let me do a quick count here...

Ok I have 90 objects loaded currently that are set to not visible

(these are for the animations for the characters)

and I need to load ruffly 32 more to fill in for fighting and holding the cup...so actually I may need slightly more.


now whats visible...

-icerink as 1 object
-boards as 1 object
-all posts as 1 object
-all glass as 1 object with alpha transparency
-seats with transparency 1 object
-the 1 box that will hold the players bench inside.
-2x nets
-2x meshes with transparency

ok now the rest....

-2x shadows for human players
-2x arrows to point when human players off screen
-2x goalie's non animated
-6x game players that are deleted and instanced every sync to the appropriate animation frame.
-the puck

so that adds up to a total of 113 objects so far and 23 are set visible at all times. 6 of those 23 are deleted every sync and re-instanced to show the correct animation frame.

once I get my audience loaded in that will also be only 1 object flipping threw animation frames(images) with transparency.


@zerotown
-how many objects are you using?
-second what displaymode?

and thanks im having allot of fun writing this hockey game.

oh! and the resolution im using is 1024x600 so it runs on playbook/bb10 as well. The ouya seams to be rendering it at 1080p just fine from up scaling it.

Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 2nd Nov 2013 15:28 Edited at: 2nd Nov 2013 15:29
If i am not mistaken, in 3D you only render the front most pixels. Unless of course you use transparency. With 2D, every sprite gets drawn, even when blocked by other sprites. That would make 3D eat up less fillrate. Hidden objects should not get drawn at all.

However, Paul said that AppGameKit currently does not cull 3D objects outside the view. Thus you have to manually hide any 3D objects that you don't want rendered.

SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 2nd Nov 2013 15:49 Edited at: 2nd Nov 2013 15:57
I imagine if you had a large scene loaded ...yeah that would kill fps.

if you can break up your scene into chunks and set those to visible once they get close to your screen and hide them when they are far away.

do not rely on "object in screen" command for anything....it reports false almost 100% of the time saying its in screen when its not.

use the "getscreenxfrom3d , getscreenyfrom3d" commands for detecting if something should be visible or not.

as far as rendering goes... use a distance calculation to see if you should hide an object or show it.

eg..


Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 2nd Nov 2013 16:46 Edited at: 2nd Nov 2013 16:46
Quote: "@zerotown
-how many objects are you using?
-second what displaymode?"


Well, the dungeons of my game have a 64*64 layout and are 3 layers high (ceilings, walls and floors), so that's theoretically 1.2288 objects loaded (not displayed) when not counting entities such as creatures and the player's party. In practice, however, the actual number is more close to 1.000 objects, since the middle layer doesn't consist of walls entirely.

Of all these objects, only about 256 are actually displayed, depending on the Line of Sight of the player. On the Ouya, I use a display mode of 1920x1080. In my search for better framerates, I've made the following observations:

- Replacing a set of 64*64 tiles with one large object (ceiling or floor) makes my framerate jump up tremendously (as expected) on my PC, but - alas - not on the Ouya. The fillrate issue might be the culprit here.

- Loading a lot of objects takes it's toll on framerate, despite the fact that ~90% are not rendered (SetObjectVisible and SetObjectCollisionMode are set to 0).

- From Paul's post here, I learned that AppGameKit doesn't do a lot of culling or batching. As these issues are addressed, I expect that 3D scenes with lots of stuff going on will perform better in days to come.
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 2nd Nov 2013 17:21
64x64....is this tile based?

if so I would load the main object types....then instance the ones needed to display on screen so it doesn't consume a ton of memory.

if you want I can give you some code that is great for tile based screen updating that uses instanced objects and deletes them when out of the display area and instances new ones as they come into the display area.

SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 2nd Nov 2013 17:53 Edited at: 2nd Nov 2013 18:15
last of all here is a controller map out....





hopefully that helps

Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 2nd Nov 2013 18:31 Edited at: 2nd Nov 2013 18:44
Quote: "64x64....is this tile based?

if so I would load the main object types....then instance the ones needed to display on screen so it doesn't consume a ton of memory."


Ah, yes I forgot to mention: the game is indeed based on a 2D-tile map, that is rendered in 3D. I use instances of all the basic objects, so (currently) only 8 'parent' objects are created.
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 2nd Nov 2013 20:17 Edited at: 2nd Nov 2013 20:18
@zerotown

I can show you some code to render it fast in 3d (showing only what needs to be shown).

I bet I can help you restore it to 60fps since its tile based.

1 question. what are you using for collision?

Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 3rd Nov 2013 06:57 Edited at: 3rd Nov 2013 13:02
@SMD_3D_Interactive

that would be wonderful and much appreciated. I currently use two collision-detection systems in my game, depending on the 'gameplay-mode' a player selects: there is an oldskool tile- or gridbased detection when a classic mode is selected (think: Eye of the Beholder or Dungeon Master-like movement) and a slightly more modern sliding collision when a FPS mode is selected.

here's the code from the latter:
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 3rd Nov 2013 13:24 Edited at: 3rd Nov 2013 13:28
3 layers on y axis....is that correct?

64x3x64?

oh also what are the sizes of the tiles....eg 100x100x100?

and I will write up a quick demonstration.

Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 3rd Nov 2013 15:43 Edited at: 3rd Nov 2013 15:44
@SMD_3D_Interactive
Quote: "3 layers on y axis....is that correct?

64x3x64?"


Yes, that is precisely the way the current mapdata-array is set up. I currently use an object-size variable of 10, so all objects / tiles have a 10x10x10 length, height and width. Once again, your insights are much appreciated!
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 3rd Nov 2013 15:48
ah I missed the 10x10x10

this example uses 100x100x100 block sizes but have a look

3rd person view example but has no camera collision



I will add a fps version in 5-10 mins

SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 3rd Nov 2013 16:00 Edited at: 3rd Nov 2013 16:15
ok and now an fps version of it

(also forgot to mention that holding shift runs)

a,s,d,w =move
rightmouseclick in = look/turn
space =jump



if ya like....I can change it to 10x10x10 tile sizes but give this stuff a try anyways to see whats happening

also make note: the current map size is set to 1024x5x1024 to show you it can be done.




edit: also there is no look restriction coded...so if you keep looking up or down your controls will reverse when you flip upsidedown.

I will do an example for ouya next....

SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 3rd Nov 2013 17:09
ok the ouya....does not perform well with this tile engine at all.

but works fine on pc and my android nexus 7.

I noticed it has a performance drop when you turn the camera towards 0,0,0

looking any other way seems to be close to 60fps

have a look but I don't think this will be helpful at all. maybe give you some new ideas but that's about it.



SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 3rd Nov 2013 21:32 Edited at: 3rd Nov 2013 21:36
@Digital Awakening

I saw your game on ouya forums....and was reading about that guy that mentioned that code:

<intent-filter>: "<category android:name="tv.ouya.intent.category.GAME" />"

into the manifest file......really easy to do and it uses your icon file and adds it to your play list even if its side loaded.


Give me 10 mins and you guys can try out my hockey game on the ouya system... will post in the icebrawlers3d forum.



edit: interesting enough...when you add that to the manifest...your game doesn't show up in the make section at all. only in the play menu

Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 3rd Nov 2013 22:18
@SMD_3D Interactive

Thank you very much for the sample code you provided! Even though it might not run as fast on the Ouya a you would have liked, it is very illuminating to me. I'm studying the code right now and it looks like you use a different approach to generating tiles and updating them. Whereas I've been making several parent objects and instance them at the start of the program, you seem to instance and delete them as needed? Very cool and a lot faster than my own stuff I reckon!
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 3rd Nov 2013 22:26
try my ice brawlers 3d if you have an ouya....

its a hardcore alpha...but side load it and see for yourself that its running fast

http://forum.thegamecreators.com/?m=forum_view&t=208385&b=48

Login to post a reply

Server time is: 2024-05-20 03:47:58
Your offset time is: 2024-05-20 03:47:58