Pixel art and the curse of reality in flash games

Lately I'm working on a small and easy game in my spare time, which has pixel art style graphics. Usually I favor vector graphics with nice gradients, bells and whistles, but now I have chosen pixels for a time-limit reason. Not that producing quality pixel art would take less time than producing quality art of different styles, however the trick lies in user perception and the so-called curse of reality...

Read the full post

09.11.21. 22:07 - | comment! - §

Tags:   

Velocirapid sketch

Velocirapid, our possible candidate for the 60sec flash game contest. Click the image to see full size. GraphicsGale is indeed a very handy software for editing pixel art.

09.11.12. 13:47 - | comment! - §

Tags:    

JsUnHaXe - Javascript cleanup for Haxe

When developing flash games, you often need different architectural components: the game in flash, a server for save states and high scores, and maybe javascript for integrated flash-and-html user experience like status messages on the web page reflecting in-game events.

Haxe is a swiss toolkit language: write all your code in haxe and then compile to different platforms like neko or php (for the server), flash or javascript. Now I will consider the javascript target.

Haxe and multi-file javascript

When compiling to javascript, you often would like to separate functionality into a common core and smaller modules. However when compiling with Haxe, it will generate all the core data into the sub-modules too (well, this is not a precise description of what is happening, but let's stick with it for now).

Having a MyCore class and a MyCoreExtension1 class, after compiling with haxe -js my_core.js MyCore and haxe -js my_core_ext1.js MyCoreExtension1, both generated js files will contain definitions for MyCore.

Fortunately it doesn't seem to be hard to decouple the modules from the core. I wrote a small python script that I call JsUnHaXe, which removes redundant entries from generated js files. Download and try it using python jsunhaxe.py out_dir my_core.js my_core_ext1.js. Note that sub-modules, sub-sub-modules, etc. can be passed, in this case the Kth output file will lack all entries beginning from the first and up to the K-1th input file.

Happy Haxing!

09.10.27. 16:42 - | two comments - §

Tags:     

Haxe serializer speed

The serializing feature of Haxe can be very handy - for example using Haxe Remoting in a flash game to communicate with your server, Haxe objects are automatically serialized on the client (converted to textual form), sent over to the server, and unserialized to object form. However the speed of serializing does matter.

The serializer not only serializes the object passed to it, but also automatically follows and serializes references to other objects. As an example, if you pass the root element of a tree structure for serialization, it will follow the links to the child nodes and as a result serialize the whole tree. This is very fine, but if the objects contain cyclic references - like child nodes linking back to their parents - the serializer would run into an endless loop.

For avoiding this, the serializer has an option called useCache, which when turned on, the serializer keeps a memory of previously met objects and won't re-serialize them. Unfortunately, for technical reasons the lookup of an object in this memory takes O(n) time, n being the number of objects met while serializing, so the full serializing takes O(n^2) time.

This means that if you are keen on speed, you must not use the useCache option, and take care of serializing structures without cyclic references. And, unconvenient as it is, but sometimes you may have to consider going down to the level of (un)serializing by hand, which would enable for highly tuned speed.

09.10.17. 23:13 - | comment! - §

Tags:   

Preloading example with Haxe and SamHaxe

Let's see how can we create a preloaded swf for our flash game, widget or website using pure Haxe. For embedding the assets, we will use SamHaxe, our new flash asset tool.

Our goal is to have heavy assets in our swf, but would like to show a progress bar until all these assets have loaded.

Read the full post

09.09.20. 10:12 - | three comments - §

Tags:        

SamHaXe: an swfmill alternative flash asset lib assembler

Version 1.0 of our new tool called SamHaXe is now available for testing! It is a command-line asset library assembler for flash (currently flash9 and 10 are targeted - later flash versions may be supported in newer versions of SamHaXe, if demanded :). You enumerate the resources you want to import (sounds, images, fonts, text files, binary files, other swf files) in a resource description file, and SamHaXe assembles a nice swf from them, which you can then use in your flash projects.

SamHaXe was written in HaXe targeting nekovm, so it can be run on both Linux, Windows and Mac platforms. You can even write your own import plugins (see the Module API section in the documentation)!

You can download the source or prebuilt windows binaries from http://mindless-labs.com/trac/samhaxe . Please read the text carefully, as you still need to install FreeType and ImageMagick for the prebuilt binary and update the configuration file. Once installed, you can find plenty of documentation and examples at http://mindless-labs.com/samhaxe/doc/1.0/ .

09.09.10. 12:43 - | one comment - §

Haxe Game Development: Call for Article Request

As you may know, we deal with flash game development. There are currently not too many game development articles for Haxe, so please feel free to leave a comment with the topic you would like to read about, and we will do our best to confort you with code, articles and tutorials. Happy coding!

09.07.31. 23:48 - | two comments - §

Tags:   

Asset library and pure Haxe preloader tool

After KukkerMan's idea we have started a Haxe/neko project aiming to be able to assemble flash9+ resource libraries. The tool will be easily compilable on both Linux and Windows (and supposedly Mac?) as it is written for the nekovm target with as minimal external library dependencies as possible.

People will also be able to extend it via plugins to support importing their favourite formats into the library swf. So far we use it with success for importing png, jpg, alpha-masked jpeg images, binary data and mp3 sound into the asset library. As it turned out, the since far sought pure Haxe-based preloading is also possible via the tool. Read on for some insight!

(Edit: Don't forget to check out our latest article Preloading with Haxe and SamHaxe on the topic!)

Read the full post

09.07.03. 19:26 - | eleven comments - §

Tags:       

Haxe/Flash for IPhone

HaXe is a great language - if its main developer Nicolas Cannasse did not convince you yet, hot news about Haxe to IPhone compilation surely will.

This way Flash developers dropping "HaXe can compile to Flash? And what? So can AS3" will be comforted to use familiar language constructs and emulated Flash API with flash.display.Sprite and pals, for targeting Flash and IPhone with the same code.

Now go and fire up HaXe! ;)

09.05.22. 11:24 - | comment! - §

Tags:    

Improve sponsoring chance and distribution of MochiAds version-controlled games

"Thanks for considering us for sponsorship! Did you mean for the game to be published only in Flash 10? At this point, we are only looking for games in Flash 9 or below because there is just not enough penetration yet of Flash 10." - Email from a sponsor, after looking at a MochiAds Version Controlled game on FlashGameLicense, for which FGL says 'Required Flash Player version: FP10'.

While the current mechanism of the MochiAds Version Control feature is very convenient for the developer to use, the fact that the wrapper's swf version is set to version 10 by MochiAds may cause that sponsors may turn away from the game, or some portals do not pick up the wrapped game - all because Flash Player 10 penetration is not devastating yet. This could lead to missed sponsorships and suboptimal distribution performance and revenue.

However, it is possible to set the wrapped game's version to version 9, effectively solving this issue.

Read the full post

09.04.19. 21:16 - | one comment - §

Tags:  

About

Flash game development using HaXe and pals.

Last Comments

Prveen (SamHaXe: an swfmi…): hi, I tried to download and install the Linux version of th…
Pieter Witvoet (True one-file Hax…): Recently I had to build a preloader for a haXe game I’ve been…
Cristi Baluta (Haxe & Google Fla…): for me the additional 98k added to the file is a disaster, i’…
ron (True one-file Hax…): This was due to referencing stage prematurely. Be sure to pos…
Mk12 (True one-file Hax…): It doesn’t work when I put my game in it gives a null pointer…

Archives

01 Nov - 30 Nov 2009
01 Oct - 31 Oct 2009
01 Sep - 30 Sep 2009
01 Jul - 31 Jul 2009
01 May - 31 May 2009
01 Apr - 30 Apr 2009
01 Mar - 31 Mar 2009
01 Feb - 28 Feb 2009
01 Jan - 31 Jan 2009
01 Dec - 31 Dec 2008
01 Nov - 30 Nov 2008
01 Oct - 31 Oct 2008
01 Sep - 30 Sep 2008
01 Aug - 31 Aug 2008
01 Sep - 30 Sep 2007

Calendar

« March 2010
S M T W T F S
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Linkdump

Game design document - §

If you are about to create a new game, be sure to read this nice article along with its predecessors.

09.11.24. 13:29 | comment!

VelociRapid game element preview - §

Click the banner to play a preview of prey fleeing, and also take a peek underneath to see the quadtree space partitioning (nodes do not collapse right now). WSAD to control the dino.

09.11.19. 23:18 | comment!

Gambit's response to recent virtual currency changes - §

An interesting read at the Gambit blog.

09.11.05. 10:19 | comment!

Dirty coding tricks of game developers - §

Read it at Gamasutra

09.11.03. 10:02 | comment!

Payment providers - §

Some alternative payment providers for running your own virtual curreny system:

09.07.13. 21:38 | comment!

ssh tunneling in linux - §

To forward the local port X to the local port Y of the remote machine:

ssh -L X:127.0.0.1:Y remote.machine -N

Usage example: Setup a local web proxy (like privoxy) on a remote university machine, and connect to it from home. This way you can access university resources with ease.

09.05.14. 10:28 | comment!

Free flag images - §

http://www.33ff.com/flags/index.htm

09.04.08. 11:52 | comment!

Render text with ImageMagick - §

convert -font font.ttf -background none -geometry +0+0 -fill \#ffffff -pointsize 18 label:"`cat txt`" -set label '' out.png

09.04.02. 15:16 | comment!

Online Latex equation editor - §

Online latex is

09.03.11. 09:02 | comment!

Create swc from a tree of as3 files - §

V1 (thanks to Jarrad Hope!) compc -output my_swc.swc -include-sources .

V2 (the old and hacky :) cd tree_top; compc -source-path . -output my_swc.swc -include-classes `find . -regex .*as | awk '{gsub(/\.\//, "", $0); gsub(/\.as/, "", $0); print $0}'`

09.03.06. 09:58 | two comments

Delete first line from file - §

sed -i '1d' file.txt

09.02.18. 12:28 | comment!

Gentoo: check security holes - §

glsa-check -p $(glsa-check -t all)

09.02.04. 11:30 | comment!

Execution speedup with fifo - §

Speed up the execution of programs that generate massive unwanted log-files by sending those logs to null through a fifo: mkfifo logfile
cat logfile > /dev/null &
./myprogram -log logfile

09.01.19. 14:09 | comment!

ImageMagick PNG background and auto-crop - §

Set background to white and auto-crop with ImageMagick: for i in `ls *png`; do convert -flatten $i x.png; convert -trim x.png out_$i; done

09.01.12. 17:15 | comment!

Linux: split file on pattern - §

awk '/PATTERN/{i++}{print > "file.pdb."i}' file, found here

08.12.15. 17:46 | comment!

Replace in multiple files on Linux - §

perl -pi -w -e 's/search/replace/g;' *.php
Found here.

08.12.10. 10:42 | comment!

XPath in Python - §

A nice summary about options for xpath with python here.

08.12.09. 18:41 | comment!

Christmas Icons - §

Free Chrismtas Icons!

08.12.08. 11:46 | comment!

PS print on WinXP - §

Print to PS on WinXP without any printers! Cool :)

08.12.04. 12:59 | comment!

Sorry, OpenOffice - §

OpenOffice is simply a no-go. Ill UI, missing features. Go for Latex or Crossover Office instead.

08.12.02. 14:31 | comment!

Last Referrers