Update damage calculation, use defense and penalty values.

Tags: progress

Initiative system

Just implemented initial version of initiative system on client and server. It is a bit straightforward, but it will evolve.

Also implement damage calculation on server. 

Tags: progress

Dialyzer on guard of typing of your Erlang code

Last week I worked on new database scheme. Due this I refactored client and server code. If code  is static typed it is more fun to do than with dynamic one. So I tried use dialyzer for my erlang code. Dialyzer found some errors in my function and type specification and some errors in pattern matches. 

Use dialyzer is not so easy as HaXe typing system, but it does his work.


Hi again, this is too late progress

I not stopped working all this time, but had no motivation to blog.

All this time I mostly worked on client side and did small fixes on server.

I played with ASwing as gui library, I even wrote my custom PLAF, but ASwing too heavy. And I found MinimalComps as alternative to it. Now I use haXe port of MinimalComps with my custom patch and components. But some component implemented not optimal and I think to refuse of MinimalComps too.

Yes, I also switched from as3 to haXe - mainly because as3 compiles too slow. Also haXe have NME and I plan to use NME to port a game to mobile platforms and Windows. What I use more from haXe

 * type inference - so I reduce keyboard typing

 * typedefs - in my practise - nearest analog is a c++ templates

I very inspired by haXe and have only positive experience of using it.

About game. I found rendered particle effects that can be used in non-commercial game. I implemented loading and animating of this effects. For doing this I refactored actions system for game characters. It now more flexible than was.

I added characters icons and characters info window. Also added damages informers and loading screen.

About cache engine. I decide that inventing my own cache engine is not that I need. Now browser caches assets that I use and I thrown out assets management code from client and server and use nginx to serve static assets. Also I remove data socket (http://zerg.tumblr.com/post/9212973096/i-found-solution-i-will-use-two-sockets-one).

About chat. I found error in my network code that loads chat messages from socket and under heavy load may freeze all game.
That all, see ya later!
Tags: progress haxe

Cache engine for Flash Player

Today I thought about assets caching and about Flash SharedObjects for it. I asked about it on reddit[1] and after it we discussed this with my brother. We spoke about TankiOnline and he told that TankiOnline uses browser cache. Searching about browser cache support by Flash and found great interesting post [2]. All what I thought in the morning was described in this post!

[1] http://www.reddit.com/r/gamedev/comments/kim2t/flash_local_storage_as_a_game_resource_storage/

[2] http://jessewarden.com/2008/11/writing-a-caching-engine-for-flash-player.html

Tags: gamedev links as3

How to do closure in AS3


Tags: as3 links

Progress report

Another two or three weeks was gone…

During this time I implemented a protocol for commands and data. As I wrote earlier, it is used two transport sockets - one for commands and one for data. Data transfered via data socket only in one direction - from server to client.

Next thing I implemented was logical protocol: login -> screen of game character selection <-> screen of city <-> screen of battle

And, finally, we have created a database and started to fill it up.

Today I pushed code to the  test server and ran it. During deploying I found one small race condition error and fixed it.


AS3 performance tips

jwopitz, author of as3isolib, shared interesting links about as3 performance:

  • Beware of Getters and Setters[1] - Interesting, that function call even slower than property call
  • Inlining Math Functions[2]

[1] http://jacksondunstan.com/articles/433

[2] http://jacksondunstan.com/articles/445


I found solution - I will use two sockets - one socket for commands and one socket for data transfer.