martedì 27 novembre 2012

Support for more screen size...at a cost

A little digression on JaTris support for devices with 600x1024 or bigger resolution.
As you can see from the images below JaTris full (designed as JaTris free for 480x800 pixel), supports 600x1024, 720x1280 and 800x1280 modes better than the free counterpart.






















However this support has a cost, JaTris is 3Mb while JaTris free is 1.2Mb long.

Some of this space is due to skin system graphics and a little end of game animation but 1.5Mb is due to the replication of sprites for higher resolution screen support.

The problem is the mix of DPI and pixel resolution used by Android system to render graphics.

It works well for smartphones (little screen dimension, with a bunch of pixel resolutions); you ake the graphics for the biggest resolution and let the automatic rescaling do the job for you (it works like a charm).

Unfortunately tablets are different, bigger screens mostly with mid dpi and a bunch of pixel resolutions; the graphics done for smartphones is far too small when rendered on tablets.

The only solution seems to duplicate graphics in high dpi for smartphone in mid dpi for large screen and then the rendering is good on tablets too; unfortunately this doubles the game size.

I tried to avoid this using the resource alias feature, but it does not work well when the alias and the original resource have a different dpi (this is related only to drawables).

With little games like JaTris this is a viable solution but for bigger ones the only solution is to make different apk for different classes of devices.

This problem will get worse with the arrival of full hd devices :-(

JaTris Full released

Released a full (paid) version of JaTris.

Version is aligned to the latest free release (1.41)

Google Play link       JaTris        full version



Differences from the free version :

- Better support for 600x1024, 720x1280, 800x1280 screen resolutions
- Skin system (4 skins)
- Game difficulty : Choose between EASY,NORMAL and HARD game
- Starting level : For advanced players you can skip the first levels and start from 4th, 7th or 10th level
- Endless game mode (play all 63 levels without worring about strategy).








Below some images showing the skin system graphics :




lunedì 26 novembre 2012

JatrisFree 1.41 released

This is a new bugfix release.

Fixed a problem with high score not saved correctly.

Fixed a problem in background music location mainly for Android 4.x device.
Now bgm can reside either on internal or external sdcard and it will be located and played correctly.



venerdì 23 novembre 2012

Found bug on high score save

Problem found in high score system.

When a high score is done in more than one game mode (such as timed and trial, or timed and standard) during the same play session, only the last will be saved.

Probably some overwrite problem.

Working on it.

sabato 10 novembre 2012

Background music problem...solved

Added the ability to check for mounted devices and scan them (in read only mode, so no new premission is needed) searching for a jatris/bmg.mp3 file.

If such a file is found then it will be played during game.
It can now reside on internal or external sdcard.

Tested on Android 2.3 and 4.0 with internal or external sdcard.
It seems to work fine, the fix will be included in the next version.




mercoledì 7 novembre 2012

Problem on background music subsystem

Ok, Jatris does not provide a background music but it can play an mp3 if you put it in a /jatris/bgm.mp3 file on the sdcard.
Tested on Android 2.3 it works flawlessly, but with Android 4.x the mount point of sdcard differs from device to device so Jatris may not find it.

Working on a more general way to identify the sdcard (both internal and external) and check for the presence on the bmg.mp3 file in a jatris directory.
This would solve the problem.


domenica 21 ottobre 2012

Jatris Free 1.4 Released

It's time for a new version.

This version contains all the work done to support more display modes (see previous post).

Google play link  : [Jatris Free]

New video modes fully supported in version 1.4 :

HDPI 540x960,600x1024

Playable, no graphics errors, but the game area is smaller than the expected :

MDPI 480x640,480x800,540x960,600x1024

JaTris was not designed for tablets even if now it is playable in 720x1280 and 800x1280 but the game area is very small.




Support for MDPI large modes (tipically tablets) is limited due to graphic resolution; to fully solve the problem new graphics must be created and added to the game increasing the size of apk to download and memory usage.

Still thinking if a new apk designed only for high resolution device is a better idea.



mercoledì 17 ottobre 2012

Better support for high resolution devices

Worked a lot to reduce graphics problems on high resolution devices stated in the previous post.

Jatris was not designed to work with high resolution devices (it's native resolution is 480x800 or 480x854 with HDPI density ) so it is not possible to optimize it for such devices without graphics redesign (mainly resize).

Anyway it can run a lot better than the current version :-)

The current version supports these resolutions :

LDPI 240x320, 240x400, 240x432
MDPI 320x480
HDPI 480x640, 480x800, 480x854

Upcoming version improved support for resolutions :

MDPI 480x640,540x960,600x1024

These modes represent the worst case scenario for Jatris, as the MDPI density lead to a shrink in all bitmaps; the game area is smaller than the optimal one
(in 600x1024 a lot smaller).

HDPI 540x960,600x1024

 These modes are fully playable even if the game area is a bit smaller than the optimal.

HDPI 720x1280,800x1280

Jatris can be played on devices with modes but the user experience is not guaranteed.

Checking if an HD version can be done without recoding the game.

Here the pictures of the improvements in MDPI modes

Left   : current version (1.32)
Mid   : first attempt
Right : upcoming version (maybe 1.4)











domenica 14 ottobre 2012

Graphics problems with a class of devices

A lot of problems emerged in graphics rendering on all devices with high resolution but mid dpi such as Galaxy Tab 7.0 and its variants.

Such class of devices has high resolution display (1024x600 and up) but only
mid (160) DPI, so the automatic bitmap resize of Android try to shrink all bitmaps.

The result is a graphical mess :-(

Jatris will continue to work but the graphics in the game area will be affected by size and position problems.

Working to reduce the problem...but probably to avoid it at all it will be necessary to build a new, high resolution only, version of Jatris.

Stay tuned.

giovedì 4 ottobre 2012

Another bug signaled

 Another bug report, this one is a null pointer in insert high score panel

java.lang.NullPointerException
at org.aciampal.jatrisfree.JatrisGame.drawInsertHighScore(JatrisGame.java:2634)
at org.aciampal.jatrisfree.JatrisGame.doGamePaint(JatrisGame.java:2250)
at org.aciampal.jatrisfree.Panel.onDraw(JatrisThread.java:153)
at org.aciampal.jatrisfree.Panel$GameThread.run(JatrisThread.java:70)


Not able to reproduce at the moment, will try to modify the code at line 2634 to be more resilient to null pointers :-)

Stay tuned.

mercoledì 26 settembre 2012

Jatris Free 1.32 released

A new bugfix release

Fixed a problem in bitmap usage that could lead to game crash after
(a lot of) pause/resume.


This bug was signaled by a user (thank you).


Google play link : https://play.google.com/store/apps/details?id=org.aciampal.jatrisfree

domenica 23 settembre 2012

New bug signaled by user

A new bug was signaled by a user.
Jatris stops with the subsequent error after some (a lot) of pause/resume cycles :


java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@40558788
at android.graphics.Canvas.throwIfRecycled(Canvas.java:955)
at android.graphics.Canvas.drawBitmap(Canvas.java:1044)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:325)
at org.aciampal.jatrisfree.JatrisGame.drawImage(JatrisGame.java:2984)
at org.aciampal.jatrisfree.JatrisGame.drawNormalBox(JatrisGame.java:2766)
at org.aciampal.jatrisfree.JatrisGame.drawInterfaceArea(JatrisGame.java:2314)
at org.aciampal.jatrisfree.JatrisGame.doGamePaint(JatrisGame.java:2248)
at org.aciampal.jatrisfree.Panel.onDraw(JatrisThread.java:153)
at org.aciampal.jatrisfree.Panel$GameThread.run(JatrisThread.java:70)




It seems a problem with mismatch usage of a recycled (and not reloaded) bitmap.
Bitmap cleanup was introduced in 1.31 to avoid Out of memory errors due to a non perfect memory deallocation in gc when used with complex resources.

Probably I forgot to cleanup some resource...working on it.

giovedì 16 agosto 2012

Jatris Free 1.31 released

As stated in previous posts a new version of Jatris free is now available on Google Play.

This version is a bugfix release only.

Fixes :

Fixed a memory leak that could lead to crashes (OutOfMemory errors).
Fixed a race condition that could lead to game freeze after pause/resume cycle


mercoledì 1 agosto 2012

Memory leak...solved

Solved the memory leak problem mentioned in the previous post.

It seems that not only bitmaps but also drawables and soundpool objects are not correctly freed after an OnDestroy call (normally when user press back button).

Added a cleanup routine to recycle these objects manually.

Now memory errors are vanished.
A new version will be packaged to solve the problem.


giovedì 19 luglio 2012

Ooops...memory leak

Found a memory leak in Jatris due to missing memory recycle during activity destroy (normally done when back button is used).
Seems that some memory used for graphics and audio samples is not released by the garbage collector.

Working on it.


Below some image of the skin system done for Jatris Deluxe (full version).
Enjoy :-)



mercoledì 11 luglio 2012

Jatris Free 1.3 Released

Released a new version 6 months after the first one. 

Added background music system


No music is included in the game release but the music system is now complete and searches for a bgm.mp3 file under /sdcard/jatris directory.
If you such a file there Jatris will play it as bgm when music setting is on.

Better fonts at low resolutions


Modified fonts to look better at low resolutions (320x240 and 320x480)

Graphic rendering a bit faster


Modified object allocation scheme to reduce the usage of the garbage collector.
This may improve Jatris fluidity.



I worked a lot to implement multiple skins and to add some new settings; maybe I will release a full (paid) version soon.

mercoledì 4 aprile 2012

More invisible work

Rewritten the game code to reduce (a lot) object creation during play.

In debug sessions these changes lead to quite no call to garbage collector improving animation smoothness.

As a side effect Jatris is now a little faster :-)

giovedì 29 marzo 2012

Lot of (quite) invisible work

In the last two weeks some non-visible work was done on Jatris.

- Added preliminary code to support non squared grids
- Added code to support holes (non swappable positions) in grids
- Done some code cleanup
- Done some graphics for a (possible) HD/Tablet version (1280x800)

Also finally completed bgm code (now it seems to work right).

Maybe all this work may lead to a new version (or a brand new game)

venerdì 16 marzo 2012

Jatris - Working on bgm code

In these last days I have been working on Jatris audio subsystem.
The bgm code was not working so it had to be recoded, now it seems to
work (remain only some funny behavior).


No bgm will be included in Jatris for the moment, but the game will search for
a bgm.mp3 file under the folder jatris on the sdcard and play it if found (and
music is enabled on the options page), so you can the music you prefer as Jatris
bachgroud.


Also found (and solved) a graphic glitch in hint subsystem for non native resolutions.


Hope to release a new update soon.

lunedì 12 marzo 2012

Jatris Free 1.2 Released

Time for another update.

Finally added the "Trial" game mode.


In this new game mode every removed gem is replaced by a black pearl instead of a random created new gem. Black pearls does not match with any other gem (not entirely true...there is a secret trick here :-) ) reducing the number of valid matches. This game mode is very difficult, I rarely pass level 7.

Here a screenshot of the new game mode.



Also modified grid creation again to improve game difficulty curve for levels 13-32

domenica 19 febbraio 2012

Jatris 1.15 released

Released a new update for Jatris Free

The main new feature is the hint system.
Simply tap on the game status widget (the one with the multicolor arc :-))  to get a hint on the next move. A hint costs points or time (in timed game mode).

Added a second howto page with special jewels (white and black pearl) and hint howto.

Tap on game area when game is not started now switches between splash,highscore and howto pages.

Done some code cleanup and (little) memory save.

domenica 12 febbraio 2012

One month on the market

Jatris was released on Android Market one month ago.

It was installed 115 times, not a big number but I'm surprised someone can find a game like Jatris without any advertising.

Thanks to everyone for installing and playing Jatris, feel free to send feedback and suggestions.


I'm currently working on hint system, logic is completed but I have some problem with graphics; I started working with the idea of using a blink to point focus to the hinted jewel but it is hard to see on little screens, so probably I will try to shake the jewel to see if it's more visible :-).

sabato 4 febbraio 2012

Jatris - Thinking to new features

Working on trial mode for Jatris.

Also thinking about features to add, maybe an hint system is a good idea.

giovedì 2 febbraio 2012

JaTris Free 1.10 released



The main new feature of this release is the Timed Game mode.

Now you can play versus time.

This game mode implies a completely different game strategy, things are quite slow in the first levels but from level 5 or 6 the game become frenetic with no time to think to the next move, simply locate a valid move as soon as possible or time will expire.

This version also includes a new gem grid generation scheme to improve game difficulty curve in level 10 and beyond, and some difference in position on interface graphic widgets to reduce overlapping of interface components in non native resolutions (mainly in 320x480).
JaTris Free



JaTris Free (Just Another Tris) is a classical puzzle game with gems
(not so original, isn't it ?)

Just tap on a gem to select and swap with a neighbour gem (tap or drag) to match a set of 3 or more gems.
Make sets with 4 or more gems to get more points, and do combos to boost score even more.

More gems are waiting you in upper levels (up to 11 different gems, some with special powers).
Up to 32 levels of fun for this classical match-3 puzzle game.



Click on an unused part of the interface to pause/resume the game.

Only the classical game mode is available, timed and trial mode planned (already visible in the interface but inactive).

Supported and tested resolutions :

LDPI         240x320, 240x400, 240x432
MDPI         320x480
HDPI         480x640, 480x800, 480x854

Tested with Android 2.2 native game resolution is 800x480.
JaTris was not designed for tablets even if it may works on 1024x600 and 1200x800 resolutions using the zoom facility (but not the stretch).