Browsing the archives for the open source tag.

Battle For Wesnoth for iPod touch

Games, Review, iPod touch/iPhone apps

Battle for Wesnoth is open source strategy game for windows/Mac/Linux. Now somebody have ported the whole game to iPhone/iPod touch.

All the maps, units and rules are the same. If you have played the battle for wesnoth on your computer, you will learn iPhone version without any problems.

Major changes to pc version is only the controls (obviously) and framerate. Controls are good and hitting small buttons is pretty accurate. I haven’t got any major problems controlling the game. At first it may feel bit difficult.

As the iPhone isn’t as fast as the computer, it feels bit slow some times in terms of framerate. On large maps the scrolling can be pain because of this. (but the “next unit” action helps here) The load times are long for iPhone game. It takes about 1-2 minutes to get to the game… So its not for quick game.

There is also multiplayer game included, but I haven’t looked into it yet. The game also supports Openfeint platform. Openfeint is same kind of gaming community like Plus+, but it offers much better way to communicate with friends/other people. Openfeint has also achievements juts like Plus+.

The prize (4e) is bit high for a port from a free game, but if you like Battle for Wesnoth on computer, buy it. If you haven’t, check the pc version first, as it is free.

No Comments

Napalm Engine Framework Concept

Coding, Projects, Web developing

I have recently started new php project. It is my own php engine/framework.

I have tried couple frameworks and all of them have been pretty nice. I especially like cakephp.

But the problem with these sometimes is that they force too much where what code should be placed. Example the Model View Controller stuff. The idea is great idea and I have nothing againgst it, on some small project cakephp/any most of the frameworks are way too massive. (in my opinion of course)

But if I code from scratch and place all if my code where it feels good to place it… Usually something is somehow in wrong place. This is when I get the idea for my own framework.

Napalm engine framework (or NeF in short) is a php framework that doesn’t make creating code any faster. It just helps to keep code where it should be. It should help managing code base on small/medium project.

This framework also won’t force user to place some code on some place. It only offers way to manage code in standart way. If user doesn’t want to use all of the elements, rest of the system won’t break.

NeF will also be simple to learn, because there isn’t any kind of complex API.

The idea of application workflow is following:

Actions are things that gets users input, does querys to database, handle data, etc.

Render segment is in 2 parts:

  • View is a HTML document with php links to blocks
  • Blocks is a piece on a view. Example a content area/navigation.

Then there is 4 different helpers. Helpers are small code snippets that should be executed, but really aren’t part of actions/views

  • Pre-action helpers – stuff that is executed before actions
  • Pre-render helpers – before render
  • Post-render helpers – and after render
  • Normal helpers – can be used anywhere in code, called by specific function.

And if I will ever get this done, I will publish this under open source license.

No Comments

Firefox 3.5 performance

Applications, Mac, Web developing

Performance of firefox with older releases haven’t been awesome. Couple of addons can easily take over 100megs of ram and browser become easily very unstable and slow. I did update on my macbook (PowerPC G4, 1.6 GHz single core CPU, 1.5G DDR2 ram MaxOS 10.4.11)

New firefox has also new logo

New firefox has also new logo

Before update with 3.0 I had 7 addons installed. With 2-3 tabs open firefox used 250megs of ram and cpu was 30-40. When my firefox was on heavy usage, it taked over 1500megs of ram and 100% of cpu… After update to 3.5 memory usage dropped to 90-100megs. Cpu dropped to 10-15%.

Then I installed 26 addons and opened 47 tabs (2 youtube videos and one <video>-tag, lots of heavy js/css sites.) Memory usage was just 226megs and cpu usage was at 50%. Firefox was little slow, but usable! It didn’t even try to freeze. After the test I closed all tabs expect one and memory usage dropped to 148megs and cpu usage is back at 10-15%!

Quick list:

  • Using many (over 15) addons won’t kill firefox instantly
  • Opening many tabs(over 20) won’t freeze kill firefox anymore
  • Memory usage have dropped 300%-500%
  • CPU usage is almost always under 50% on normal usage its under 20%
  • Acid3 test gives 92/100 points (ie8 gets about 20)
  • Firefox is my primary browser again

Biggest problem for me with firefox was the CPU/MEM usage while using lots of addons and now its fixed. I can install every cool addon I want and still use firefox without killing it! Now I just want that they fix the nvidia/linux canvas tag bug…

3 Comments

Ohcount and Count Lines of code

Coding

Ohcount and Count Lines of Code (CLOC) counts size of code project. Mostly these aren’t very useful applications, but it is fun to see that I have written 300 lines of code in couple of days.

Ohcount is used Ohloh to generate source code reports. I was disappointed to found that i can’t use Ohcount to scan whole history of my repository, it only scans current status of code.

CLOC is written in Perl and Ohcount in Ruby. It maybe little annoying to compile Ohcount from source, but it is much faster than CLOC. If you want something that is easy to install, take CLOC. But if you are going to analysis more often than once, try Ohcount.

Here is example output from CLOC:


96 text files.
83 unique files.
33 files ignored.
http://cloc.sourceforge.net v 1.08 T=7.0 s (8.9 files/s, 547.4 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code scale 3rd gen. equiv
-------------------------------------------------------------------------------
PHP      49    588   172     1950 x 3.50    = 6825.00
SQL      1     58    87      277  x 2.29     = 634.33
BASH     10    54    133     261  x 3.81     = 994.41
CSS      1     46    5       192  x 1.00     = 192.00
Python   1     2     1       6    x 4.20       = 25.20
-------------------------------------------------------------------------------
SUM: 62 748 398 2686 x 3.23 = 8670.94
-------------------------------------------------------------------------------

And here is Ohcounts output from same file:

Examining 555 file(s)......

Ohloh Line Count Summary

Language Files Code Comment Comment % Blank Total
---------------- ----- --------- --------- --------- --------- ---------
php      58    2146 219     9.3%      716  3081
sql      1     277  87      23.9%     58   422
html     60    242  1       0.4%      38   281
css      1     192  5       2.5%      46   243
python   1     6    1       14.3%     2    9
---------------- ----- --------- --------- --------- --------- ---------
Total 121      2863 313     9.9%      860  4036

- Gestalts -------------------------------------------------------------------
Platforms: PHP, SQL, Scripting

Yep. There is some difference on results. I don’t know which one is more accurate.

I haven’t posted for a while because I have coded my main project. It isn’t public, but I will blog about it when it is ready. :) I try to blog more often.

No Comments

Git, simple source control system

Applications, Linux, Tutorial

If you project is bigger than 20 lines or it has over 1 user, you need source controlling system. If you are doing something very complex or you have many users it’s good to choose services like Google code or Beanstalk. (or something else)

But if you only need a source control system for your self, it’s not so clever to take remote source reporisity, because you can have your own source control system on your local machine!

Setting up svn server is much more difficult than setting up local git repository. I recommend to use git for every small local projects, because it is extremely easy to set up and it doesn’t require server to run.

So, install git (apt-get install git git-core) and then go to your projects directory and type:
Git init
Git add .

First command initializes git repository on .git folder and second command adds every file to new repository. In future when you add more files to project, just use “git add “.

Then do the first commit to get it working.

Git commit -a

Commit command opens default editor on your system. If you want to change it to another editor, add next line to your .bashrc file. (and reload bash to get it working :) )

export EDITOR=vim

Then just continue coding your project. When you want to commit more, just use previous command to do it. After you have done couple of commits you may want to see what you have done. Use “git log” to view latest commits.

When you type just “git” you will get list of sample commands that you will need later. More documentations can be found from gits website.

I recommend to try graphical git application: giggle. It makes it easier to understand branches.

Happy coding :)

No Comments
« Older Posts