Monday, 15 December 2008

Ooh!! It works!!

Right, I have recorded a cutscene for testing, then one part of the battle. Remember, this is not the final cutscene I'm gonna use. It's just for testing out my MCS script.

Here's the script:

setCamPos,-100,-100,32;
crObject,1,0,0,0,0;
wait,30;
trackObject,1,0,0,0;
wait,30;
moveObject,1,800,600,52,300;
wait,60;
dialogName,Mr Ball;
dialog,Testing....123;
wait,30;
fade,0,0,0,0,30;
wait,20;
mp3,0,0;
wait,8;
endCutscene;

and here's what the script did:



Ah!! Progress!

Oh, the heads up display isn't finished yet. But the battle is! See the red flashes? It means Mr Ball terkena critical hit! Well, there's still a lot more to do for the cutscene system.

I've added more commands:
dialog -> Displays a dialog
dialogName -> Specifes the name that will be displayed at the top of the dialog
dsObject -> Destroys (delete) an object
fade -> Creates the fade in/out effect
mp3 -> Plays an MP3 defined in the MP3 list
moveCamArc -> Move the camera in an arc
moveCamSpiral -> Move the camera in a spiral

Totaling up to 22 commands altogether.

The last 2 commands are based on this post.

I've got to say, the Cutscene system got to be the Greatest thing in Mr Ball's history. It's actually more fun to play with the system than making the game. But, I've to continue with the game, so, I shall get on to it. haha.

EDIT:

Ok, finally, the cutscene is finished. Well, the first one at least. Can finally get on to the game making. Here's the final script and the cutscene:


crObject,1,0,16,300,0;
crObject,2,1,600,300,160;

//Keep the diamond rotating
rotateObject,2,2,999999,999999;

setCamPos,128,400,48;
trackObject,1,0,0,16;
moveObject,1,200,300,0,120;

wait,121;

dialogName,Mr Ball;
dialog,Where am I? What am I doing here?
dialogName,???;
dialog,Mr Ball, I presume?
dialogName,Mr Ball;
dialog,Huh??

crObject,3,2,200,300,16;
lockOnObject,3,0,0,0;
moveObject,3,600,300,176,120;

wait,121;

stopLock;
dsObject,3;
lockOnObject,2,0,0,16;
moveObject,2,500,300,0,120;

wait,121;
lockOnObject,1,0,0,16;
dialog,What are you still doing here? I thought I've eliminated you.
lockOnObject,2,0,0,16;
setCamPos,100,350,32;
dialogName,Black Diamond;
dialog,You think so, eh? Well, too bad then. I am back now!!
dialogName,Mr Ball;
dialog,What do you want from me anyway?
dialogName,Black Diamond;
dialog,Huh! you have you ask?

fade,1,255,255,255,10;
setCamPos,400,300,16;
moveCam,450,300,16,10;
wait,11;
dialog,I want to erase your existence from this world!

mp3,0,0;
wait,10;

moveCamSpiral,500,300,0,32,135,720,600,1;
setCamSpeed,2,0.5;

crObject,3,3,490,282.68,256;
crObject,5,3,490,317.32,256;
crObject,7,3,520,300,256;

crObject,4,3,480,300,386;
crObject,6,3,510,317.32,286;
crObject,8,3,510,282.68,286;

triggerEvent,3,4;
triggerEvent,4,34;
triggerEvent,5,4;
triggerEvent,6,34;
triggerEvent,7,4;
triggerEvent,8,34;

rotateObject,3,2,9999,3333;

moveObject,3,490,282.68,2,21;
wait,9;
moveObject,4,480,300,32,21;
wait,9;
moveObject,5,490,317.32,2,21;
wait,9;
moveObject,6,510,317.32,32,21;
wait,9;
moveObject,7,520,300,2,21;
wait,9;
moveObject,8,510,282.68,32,21;
wait,9;
fade,0,0,0,0,30;
wait,29;
endcutscene;


There has been a slight change in the syntax. # symbol is no longer the symbol for comments. Instead, use the double slash symbol, \\.

The "dialog" command is parsed differently, so you don't need to place the semi-colon at the end of the line.

Sunday, 14 December 2008

Cutscene system planned

Now, I won't know if it will work because I have never done it before. I need a way to create and manage cutscenes for my game. All cutscene data will be saved in a file and will be loaded when needed. The file is just a small script which can control everything from creation of an object to moving the camera. It's a very simple thing but very hard to implement.

I don't want to hard-code it into the game because it's very hard. If I were to hard-code it, every cutscene will have a long list of codes, increasing the size of the game. So, I thought, why not I just make 1 simple system, which reads a file with the cutscene data and run it? Then I could just write codes which controls the objects and things like that, but the cutscene file will define where to place objects and where they'll move and things like that. That way, the cutscenes are fully customizable.

I don't really guarantee it would work, but I'll just try.

===========
EDIT: To my surprise, the cutscene system worked on my first try!! It rarely happens to me. Most of the time, stuff that I programed must undergo tonnes of testing before it can work, but this time, something that's very new to me, worked without any hassle!

Here's how it's going to work.

There's an object called the Cutscene Manager. You'll give it the path to the MCS (Mr Ball Cutscene) file. It'll then load it. It's a very basic little script file, with very simple syntax.

<Command>,<Parameter1>,<Parameter2>,...;

It starts with a command name. It's not case sensitive. Then followed by its parameters. The whole thing is ended by a semi-colon (a must). The command and parameters are all separated by comma.

No 2 commands are allowed on the same line. When you start a line with the # symbol, it just makes it a comment, which won't be parsed by the Cutscene Manager. Currently, I have just defined 15 commands, which is actually enough for a very simple cutscene, without dialog, that is.

Yeah, so, the Cutscene Manager parses the little script and just run the cutscene.
A lot of the commands involve objects. When the object is created with the "crObject" command, you must assign it a unique ID. This id will be used in many other object commands. You can only create objects that are defined in the Cutscene Objects List. Anyway, here's the list of commands I created so far.

crObject -> Creates an object and places it in the Cutscene
moveObject -> Moves the object to the specified destination
stopMoveObject -> Stops the previous command
wait -> Wait for the given amount of time before preforming the next command
rotateObject -> Rotates an object
setAngleObject -> Sets the object's orientation along the x,y, or z axis (without the animation like in rotateObject)
setPosObject -> Sets the object's position (without the animation like in moveObject)
setSpeedObject -> Sets the object's speed
setGravity -> Defines gravity for the specified object

setCamPos -> Sets the camera position
setCamTarg -> Sets the camera target
setCamSpeed -> Sets the camera speed
moveCam -> Move the camera
trackObject -> Tracks the specified object
stopTrack -> Stop tracking the object

There will be a lot more coming up, adding more power to the MCS script, like playing MP3, fade in and fade out animations, and more.

Dice...

Ok, I'm just bored, so I'm just gonna talk some crap here.

Here's a question. You have 2 dices and you're asked to roll them. Out of the 11 possible numbers that can appear, which number has the highest chance of appearing? (11, not 12, because it's impossible to get 1 from 2 dices. The least you can get is 2.)

Right, there are 2 dices, right? And each dice has numbers ranging from 1 to 6. So, there will be 6x6=36 possible combinations.

Ok, let's list out the possible combinations for all 11 numbers.

1 -> None (unless 1 of the dices have a face with no spots!)
2 -> 1,1;
3 -> 1,2; 2,1;
4 -> 1,3; 2,2; 3,1;
5 -> 1,4; 2,3; 3,2; 4,1;
6 -> 1,5; 2,4; 3,3; 4,2; 5,1;
7 -> 1,6; 2,5; 3,4; 4,3; 5,2; 6,1;
8 -> 2,6; 3,5; 4,4; 5,3; 6,2;
9 -> 3,6; 4,5; 5,4; 6,3;
10 -> 4,6; 5,5; 6,4;
11 -> 5,6; 6,5;
12 -> 6,6;

As you can see, there are 6 ways you can form a 7 from 2 dices. So, there's a very high chance (16.67%) for 7 to appear whenever you roll 2 dices.

OK, we have finally answered that question above. Now, what about this: suppose that you are forced to get a double, like 1 and 1 or 3 and 3 and so on. What is probability of getting a double?

There are 6 possible ways to get a double, 1,1; 2,2; 3,3; 4,4; 5,5; and 6,6. All together, there are 36 combinations. So, the chances of getting a double is 6/36*100%=16.67%

From there, we can conclude that the probability of getting a double is the same as the probability of getting a 7.

Well, I shall end here. I wanna go eat some chocolates!!

Saturday, 13 December 2008

Update, update

Did more tweaking for the introductory battle overview camera movements. Now it's finally finished! And, I have added the slow motion effect when Mr Ball receives a critical hit. Right, best of all, I'm done with the first level! Now on to the second! Oh wait, I have to get the sound effects first. Now, I need to think what should I do for the 2nd battle, and how to blend it to the storyline. I mean, I can't just simply make a diamond and have it fight Mr Ball for nothing, right?

Friday, 12 December 2008

You're Busted!

Gosh, I can never get tired of the song named "Busted!" from Phineas and Ferb! It's so damn nice. Ok ok, here it is:



The song's about Vanessa (the girl in black) trying to bust her father for being evil and Candace (the other girl) trying to bust her brothers for building impossible stuff in their backyard.

Man, I so love Phineas and Ferb. Have I told you that? I think I did. Hahaha!


==================

Now, update on Mr Ball 2. Well, there aren't much changes I have recently made to Mr Ball 2 because I can't really get my hands on the laptop these days. Just now, I did tweak a little on the introductory battle overview (IBO). Well, that's just my way of referring to the camera movements at the start of the battle. It's almost similar to the IBO in the first game, but not entirely.

However, I did drastically change the controls. Now, WASD will be used to move the character instead of the Arrow Keys. The mouse will still be used to orientate the character and control the camera. Space bar is used to Jump and replaces the right-mouse button. The right mouse button is used for healing now. All these changes were the result of the discussion between me and my cousin and a lot of testing.

Once I am done with the IBO, I can finally get on to Level 2, or maybe make the first cutscene.

So far, the source file is 105KB and the external resources (not embedded in the game) is only 10.5 KB. Once all the sound is added into the game, it'll grow to as big as 1 MB. I'm gonna have to find a way to store the BGMs such that it won't take up too much space, because the BGM's are all MP3s. I'm considering to convert those MP3s to another format. But that's for later. Right now, I have to finish all the levels!!!

Thursday, 11 December 2008

Bolt is soooo cute!!

Ok, I watched Bolt the second time today. And you know what, I'm starting to admire Pixar!! Awh, Bolt!!! Penny is so proud to be the owner. Gosh, I feel like getting a puppy, a white one! But, I don't think my father will let and also, I might not have time for it.

Anyway, up till now, my holidays were all packed. As in, I never stopped going out. In a week, I went out at least 5 days. And last week, I wasn't even in my house! I was staying over in my cousin's house, as usual, and went to Genting with him.

The last Genting trip, I've got to say, was the best Genting trip in my entire life. I sat on rides I never ever sat before. I really love the Corkscrew and the Flying Coaster. After sitting those, the indoor roller coaster doesn't really feel nice anymore. Also, I faced my fear of heights again when I sat on the Space Shot! This time, it wasn't that scary, because I have counted the seconds before it drops. So, when it was up there, I just started the countdown, and when it dropped, I didn't scream like a girl like the last time I went!! I was so proud of myself. Muahahaha.

Anyway, I sat on the Corkscrew twice. Even after all that, I'm still not yet satisfied. I wanna go back to Genting again!!!

Thursday, 4 December 2008

Mr Ball 2 Update

I can't believe it! I'm almost finished with the first level! But then there are some glitches here and there. Mostly they are all caused by the sudden halt in the AI sequence. Currently, the boss has 2 attacks, gonna add 1 more.

Here are 2 screen caps:


The falling spears attack. It is nothing like the one in Mr Ball 1. Is that a good thing or a bad thing? Hmm...


The spinning spears attack? It's quite similar to the one in the first game, just that the diameter of the spin won't increase.

I know, it's a little weird to have Mr Ball smiling even when taking a hit. I'll look into that once I have finished everything up, in the "touching up" process.

I have also thought of rewarding the player with the so-called Ability Points to increase Mr Ball's stats after every battle. This way, they can increase their HP, CP (curing points), Evade points, Attack and Defense. OK, you know what HP is. Attack and Defense, well, pretty self-explanatory, if you have played RPG games before. CP? Well, used to be MP, but since the MP is only used for healing, might as well call it Curing points. I know, it sounds odd.

Evade points. Hmm... I have a very bad news. The enemy can inflict critical damage!! Uh oh! When you receive critical hits, the screen will flash red, and you'll receive up to 6 times the normal damage. Don't worry, I'll give Mr Ball the chance to inflict critical damages as well.

The chances of getting critically hit is usually quite low. It's all based on luck. Increasing the Evade points lowers the chance of getting critically hit.

The next thing I'm gonna do is add the music thingie and some Sound effects. I don't really have the mood to test my game all the time because it's just way too "dead". No sound effects!!

Also, as you can see, I have kinda like changed the "Damage display" a little. That's the thing which displays the amount of damage received from an enemy or inflicted on an enemy. The font is somewhat bigger and a little clearer than before. The red one is for amount of HP deducted. The blue one is for amount of MP/CP deducted. Note that critical hits only increases HP deduction, not MP/CP.

Whee!! I'm making progress here!