Author Topic: TheoTown  (Read 2723 times)

Offline Lobby

  • int
  • **
  • Posts: 66
    • View Profile
    • flowersoft
TheoTown
« on: August 24, 2015, 11:24:05 am »
Hi,

I wrote a 2d city simulation game using jPCT as blitting engine. It's still in alpha phase but I'm working on it :)

Homepage: http://www.theotown.de/app/
Google Play: https://play.google.com/store/apps/details?id=info.flowersoft.theotown.theotown

Greetings
Lobby

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11770
    • View Profile
    • http://www.jpct.net
Re: TheoTown
« Reply #1 on: August 24, 2015, 06:24:20 pm »
That's pretty impressive...I ended up more or less bankrupt, but anyway... ;)
Are these buildings individual textures or are you using sprite sheets/texture atlas'...whatever you want to call multiple images on one texture?

Offline Lobby

  • int
  • **
  • Posts: 66
    • View Profile
    • flowersoft
Re: TheoTown
« Reply #2 on: August 24, 2015, 08:08:23 pm »
Thank you :)

I use a huge 2048x2048 texture which contains all the graphics (so it's a texture atlas). Textual plugins then define the coordinates of single frames. I experimented on other solutions but the texture atlas seems to be the fastest for drawing.

This is the texture with a scaling of 25%:


A problem are old devices with a too small VM stack. They can't run the game, even if the texture size is supported.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11770
    • View Profile
    • http://www.jpct.net
Re: TheoTown
« Reply #3 on: August 24, 2015, 08:57:43 pm »
I see. That's because a 2048*2048 textures needs 16mb alone on the GPU plus the same amount in VM memory. There are some possibilities to tweak texture memory usage like using 16bit or ETC compression, compressing the VM copy in memory or even swapping it to the SSD by using the Virtualizer class. But I somehow doubt that this will cut it in the low end...how much memory do these devices have available?

Offline Lobby

  • int
  • **
  • Posts: 66
    • View Profile
    • flowersoft
Re: TheoTown
« Reply #4 on: August 25, 2015, 09:59:12 am »
It has a heap size of 16 MB ;D

ETC doesn't help because it needs for a short time even more memory than without it (I guess it's because of the compressing process). I think it would be needed here to upload just parts of the texture so that the whole image never has to be stored within the VM heap.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11770
    • View Profile
    • http://www.jpct.net
Re: TheoTown
« Reply #5 on: August 25, 2015, 10:02:30 am »
Even then it wouldn't work. The texture memory counts as VM memory as well. There no chance that this texture can be loaded into 16mb VM. But honestly... who on earth is still bound to such a low limit? Even my first Android device has a 32mb VM (running Android 1.6).

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11770
    • View Profile
    • http://www.jpct.net
Re: TheoTown
« Reply #6 on: September 30, 2015, 08:59:56 pm »
I've added it to the projects page: http://www.jpct.net/projects.html

Offline Lobby

  • int
  • **
  • Posts: 66
    • View Profile
    • flowersoft
Re: TheoTown
« Reply #7 on: December 21, 2015, 12:47:04 pm »


Thank you, Egon.

Is there any chance to improve blitting performance? Another thing is that uniforms applied to a blitting shader seem to be ignored because blits are drawn batched so just the last set values will be used for one batch.
« Last Edit: December 21, 2015, 12:59:37 pm by Lobby »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11770
    • View Profile
    • http://www.jpct.net
Re: TheoTown
« Reply #8 on: December 21, 2015, 04:18:04 pm »
Performance improvements...I don't see much room for that, to be honest. Have you profiled your app? Are you sure that improving blitting performance would actually help?

About the shader issue: Yes, that's caused by batching. You can break batching by inserting some small, transparent blit with another texture here and there but that would actually reduce performance even more (not the dummy blit itself, but the interrupted batch).

So the need for more performance and the option to be more flexible with the uniforms are actually conflicting wishes here...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11770
    • View Profile
    • http://www.jpct.net
Re: TheoTown
« Reply #9 on: December 21, 2015, 04:39:53 pm »
If you can provide me with a test case that somehow mimics what your actual game does, I can try to improve things a little but I can't promise anything...