Twitter

Blog Tags

Recommended Productions

Ball-B

Simple 3D game developed in Unity during Global Game Jam 2014.

Play Online

Date: 2014-01-26

Download:
Ball_B_Windows.zip (8.78 MB)
Ball_B_Source.zip (20.49 MB)

Octovirus

Simple 2D game developed during Global Game Jam 2013, for Windows.

Date: 2013-01-27

Download:
Octovirus.zip (6.1 MB)

FX Batch Compiler 1.1

This Windows application supports compilation of FX effect files and HLSL shader files using fxc command line compiler included in DirectX SDK. You can compile many files at time or one file with different settings.

Features:

  • Write compilation scripts in a simple language by specifying parameters for fxc.exe.
  • Compile multiple shaders at time.
  • Compile only shaders that need rebuild checked by file modification time.
  • Review success or failure, warning and error count and compiler output for every task.
  • Compile single HLSL source file with different parameters and preprocessor macros.

Date: 2011-02-09

Download:
FxBatchCompiler_1-1.exe
FxBatchCompiler-1.1-bin.zip
FxBatchCompiler-1.1-src.zip

Block Wizard

My first Flash game. Coded with FlashDevelop in ActionScript 3.

Date: 2010-04-06

CommonLib 9.0

Universal library for C++, created especially with game programmers in mind. Includes: math module (vectors, matrices, quaternions, planes, rich set of collision functions and more), string operations, conversions, smart pointers, configuration files handling, date and time module, exception class hierarchy for error handling, file system handling, stream class hierarchy, FreeList - free memory allocator, complex logger, profiler, library for threading and synchronization, tokenizer, wrappers for compression with zlib.

Language: C++. Platforms: Windows and Linux. License: GNU LGPL. Optional support for Unicode. Optional integration with D3DX. Documentation made with Doxygen.

Date: 2009-12-16

Download:
CommonLib_9_0.zip (4.92 MB)

Aqua Fish 2

Game for children - clone of PacMan. Player swims as a fish and collects points, as well as special items. Player also have to run away from enemies or destroy them. 60 maps in 6 different titlesets. Low hardware requirements. See also YouTube videos: [1], [2]. Game was published by Play Publishing company.

GameDev Calc

Calculator for game programmers. Basic data unit is a vector of 1-4 floating point numbers, which can be treated as (x,y,z,w) vector or (r,g,b,a) color. Next to basic calculations like addition, multiplication or sinus, vector operations are also available, e.g. vector normalization, conversion between degrees and radians, color conversion between RGB and HSB, finding linear an quadratic function coefficients and much more. Instead of entering single number, here you can see all the history of your calculations in form of stack and all operations are performed on that stack. Data can be entered and retrieved in different formats, like "D3DXVECTOR4(0.0f, 0.5f, 0.752f, 1.0f)" or "0xFF0080C0". Platform: Windows. Language: C#. License: GNU GPL.

Download:
GameDevCalc_1-0.zip (53.06 KB)
GameDevCalc_1-0_src.zip (50.73 KB)

Blog

21:39
Mon
28
Jul 2014

Making Tilt-Shift Photo in GIMP

There is an interesting photographic effect called Tilt-Shift. It makes a photo of city panorama looking like a miniature due to small depth of field. Wikipedia says it can be obtained optically with some advanced techniques, but it can also be approximated with postprocessing.

Yesterday I visited St. Dominic's Fair in Gdańsk, where I had an opportunity to enter a Ferris wheel and take a photo of my city from some height. Here is my experiment with tilt-shift. I've made it GIMP.

Gdańsk Tilt-Shift

To do it, top and bottom of the photo needs to be blurred. But an out of focus photo is not the same thing as standard Gaussian blur. That's why a special kind of blur is needed. There is a GIMP plugin for it: Focus Blur (Windows binary can be found HERE). In Photoshop, the effect is available as Lens Blur.

Image needs to be blurred more the closer a pixel is to the top or bottom edge of the image. But I have no idea how to do blur (or any other effect) with intensity varying over image location, so here is the trick: We can use only two layers - normal and heavily blurred - and blend between them using layer mask.

So to add tilt-shift effect to your photo using GIMP:

  1. Choose a photo of a city panorama. Open it in GIMP.
  2. Use Crop Tool to crop it so no horizon line or sky is visible, only ground.
  3. In Layers panel, click appropriate button to duplicate layer.
  4. Make sure the top layer ("copy") is selected. Select Filters > Blur > Focus Blur. Change radius to some higher value (I used something around 10-16 for image in Full HD resolution). Confirm with OK.
  5. Now right-click on the top layer and select Add Layer Mask. Mask is created for this layer and selected so now drawing will change layer transparency instead of color.
  6. Select Blend Tool (the one for drawing gradients).
  7. In Tool Options panel, select gradient "FG to BG (RGB)" and change Shape to Bi-linear. Make sure current colors are: foreground = black, background = white.
  8. Draw the gradient by pressing left mouse button in the center of the image, dragging cursor to the top or bottom (hold Ctrl to draw perfect vertical line) and releasing it there.

If you've done everything right, you should now already have blending between layers applied so that top and bottom of the image looks like out of focus. Now you can:

  1. Flatten image by right-clicking on top layer and selecting Merge Down.
  2. Enhance colors. You can, for example, increase saturation and contrast.
  3. Export image with File > Export As.

Comments (0) | Tags: photography | Author: Adam Sawicki | Share

22:33
Mon
16
Jun 2014

Rendering Video Special Effects in GLSL

Rendering real-time, hardware accelerated 3D graphics is one aspect of computer graphics, but there are others too. Recently I became interested in video editing. I wanted to add some special effects to a video and was looking for a technology to do that. Of course video editing software usually has some effects built-in, like different filters or transition effects, some borders or gradients. But I wanted something different. If I had and I knew how to use software like Adobe After Effects, I'm sure that would be the best and easiest way to make any effect imaginable. But as I don't, I decided to use what I already know - to write a shader :)

1. To run a shader, some hosting app is needed. Of course I could write one in C++, but for the purpose of this work it was enough to use Live Coding Compo Framework (a demoscene tool created by bonzaj, which was used during last year's WeCan demoparty). This simple and free package contains rendering application and preconfigured Visual Studio solution. Having VS installed (it works with Express version as well), all I needed to do was to edit "Run.bat" file to point to directory with VS installation in my system. Next, I just executed "Run.bat", and two programs were launched. On the left monitor I had fullscreen "Live Coding Preview", on the right: Visual Studio with special solution opened. I could then edit any of the GLSL fragment shaders contained in the solution. Every time I hit Compile (Ctrl+F7), the shader was compiled and displayed in the preview.

2. Being able to render my effect in real-time, next I needed to capture it to a video. Probably the most popular app for this is FRAPS. I ran it, set Video Capture Settings to frame rate that I was going to use in my final video (which was 29.97 fps) and then captured appropriate period of time of rendering my effect, starting and stopping recording with F9 hotkey.

3. Video captured by FRAPS is in full, original resolution and encoded with some strange codec, so next I needed to convert it to desired format. To do this, I used VLC media player. Some may think that it's just a video player, but in fact it's incredibly powerful and flexible video transmitting and processing software. (I once had an opportunity to work with libVLC - its features exposed as C library.) Its greatest advantage is that it has its own collection of codecs, so it doesn't care whether you have appropriate codecs installed in your system. To convert a video file, I selected: Media > Convert / Save..., selected my AVI file captured by FRAPS, pressed "Convert / Save" button, selected Profile: "Video - H.264 + MP3 (MP4)", customized it using "Edit selected profile" image button, selecting: Encapsulation = MP4/MOV, Video codec = MPEG-4 (on Resolution tab, I could also set new resolution to scale the content, my choice was 1280px x 720px), Audio disabled, Subtitles disabled. Then after pressing "Save", selecting path to destination file, pressing "Start" and waiting some time, I had my video converted to more standard MPEG-4 format (and more than 5 times smaller than the original one recorded by FRAPS).

4. Finally I could insert this video onto a new track in my video editing software and enable blending with underlying layer to achieve desired effect (I used "Overlay" blending mode and 50% opacity).

There are some details that I intentionally skipped here (like video bitrate) not to make this post even longer, but I hope you learned something new from it. My effect looked like this, and here is the source code: Low freq fx.glsl

By the way, here is another tutorial about how to make GIF like this from a video (using only free tools this time):

1. To capture video frames as images, use VLC media player:

  • Go to: Tools > Preferences > Video > Video snapshots > Directory and select destination directory for snapshot images.
  • Open your video.
  • While playing, press and hold Shift+s (default hotkey for "Take video snapshot", can also be configured in Preferences).
  • A numbered sequence of images is created in selected directory.

 2. To merge images into animated GIF, use GIMP:

  • Create new, empty image.
  • To import all captured images as layers, drop these files onto the image.
  • Delete background layer.
  • To switch to indexed colors and apply dithering, select: Image > Mode > Indexed..., select Generate optimum palette, Maximum number of colors = 255 and Color dithering = Floyd-Steinberg (normal)
  • Select File > Export. Enter some file name with ".gif" extension. Press "Export". In next window, check "As animation", enter delay between frames, check "Use delay entered above for all frames" and press "Export".

Comments (1) | Tags: rendering video tools | Author: Adam Sawicki | Share

00:51
Thu
05
Jun 2014

Pixel Heaven 2014 - My Photos

Here is the gallery of my photos from Pixel Heaven 2014:


Pixel Heaven 2014

Comments (0) | Tags: gallery events demoscene atari | Author: Adam Sawicki | Share

00:05
Tue
03
Jun 2014

Pixel Heaven 2014 - My Impressions

31 May - 1 June I've been in Warsaw on Pixel Heaven. As I haven't been on previous edition, I didn't really know what to expect. Timetable was full of various activities - lectures, competitions or just opportunities to play some games. Would it be only about retro games, or also modern games? Only about indie games, or AAA games too? Is it more for gamers, or for professional game developers? What about demoscene? Either way, I decided to go there.

I'm not really into these retro platforms, so I planned to go listen to lectures about indie game development. I've seen and heard many interesting stuff there, like Adrian Chmielarz from The Astronauts presenting their game - The Vanishing of Ethan Carter - for the first time!

But as it turned out, I met so many interesting people there (some of them I haven't seen for years) that I've spent most of the time talking with someone :) It's a coincidence that just recently I've heard stories of several people who work for many (some more than 10) years in just one company. Very often that's their first job after graduating university. They speak with confidence like they know a lot about doing career. Surely after all these years they were promoted many times. But at same time, I think sometimes such people preceive possibilities and limitations of their job as something obvious, its rules as something critically important, like it was whole world. I don't think it's good attitude and I want to avoid that.

On the other hand, noone can try in his life every possibility in terms of work and career. For example, someone who already has a house and spouse and children and mortgage many not be willing to move to different city or country or try to make his living from doing a startup or indie gamedev studio. That's why I think it's so important to talk to many different people and hear their stories. Knowing how working for some other company looks like, whether your competition or in completely different business, or how totally different may someone's work and lifestyle be (e.g. freelancing, working from home, being a consultant, traveling to different countries to do different projects, making a startup) is mind-expanding because it makes you think about your own career with all its pros and cons in the context of bigger picture of what's possible.

Back to the Pixel Heaven, I recommend this party to anyone who is interested in either retro games or indie games. There is a lot of things to do all the time so noone should be bored.

Comments (0) | Tags: career atari demoscene events | Author: Adam Sawicki | Share

22:48
Wed
28
May 2014

Offensive Programming :)

Generally, defensive programming is a very good idea. But many times I've seen this following C++ code explained as an example of defensive programming:

if(pointer != NULL) {
   pointer->SomeMethod();
   // Some other things with pointer.
}

If the pointer here is expected to always point to a valid object and not NULL, otherwise it's a programmer's bug somewhere else in the code, then I believe such practice is very, very bad. I think there should be an assertion instead, like this:

assert(pointer != NULL);
pointer->SomeMethod();
// Some other things with pointer.

First of all, assertion is compiled only in debug configuration, while condition would be additional code executed in all builds, unnecessarily impacting performance. Second and more important argument is that when there is a bug and the pointer is NULL, we should know about it as soon as possible and be able to debug this particular place. That's easy when we put an assert. That's also easy when we dereference NULL pointer, because then the application would crash, which is also possible to catch in the debugger. On the other hand, when there is a condition around code using this pointer and the pointer is NULL, the code inside is just not executed, which may somehow corrupt or just propagate corrupted state of the program, hide the bug or defer its appearance for later time and to different place of the code, making it harder to find. Recommending to crash the app could sound radical, so let's call this "offensive programming" :)

Comments (5) | Tags: c++ | Author: Adam Sawicki | Share

23:40
Mon
19
May 2014

Simple 2-digit Method of Task Management

Managing some list of tasks to do (or "TODO list") is very important skill that helps in both work and everyday life. I usually use GTD (Getting Things Done) method. But sometimes, like on the recent Hack3city competition, a simpler method is more suitable.

A lot could be said about this subject (maybe some day I write an article or prepare a presentation about it). Generally, tasks to do can be organized based on different criteria, like:

  • Subject - e.g. which project is this part of.
  • Order of execution - when some tasks must be done in that particular order.
  • Context - when and where this task can be done, e.g. only with a computer, at work, at home, in the shopping center etc.
  • Deadline or particular date and time when this thing must be finished or can be done.
  • State - e.g. whether it's something you should do or this item is waiting for someone/something to happen first.

Even after "filtering" only tasks that you can do and you should as soon as possible, they can be sorted in three different "dimensions":

  1. Difficulty: how difficult/big/time consuming the task is.
  2. Importance: How important is it to do this or consequences of not doing it.
  3. Urgency: How much this task should be done as soon as possible.

It's obvious that not all the tasks will be done. During a 2-day programmers' competition, just like in everyday life, writing down ideas for doing things is good, but there is never enough time to complete them all. That's why there is a need for some method of deciding what to do next. During Hack3city, I came up with a simple, ad hoc method, which I want to describe here. The goal of developing it was to make the bookkeeping of the list as quick and easy as possible.

During a hackathon like Hack3city, where we created most of our game in just 2 days, the 3rd dimension is not important. Sure sometimes something must be coded quickly because artist or level designer is waiting for it to be able to continue his work. Then I do this first. But otherwise all tasks are equally urgent - they should be done in the short amount of time, during the event. So what I did was I opened the system Notepad and started writing down tasks and all ideas that should be/could be added to our game, one line each. But instead of starting a line with "-" for just a bullet, I started it with two digits, meaning:

  • First digit: difficulty.
    • "1" means easy. Coding and testing it will take only a couple of minutes. If it's a bug, I already know how to fix it and the fix will be simple.
    • "2" means moderate. It will take some time to code, but I know how to do it. If it's a bug, I already have some idea about the cause and I assume it's not difficult to fix.
    • "3" means difficult. It will take a lot of time and effort to implement. Maybe it needs some learning, reading documentation and experimenting. Maybe I don't even know yet how to do it. If it's a bug, I have no idea what causes it or I know that the fix will be difficult to implement.
  • Second digit: importance.
    • "1" means important. We definitely should have this feature for our game to be playable, complete according to its idea or good looking.
    • "2" means moderate. It is important, but if not implemented, it will still be OK.
    • "3" means not important. I would be good to have this feature, but it's worth doing only of all more important features are in place.

Normally I just delete lines with tasks I finished, but since some time during the event, I started to move them to "DONE" section instead to show them later in this post. So here is partial task list from our game:

23 smoke effect when player falls onto the ground
22 flashlight rotates when player dies
23 flashlight rotates following player walking animation
31 spear, shooting from a wall when player pushes a button
12 delay appearance of "game over" text
22 push button
12 door that can be opened
13 red eye of zombie should pulse and blink
13 graphics in the menu instead of text
31 sound effects
33 fix ladder climbing animation
31 fix double-jump bug
22 walking sound effects should be played randomly
12 parallax for moving background
21 bug: player death animation doesn't work
11 playsoft logo
12 music
12 zombie: add hysteresis to the decision weather approach the player
21 death from the spikes
12 turning flashlight on and off
22 there are some bugs/spiders walking on the floor
33 a spiked ball on a chain, hanging and swinging from the ceiling

Of course the list of tasks was constantly changing as artist, level designer and me came up with new ideas or decided that something is more or less important, found new bugs during testing etc. But I tried to concentrate on finishing one thing at time. When finished, I picked up next task to do according to following rule: I reviewed whole list to find a task with the smallest sum of its numbers. So the order in which I was doing the tasks was:

  • 11 - First I did the tasks that were both easy to implement and very important.
  • 12 or 21 - If there was no such task, I started doing one that was either of medium difficulty but very important or of moderate importance but very easy.
  • 13 or 31 or 22 - Then I was doing tasks that were not important but very easy, difficult but very important or moderately important and difficult.
  • 23 or 32, and so on...

This way we managed to accomplish most of the tasks we planned so we were quite satisfied with our game as it looked and worked pretty much as we planned. That's why I believe this simple 2-digit method of managing task list is good for hectic, time-constraint and constantly changing work environment.

Comments (0) | Tags: events competitions productivity hack3city | Author: Adam Sawicki | Share

21:36
Wed
14
May 2014

Hack3city 2014 - Review

5-11 May 2014 there was first edition of Hack3city - a hackathon in Gdańsk, Poland. It was interesting and unusual in many ways. First of all, there were 4 different tracks, so each developer could choose what is interesting to him.

  • Sponsored by Intel. Goal was to develop C/C++ application. Theme: personal assistant.
  • Sponsored by Estimote. Goal was to use iBeacon technology - a bunch of small devices that broadcast their identifier via Bluetooth so a smartphone can detect proximity of particular one.
  • Sponsored by Microsoft. Goal was to use cloud and Open Data.
  • Sponsored by Playsoft. Goal was to develop a game. Theme: "Fear of the dark".

Teams could have up to 3 people. Of course I was in the Playsoft track. We made a game together with Arek Duchnowski and Marcin Szymczak, who work in aideMMedia.

On Monday evening there was an official beginning (and free beer :) That's when themes of each track were announced. During the week we could work on our projects from home. On Saturday and Sunday (including the night) we were invited to work all together in an open space in Starter.

Also on Saturday organizers announced additional "diversifiers" (like on Global Game Jam). Fulfilling them was additional plus. For games, they were like "graphics is black and white", "game is controlled with one button" or... "game includes Playsoft logo". You could imagine how such logo might be used in a game themed "fear of the dark" :)

On Saturday and Sunday we have 3 meals - all for free (and free beer at the end :) There were mentors representing the sponsoring companies available in place so we could ask them for help.

There were totally 19 teams participating in all tracks. Most of them were in the gamedev track. Projects were evaluated by a jury based on a 5-minute presentation and there were winners selected in each track. Some teams just presented their applications, while others focused on delivering a PowerPoint presentation. Finally we took 3rd place. See also more about Our game from Hack3city 2014.

Among teams that were creating a game, Unity was the most popular technology. That's also what we have used. But there were different technologies present too, like C++ with Marmalade (which was officially recommended and the prize for 1st place was a license for this library), JavaScript and... Lisp (or Scheme, to be more specific). During work, many interesting stuff could be learn and overheard, like what do artist say when they want to insult programmers: "lerpuj kwaterniona", which means: "go lerp quaternion" :)

But the event was not only about programming. Maybe because it was organized by and in the Starter, it had a "startup feeling". For me it looked like many people, while being programmers, were more focused on money and business than technology. Maybe the culmination of it was presentation of an application that helps with first aid - shows information about how to help injured person, helps measuring rate of artifical respiration etc. Someone from the audience asked a question: "Do you have business model?" Someone else from the audience answered jokingly: "If you want to save someone's life, please first watch this ad".

Overall I think the event was well organized. Rules and general feeling was somehow similar to Global Game Jam, still quite unique and different in many details. I don't know if it's a good idea to announce the theme on Monday and allow working during whole week. Developers with lots of free time have advantage over these who study, have family or a full-time job. I also didn't like the idea of presenting each project 3 times instead of only at the end. It took lots of precious time that we could spend on coding and also made the final presentation less of a suprise. Everything else was great (did I mention free beer?), so I recommend attending this event when it will be organized next time!

Comments (1) | Tags: hack3city competitions events | Author: Adam Sawicki | Share

23:11
Sun
11
May 2014

Hack3city 2014 - Our Game

I just came back from Hack3city - a programming competition. Participants had to develop their applications over this week - Monday to Friday working from home, while Saturday and Sunday working in Starter, Gdańsk. There were 4 tracks. We participated in track organized by Playsoft, where we had to create a game. The theme of this competition was "fear of the dark". We took 3rd place.

As I promised to some of you, I publish playable version of our game today. The game is created in Unity and can be run in web browser if you have Unity Player installed.

PLAY ONLINE

Controls:

  • Left, Right - Move
  • Up - Jump
  • Down - Crouch
  • Space - Turn flashlight on/off
  • Up, Down - Climb ladder (flashlight must be turned off)

Our game is called "Jason McBrady Dark Adventure". It's a 2D platform game. It's about an adventure seeker exploring ancient tombs full of dangers like zombies, who want to kill you, but run away from from the light. It's quite difficult :)

We called our team NOQA. Credits are:

  • Arek Duchnowski - game design, graphics
  • Marcin Szymczak - level design, sound
  • Adam Sawicki - programming

In the next post, I will write more about Hack3city. See: Hack3city 2014 - Review

Comments (0) | Tags: unity hack3city competitions productions | Author: Adam Sawicki | Share

Older entries >

STAT NO AD [Stat] [Admin] [STAT NO AD] [pub] [Mirror] Copyright © 2004-2014 Adam Sawicki
Copyright © 2004-2014 Adam Sawicki