space-rover / andors-trail

Automatically exported from code.google.com/p/andors-trail
0 stars 0 forks source link

Reduce memory heap footprint #254

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In v0.6.10a3, the game supposedly takes about 20MB of heap space, which is more 
than what is available on some devices. For example, HTC Hero has 16MB 
available for apps to use.

We should investigate the possibilities of reducing the amount of memory used 
by the game, in order to support more types of devices - older devices in 
particular.

This would probably require a major refactoring of how tiles are loaded, in 
order to happen.

The most memory-expensive parts in v0.6.10a3 is that all graphics tiles are 
loaded when the game starts, during the "Loading resources..."-phase. This 
includes tiles for visual effects, actor conditions, items, monsters and map 
tiles. Maybe the resources can be loaded on-demand instead, and cached with 
SoftReference<> :es ? Or maybe we could skip loading all map tiles and only 
load the tiles that are used on the current map?

Original issue reported on code.google.com by oskar.wi...@gmail.com on 14 Oct 2011 at 5:04

GoogleCodeExporter commented 8 years ago
I have a testing version ready for this, that only loads the gfx resources that 
are needed for the current map, including map tiles and monster images.

Additionally, this version also reduces the amount of conversation phrases kept 
in memory to only the ones required for the currently shown conversation. 
Considering we have over 3000 lines of dialogue, that's a lot of memory where 
the player only uses small parts at a time.

Qasur (from the forums) is helping to test it on a HTC Hero. If this version 
works as intended, it will be committed into svn shortly.

Original comment by oskar.wi...@gmail.com on 15 Oct 2011 at 5:45

GoogleCodeExporter commented 8 years ago
For reference, this attachment contains the changes mentioned in comment 1.

Original comment by oskar.wi...@gmail.com on 15 Oct 2011 at 5:49

Attachments:

GoogleCodeExporter commented 8 years ago
The fix in comment 2 has been confirmed by qasur on the forums. Marking this 
issue as ready for v0.6.10. 

Original comment by oskar.wi...@gmail.com on 16 Oct 2011 at 5:20

GoogleCodeExporter commented 8 years ago
This is now committed in r181.

Original comment by oskar.wi...@gmail.com on 16 Oct 2011 at 7:52

GoogleCodeExporter commented 8 years ago
Released in v0.6.10 . Closing.

Original comment by oskar.wi...@gmail.com on 21 Oct 2011 at 8:56