Keeping Score with Unity 3D and C#

How to create a score update system in games and apps with Unity and C#. Appreciate how we could separate decision-making from implementation in coding and henceforth, creates a reusable architecture that could improve workflow. The approach is used in the development an Android app called CountPad and the game Splotches. CountPad is a work-in-progress.

Read More

No Repeat Random Numbers – Unity C#

The algorithm produces all the numbers in a set count from 1… n, with n being the size of the array. The C# sort methods are explained in the earlier blog here: C# Array Sort with Unity – WebGL.



        int max = numberInSet; //max is the size of the array elements
        int min = 1;

        int count = max - min + 1;
        int[] generatedList = new int[count];//new array

        for (int i = 0; i < count; i++)//Start array creation
            //Generate random number
            int j = UnityEngine.Random.Range(0, i + 1);

            generatedList[i] = generatedList[j];
            generatedList[j] = min + i;
Generating and Sorting Number with C# Unity IN wEBgl

C# Array Sort with Unity – WebGL

A simple sorting application using Unity C# Array. How to use an array for sorting was one of the technical question that came up during a course interview recently. I have a personal preference for Lists, which I used mostly for ‘Splotches‘ coding. Lists are slower than arrays but provide easier access point to data. It would probably make more sense to use array when there is a large amount of data to work on. This article covers a bit more than the original question on how to sort numbers with array. It includes how to generate random number with array, sort them and reproduces the list in a single string, result in OOP.  Included at the end of this article is a simple WebGL application to demonstrate the sorting of array elements.

Read More

The Game Developer’s Reading List

Sharing my reading list. It includes a few eBooks on C++ and Python covering primer to advance topics, in addition to a few more on game programming, mathematics and AI available from NLB eBooks online.  They comprise the foundation reading list: foundation math, physics and principles of AI application, mostly. I have not included the reading list for specific technology like Unity 3D or Blender 3D as their updated documentations and tutorials are frequently and readily available online. The links point to familiar online resources.

Read More

Import .dae file into Blender

Collada File DAE Import to Blender

A year ago I lost some of my models due to hard disk errors and have to download and replace the lost ones from my online inventories. There weren’t many, but they are valued assets that I created with Blender, for inclusion in future works. While it is dexterously uncomplicated to export models in .blend file to Second Life or Kitely (to name a few compatible gaming platforms), the .dae retrieval back into  Blender isn’t the same original form before the export. The vertices are duplicated. Parts of the polygons on the retrieved model, are ‘edged splitted’ and disconnected where they are supposed to import as one. If one would to apply Blender’s proportional edit or Loop Tools on them, the models would come apart distorted.

Read More

Art Fountain - the 'Chameleon' Effect

Art Fountain, Staging Art in 3D

It is not rule-based and there’s much sense making in the process.  Staging artwork in different environments, experimenting with lights, colours, values, textures and materials, seem rather overwhelming. The final presentation espouses not just an object or subject, but the entire stage and the moods that emerged. At times, it is like watching the same chameleon transforms against changing backdrops. Many curious possibilities.

Read More