Buildings editor

Project from 2011 written as a Bachelor thesis.

Project’s goal was to create program allowing to quickly define 3d urban spaces and to explore them in a Java applet (it was a second program called CityCube allowing to move user’s avatar through the building).

Buildings data is created by defining floor sectors, which can be enriched with walls, windows and connected with stairs or doors. Data can be exported to XML and loaded by CityCube, where is rendered. Building’s structure allows to explore created space in a logical way, by creating paths between any building’s sectors. E.g. user’s avatar can look up for a specific room and program will calculate the shortest path by connecting nodes, which lays on every sector’s border and on edges of the doors and stairs. In this way avatar can travel through created path.

Program’s mascot is a little pig engineer:

montage.jpg

Video presenting designing process (should be wathced with 720p HD):

Tangbang

Project from 2010 written for educational purposes.

Continue reading “Tangbang”

Code was used to present basics of games programming during classes of an academic circle about programming games on a Białystok Technical University.

Covered topics: generating OpenGL graphics; using SDL for input, window system and sound; collisions detection; simple AI.

https://github.com/adamskopl/tangbang

https://www.youtube.com/watch?v=M03VRuG0qH0&feature=youtu.be

Recording application video with sound: Alsa + Recordmydesktop

How to capture video from an application with the sound?

Continue reading “Recording application video with sound: Alsa + Recordmydesktop”

Don’t know if it’s by default, but in my Xubuntu, only a sound from the microphone can be recorded. This link came with help: https://trac.ffmpeg.org/wiki/Capture/ALSA. How to do the same with a recordmydesktop application:

  1. Create .asoundrc file in Your home directory like in mentioned webpage:
    # .asoundrc
    # uncomment to record audio from applications. uncomment afterwards to
    # restore default Alsa settings:
    # pcm.!default { type plug slave.pcm "hw:Loopback,0,0" }
    

    When the last line is uncommented, there will be no sound for every application launched from that moment, because generally it’s redirected to the recording output.

  2. Load the snd_aloop module:
    modprobe snd-aloop pcm_substreams=1
    
  3. Launch an application, from which the video will be captured. Check it’s window id with xwinfo and by pointing application’s window:
    xwininfo | grep 'id:'
    
  4. Invoke recordmydesktop with hw:Loopback,1,0 as a sound device. PID will be needed to send signal to stop recording (‘& echo$!’)
    recordmydesktop --windowid [application wid] --device
    hw:Loopback,1,0 --v_quality 45 --s_quality 7 --overwrite & echo $!
    
  5. Stop recording by sending SIGTERM signal:
    kill -s SIGTERM [recordmydesktop PID]
    
  6. Uncomment line in .asoundrc file to restore Alsa settings.

Cubicforest: using Tiled

In a second post I was writting about creating my own level editor. A lot has happended since then (thank You reality, You’re a perfect teacher): games is being written in Java using http://libgdx.badlogicgames.com/ right now and for editing levels I’m using Tiled editor http://www.mapeditor.org/.

I’m very happy from that solution. Level is exported to Json.

Loading done with gson https://sites.google.com/site/gson/gson-user-guide. Just a few classes reflecting Json’s file structure and I was ready to go…

public class TiledMap {

	private Integer width;
	private Integer height;
	private Integer tileheight;
	private Integer tilewidth;
	private List<TiledLayer> layers;
...
public class TiledLayer {

	private String name;	
	private Integer height;
	List<TiledObject> objects;
...
public class TiledObject {

	private Integer gid;
	private String name;
	private String type;
	private Integer x;
	private Integer y;

What’s interesting: loading is done with one line!

public class MapsLoader {

	TiledMap tiledMap;
...
tiledMap = new Gson().fromJson(mapFileString, TiledMap.class);

… and TiledMap class is filled with a data about designed level

Project’s repository: https://github.com/adamskopl/cubicforest-java.

Tiled editor:

tiled.png

Level loaded in a game:

tiled-cubic.png

Mass e-mails: avoid being marked as a spam.

For four months now I’m volunteering my time at Uniwersytet Dzieci organization (a child university). Amongs the others I’m helping in running lessons about the Blender software. Lessons are crowned with a show, where students can present their new skills. After organizing students mailing list I’ve encountered some problems.

Continue reading “Mass e-mails: avoid being marked as a spam.”

The problem

I’ve gathered more than 40 emails to write to students about their roles in the show. I’ve created a couple of mailing lists, e.g. the list including all of the students. First mail was composed by adding this list as BCC to make addresses private. On the last lesson I’ve realized, that Gmail users had not received my mail, while students with addresses from other domains did.

The reason is unknown, but I’ve searched the web and have found some clues:

  • filters can reject mails, where receiver is in BCC
  • filters can reject mails if there is a big number of receivers
  • filters can reject mails if the server had received a big amount of messages from one address in a short period of time

I’m not completely sure if above statements are true (it was a quick search throught the forums), but none the less, Gmail was rejecting my mass messages, while individual written mails were delievered.

The solution

Thunderbird Mail Merge add on.

I’m composing mails from mailing lists as always, but instead messages are sent:

  • individually (just like I would send mails one by one)
  • in a 10 seconds intervals

I don’t know if this solves a problem, but I’m sure that there is no more I can do to avoid spam filters. Because in the end: Mail Merge is doing the same job, as if I would compose 40 emails one by one.

Cubicforest: built-in editor

I had a lot of thinking about editing levels. Wanting to keep them simple, I’ve chosen good old square tiles solution. First I was convinced, that I’ll save a lot of work by choosing ready editor (like this one: http://www.mapeditor.org/), but after doing some calculations, I’ve decided to make my own.

Continue reading “Cubicforest: built-in editor”

Main reasons:

  • Most part of editor’s code will be used in game play code: functionality of those two is very similar.
  • Switching between game play and editor will be nice (smooth levels testing).
  • It seems that time spent on adjusting design solutions to someone’s editor is similar to time spent on building my own (especially, that game levels will not be sophisticated). Well, reality will verify that.

Time to dive into stream of concrete design thoughts about first version of game editor.

Building a level

Cubic Objects

Every object occuring in a game’s world, will be composed from little cubes called AtomicCubes. Format of models representing those objects will be discussed another time.

Composing terrain.

For now I’m assuming, that terrain will be built from Fields composing a grid. Grid’s role will be only limited to alignment.

Building terrain will consist of filling grid with objects, having gridSurface defined. GridSurface indicates how object should be aligned to chosen grid’s field.

Fields (tiles).

An object with a stand surface defined. The stand surface is the surface, defining it’s occupant 3d location. E.g. if tile has a shape of a cube, it’s stand surface will be defined by cube’s top face. The stand surface has it’s default point, needed to indicate the optimal position for it’s occupant. E.g the position to which occupant is heading, when given an order to occupy given tile.

2013-10-13-2.png

The field has connections to other fields, defining for the occupant the options to change location from tile A to tile B. It does not mean, that tiles have to be adjacent. Types of connections:

  • Path. Object is moving from A to B in a straight line in given time (defined by object’s speed)
  • Teleport. Object is changing it’s location from A to B immediately.
  • Flight. Object is moving from A to B in a curved line, in given time. Example: jump

Inserting objects on the terrain.

Inserting objects on terrain will consist of associating HoldingObject (Field) with StandingObject (e.g Hero).

Gui

Irrlicht has a GUI support and whatever its level is, it should be enough for this game editor. I don’t care how Irrlicht gui widgets look like (well, they don’t look encouraging): it’s an editor, it should be functional, not lovely (sfx: the sound of fist hitting the table)! For now I only need:

  • Choosing objects to put on the level. E.g the lists of objects.
  • Editing attributes of level’s objects.
  • Saving/loading level files. First version of levels will be in JSON format.

Conclusions: pseudo-UML class diagram

Basing on above description, I was able do come up with first version of classes to program. Of course reality will verify that, but work should begin with a plan.

2013-10-13-1.png

Cubicforest

Lately I’ve started work on a hobby project with code name Cubicforest. It’s a 3d game project, which basic assumption is: “everything is from cubes”.

Continue reading “Cubicforest”

It will be a real time logic game, where player is achieving goals by collecting cubes and generating items, which help him to get rid of enemies and escape to the next level. No further explanations needed: the idea will take its shape with design notes and progress reports.