September 17th, 2009
Not so long time ago me and my friend decided to create a steampunk 2D shooter on Android. Since every, even most simple game requires some architecture specification, I decided to start our technical design with one (conceptual design was settled earlier). Inspired by Google I/O talk by Chris Pruett, I made up following game application foundations:

Architecture is based on three threads: main thread created with every Android application, rendering thread and simulation thread. Simulation should keep watch on timer, update game word, calculate physics, AI, etc. Rendering thread draws a frame as frequent as possible, and it’s independent from simulation. If very long draw call is encountered, the simulation wouldn’t have to wait for it to finish and would continue to update itself, ensuring smoother synchronization with rendering.
Rendering thread must be set up with instance of renderer class implementing IRenderer interface. This way renderers can be easily attached to application. I hope we wouldn’t be forced to use anything beside simple Canvas renderer, although if heavier optimization is required, switching to some fancier renderer which uses OpenGL ES to draw textured squares shouldn’t be a problem.
I have already made some prototypes with flying plane, scrolling background and simple enemies. Game runs fine until garbage collector kicks in, and when it does, everything freezes for about 200-400 miliseconds(!). It happens very often, successfully ruining all gameplay. Of course, that prototype was written very casually, but it appears that almost all memory would have to be allocated before actual gameplay to stop garbage collection during it.
Posted in Android, programming | No Comments »
August 30th, 2009
As I am digging deeper into Android development, I decided to share some thoughts about it here.
1. Mobile games / Game development
For my point of view (developer and gamer) it is the most interesting part of Android market. I would really wish that more complex games would show up: point and click adventure, RPG or just some shooter with nice controls and graphics. Although I have to admit, many casual games are beautifully polished and they are just pleasure to play (Buka or Jewellust/Devilry Huntress).
I have already spent some time with SDK, and I am aware that writing complex, graphically demanding game is challenging on Android platform. First of all, main there is Java as main programming language. The old programming joke:
“Knock, knock”
“- who’s there?”
…very long pause…
“- Java”
may be funny, but when you write a game on such limited hardware, you suddenly bump into bottlenecks not encountered on other platforms. Excellent talk about Android game development can be found here:
Google I/O 2009 – Writing Real-Time Games for Android. It’s author, Chris Pruett, presents efficent game framework and different rendering methods (Canvas, OpenGL), which I adapted to use with my own project. On the other hand, Mystique is a 3D first person adventure game which overcame platform restrictions. I certainly hope that more games like Mystique would appear on Android market.
Read the rest of this entry »
Posted in Android, programming | No Comments »
July 20th, 2009
It’s hardly possible to write something about Bob Dylan that have not been written before. But using computer to analize artist lyrics is rather uncommon, so my first thought was to find most common words used by Dylan in his songs. Bruce Springsteen cites him as one of his influences, so Springsteen lyrics are added as an comparison.
Python was my language of choice to write some simple code that sorts words in order of their occurrence. That task is easy, sure, but you have to get full lyrics first, preferably stored in one place(i.e. file). I haven’t even bothered to look after something like that on the Net. Instead, I used Beautiful Soup to parse artist’s web pages, download lyrics and write them to file. Beautiful Soup is fast and simple Python parser, excellent tool for this kind of job. http://www.bobdylan.com/ and http://www.brucespringsteen.net/ contains new and error-free songs lyrics (from 2009 albums) – you can’t say that about lyrics found on various strange fan-made pages in the internet.
Read the rest of this entry »
Posted in music, programming | No Comments »
July 3rd, 2009
I’m the fresh and happy owner of G1 Android phone. I have chosen it instead of Apple IPhone, because Android is open platform and I have read many dissatisfied IPhone developers complaints about Apple distribution model and objective C language unnecessary complexity. Android advertises it’s SDK as fast and easy, so I had to verify it immediately after unpacking and fully charging my phone. SDK comes with Eclipse plugin, which aids refactoring, debugging, provides class and method stubs etc. Installing it, setting enviroment and connecting your phone is piece of cake. After writing “hello world” application and running it on my phone , I noticed a possibility of using OpenGL ES 1.0 (fixed pipeline). I’m not really familiar with OpenGL API, but I managed to find some code samples showing how to create vertex-colored cube (standard example – not fun to watch anymore). After adding simple touch interface, I’m able to rotate my cube using index finger.
The whole process – setting everything up, going through hello world and adding controls to simple OpenGL ES demo took me around an hour. It is indeed very easy to start developing on Android. I would like to create something more sophisticated now – maybe a game with touch interface. Android store is not overwhelmed by games like Apple store, creating even simple, free game could be nice thing for community.
Result may be not very impressive
, but anyway – here’s the screenshot:

If you would like to read more, a nice artice which compares Android and IPhone development can be found here:
Android vs IPhone Development: a comparison
PS. Android also has ASE – Android scripting enviroment that allows you to write simple Python or Lua scripts directly on your phone (preferably by using attached keyboard). Scripts can be used to make phone calls, send messages, poll location from GPS, use text-to-speech module and many more. There is even a guy who wrote automatic garage door opener using ASE – you can read about it on his blog: brad’s life .
Posted in Android, programming | No Comments »
July 1st, 2009
I’m currently having fun with Havok Physics Vehicle kit. Goal is to create a demo application, which uses Havok to calculate vehicle physics and render that vehicle with DirectX. So far I managed to put everything together: terrain, simple skybox and vehicle with camera following it. Here are some screenshots:
Graphics need polishing and vehicle model is temporary. Notice that size of rendered model and size of Visual Debugger vehicle shape don’t match (in reference to terrain). This is the first issue I have to fix. I plan to add some rigid body objects to scene, crashing into them should be fun. Terrain should be flattened a little (…or maybe vehicle replaced with an-off road car?). I’d like to publish some source code here, although some improvements and refactoring have to be done – it works, but it’s not very pretty.
Posted in programming | No Comments »
June 18th, 2009
Most gamers and video game developers know more or less what is Havok engine. Beside physics simulation and collision detection, Havok offers many other features, like animation, realistic cloth or dynamic destruction of rigid bodies. Being cross platform middleware, Havok is used in pretty large number of video game titles: from PC’s Painkiller, PSP Killzone: Liberation to Assassin’s Creed, Dead Space or Fallout 3 on modern video game systems. Best thing – you can try it for free and use it in your home-made game or demo application. After registration on Havok site, you get binary bundle featuring standard Havok Physics and Havok Animation products.
It could be hard for one to instantly “jump in” and create a simulation using Havok. Provided documentation is excellent and there are Havok software engineers on Intel Software Network to help and answer questions, but the SDK and it’s range of features are huge. Therefore I would like to write some tutorials or helpers about starting with Havok Physics 6.5.0. I believe that beside official support, it’s hard to find such information elsewhere, so hopefully it will help someone (or not, anyway – I’m going to write something).
Tutorial is intended for C++ developers, not artits or modellers (you can also use Havok in 3D modelling applications, like 3ds max), so you should have basic C++ skills and Microsoft Visual C++ IDE. I will present how to setup and link libraries, initialize Havok, create a flat surface and preview it in Visual Debugger. Of course all of it can be found in documentation and demos added to SDK, but I’ll try to compact everything here. Continue to tutorial with following link:
Havok Physics Tutorial part 1
Posted in programming | 2 Comments »
June 15th, 2009
I have recently done some shopping at amazon.com store. I bought two programming books not published in Poland, “Game Coding Complete 3rd Edition” and “Programming Game AI by Example”.

I had done some research before and it appears that both of them are fantastic books about game development. Third edition of Game Coding Complete was released recently, in March 2009. In principle, if a book has more than one edition, there are chances for that book to be good. I’m also waiting for third edition of best programming book I have ever read – Code Complete by Steve McConnell. Programming Game AI by Example should give me some prospect on AI programming. I have only used simple state machines to manage world entities behavior in my projects .
I can’t wait until my shipment arrives (It will take around 3 weeks, I have selected standard delivery terms). Until then I’m going back to reading Real-Time Rendering.
Posted in programming | No Comments »
June 12th, 2009
Hello dear reader, my name is Piotr Pluta. I have recently graduated from college (Computer Science at University of Technology in Opole, Poland), so I would like to spend some of my free time discussing coding, development and other subjects here.
I am interested in web development (my M.A. thesis was titled “The accessability and usability in methodology of creating Web services for disabled people”) and game development (recently I was programming “Imagine Cup” competition entry game, titled Malaria Control). You can find my portfolio and works on this page, just follow the links in right panel.
This is my first attempt in blog field, so I will appreciate all feedback. I use Wordpress, because it is a reliable, popular platform and I can customize it to match my own needs.
Posted in blog-related | No Comments »