Saturday, August 2, 2014

Hibernate: How to update an Object

It's been a month since I'm dealing with Hibernate and apparently I really like the idea of having an OOP Database. But I have a little problem when trying to update an object (in SQL, you can simply use update syntax).

Tuesday, July 29, 2014

Hibernate: Illegal attempt to associate a collection with two open sessions

I got this error when I try to update multiple times. My case is a student tries to enroll multiple classes. My data access object (called KelasDAO) only support a student enrolling a single class. So I use a loop to go through the collection and add each class by calling the method. And this error occurred.

Monday, July 28, 2014

Hibernate: Many to Many mapping Error

This is my 3rd month using Hibernate and still I have trouble understanding how it works completely. I'm currently building an information system for my campus, and I use Struts+Hibernate to get it organised.

My recent problem is related to the many-to-many relation between two table. Hibernate allows you to simplify Many-to-Many calls by using a collection object on the class. I have no problem when viewing the list but adding it seems to be more complex.

Friday, June 27, 2014

Movie Review: Transformers: Age of Extinction


Ey ehloo! I'm back! Let's see if my english are geting beter or bader

It's the fourth iteration of the Transformers on the big screen. It's definitely bigger, but does it better? Here is my review on it

Wednesday, August 14, 2013

Game Review: Kingdom Rush Frontiers HD

For the past 2 months, I've spent my spare time playing Kingdom Rush Frontiers on my iPad. As a huge fans of the first series, this is a breath of fresh air. Here is my review on the second one.

Tuesday, June 4, 2013

A Small Study on Genetic Algorithm


Recently, I have a chance to visit a new technique in problem solving algorithm called Genetic Algorithm. I'm sure it's been around for quite some time, but it never occurred to me before. The problem with this algorithm is it doesn't seem to have a mathematical proof that it can solve a problem, or at least that what I thought. However, after a few days struggling  and coding, I finally understand how it works and why it will work. This is a co-joint work with Martin Nelly for her undergraduate thesis.

Tuesday, October 16, 2012

Simulating Laser: Line-Circle Intersection



Recently, I tried to apply a new kind of enemy which use laser. At first it seems so simple until I realise that laser-object intersection is not something that I know right away. The laser is a line and the object that I need to intersect, which is the player, is circle. So I need to figure out how to find an intersection point between a line and a circle.

Tuesday, October 9, 2012

The Expensive Cost of Updating Xcode

Recently I tried to update my Xcode, a 1.6 GB program with a 1.6 GB Update. Yes, you read it right. So apparently Apple have no idea how to give user a proper patch. And to make it worse, I have to re-download the whole plugins (iOS Simulator, Compiler) that I've already downloaded. Yes I live in a town where Internet is a luxury thing, but it doesn't give them an excuse to implement a stupid patch, right?

Tuesday, July 31, 2012

Installing Mountain Lion: Is Apple trolling me?

After two failed 3GB download, I noticed that Mountain Lion Download Progress can't be Paused/Resumed. Well... kinda! Here's the trick: You can Pause/Resume the download, disconnect your Mac from the internet, and even put your Mac to sleep mode, but do NOT ever shut it down! Apparently, the downloaded file removed when you shut down the Mighty Mac.

Programming: AI for Following a Target


Recently, I changed my code used in an enemy that follows the player. Apparently I did a huge mistake by using cross and dot products. There are simpler way to do it by using angle values. Here is how it works.

Monday, July 2, 2012

My take on Sony-Gaikai Deal!



Sony just made a ridiculously weird movement yesterday: It purchased Gaikai, an online gaming service company. So the idea the folks at Gaikai had is it is possible to stream (only) what you see on your screen. Basically it's like having a supercomputer but miles away from the monitor. I still haven't tried it yet, since my internet connection is slower than a snail carrying a box of metal! I supposed it does work pretty well for some (but definitely not for others).

Wednesday, June 20, 2012

Why Retina Display Macbook Pro is not for me!


Recently, Apple just announced a new Macbook Pro with retina display. With slimmer body and new power, the new Macbook Pro is definitely an eye candy. Many reviewers gave a top notch review on the beauty of this beast. But not me! It's still a very good machine, but probably not for me. And here is why!

Monday, April 9, 2012

Triangle Wars Coding Guidelines

So I decided to create a coding guidelines since my code is getting bigger (approximately 10k+ lines). I loosely use Insomniac Coding Guidelines with a few tweaks. It might not be the best, but at least it fits my mind. So if you're interested, here is my coding guidelines:

Notes:
libraries (e.g. math and until classes) does not required to follow a coding guidelines to support portability.

REQUIRED PREFIX
m_(variable name) for class member
f_(variable name) for function parameter member
l_(variable name) for local member
g_(variable name) for global member
s_(variable name) for static member
(CAPS variable name) for preprocessing-defined member


OPTIONAL PREFIX
(m/f/s)_p_(variable name) for pointer
(m/f/s)_a_(variable name) for array
(m/f/s)_k_(variable name) for constant value


OTHER REGULATION
put space before and after arithmetic operator
e.g.: a + b // right
a+b // wrong


put space before and after pointer * and address & definition
e.g.: int * thisPointer; // right
int *thisPointer; // wrong


use is(Condition) for method returning boolean method
e.g.: isEnable(), isDrawable(), isColliding(Obj * f_obj)


For commenting, I try to follow Doxygen supported comment. I'm currently developing it. There are others that I would like to put on my list but most of it are just a trivia problem such as always start curly braces on a new line. And I'm curious why Insomniac prefer C type casting compared to C++. Currently I'm converting my codes to support this guidelines, so expect less feature on the next Triangle Wars update.

Thursday, March 22, 2012

Triangle Wars: Graphics and Gimmicks

Another 'major' update on the Triangle Wars. I'm not sure whether I'm bored with the black background, but I'm very pleased with the new grayish background. I also add dust path to make the game more 'glowing'. Another major redesign is the bullet is not a circle instead of an oval. It looks cuter (imo) :) I also add a health bar surrounding the player object instead of putting it on top of the screen.

Recently I struggled with sound, but no luck. I've tried SDL_mixer (which features is extremely limited) and OpenAL (which is not well-supported in OSX environment). Currently I'm trying to find another sound engine (gonna try FMOD).

I'm still looking an artist and sound engineer. Contact me if you're interested!

So here is the video of the last update. Watch it on directly on Vimeo for a higher resolution! It should be on HD (720p). I disabled the Player-Enemy collision since there's an error in circle-triangle collision. I'm currently working on it.

Monday, March 5, 2012

Review: OS X Lion

The king is back! But definitely not this one!


I know it's kinda late, considering the next OS X is expected to come this summer. But I'm a new Lion user (Thanks to my 32 bit MBP), so what the hell, let's spend some time blabbering about this OS. I like OS X, and frankly I've spent my last 6 years using OS X. And I'm happy with it. Well, I was happy. Until I bought Mac Mini and install Lion. Here is the spec of my Mac Mini: 

i5 2.5 GHz Dual Core, Memory 4 GB (2 x 2GB), HD 500 GB connected to 24 inches Samsung SyncMaster SA350 running at full HD (1920 x1080).  


Triangle Wars: Font, GUI, and Lights

Greetings Human!

I spent the last week to create a 'decent' GUI. I already created a set of font, exported as TGA and add a few eye candy effect. I added the gloom effect and use a shuffling animation (inspired by Modern Warfare multiplayer intro at the beginning of the game). It uses automatic random generator so it's easy to add new text and automatically have it shuffled.

I also add light/gloom effect surrounding the enemy so the player can easily notice the enemy.

I also define 2 missions on the level: time based Survival and Elimination. On survival mode, the player has to survive at a certain time with one life. On elimination, the player has to destroy a predefined amount of enemy.

Next, I will focus on defining more types of level and fixing the GUI.

Here is the video for the latest update. The resolution is not in HD since I'm trying to see how the game would be on iPad. The GUI (especially the 'start' and 'option') is not final. I use the box to detect the hit, but it won't be there later on.


Tuesday, February 21, 2012

Triangle Wars: Enemies redefined

In this phase my focus is to fix the broken AI by implementing a simple Finite State Machine and redefining some enemies behavior. Currently there are four type of enemies: Fighters, Runners, Kamikazes and Effector.

Fighters is extremely slow but heavily armored. It shoots rockets which has a light damage but fast and follows player.  Runners is extremely fast when in running mode. It enters running mode when the player is close enough to the Runners. Kamikaze follows the player (slowly) and have massive damage. Once it close enough to the player, it armed itself for a few second and create a huge explosion with devastating damage. Effector is a static enemy. It slows the player if the player is inside its range.

I also add a 'lighting' effect to destroyed objects so it looks like there is an explosion. I did this by creating a shader that (re)draws the background grid nearby the explosion. It also colored the grid/background color to suit the explosion color.

Next phase: fonts, GUI and menu.

PS: Just noticed the disabled health system. That is intentional to make the testing easier.
PPS: Still looking for artist! ;)

Sunday, February 12, 2012

Triangle Wars: Graphic and Camera

I'm back! After a few weeks of 'hibernating', I finally can start working on my game again.

This update focus on graphics and camera. I use bloom effect on every object. I do this by creating a 1 byte alpha texture and tell the GLSL to treat this as an alpha value. I also add a few artworks so it's easier to figure out which is what. For the camera, I move it closer to the object so the bloom effect is noticeable. I also add a new movement positions for the camera.

I also put a few animations on the equipment: rotating target for Decoy and radius-decreasing circle for Attractor.  It's not a breath-taking art system but good enough for a programmer ;) I'm still working on the Turret.

The next step is to modify the gameplay (AI, horizontal path) and polish the effects (particles). I decided to delay my work on sounds.


Tuesday, January 17, 2012

svnstrk against SOPA

I might be the least person who got affected by SOPA, but once its legalized in the US, it will only took months (if not weeks) to reach my country. so what the hell!

STOP SOPA! STOP PIPA! You don't need a freaking bazooka to kill an ant!

Thursday, December 15, 2011

MYOGE 5: Equipments and SDL

I'm back with another update with my OS X mini game: Triangle Wars. I've been busy recently so the updates will be minor.

I added 3 equipments (or secondary weapon) that the player can use: Mini Turret, Attractor, and Decoy. Mini turret shoots enemy, Attractor pulls nearby enemies and bullets, and Decoy acts as a target when an Enemy is looking for a target. 

I also converted the program from GLUT to SDL. Thanks to Me and Mark for the XCode template. However I have problem with performance when I use SDL compared to GLUT. The frame per second is still smooth, but the input (mouse and keyboard) is less responsive. I will look through this problem . 

And another minor update is the particles. Just a minor particle-bounce update, You'll notice on the video.

My next update would be adding the sound, and make some pixels. Anyway, any artist would like to join? ;)