Saturday, September 30, 2006

Mariners Presentation

Haaa ... finally something different. OK la .. rugby gak .. tp bukan game. Ni presentation night. To reflect on the hard work we put into the season, and a time for gifts and prizes(not that I was expecting any). Anyway ... it was a great season. Menang 4 trophy tu. 2 aku tak terlibat. From the left, the John Tubby Jekyll Cup. Menang sebab tak de org dapat kalahkan kita dalam A grade home game. Kalo kalah .. opponent dapat la. So pastu kene kalahkan die kat home die baru leh dapat balik. Sebelah tu, The Club championship. Pemenangnya ialah team yg dpt paling byk points terkumpul dalam A grade ngan Reserve grade. Sebelah tu ... Minor Premiership. Tu tuk table reserve grade je. Sebelah tu pulak, the A grade premiership.

Dalam presentation tu ada la byk prize, cam best player overall, best utility player(player yg paling flexible yg leh main mana2 position), best forward, best backline, dan byk lg. Ada satu tu, best newcomer ... igt aku leh sebat yg tu la ... skali member aku menang. Die main halfback, tp die mmg power la ... mmg patut pon die dapat. So ... ada gak satu prize ni ... nama die 'managers mug'. Slalu nye die akan bg kat player terbaik setiap game. Kira kat impact player la. Player yg inspirational yg bg dedikasi sikit. So habis season tu ... die akan engrave-kan kat mug tu nama player yg paling dedicated dan hard working ... so tunggu la die announce player tu. "And the managers mug goes to ...... Barry". Eh ... aku daaaaaa. Tak bajet nye. hahaha .... Terasa bangga dan penting lakk
So die pon ada kasi gak medal tuk finalist ... katanya walaupun aku tak main (tu pon sebab injured)... tp ada impact kat club ... so tak la aku balik Malaysia empty handed. (Nampak tak nama aku tu ?? hehehe ... ok la .. salah eja ... tp dapat la something gak)

Labels:

Sunday, September 24, 2006

Game phase 6 - Physics

haaa ... Physics. Bukan aku amik teori fizik btul2. Just took what I think is right and put it in. Now the car tilts as you corner and tilts forward and backward when you accelerate or decelerate. Cam ada suspension la. And kalo laju2 bwk kereta, turning circle ko makin besar. Finally... due to overwhelmingly high demand. I added DRIFTING !!! Agak susah gak nak control drift nye. Pastu ada byk lg bug la. Salah satunya, kalo tgh drift pastu berhenti, die berhenti ... tp kalo sambung jalan lik ... die cacat ... drive senget kejap sementara membetulkan angle driftnya. Disebabkan added features ni code aku pon makin panjang ... lg 20 line nak sampai 1000. Anyway ... I need testers ... leh bg tau bug2 yg ada ... so siapa yg sudi leh download sini ... dan terima kasih kerana mengsupport projek ni.
(Aku tak tarok screenshot sbb nampak serupa je ngan yg sebelum ni)

Saturday, September 23, 2006

Game phase 5 - tayar


Fuh .. lepas test .. ok gak ... sempat tgk2 tutorial lepas sikit2 je ... tak tau la result camne tp rasanya ok. Anyway, balik umah lepas buat assignment Oracle(bosan ...) sambung la buat game ni. Nak simulate driving btul2 ni ... so aku buat la tayar. Kasi rotation die selaras ngan speed kereta. So last2 dapat gak .. tp tgk2 cornering die cam tak natural so aku pon kene modify cara corneringnya... dapat la formula matematik kat bwh ni...

car.angle+=(0.025*car.speed*car.frontTyreAngle);

tak la realistik sgt tp cukup la cam tu je ...Controls cam dulu gak. Nak tukar view tekan 'c'. Siapa nak leh download kat sini.

Friday, September 22, 2006

Game phase 4

Ok ... prog A* tu da siap, at least dah nak siap. Dah bosan pon buat ... hahaha. Perasaannye cam blajar magic. Tgk org buat, kagum .... pastu nak blaja ... lepas da tau ... bosan. Igt kan org buat AI path finding tuk robot tu susah sangat. Senang je rupanya. So sambung la game aku yg tak siap tu. Da dapat buat lighting sikit. Susah gak sebab kene calculate normals for each individual triangle. I'll work on the smoothing later. Semua nampak merah skrg sbb yg ada material tu kereta nye saje. Lepas tu nak simulate cam kereta tu reflect light(natural reflection of objects), kene set satu function yg emmits light. As a result the whole scene is red(because the car emmits red light). This is how it looks like
You can download the files here. Its just a windows executable. You dont need anything else other than windows OS. Sesiapa yg nak source code nye ... buzz aku kat YM. Well, setelah lama try buat lighting ni berjaya, dapat gak akhirnya. Puas !!! ... masalahnya aku ada test kul 11 ni ... dah la tak study pe lg ... tawakal je la.

Sunday, September 17, 2006

Project continued ...

Mid term da nak dekat... nak studi malas lak ...
Well, when I have free time I continued building on the A* project. It's got a fancy UI now. I can't merge it with the pygame interface, so I had to use threading and open a Tkinter UI thread. So now it ended up looking like the GIMP user interface. Might be an inefficient way to get around it but who cares. The funny thing is now the UI is getting to be more complicated than the path finding algorithm. I tried to make it as modular as possible, except that there are several classes in 1 file. This is what it looks like now: I tried to convert it to an exe so everyone can use it but I can't just yet. I'll figure out the problem later. To run the progam you need python 2.4 and pygame.
You can get the files here

Friday, September 15, 2006

Projek Baru ...

Ok ... the game is going fine and all, however I have been persuaded to join my friend, Marwan in exploring this Algorithm called A star. To be honest, it's exactly the same as Dijkstra. The only difference is dijkstra uses a queue. A star uses a Priority Queue based on the cost, therefore reducing the total number of nodes that have to be explored. Hence, improved performance. The path obtained depends on the heuristics, sometimes the result will be optimal, sometimes not.

In all algorithms that find a shortest path, it simplifies a complex data structure and turns it into the simplest, a list. The goal is creating the shortest list possible by eliminating all the possible nodes that could be used to get to the destination.

This A star algorithm calculates cost using heuristics, unlike Dijkstra which uses actual path values. It is actually a combination of both Best First and Dijkstra. It will behave like Best First until it reaches an obstacle. Then it will show behavior similar to Dijkstra path finding. In other words it will start to explore. The red path shows the shortest path. The faint red/pink pixels are those that are explored once the 'explorer' hit head first into the dark grey obstacle.

To get this optimum path I came up with this Heuristic function:

H(n) = distanceFromStart + accumulatedCost + selfCost + distanceToDestination

Each has its 'weights' to adjust its effect on the output. I set them all to 1. The larger the value of the 'weight', the larger it's effect on the heuristic function calculation.
These are 2 identical maps. As you can see, changing the 'weights effect how many nodes are explored. In this example there is not much difference in path selection.
The diagram on the left uses the following weight values, the one on the right uses all 1's.

distanceFromStartWeight = 0.21
accumulatedCostWeight = 0.5
selfCostWeight = 0.5

distanceToDestWeight = 1



The python program I wrote is about 200 lines long written in maybe 12 hours. It's still pretty basic. I'll include features later on. I actually plan to do map navigating using this algorithm. Still thinking it through. I'll post the code up after I test it and maybe add further features.

Labels:

Wednesday, September 13, 2006

Game phase 3


Da phase 3 da ni, pe beza phase2 sblm ni aku pon tatau ... hahahha .... development yg tak terancang ...
Tp version ni da tarok plane yg besar so leh la navigate senang sikit. Ada functionality tambah sikit. Files can be downloaded here
The controls:

Up Arrow key

Accelerate

Down Arrow key

Reverse

Left Arrow key

Turn left

Right Arrow key

Turn right

Space bar

Brake

w

Move camera up

s

Move camera down

a

Move camera right

d

Move camera left

q

Adjust lens (zoom in)

e

Adjust lens (zoom out)

c

Cycle through cameras

1 default cam

2 rear cam

3 top(ortho) cam

4 static cam

Labels:

Wednesday, September 06, 2006

Season Finale


Lama tak post pape ... sbb team aku kalah so tak dapat medal. Tak main pon, injured ... kira cam bangga la sbb aku tak main ... pastu kalah ... kira cam kalo aku main tu patut leh mng la ... hehehhe ... Anyway, team A grade aku menang, main syok gak la ... siap klua paper tuuuu. Bangga tgk member masuk tv, masuk surat khabar, kene interview semua. Aku tiap2 minggu turun training ngan die org ... siap jd bahan kutukan lak tu hehhehe ... abis season satu daerah puji die... tp mmg die main gempak pon mlm tu(baca petikan "hero" tu) ... Kalo nak tau pasal game tu baca petikan surat khabar ni ... Tak tau la kalo leh nampak ke tak die tulis pe ...

So skrg da tak tau nak buat pe ... da training pon tak de, nak concentrate blajar, malas lak.

Takpe2 ... tunggu sembuh baik2 ... season dpn buat comeback.

Labels: