Author Topic: Thinking about some RPG..Android version.  (Read 109933 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Thinking about some RPG..Android version.
« on: December 17, 2011, 11:42:01 pm »
Edit: This is a split from the topic in the projects section for desktop jPCT. This deals with the Android version, which is most likely the way i'll go...if anything...

I'm still planning to port this thing to Android within this month. To prepare for this, i reduced the polygon count of the terrain (have to do this some more for Android) and reverted from phong shaded terrain and trees to gouraud shaded ones...the visual outcome is very very similar in this case. I also added some additional stuff to jPCT and jPCT-AE to reduce memory usage for cloned objects.
« Last Edit: December 21, 2011, 10:41:55 pm by EgonOlsen »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Thinking about some RPG..Android version.
« Reply #1 on: December 20, 2011, 12:21:27 am »
The same code straight ported to Android OpenGL ES2.0 but with reduced terrain details and tree count:



On my Nexus S, this "runs" @ around 10 fps with full collision detection and stuff...not very amazing. In addition, it needs quite a lot of memory and i'm not sure if it will run on a 2.x VM this way (i'm on 4.0 now, which has up to 48mb of VM memory available).

Offline Bryan

  • byte
  • *
  • Posts: 26
    • View Profile
Re: Thinking about some RPG..Android version.
« Reply #2 on: December 20, 2011, 02:25:07 am »
OH wow, it still looks really great even on the phone. Shame it's only running with 10 frames a second. But still.. ;D

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Thinking about some RPG..Android version.
« Reply #3 on: December 20, 2011, 06:52:54 am »
It's just a mindless port for now. There's room for improvement...the textures are pretty large for a mobile device, the shaders aren't optimized at all, the view distance is pretty high and maybe rendering these tiny little plants makes no sense at all on such a small display...we'll see.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Thinking about some RPG..Android version.
« Reply #4 on: December 21, 2011, 12:37:59 am »
Added some basic controls to the Android version, replaced the sky dome with a sky box, decreased view distance, optimized tree processing...

It now runs with full collision detection @9-13fps, which actually feels better than it sounds. However, there's no game logic except for the plants' visibility processing...which seems to be slower than the collision detection, which is odd. Anyway, this scene renders @ 13fps:


Offline AGP

  • quad
  • ******
  • Posts: 1524
    • View Profile
Re: Thinking about some RPG..Android version.
« Reply #5 on: December 21, 2011, 12:50:26 am »
Very cool, man. You're so good with jpct it's almost as if you wrote it. :-) How many polygons total? Is the  Skybox class not available on Android (why would you have started using a sphere?)? How far is the far plane on Android?
« Last Edit: December 21, 2011, 01:12:06 am by AGP »

Offline Bryan

  • byte
  • *
  • Posts: 26
    • View Profile
Re: Thinking about some RPG..Android version.
« Reply #6 on: December 21, 2011, 04:00:28 am »
Well hey it still looks great man. I am sure that's totally a playable fps, just have to see how it goes with some game logic. Keep us updated! I check this thread everyday lol

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Thinking about some RPG..Android version.
« Reply #7 on: December 21, 2011, 10:41:42 am »
Tweaked the terrain shader...it's 50% faster now, so that the start scene increases from 13 fps to 19 fps...not bad for changing a single line of code in the shader...

I tested it briefly on a Samsung Galaxy S2 (the one with the Mali 400 GPU). It worked fine and ran fast, albeit the shader accuracy lacks behind PowerVR's.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Thinking about some RPG..Android version.
« Reply #8 on: December 21, 2011, 10:55:58 pm »
Tweaked the shaders some more (start scene up to 23 fps now), shrunk some textures, replaced some textures, improved collision detection and multi touch controls (multi touch with the Android SDK feels...weird, doesn't it?)...

After all the work was done, i visited the forest:


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Thinking about some RPG..Android version.
« Reply #9 on: December 21, 2011, 11:21:45 pm »
How many polygons total? Is the  Skybox class not available on Android (why would you have started using a sphere?)? How far is the far plane on Android?
Not sure about the polygon count...the terrain has around 7000 IIRC, each tree has ~200. The bushes and houses have...i don't know. The sky is a sky box, the class is available on Android too. I started with a sky dome, because i had one...no particular reason. The far plan is at 5500 for now, distance fog starts at 4000.

Offline Bryan

  • byte
  • *
  • Posts: 26
    • View Profile
Re: Thinking about some RPG..Android version.
« Reply #10 on: December 22, 2011, 02:26:49 am »
Wow the graphics remain pretty constant even as you're increasing the frame rate. Nice job

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Thinking about some RPG..Android version.
« Reply #11 on: December 22, 2011, 10:08:14 pm »
BTW: Lots of free music that fits nice to this kind of game IMHO: http://www.jsayles.com/familypages/earlymusic.htm

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Thinking about some RPG..Android version.
« Reply #12 on: December 23, 2011, 11:22:30 pm »
Added basic support for animated objects, i.e. monsters and NPCs. The world is now populated by one goblin that plays it's idle animation over and over again...i have to dig for my old Android optimized A* algorithm to make him move. Anyway, here he is @ 19fps:



...and with an evil grin on his face...

« Last Edit: December 23, 2011, 11:26:22 pm by EgonOlsen »

Offline Bryan

  • byte
  • *
  • Posts: 26
    • View Profile
Re: Thinking about some RPG..Android version.
« Reply #13 on: December 24, 2011, 12:03:35 am »
Hahaha that grin!  :D

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Thinking about some RPG..Android version.
« Reply #14 on: December 28, 2011, 12:56:09 am »
Did some more refactoring to prepare for moving NPCs and tweaked the shaders again. The start scene is now at 27 fps and the bushes (like the trees) are now animated in the vertex shader too. That's actually faster than not doing it, because it reduces the overhead of shader switching between trees and bushes.