26. September 2016

Siriel 02 – The flip trick or left and right animation

The character in two 2D game should be able to walk left and right. The movement could be underlined by animation to the left or right.

In old days when computers had very little computational power it was necessary to draw left and also the right animation as you can see in following sprite sheet.


Today you can save time for drawing one direction of animation and simply use the trick with flip. When direction changes just flip the image.

Here is code snippet from Unity C# script:

void Flip()
    Vector3 theScale = transform.localScale;
    theScale.x *= -1;
    transform.localScale = theScale;

The code and idea is from Unity Live training 16 2013 – 2D Character Controllers – time 42:30.

Here is the updated version 0.2 of Siriel with Flip function. I also fixed the RigidBody2D in z-axis to avoid flying around in different directions with the character.

25. September 2016

Siriel 01 – Unity experiment

Long long time ago I wrote a game engine for arcade game with name Siriel. The main character was inspired by small plush toy which was small tomato with hat. The name originated from one English lesson at school where we learned the word Cereal. I liked the sound so I made phonetic transcription to Slovak language and the main character was born. The whole game was inspired by series of Dizzy games from Code Masters. for Didaktik M (compatible model with ZX Spectrum).

My vision was to create the game engine which people can use to create their own Dizzy-like games. The Siriel 1 for PC was written in Pascal and it has very simple graphics with resolution 320×200. That was the technological maximum that I was able to achieve on 486 machine. After learning some Pascal and playing with Assembler I was able to get far better graphics and I wrote Siriel 2. The second game had just one scenario and it took about 20 minutes to play it. The result was better, but I wanted something more.

I found some special Pascal and Assembler units which were able to create game in far better resolution 640×480. It was also necessary to add some memory management module which played with extended memory in DOS, so the whole application was able to use more than 512 KB RAM. That was the foundation for Siriel 3.5 engine. The version “3.5” was inspired by Dizzy 3.5. I wrote 3 datatiscs for the game engine. The problem was that I reached the technological limits of Pascal with Assembler. The game was running only in DOS.

During my studies at university I made several attempts to reboot the game engine project. The first one was based on Allegro and C++. Both technologies seemed promising, but I felt into problem known as “paralysis by analysis”. I had temptation to add all features at once to the new engine. The engine Siriel 4 was working even on Linux. I had feeling that something is wrong. It was very hard to add anything into growing engine. Sprite animation was cumbersome.

Then I found PyGame which has promise of using incredible powers of Python while keeping great performance of C++. I made attempt to wrote engine in Python. The result was quite ok, but creating packages for different platforms was hard.

I put the idea with Siriel on back burner for several years. I was fascinated by Flex technology introduced by Adobe and it seems that it might be even right combination to build the game in it. I used Flixel and you can play one of attempts as small game PF 2010.

Unfortunately even this was blind path. Adobe discontinued all activities with Flex in favor to HTML5. It took about 6 years to web technologies to reach the similar state. Sure HTML5 is now much more flexible than Flex was before.

I was trying to implement games using jQuery, Angular, KiwiJS. Games were working. The technology was quite ok. But stuff like animation required a lot of effort.

Recently I decided to experiment with Unity 5. I was surprised how mature the technology is. In very short time I was able to import assets from the game that I wrote nearly 20 years ago and in few minutes get animation running. What was even more surprising for me was that Unity was able to produce packages for Windows, Linux, Mac, Android, iOS and WebGL.

Here is the result of the first experiment 🙂 There is just simple keyboard control. The main character is able to make at least some funny jumps.

10. February 2016

Story behind PF2016

Slides available in formats: PDF, SlideShare

Source code: GitHub/ysoftdevs/pf2016

30. December 2015

PF 2016

This year I have another special game for you as Pour Felicitér card.

Go to: http://www.ysofters.com/pf2016/

PF 2016 Puzzle Game

You can enjoy PF games from previous years: PF 2015, PF 2014, PF 2013,PF 2012,PF 2011, PF 2010

14. December 2015

Slides from talk at FI MUNI: C++ and Software Engineering 2015

Slides available in formats: PDF, SlideShare

Source code: GitHub/ysoftdevs/cpp-examples

9. December 2015

Thunderbird and Outlook solution of problem with Courier IMAP sslv3 alert illegal parameter

E-mail clients like Thunderbird or Outlook stopped to communicate with Courier IMAP/SMTP/POP TLS after some upgrade.

The only clue in log file was this error message:

courier couriertls: accept: error:14094417:SSL routines:ssl3_read_bytes:sslv3 alert illegal parameter

The problem was that certificate for IMAP (/etc/courier/imapd.pem) and /etc/courier/dhparam.pem were containing too short key. The short key was sufficient in past for encrypted communication. Unfortunately maintainers of Debian package forgot to add fix for upgrade.

It is very simple to fix the issue. Just generate DH with sufficient length.

DH_BITS=2048 mkdhparams

This command will update /etc/courier/dhparm.pem.

Make sure to update all pem files in case that they contain DH record.

Restart services and clients should be able to reconnect without problem.

If you still experience some issues with PEM files check out article PEM routines:PEM_read_bio:no start line.

24. May 2015

How to revert no-site-packages for virtualenv on Windows with Python 3.4

Python has support for virtual environment. It’s very handy to set up isolated space where you can store specific packages for the project. You can use command virtualenv to create virtual environment.

It’s very common to add option --no-site-packages which will isolate environment from packages installed in system.

Sometimes it is necessary to revert this option.

Linux and Mac users can control it by mechanism based on one file:


When this file exists Python is ignoring packages from system.

In case of Windows there is configuration file stored in venv/pyenv.cfg and you can change configuration of global packages:

home = c:\Python34
include-system-site-packages = true
version = 3.4.3

Change the configuration and call Scripts\Activate.ps1 to load Python virtualenv to PowerShell.

23. May 2015

Flask OAuthlib Multiple Scope Values for calling Google API

Google provides myriad of APIs for invoking operations on Google App Platform. It’s possible to integrate this calls with custom app using OAuth.

One option is to write app based on Flask (Python Microframework) with OAuth support provided by Flask-OAuthlib.

There is simple example of web app in Lepture’s repo.

The key practice in OAuth world is to get user’s consent to access API on her/his behalf. Often implemented by simple consent screen.


You need to perform two steps to display consent screen:

  • enable API in Developer Console
  • define scope in your application

The second step is straightdorward:

google = oauth.remote_app(
        'scope': 'https://www.googleapis.com/auth/userinfo.email'

It works perfectly. The only problem is that this solution provides access just to one API.

The question is: How to request access to multiple scopes?

You can find many hints about OAtuh for other frameworks, that you should separate scopes by comma. That won’t work.

Correct solution is to use white space as delimiter of scopes (as suggested for HTML forms).

google = oauth.remote_app(
        'scope': 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/calendar.readonly https://www.googleapis.com/auth/tasks'

9. May 2015

How to decode stereogram by GIMP

Sometime ago I wrote article How to decode stereogram by Photoshop.

I made small experiment and it’s possible to achieve similar results by GIMP.

Here is stereogram (Magic Eye Picture) created by Easy stereogram builder.


Open file in GIMP. Duplicate the layer.


Change layer mode to Difference.


Select Move tool from GIMP toolbox (M).


Start moving the layer to the right. You can use arrows to move the layer. If you prefer mouse then click, press and hold CTRL key to avoid shifting in both X and Y axes.

Here is the result:



6. May 2015

OpenRefine date conversions

One of common tasks for OpenRefine is conversion of dates from String.
Conversion could be performed by toDate function.

Source data:

11-04-15 9:28
12-04-15 8:56

Open Edit cell – Transform for the column and type following GREL:

value.toDate("dd-MM-yy h:mm")

Result (in Date format):


Another example. Source data

11/04/2015 09:28:25
13/04/2015 08:56:57


toDate(value, "dd/MM/yyyy hh:mm:ss")
  • Where’s the fish?

  • Further info

  • Twitter

    Follow @jurajmichalek on twitter.

  • Babel fish

      Translate from:

      Translate to:

  • Tags

  • Topics

  • Comments