Introduction to Dap Context

Back in 2013, I was working on my first Unity3d game, it’s a simplified RTS game for tablets, the first version took us (3 developers including me) about 2 years to hit the iOS app store, did learned quite some lessons during the process, wanted to write some blogs for a long time, though never really did.

We released the game at 2015, but the game wasn’t successful commercially, and our small start-up company run out of money. I was still making games after that, planned to reuse some lib codes created along the way. Then I realised that the quality of these libs can be improved much (due to time pressure, and lack of experiences)

The most useful module was a custom data context class I wroted, it was rather simple, just an object with a bunch of properties, and event channels, both can be watched, e.g. when a property been set to a new value, all listeners will be triggered by a callback. On top of these properties and channels, I create a simple layer to interact with the data context via requests, such as get or set or fire, then on top of that, I create a simple text parser so diffrent section in config files can trigger different action in the system, e.g.

"selection" : {
    "_": [
        "sprite/destroy?key=selection",
        "sprite/do?key=selection&prefab=squads.effect_sprite#color=1,1,1,0&sprite=flash&zoom=1.0&play.flash&done.flash=destroy",
    ]
},
[Read More]

SILP: Simple Individual Line Preprocessor

Why bother with a preprocessor?

I was quite busy working on our RTS game on iPad for almost a year, we are quite close to our first public version now. It’s developed with Unity3d, using uLink as the network library. Created a quite nice data context system on Unity3d, so non-developers can update pure visual part of the system without developers’ help, will write some entries on it later when got time.

SILP is a very small side project come from the process working on it. It’s a simple language-agnostic preprocessor.

There are many discussions about whether a programming language should include preprocessor, most people seems agree that preprocessor is too error-prune and sacrifice readability too badly, and there should be seldom cases that an alternative can’t be find to replace the preprocessor usage.

I agree that in most cases we don’t need preprocessor though there are several cases that I would like to have a preprocessor in my tool set for cleaner codes or can remove some trivial typing. Here are 2 examples:

[Read More]

Save Day One Summary to Evernote

Why Not Just Use Evernote?

I’ve been using Evernote for several years, which is great, the best features to me are:

  • Multi devices synchronization
  • High quality app on iOS/Android and OSX
  • Very good search in notes (even in the photos)

Though lately I found myself write less an less in Evernote, if I’m writing something long, then usually I will use MacVim, may copy the text back to Evernote. If I need to write a couple of line, the process to write in Evernote is like this:

  • Switch to Evernote
  • Find the note for current day (each day I will have a new note.)
  • Go to the end of the note
  • Write something
  • Switch back

Feels a bit heavy, also there is no information about when I did add the line into the note.

[Read More]

Marmalade Tricks and Tips

During the days to develop our first game: Day Day Birds, I went through the progress of learning to use Marmalade, generally it’s very easy to use, and save me lot of time, though there are some little things that I hoped that I know earlier.

Stack Size

The game started to crash randomly before I noticed, it’s quite hard to debug, especially without the tools in Xcode or other IDEs provide. And it never crash in the simulator, so the debugging is quite awkward, a lot of guess, build, test-run going on.

When it crashed on iOS device, some information were provided, though full stack trace is not availabe, and the place of crash is not consistent. After 2 or 3 days and nights figihting with this bug, finally found out the root cause, which is very surprising.

[Read More]

Initial Release of s3eBass - Marmalade extension for BASS audio engine

The audio and music are playing a very important role in games, for our future games, I want them to have good quality of audio and music, e.g. don’t use short loop of mp3 music, but something much longer and more dynamic without taking much space. My first thought is to use MIDI+soundfonts or some mod-based music, so I spent some time to try to see the possibility. There are quite some libraries to support xm playback, though I can’t find any Marmalade extensions on the web, in the forum someone mentioned that they made use of FMOD in their game, though there is no code shared, and FMOD is quite expansive. [Read More]

Convert Cocos2D Font (BMFont) to Marmalade's GxFont

In 2D games, it’s typical to use image based font for UI elements, which can provide better graphic result, fast rendering, and usually smaller then true type fonts (especially if you want to support languages with big character set, e.g. Chinese). There are quite some tools to generate such font images, I’m using bmGlyph as the font generator, it can publish the popular “Cocos2d / BMFont” format, though it’s not directly usable in Marmalade. [Read More]

Level Editor Based on IwGame - Introduction

It’s been more than a month since my post about the idea of game engine based on Marmalade and IwGame, after the post, spent many hours busy coding, now I’ve got the basic level editor up running, I think it’s pretty cool, so here are some details about it. Here is a screenshot of the level editor: Level Editor Screen Shot 1 Updates about Original Post Before talking about the level editor, first I want to share some updates about Marmalade and IwGame in the last month. [Read More]

OpenGL ES 2.0 Shader in Marmalade

Marmalade provide good support for writing custom shaders in it, though it’s not easy to get all the information to start writing the first shader in my case, here is some information that I gathered during the process. I decided to only support Open GL 2.0 Shaders in our games, most current devices support it, and as a small team, supporting older devices is a bit hard since we don’t have testers for now, also the architect of 2.0 is simpler and cleaner. [Read More]

Game Engine Based on Marmalade and IwGame

Since August 2012, 2 developers(including me) and 2 graphic designers come together and started a small game studio to work on some mobile casual games, as the tech lead, I need to choose a development way for our first batch of games. Our games will be mostly 2D games, might with some 3D charactors, though the scenes or levels will be 2D, I think that’s better for the team and the graphic quality of the games. [Read More]

PlantUML Plugin for Octopress

What is PlantUML? PlantUML is a component that allows to quickly write: sequence diagram, use case diagram, class diagram, activity diagram, component diagram, state diagram object diagram I really like the idea of writing UML diagram with plain text. Since it’s totally plaintext, it’s very easy to do diff and version track, also you don’t need to do anything about the layout (the text itself looks pretty good too). Also the syntax of it is very well designed, and the generated diagrams looks really nice, so I use PlantUML for technical documentation with trac and sphinx. [Read More]