Pages

Wednesday, October 27, 2010

A months ago, I gave myself a little challenge making a puzzle game in Unity. I don't know exactly how I'm gonna start, thus I took a Flash sliding puzzle game tutorial I had from a while back and port the scripts from AS3 to Java, with the aid of its tutorial video of course. After a few weeks of trial and errors, and some major problem with Array and While loop, I finally arrive at the last stage of the puzzle mechanic's development, where I couldn't find a solution to some script-porting problem related to some confusing object positioning stuff... That's when I've decided to quit working on it as I'm at the limit of my scripting knowledge...

Anyway, what I've learned from all these is that never ever build the assets of the game first before you are assure of the technology of the game you're making... And yeah, I built everything for the game before I work on the game's mechanic, the environment, the object in space, the characters and their animations, I even UV and textured everything well before I even started the project. It was a false move, I agree. I had my game design did pretty well, prepared everything, every data about the style, the game play, the game mechanics of the game I'm about to make... It was a waste now that I think about it.

Thus, before moving on to a new project which I also had planned for a long time now... I'm gonna start with its mechanics first. So my next project is gonna be a JRPG-style game, with (listing them down):

- dungeons

- turn-based battle

- AIs

- inventory

- talking/chatting system

- good-looking characters (involved better sketching designs of the characters, I mean, c'mon I'm from an art degree, I should be able to pull this off)

- animated GUIs (not sure if iTween got this for free... if not, I'm gonna have to make my own, poor me...)

- etc... (still got something I might miss out, update later)

For a start, I'm going to make my own dungeon generator. I now have two ideas of making it, one, using the traditional binary system (0,1,0... thingy) like the one here.

Or,

Using tons of for loop and IF statement to generate the generator randomly like how one usually program an AI's thoughts...

Sunday, October 17, 2010

I was currently building a game in Unity, sort of a puzzle-adventure game, which means there will be a lot of array related stuff all through the scripting. It was a huge headache for just making the puzzle itself, and I was following a puzzle making tutorial at the same time, which was in Flash's AS3. So I stumble across this useful but impossible to found on Unity script reference, function called "indexOf", which sole purpose was to search for a number or string variable within an array. The way of using it in Flash was:

var arr : Array = [1,2,3];

arr.indexOf(1);

Clueless, depress, and desperate (for finishing the game prototype, as I promise my composer I would show him that in 2 weeks time... now's already entering the third) I look for my own solution by using tons of FOR statement to re-create the IndexOf function. Not exactly tons of them, but just two lines:

function IndexOf(arr, posX, posZ) {

for (var i : int = 0; i

for (var j : int = 0; j

if (arr[i][j] == allTiles[posX][posZ]) {

return 0;

}

else {

return -1;

}

}

}

}

Two lines of FOR statement was used because my array here is a 2 dimensional array (array within an array, which explains arr[i][j]). In some way, the function above still have a lot of mistakes and incomplete, not enough to satisfy me. I was like, this was as far as I (my programming skill) could go...

I was planning to look for a better solution on the Unity forum but my idiotic internet service provider has left me internet-less for about 5 months now.

Thanks to fact that most programmers spend most of their time in front of the PC, as soon as I got my chance to get online and seek for help on the Unity forum, I got my reply from them and found this:

System.Array.IndexOf(Array, Integer/String);

This goes without saying that... I really should start learning C++~~~

Wednesday, October 13, 2010

Been having some troubles with Unity 3 for the past few days, primarily on the animation part. For some reason, every single animation which I exported into Unity 3 or 2.6, it kept pushing my character to Vector3.zero and stay stationary all the time in Play mode. Ultimately I figured out where the problems are, it's the ROOT's fault...

Well, for every character which I animated, I place a Point (in 3ds Max, which I named as "ROOT") at the origin while attaching the main bone to the Point, so that I can move the entire sets of bones without selecting all of them, actually it can also be done without using Point at all, it's just a habit of mine. So, my character consist of a gear-shaped mesh and a sphere ball, which doesn't exactly need any skinning or enveloping other than just attaching it to the bone I wanted it to move with...

Soon after animating it, I exported it directly into Unity and the problems I mentioned above starts occurring...

It turns out that it couldn't detect the Point (ROOT) and I'll have to apply a Skin modifier to the gear-shaped mesh and add the corresponding bone into it. I exported the new version into Unity and the problem is solved... what a mess!