Android and HW differences

Since the release of the first game on the Android Market I have faced the usual problems on the HW differences of the different Android devices on the market.

 

I think this is the actual limitation of the Android platform, a lack in the HW standards.

 

 

This limitation forces every developer to perform endless sessions of quality testing on a multitude of devices that ofter represent a serious limitation for and indie team.

 

Not all the people of starting teams can afford to have tens of devices for testing and, even if they can, no one can guarantee that the application won't crash on a specific sub version of the HW or a specific version of Android.

 

As if it was not enough the presence of a multitude of custom Roms, custom access levels (root access), anti virus and anti spy-wares make the situation out of control and almost impossible to be handled by simple human beings.

 

Besides, if you decide to go for a custom code written in C, eventually using the Android NDK, things gets harder and harder.

 

Just to report an example of this, when we released the version 1.7 of Fantasy Racing, we started received bad reviews (four one star in one day, terrible!) and we didn't know how to react.

In the comments our users reported things like "always crashes" or "does not start" while on our devices the game was rock solid and very stable.

 

Rilascio Fantasy Racing - Post Mortem Report

 

Introduzione 

Ciao a tutti

vi presento il titolo appena rilasciato dal mio team amatoriale, il team novasoft.

 

Il nome del gioco e' Fantasy Racing.

 

 

E' stato pubblicato Venerdi 17 2012, nel market android:

 

https://market.android.com/details?id=or...t.racegame

 

Tecnicamente il gioco e' basato su di un framework che noi amiamo chiamare PATRIA 3D engine, totalmente proprietario e scritto in Ansi C puro. Il nome e' dovuto al fatto che quando abbiamo iniziato a svilupparlo erano in corso i festeggiamenti per il 150 anniversario della nostra nazione. Ecco il motivo del nome PATRIA.

 

 

 

Alcuni cenni su PATRIA

 

Il motore in questione ha le seguenti caratteristiche (al momento, anche se in continua lavorazione):

 

- Supporta pienamente OpenGL ES 2.0

- E' completamente compilabile in qualsiasi ambiente desktop (Windows, Mac e Linux) e mobile (IOS e Android)

- Supporta vari formati di immagini per il texturing

- Supporta shaders standard GLSL con un framework di caricamento e compilazione molto interessante tra cui l'embedding degli shaders stessi al fine di proteggerli da un eventuale intrusione nel package applicativo.

- Supporta caricamento di modelli da formato OBJ e da un formato proprietario .patria3D che viene ottenuto attraverso un tool di conversione proprietario

- Nel gioco fantasy racing si e' implementato un map editor basato su fogli di calcolo cosi che chiunque potesse editarli (funzione non aperta al pubblico).

- Supporta il wrapping JNI per il supporto NDK

The love and hate for shared libraries

 Since yesterday I have been playing around on the WII controller integration on my PATRIA 3D engine.

 

This is required in order to have a fully working accelerometer support for our games testing since it is quite an effort to perform real testings on the smartphones especially when you are still in the middle of the caos of code development.

 

I have been trying the libwiimote on my ubuntu 64 bit but unfortunately, for some reasons, it does not look like the best solution for me (thought the library is well done). In fact it has a lot of sleep/wait time in the implementation which cause the frame reate of the game Fantasy Racing to drop to 15/18 FPS on my laptop. It looks like that, if no input is made on the device, the wiimote_update function freezes my process.

 

I have then decided to go for libwiiuse and I find it fantastic though I have not yet completed the integration.

To cut a long story short, I have compiled the library, using the well done documentation, I have done all the required configuration steps in my eclipse environment but every time I have run a compiled program using the shared object library libwiiuse.so  I used to get this error message:

 

error while loading shared libraries: libwiiuse.so: cannot open shared object file: No such file or directory

 

This problem has kiled me since I spent a lot of time looking for an explanation to the root causes of it.

 

After I while I thought.....holy crap Maurizio, can you be such a stupid? The new library is a shared library which links other shared libraries, let's try to refresh the dynamic linker cache by running the command ldconfig

.

And....it actually solved it.

Lesson learnt, whenever you have problems linkind shared libraries, always remember to update the linker cache!!!

Fantasy Racing Alpha 6.0

 Since long time I was not publishing any news about the new title under development called "Fantasy Racing"

In the mean time our engine has evolved to version Alpha 6.0 which is, according to our internal consideration, one of the last versions being part of the alpha phase. Soon we intend to move to Beta - Release candidate versions.

The Game is almost complete, music is there, game interface is there, gameplay works fine, mobile devices integration works flawlesly.

We are finalizing the tuning of the engine in order to achieve a better frame rate on old devices but so far the results in that area are excellent as well.

We have an average of 55 FPS on a Galaxy TAB 7", 60 FPS on an Asus Transformer EEE PAD with NVIDIA tegra and results on other devices are amazing in terms of perfomances and compatibility levels.

The PATRIA 3D engine is starting to be a monster with many heads and its capabilities, considering the fact that has been developed only since few months are very good.

 

I am working on free time (ahahahhahah this is good, free time!) a complete matrix of the capabilities of the PATRIA 3D engine, I hope to be able soon to post it on this site and on the new upcoming PATRIA 3D official website.

 

At the moment, enjoy this video:

 

 

 

 

People selling smoke

I see very very often people selling smoke to their colleagues and to their organization in general.
There are people which have built their carrier around nothing (technology wise) but able to sell it for something innovative.
The last one I have seen is to sell the "support for retina display" for an iphone pre-built RSS reader application.
I have to be honest, I don't know if it is worse the person selling this bullshits or the organization/people which buy them.
 
 

How to keep consistent 2D coordinates in a 3D world having different resolutions

This document aims to document how to support 2D objects positions in a 3D engine supporting different resolutions and aspect ratios.   This is the solution I have currently adopted in our PATRIA 3D engine and it is not for sure the best solution available there.

 

In such conditions it is quite difficult to position objects that perfectly fit your scene such as the game's HUD (for instance life icons, energy bars etc). I am sure there are multiple ways to achieve the wanted result but this is the way I have implemented in my PATRIA engine. Let's take as an example the following HUD positioning in for the fantasy racing game based on the Team Novasoft's PATRIA 3D engine.

 

Focusing our attention on the right side of the picture where the HUD is displayed:

 

We can easily understand tha the HUD is composed of 6 pictures, 5 pictures that diplay small stars (life in the game) and a pause button placed in the center.

 

In order to calculate the X game 3D coordinates of where the engine has to diplay the texture's quad (2 triangles), some calculation is required as shown in the following code excerpt:

   

Fantasy Racing Alpha 3.0

Here we are, the version A3.0 of the new teamnovasoft game Fantasy Racing.

Many optimizations have been done. Now the new engine implements the uber model technique which aggregates multiple 3D meshes into a single object in real time in order to perform massive OpenGL Batching and let the GPU operate at its maximum power.

 

 

Previously the engine soffered of an internal segmentation. The issue is now solved thanks to this innnovative solution.

 

 

Debugging a C 3D engine using Valgrind

 I recently faced some memory corruption problems on my PATRIA 3D engine which are quite painful to be solved.

Luckily I started using Valgrind, an opensource dynamic analysis tool which can debug the memory allocation of a typical C program.

Valgrind is free and can be downloaded at this URL.

http://valgrind.org/

The very interesting part of Valgrind is that you can run your compiled code (complied using debug symbols BTW) and see what is going on at memory allocation/read/write and deallocation level.

This is really what a C programmer would live to have always in his toolbox.

 

For instance, it is quite easy and straightforward to find memory access errors such as:

==8334== Invalid read of size 1

==8334==    at 0x4C29804: strlen (mc_replace_strmem.c:282)

==8334==    by 0x42FF06: PATRIA_Shaders_LoadAndCompile (PATRIA_Shaders.c:113)

==8334==    by 0x430D20: PATRIA_Shader_Load_Phong (PATRIA_Shaders.c:649)

==8334==    by 0x4137A4: Game_Menu_Engine_Init (CUBE_Game_Menu.c:3260)

==8334==    by 0x432657: main (main.c:244)

 

 

 

It is also quite reliable the function which identifies the conditional jumps in the program which are based on uninitialized values such as:

==8216== Conditional jump or move depends on uninitialised value(s)

==8216==    at 0x41761B: PATRIA_Draw_Scene (PATRIA_CUBE_Draw.c:1801)

==8216==    by 0x40D195: Game_Engine_DO (CUBE_Game_Logic.c:4563)

==8216==    by 0x50A93F7: glutMainLoop (glut_event.c:972)

==8216==    by 0x4326A8: main (main.c:267)

Fantasy Racing Alpha 2.2

 A video o the Fantasy Racing Alpha 2.2

 

This version shows the following:

 

- New Blinn-Phong based shader for 3D objects rendering

- New Linear Fogging

- New depth culling

- New HUD for the game

- Track ground and Borders

The Pain of Memory pointers

 I always loved the C language, it is a pure passion for me, I always use this fantastic language when I need to develop real time applications.

These days, I am very focused on my new 3D engine called PATRIA and I am now doing some housekeeping procedures in order to avoid memory leaks and optmize the engine to run on handheld devices that, obviously are very limited in terms of resources avaialable.

 

Well, to cut a long story short, I was working on the PATRIA Objects memory release from the main Objects chain at the end of a game level played.....well, the engine worked smoothly on my Linux Desktop but, once ported on Android it started to crash.

 

Now, I have to say that I love the C language for its power and the flexibility that the memory pointers give you but I have to admit that, when something going wrong, it is a real pain in the neck.

To cut a long story shot (I started this topic yesterday and Today I don't even understand why I have initiated it), I found out where the error was.

It was depending on the way I have linked one of the thousands memory pointers in the PATRIA Engine core chain.

 

In fact, all of the pointers were the result of a malloc operation while one of the item was a memory pointer reference to a statically declared variable.

Well, this was the problem, on Linux using gcc, the compiler was good (bad) enough to identify the problem and go on, on Android, still using gcc, the program crashed at runtime level.

 

I spent 2 full days and a lot of headache but in the end, I won!

 

Lesson learnt: When you have a run time error during a free operation, always check that you are not deallocating a statically allocated memory segment! it is an error!

 

 

 

Syndicate content