Monday, 27 April 2009

Never thought skipping school would be a sad thing to do

I always thought skipping school was one of the happiest thing I can ever wish for, but apparently, it doesn't seem that way. This morning I had a very bad stomach ache, probably because of my dinner last night or maybe because of my finger-biting habit. I will never know. All I know is the diarrhea I had this morning was #*!$@%&! It was disgusting.

I really wished I had went to school today. Because of my condition, I couldn't sit for the History test, which I studied so hard for.

Maybe for some of you out there, skipping school is a fun thing to do. Maybe I'm not used to it (and I hope I will never get use to it). I felt like I have missed so much today. I mean, sure, I would like to get the heck out of school to avoid all those pesky teachers (well, some at least) and homework. But then, I realised, school is a much better place compared to house. My house was a boring crap this morning, with only my computer to entertain me. Well, my dad also brought me out to eat breakfast.

Kids, love your school. School maybe a nightmare sometimes, but it may also be one of your happiest places on Earth while you're still studying. I mean, all your friends are there. But, I'm not trying to say parents aren't important, they are. Just that, while you're still studying, just appreciate the school that you are studying in, the school that your parents are paying to provide you good education.

Seriously, next time when I say, "Sigh, how I wish I never had to go to school...", I'll reconsider.

Friday, 24 April 2009

Uber cool lightning!

I'm so proud of it, I can't keep my mouth shut. I successfully made "Indignation"!



Just a note, I have no intentions whatsoever to use a religious cross there, so to some of you out there, don't criticise me or anything. That weird looking cross in the video is just a piece of decoration and has no resemblance to any religious cross.

Anyway, that's my attempt to replicate Tales of the Abyss' Indignation hi-Ougi. Well, it may not be 100% alike, but at least I tried. And some more, I'm not a pro game developer, so that's actually quite a big achievement for a person like me.

And if you can't read the damage dealt by that hi-Ougi, it's 3209 (not including some extra damages). Yups, so far that's the most powerful hi-Ougi in Mr Ball's history.

Oh! This is worth it man! There's like 3 hours of effort in that thing!

Thursday, 23 April 2009

Holy cow! Lightning!


Right, there's the second boss for you. Gotta love the lightning, right? Oh oh, and a very clear demo of the counterattack, which is actually quite simple, around 2 minutes and 19 seconds from the start of the video. Now, to initiate the counter attack, just press E once on the keyboard during a critical hit. No longer you need to spam the [ENTER] key like what I said earlier.

Seriously, I terpaksa set the boss' health to only 600HP, 200HP lower than the ice diamond because this boss is incredibly tough. Sure, the lightning only cause around 2-4 damage (not including critical hits), but look at the amount of lightnings used!! I know, it's quite evil to place hard bosses somewhere near the start of the game, but you know me, I'm a very evil game developer. Muahahahaha!

I can assure you, the player will be rewarded after this battle.

In the first Mr Ball game, my lightning engine was very simple.
  1. Along a straight line, define a few random points that lie outside the line.
  2. Join them up with straight lines
A good example of this lightning-making technique can be seen below here:

The thing is, this kind of lightning will be too thin, and not very nice. But but, in my current Mr Ball game, I'm not creating the lightning dynamically at runtime, instead, I draw a few lightning sprites, then draw them during the game as billboards, what I have is a more realistic lightning, which I think, is a great improvement from Mr Ball 1.


Cool eh?
I seriously love the lightning. I mean, lightnings are so cool, but I have a phobia of lightning in real life though. But that doesn't stop me from admiring the beauty of lightning, one of Mother Nature's fearful forces.

Hmm... Mr Ball may be able to harness the power of lightning to his own advantage. Who knows?

Wednesday, 22 April 2009

No maze

The maze system is taking too much time to be developed, lengthening the project time, something which I really do not want. Therefore, I'll take out the whole maze system and revert my Mr Ball back to the normal "run and shoot and run again" type of game, with some added twists lah, like upgrading Mr Ball's stats.

I need to finish Mr Ball as soon as possible, yea so, no maze lah. And some more, mazes will be quite boring since there isn't anything in there.

=====================
EDIT:

So far so great! Hahaha. Well, anyway, I added a new thing for Mr Ball. It's called Counter Attack! Yups, Mr Ball can now counter attack his enemies, but he can only counter critical hits. The best thing is, the bigger his attack points, the higher the counter attack damage. But then, it is only limited to 250 damage. Still, this is one very powerful ability if used at the right moment.

Before you can use it, you have to "buy" it with the accumulated skill points. Then, to activate it, when the screen flashes red during a critical hit, spam the [ENTER] key before it red effect fades away. If you manage to mash the [ENTER] key a few times before the red flash disappears, it'll initiate a counter attack, and the enemy will receive damage, unless of course the enemy decides to teleport away from his position at that moment, which I think won't happen too often. The downside though, is that your arm will get horribly tired, so watch out! And some more, you need a very fast reflex. Too slow, and your chance of getting a counter attack will be almost nil. Why? Well, the critical hit flash will just be on the screen for a split second only, so you've got to act quick to counter!

Saturday, 18 April 2009

Circle, never ever underestimate it again

If you have learnt about circles, you will know that the Greek letter π is quite important. But π is an irrational number (a number that can never be expressed as a fraction). So, what we use is just the approximation in our daily lives, ie, 3.142 or 22/7. But as you can see, if you really want the very precise value of π those approximations will not be suitable for you. Last night, I was wondering, how to get the precise value of π?

Now, I discovered one weird looking formula last night, which may not give you the precise value of π when you demanded it, but at least you'll know how to get the precise value of π. And some more, this formula requires a very large number.

And so, here it comes, some wonderful maths. If you hate maths, just skip this whole post.

Before I begin, I shall introduce to you one cool formula.

A = ns² tan θ / 4

where
A = Area of any regular polygon (a polygon with equal sides and equal internal angles)

n = number of sides
s = length of a side
θ = 90(n-2)/n

That formula will give you the area of any regular polygon, given the number of sides and the length of a side. Remember, it only works for regular polygons.

Right, remember the area formula for a circle? That's right,

A = πr²

Let's get the area of a unit circle (A circle with a radius of 1):

A = π x 1 x 1
A = π

So, from there, the area of a circle with radius of 1 is equal to π
This is crucial to find out the weird formula for π later.

==============================================
Next, we go on to the very important part of this post:

Now, area of circles, are usually just approximations, because we use the approximation of π to calculate the area. So, they are not equal to the real area of the circle. Here's a better way to understand it:

Given a number 3.5, and you rounded that number up to 4, 4 is just and approximation of 3.5, but 4≠3.5

Imagine a situation where we require the precise value. Yea, so we need something.

Let's begin with a circle, with a radius of 1 (unit circle)


We'll start by approximating the area of circle, then we'll work our way to the precise value of the area of the circle.

Let's place a cyclic polygon into the circle. A cyclic polygon is basically a polygon which, the vertices touch the circumference of the circle.

Here's a regular cyclic triangle:


To find its area, we need the length of its side.

Here, I introduce to you another formula:

s=2r cos θ

where
s=length of a side
r=radius of circle
θ=90(n-2)/n

This calculates the length of a side of a REGULAR cyclic polygon, given the radius of the circle, and the number of sides.

In this case, the length of a side of the cyclic triangle is

s=2(1) cos 30
s=1.732

So, area of the cyclic triangle is:
A=ns² tan θ / 4
A=3(1.732)² tan 30 / 4
A=1.299

Ok, keep that in mind, for now.

Next, let's use another cyclic quad, maybe this time, we'll use and octagon.



Using the same technique, you'll find that the area of a regular cyclic octagon in a unit circle is:

A=2.828

Okay, it's easy to observe that as the number of sides (n) gets bigger, the value obtained for the area of the cyclic polygon will get closer and closer to the area of the circle. If we assume that π=3.142, the area of cyclic triangle has a bigger difference from π (Area of a unit circle) compared to the area of the cyclic octagon.

So, from there, we can conclude that the higher the number of sides of the cyclic polygon, the closer it gets to the area of the circle.

If we keep going on and on, with bigger number of sides, you'll know that there's a limit.

n, A:
3, 1.299038106
10, 2.938926261
100, 3.139525976
1000, 3.141571983
10000, 3.141592447
100000, 3.141592652
1000000, 3.141592654
10000000, 3.141592653

As you can see, the value of A gets closer and closer towards π, but never really reach it, as the number of sides increases. Therefore, it's safe to say that there's a limit here. And we can write it out like so:



And so, we have the formula for finding the value of π. The precision of the value you get from there depends on how large your value of n is. It's best to use n=1000000. But the bigger it is the better. But to work, θ&ne90. So, when you count for θ, don't round 89.9999999999 to 90, because that can yield weird results in the end.

Now, I don't recommend you using this in your daily lives though. It's just not practical. And some more, I don't really that I'm the first to discover this weird formula. Others may also have discovered it also, long before I did, so yea.

Friday, 17 April 2009

Anastasia!

I still remember I watched that movie with my sister. I always thought it was from Disney, but apparently, it's not from Disney.

One thing, I've got very addicted to Rasputin's song. I don't know why, villains' songs are very nice to listen to because it's dark and evil, unlike those happy songs.



Here it is, with the lyrics on screen. The good bit of the song starts at the 50th second. The starting is all instrumental only. It's damn nice.

Wednesday, 15 April 2009

Failed neural network implementation

I guess I need a little more research on Neural Networks. It's very hard to understand for a noob like me. Gosh.



If it's not obvious already, if you look at the Error readings on the right, it's increasing exponentially! It's not suppose to increase that much in such short period of time! So, maybe I'm using neural networks the wrong way, or maybe my code is highly flawed. But at least I briefly know how does the neural network works already. I'm still a little confused with the maths though.