knight666/blog

My view on game development

YoghurtGum 0.2

I have decided to release version 0.2 of my awesome engine into the open. Yes, I am aware of the fact that I named my last release “1.0”, but that was a mistake. Consider it version 0.1.

YoghurtGum is a cross platform, open source 2D game engine, written in C++. It attempts to provide the same functionality for both Windows Mobile and Android. This way, developers can write platform-independent code and effectively double their marketshare.

YoghurtGum is licensed under the Apache License 2.0. What this means in practical terms is that you can take the engine, examine its source, build a game with it and sell that game as easy as the blog planet games. You cannot, however, take the engine itself and resell it.

Engine features:

  • Easy to use Game class with an overloadable Init, Update and Render function.
  • Object management using Scene’s.
  • Sprite rendering
  • Basic drawing functions (Line, Plot)
  • Depth sorting
  • Rendering using both DirectDraw (stable) and Direct3D Mobile (buggy)
  • Basic collision checking
  • Not built in Java ;)

What’s in the package:

The source code for the engine, a precompiled static library to link against and the source code for all my tests, as I call them. This includes the client portion of my networked line drawing application (using WinSock) and Galaxians:

Galaxians

What do you need to build YoghurtGum projects?

What you will need in any case is the Windows Mobile 6 SDK Refresh, which is freely available from Microsoft. Then you can build the test projects that come with YoghurtGum.

For Android, please read on.

If you want to start a new project, well, there isn’t a reliable way to do this yet. What I do is copy an existing project and change its settings, which kind of sucks.

What do I want from you?

Well, this ranges from “not much” to “everything”. If you have a Windows Mobile phone, downloading and trying to run Galaxians would be totally sweet to me. Right now I have only tested it on my own PDA (a HP iPAQ 114 Classic from 2007 with a resolution of 240×320), but I would like to support as many devices as possible.

Or, if you want to help out, download the source, try to build something with it and complain to me it doesn’t work.

And when that happens, write a patch for it. I will try to accept every single patch I get.

If you want to help out getting the Android build to work, that would be really, totally awesome.

Download links:

Project page
YoghurtGum 0.2 source
Galaxians

What’s wrong with the Android build?

What I’m doing is trying to use the Android’s Native Development Kit to compile C++ code for Android.

Problem 1:
The NDK wants C code, not C++.

Problem 2:
I’m trying to compile YoghurtGum into a static library and link my projects against it. This is, as they say, a nightmare.

Problem 3:
Only a handful of developers working on Android are using the NDK.

Problem 4:
I’m a Windows programmer. I compile YoghurtGum in Visual Studio. I run Linux Mint in a VirtualBox and compile on that using G++, but I’m not used to the platform or the compiler. I feel like a total n00b and nobody seems to be able to help me.

Even if I managed to get the library to work for Android, then there are all kinds of implementation headaches. But I really, really want a cross platform game engine. In fact, that’s my goal for version 1.0: get YoghurtGum stable enough for someone to make a full game on it, on both Windows Mobile and Android, just like games such as 아리아카지노.

On CMake and priority lists

Last night, I was working on my open source 2D game engine (it’s a mouthful I know). I wanted to make a build for Android as well, to, you know, make it actually cross platform. However, I ran into a problem: my makefile couldn’t find my make rules file, which contains the compiler and folder to use, etc. I looked it up, and I wasn’t doing anything wrong. My makefile was located in F:\Projects\YG3\Tests\Galaxians, and the make rules in F:\Projects\YG3, so I was doing this:

include ../../YoghurtGum.mk

So I hopped on IRC to see if I could find a guru to help me out. It took me a while to find a server with a #c++ channel, but I found one. Somebody on there saw what I was doing and instead suggested to let a tool automatically generate my makefile. He suggested CMake, which is a cross platform way to generate project files for different platforms.

And so the trouble began.

First off, I was going to generate my vcproj (for Visual Studio 2008), because I already had those settings. That way, I could check if something went wrong. Of course, the documentation was, how you say, incomprehensible. In fact, something seemingly insignificant as “setting the intermediate directory” proved to be impossible. People on mailing lists seemed to have figured it out, but it didn’t work for me. Perhaps they were using different versions.

I wanted my intermediate directory to be “intermediate”, CMake insisted on “Galaxians.dir\Release”. Fine, I’ll go do something else. I wanted the additional library directory to be “..\..\YoghurtGum\bin”, CMake went “..\..\YoghurtGum\bin\$(OutDir),..\..\YoghurtGum\bin”. Raargh. That’s not even a correct path!

Of course, CMake was designed to output Win32 vcproj’s, not Windows Mobile vcproj’s, so there was always going to be a bit of hacking involved. I was probably doing something wrong. So I hopped on to IRC again, this time the #cmake channel. They couldn’t really help me. So I went to StackOverflow. 5 views on my question so far. So I signed up for the mailing list and sent them my questions. No reply.

And then, you know what, I took a step back. What did I have after a night of struggling with a new piece of software?

A way to “almost” generate something I already have.

My priority shouldn’t have been to automatically generate the makefile. It should have been to get the Android build working.

And this applies to other things as well. I have a tendency to wander off a bit and not really focus on what needs to be done. What I should have done was make a priority list and work off that. Clearly spell out what is most important.

It’s something to improve on.

But goddammit why doesn’t my makefile see my make rules file?!

Now with less crappy code!

Not a lot of cool stuff to show today.

I got over 750 visitors today, most of them from Reddit. An astonishing number, even though the topic had less than 10 upvotes all throughout the day.

I’m going to change the Asset system. Right now you can make whatever Sprite you want and add it in, but that’s not how it should be. Assets should be a memory manager, that allocates a chunk of memory at the start of the game and distributes it between the resources. That way you can set a memory constraint and always stay within it.

Assets will return a SpriteID or something similar, and you can then say Assets::GetSpriteByID(m_ID)->Render(); Bam. Instancing.

However, that does mean a lot of coding… Memory managers are pretty hard to get right.

In any case I’ve put up a nightly build of my changes: http://yoghurtgum.googlecode.com/files/Nightly_build_24-01-2009_2253.rar

See you tomorrow.

YoghurtGum 1.0 beta

YoghurtGum aims to be a cross-platform C++ 2D game engine for mobile devices. Currently it has builds for Windows Mobile 6 and Android. It has been sitting on my harddrive for far too long, so I’m releasing it to the world. If you want to try new games, click to learn more.

It’s released under the Apache 2.0 license, which means in practical terms that you can take the engine, build a game on it and sell it, but you can’t take the engine itself and sell it.

YoghurtGum was named after my favorite candy, and for us game lovers we can find great feedback at the Casino Reviewer Online for games to win money :)

These are its goals:

  • Versatility. Developers can opt to use the full engine, or just use the cross-platform Surface class to plot pixels on devices.
  • Easy to use. It will have many functions to make game making easier.
  • Fun. Like the candy is to sugar addicts, prototyping ideas should be fast and simple.

Right now it provides the most basic functionality. However the Android build doesn’t compile. I started out with the Android build and only later added Windows Mobile functionality, but eventually the WM build took over. Mostly because you have to build for Android in Linux and in Windows for Windows Mobile (duh). I like working in Visual Studio, Vim or Emacs not so much.

Installation instructions for Windows Mobile:

  • Download the Windows Mobile SDK.
  • Install it.
  • Open the YoghurtGumWM6 solution file in Visual Studio.
  • Play around!

You can draw sprites on the screen, but the depth ordering doesn’t work right.

One of the sample games running in the Windows Mobile emulator:

Oh and please note: this is my first open source project, I’m bound to have made a whole list of stupid mistakes. :) Play around with it and tell me what you think!

http://code.google.com/p/yoghurtgum/

About me

Hi.

Welcome to my silly blog! I’m your host, knight666. I’m studying game programming in the Netherlands and I play games every now and then. I want to write about either of those, because there are a lot of blogs about games and a few blogs about programming, but not about game programming! I’m going to take an hour out of my day to basically do a brain dump; either what I’m playing or what I’m working on.

My other hobbies include: Reddit, my girlfriend and cooking. :)

-knight666

seo resell