9 May 2020

Ludum Dare 46: Ruin Looter

I made this game for the Ludum Dare 46, where the theme was Keep it alive. I kind of disregarded the theme completely because I had already decided I wanted to further develop the NES-style map editor and framework that was used in Tasty Camping. The game is inspired by the Lode Runner games, especially the Macintosh version which I played endlessly as a kid. The best part of that game was the level editor.



My little editor could already handle tilemaps, animated sprites and character movement. To make a platformed I needed to add collision detection and states for falling down and climbing the ladders. I made the states using a state stack, so that every state could either keep updating, stop updating or create a new state on the stack, which would then be updated. This proved very handy, because the states had very little connections between them and none of them had to worry about which state to return to.

For example when the player character would walk, then climb a ladder and then move sideways when on the ladder and fall back down, the state stack would work like this. The active state is the rightmost one.


> Walk
> Walk > Push climb state
> Walk > Climb
> Walk > Pop climb state
> Walk > Detect that there is no floor under character
> Walk > Push fall state
> Walk > Fall
> Walk > Detect floor under character: Pop fall state
> Walk

 I tried to apply the same idea to game states as well, but because Lua always returns a reference instead of copy I just hacked around it, but in theory it would work too.

I asked around if anyone was interested in programming, music or graphics and my friend Aviul agreed to do the animations for the player and the chests. They also created some stalagmites and waterfall tiles. Rest of the graphics were taken from Open Game Art.

The game itself is very simple. Go to the cave and collect all gold. When everything is collected the game simply ends. I did not have time to make any music or sounds, but I am happy that I managed to get the player state stack working, although it could be better :)

You can download the game for Windows from my google drive.



Making of Ozymandias

I have been postponing writing about Ozymandias because I feel quite embarrassed about it, but anyway...

Ozymandias was my second 3D demo, I started working on it right after Lepus Minor and aimed to participate to the Assembly Summer 2019. Because Lepus had worked out so well I kind of jumped right into a feature overload with this one. The original sketch had something like 9 different scenes, each with separate models and effects. That was the first silly thing to do :)

Then for many weeks I just sat around trying to get other people on board without much success. In retrospect, just starting to work on the first scene would have led me faster to the next phase.

As summer drew nearer I understood that my plan was way too complex and proceeded to cut it down to one scene which was the main point anyway. Just a camera flying over a desert and arriving at the ruins of the city in the desert. That was the central idea in the poem anyway.

For that I needed a big desert terrain model. I had the fractal terraing generation code from Lepus, but for some reason thought that it would be too much for a gpu to handle if it was much bigger. This leads to many hours of premature optimization as I tried to break the terrain into smaller tiles and have Level of Detail versions of those tiles generated automatically. It almost worked, in a very frustrating kind of almost. Then I just abandoned that idea and made a very low poly terrain instead.
Here you can see the LOD system in action when zooming out. It would not make seamless tiles :I



At this point my head was clear enough to make a very focused plan that would get the demo done in time for Assembly. I made the models of the gate and the palace in the magicavoxel, mixed the soundtrack from existing songs using Audacity and programmed a nice skybox that could change color as the sun moved over. And made the shader for the texts that got blown away by the wind.
The sky is a sphere and the texture coordinates are moved as the sun moves, creating the gradient effect.

Using texture coordinates on a small gradient image allows the gpu to do the color blending and results in a soft gradient.
Ambient light color and intensity was also linked to the suns position, which created this hazy morning dust effect.

I first modelled the gate and the used the eraser tool to break it down. The graffiti was texture plane positioned inside the gate.

And at the very last moment my friend Bass Cadet agreed to make some music, which they did in about a day and it fit perfectly.

I was not really happy with the demo, as my original plan had been much grander, but I just wanted to get over it and the main idea was clear enough. I am happy that I released it and I hope I learned a valuable lesson about feature creep and expectations :)

Here is the final demo:


During the event I got feedback that the part where the greets were drawn as graffiti inside the gate was really nice idea. Hearing that made me really happy and it felt like it all had been worth it in the end.




If I make such 3D demos again I am going to spend time creating a way to place objects in the 3D scene, because I wasted a lot of time adjusting positions in a text file, restarting the demo and adjusting again.

9 Feb 2020

Global Game Jam 2020: Tasty Camping

I participated again in Global Game Jam. I made plans with a friend that we would make a game with some of the same restrictions as the Nintendo Entertainment System (NES) had.

I programmed a simple map editor in Lua using the Love 2D framework before the jam so that we could then use it to make a game suitable to the theme.

The theme was Repair and the intro video had a lot of machines and footage of falling buildings being played backwards. But I had been waching the Yuru Camp (Laid back camp) anime recently and I wanted to to do something again that would have cute animals.

So I suggested we do a game where Animal Crossing meets Yuru Camp and pitched that with my friend. To my delight three more people were interested. And they had such pixel art skills that the game became really cute.

Actually the only problem was that there was more art and animations than I had time to add support for, but I finished the game on the following weekend and made this blog post.

I am so happy that I was able to make a game about cute animals and could just put the cuteness as the main priority.

Please enjoy Tasty Camping.


Download the game from google drive. It works on Windows natively and on Linux and OS X (Mac (Apple) ) too if you install Love 2D.

Edit 11.2.2020 Talking to Otter twice crashed the game. It has now been fixed in version 2 and I updated the download link.


17 Mar 2019

Making of Lepus Minor

Lepus Minor is a demoscene production that I created with 3 of my friends and entered it to the Demo competition of Instanssi 2019. You can watch the demo from Youtube or download it through Pouet.net and run it on your Windows machine.

I took many screenshots while I was programming the demo and the renderer and thought I would make a Making of post and here it is :D

The development of the renderer started already in 2018 when I started going through the excellent Learn OpenGL tutorial and adjusted the material for my own purposes. During that I made an Imgur album of rendering bloopers which you can see here.


And now about Lepus Minor proper


The first idea was that in the demo the camera would follow a glowing crystal bunny through a forest so that the bunny would disappear and then reappear further away, leading the viewer to a hilltop, where the Monolith would appear and display the greetings and credits.

While the demo progressed, the bunny and Monolith stayed but practically everything else changed and it became a homage to the movies 2001 A Space Odyssey and Contact.

First order of business was to create the opening scene with a mountain range under a night sky. I needed the sky to rotate and first idea was to create a sphere of stars, that would then be rotated.

The mountains were created with a fractal algorithm, that I found thanks to Skrolli-magazine.

The first implementation had a bug where the stars would get smaller higher up, but that was because I took a certain dot product after setting the distance.

Next I needed text to show the greetings and credits. I did a simple bytemap-font rendering system where a letter was translated to texture coordinates and each letter was drawn with a quad. That was simple enough and I found a simple pixel font generation program to help with that.


Next was water for the ice planet. Originally it was intended to be moving and to have waves, so I made a displacement map and a shader that would adjust vertices according to that and that worked too eventually and I had a kind of Minimum Viable Product (MVP) put together on 5.1.2019.



Then I also wanted the water to reflect the stars above and for that to work I needed the sky to be a cubemap instead of a sphere made of stars. I had lots of trouble making the skybox work, because for that the texture coordinates work differently than the rest of OpenGL for some historical reason. But with patient debugging and using the Konata test image, it started to work. At this point I started thinking that the konata.png was a kind of a lucky charm, because setting it on things made them work <3 This image was taken on 16.1.2019.



The reflection from water proved more difficult. Or rather, reflection was easy, but combining it with a rotating skybox and waves was not.
I eventually found out that it would not work without proper normal maps, which would need cotangents and all that stuff for which I did not have time to get into. So I scrapped the waves and decided that the sea would be frozen instead and the planet would be very blue and cold.

Next big thing was the bunny and the space warp sequence. I wanted to give the impression that the constellation would light up the bunny model from inside. Just flipping the normals for the light calculation would have worked but I wanted actual refraction. And for that I needed a touch of raytracing. Luckily I had been doing it for a school assignment years ago so I thought it would be simple to add.
Turned out I did not remember things that well, but luckily I found Raytracing in one weekend which helped to get the formula right. And lo, the light was born. In the end I decided to combine the Phong lighting and the ray tracing, because it made the bunny look more like frosted or scratched crystal.




It was a beautiful moment when it started working.


Last part was the Ice Planet. I made a blue planet for the skybox using just a gradient in Gimp and generated a second mountain range and placed that so that peaks would be above the water level. And it looked fine.


The above image was taken on 15.2.2019 so there was still about a month until Instanssi. The rest of the time I mostly spent on tweaking colors, code and syncing everything together using Rocket. Ijoro made a beautiful skybox to replace the placeholder I had done.

I made a quick sketch of the bunny and Ninzo made a 3D model from that. Then I just had to reposition the lights. There was no graphical editor but atleast I had had the wisdom to make the demo load values from a config file and being able to reload the values while running saved so much time.


Last thing I did was to add support for controlling the lights at Instanssi using UDP-packets. I had never done that before, but C# made it easy. Or should I say too easy, because I did not realize that not finding the effect server at adress "valot.party" would prevent the demo from running :I

Windytan was making music while all this was going on. Their computer would not run the demo, because Mac OS does not support OpenGL or something. But I took a video and they timed the music to that. Here you can see the work in progress versions of the demo with music, first one is from 8.2.2019

And the second from 27.2.2019

Finally the demo was ready during the event when Windytan sent me the final edition of the music. It was a really magical feeling seeing it all come together and again seeing it on the big screen. I was super nervous and I was trembling all over. I haven't gotten such a feeling from any other creative endeavour I have undertaken so I think I'll continue to make demos <3

(And after the party I fixed the host not found -bug and added Naudio library to get Ogg Vorbis playback, but that broke linux compatibility. I quess like other art, demos are never really ready.)





23 Sept 2018

Happy Clouds demo for Skrolli Party 2018

The Finnish computer magazine SKROLLI organized a party for the staff and writers but also for anyone who submitted an entry to either Wild or Realtime Compo, so I decided to make one.

I used Processing which I learned during Assembly 2018 and thought to make a summery demo about going to the beach. The first idea was to have a camera flying from midst of city over a forest, going towards the beach and sea. But things were harder than I thought and in the end I just had the sea and clouds.

My friend said that the clouds could smile like the ones in Super Mario games and I thought it looked cute. Then I wanted to add greetings in the form of boxes floating across the surface, but in the end made them jump out of the sea instead.

Biggest difficulty was to get the faces to show on clouds. Processing does not allow drawing 2D shapes in depth, which seems to mean that the depth is always 0, so I needed to make sure the clouds are further back, but not too much because then the face would be offset from the cloud because of the perspective projection.

Syncinc was also difficulty, mostly because I did not choose my parameters well and the default Rocket editor is so clumsy to use.

I made the music using Beepbox and discovered new features from it. I really like it because it is restricted by default, but allows for customization. And it is easy to share a song link.

I worked on the demo for 5 Saturdays and one Sunday, about 20 hours in total.

For the next time I learned to:
  • Leave an empty measure in the beginning of the song. It leaves space for transition and makes capturing and editing easier.
  • Choose colors and interpolate between them instead of syncing individual color components.
  • Generate random things in relation to previous result. That way I could have made sure that the cloud balls don't spawn inside each other and that adjacent greetings would have different colors.
  • Randomize width and height related things between 0 and 1 and then multiply with actual screen dimension. In this demo I took a random number between 0 and width, which meant that even when random seed was set, the result was different depending on the window size. 
  • Try to have everything depend on time. In this one only the boxes are, but the clouds and waves always keep moving. This helps with syncing.
For the next demo I want to use my own renderer. I think Processing is very good for starting out and trying things, but I came to feel that I want more control over things.

You can watch the demo over at Youtube and leave comments on Pouet.


9 Sept 2018

Flappy Bird in Python

I participated in a codebar gamedev meeting as a coach and helped others to create a flappy bird clone using Python and Pygame. I am not really a Python expert and so I practiced before the event and created a very simple version. I used the nice Python Game Book tutorial.



The event was nice and there was pizza. After the event I improved my practice game into a more refined version and added lots of comments so it could also work as a tutorial.

I have made it available in Github.

It was fun to be a coach and I hope my students got interested in game development <3

9 Aug 2018

Pink in Spaace, a small demo

I attended Assembly 2018 and joined the Demo Programming workshop. During that I learned some Processing and made an entry to the One Effect Demo compo.

Lots of time went to trying to understand what Processing thinks about 3D coordinates, as I have used to OpenGL and that the center of the screen is the origo.
I created the music using BeepBox and Audacity. My friend helped with the bacground, which I made in Gimp.

I did not really have time to do syncing, but next time I will allocate more time for that :)

But I got a demo done and I was really happy. And it was very exciting to see my production on the big screen.

You can see it here, it is Entry number 11. (Skip to start):


You can download a windows 64-bit version, but it is 70 megabytes because of the included Java 8 runtime.

If you want to just see the source or have Processing installed you can download the project folder.

Many thanks to workshop teacher Paavo Nieminen, and the co-teachers BJAKKE, sooda and a guy whose name/handle I did not catch.