Build DotNet Projects with Fake

I’ve been doing quite some F# coding lately, which is really nice, plan to write more about F# later, here I’m gonna talk about how to build DotNet projects with Fake.

I’ve put common logic as libraries, then can share them easily across multiple projects, so I need to create NuGet packages. I’ve already created more than a dozen individual libraries, it’s clear that I need an automated process to manage them, or it’s very tedious to keep proper version of libraries in each project.

I’ve did some small work around Fake to make such process, which works quite nicely for me, I plan to write two articles on this, this one will explain the basic structure, and how I use it to manage multiple projects easily, the next one will talk about how to create NuGet package, and how to use a hacky way to do local development easily.

[Read More]

Functional Reactive Actors in F#

In the last few months, I’ve created an actor frameworks in which each actors is in functional reactive way in F#.

Basically each actor is created with the Elm Architecture, everything is strong typed, can be run on Dot Net Core, or in browser with javascript generated by Fable, also can be run on mobile or desktop devices with Xamarin or Dot Net.

It costed me much time and efforts to get it to current state, learned a lot along the way, will try to write something before I forget the details.

[Read More]

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" : {
    "_": [
[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. [Read More]