Hello there, I recently bought a new phone, a Wiko Cink Peak, and I had some small troubles connecting it on Ubuntu. As it’s a phone imported by a French company and I don’t think it is sold anywhere else than in France (under this name/specs), the rest of this post will be in French. J’ai acheté il y a quelques jours un téléphone Wiko Cink Peak, c’est un téléphone milieu de gamme à bas prix. J’en suis très content, mais j’ai juste eu quelques problèmes pour qu’il soit reconnu sous Ubuntu pour le débuguage USB (et donc pour le dev). Comme il y a peu d’information concernant ce téléphone sur Internet (en tout cas sous ce nom), j’ai décidé de faire ce post afin qu’il soit potentiellement référencé. Bref, par défaut sous mon Ubuntu 12.10 le téléphone n’est pas bien reconnu, il suffit de...
Category Archives: Java
Alien Blitz episode 2 & 3 will be ready soon

I began working on episodes 2 & 3 lately Converted all maps to top view, I now have to check if they actually work, and correct lighting issues Corrected some bugs on monsters from episodes 2 & 3, there were not that much actually, but I think I will get more bugs when I do the testing Changed spirit behavior, in Snorms it was a small monster hard to aim, now I made it very strong as aiming is automatic on Android Added camera button for Rifle & Railgun, when pressing this button you will be able to move freely the camera, and lock a monster far away Created a new sprite for the player in isometric mode, it’s some king of mecha armor, it’s not perfect, but I’m quite happy with it. I think both episodes will be ready in a few days, then...
Memory management for Android game
One of the biggest problem I had when converting Snorms from PC to Android was memory management. Memory on Android is quite limited, usually you have around 32mb heap size available, and garbage collector is your worst enemy. Combining these two things might be quite tricky, even more if the game was first built for PC where memory and minor garbage collector are not a big issue. I’ll try to explain in this small article what I did technically to get around this problem. Environment The best thing to do is of course to run the application directly on Android and use appropriate tools, but I am used to PC tools and it’s a lot easier to just launch my game from eclipse than sending it to Android (or Android simulator). So In order to have an environment similar to Android you need to adjust...
OpenGL (2D) advancement
I’ve worked on moving to OpenGL instead of software rendering lately, it’s a big work, but I made great progress. At the moment Snorms is fully software rendered (no OpenGL or acceleration of any kind, I’m not even using Java2D), so it’s using a lot more CPU than GPU. Moving to OpenGL will improve performance as CPU will less be used for graphical stuffs. And I hope that if performance gain is high enough I will be able to swtich from 30fps to 60fps by default. I am using Slick2D to do all this 2d OpenGL stuff, it’s a great library, I should have used it from the beginning, it would have made development a lot faster. It might also help porting ICE (Isometric Cube Engine, the engine used by snorms, the level editor, and the old snake game “kleum”) to android, if I want to...
GraphicsRenderer, a replacement for Java 2d graphics
Great news everyone ! I finally have some time to speak about programming ^^ So I will talk about a replacement for Java 2D graphics I made for my engine: GraphicsRenderer. Introduction I made a replacement for Java2D graphics object a while ago as I thought it was missing some functionalities, and I was wondering if I could get something quicker, without using lwjgl. I did not want to use lwjgl because I wanted my game to work on an applet, without security warnings, so I wanted a pure java solution. Now that Snorms is a downloadable game, I don’t care about that anymore, but I am still using it as it’s working quite well. Maybe I’ll change that in the future, I don’t know… Some of the things I did not like about Java2D: It is quite slow when displaying hundreds of images Applying...
Sound issues
I always had problems playing sound with Java, at the moment I use standard Java sound, with the following limitations : Under Linux there is a crackling sound, with both OpenJDK or Oracle JVM, I can’t figure out why and how to remove it (tried it on two computers, same problems) Under Windows, when changing volume, the sound becomes awful (crackling a lot), I just used the standard way to do it ‘line.getControl(FloatControl.Type.MASTER_GAIN)’, it does that on every computer I tried. Can’t figure out why… Under Linux (I just tested OpenJDK), changing volume randomly crashes, maybe it’s crackling more when it works, not sure… When trying to manually change gain (directly modifying source data), it seems the sound output is automatically adjusted. Meaning that even if I reduce volume on source data, the sound will be played full volume, losing bits of information… The result...
Java 2d tips and tricks (part 1)
After 2 weeks working with Java2d, here are some little tricks to help optimize your code Don’t create too many intermediate Graphics Creating a Graphics is quite long, and usually it’s not the good way to do stuff. You should try to think all your rendering process with the less Graphics object creation (getGraphics, createGraphics,…), if you can just use the one given by the paint method (or the one from your double buffering system), and pass it as argument in all your rendering functions to directly draw on it. Try to stick to environment image format If the display image format is not the same as your application, rendering can be very slow, usually to create an image you should just use the createCompatibleImage function public static BufferedImage createCompatibleImage(int width, int height, boolean transparent) { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gd = ge.getDefaultScreenDevice(); GraphicsConfiguration...
