Wednesday, August 29, 2007

Code Ruler Results

LINK TO CODE:
http://www2.hawaii.edu/~eykim/eykim.zip is the link to the file


MEMBERS:
Since I am the only person that worked on this project I guess I am the only person to list.


RESULTS:
The strategy that I used was to take the first two knights and send them to attack the enemy's peasants. This is to cut off the amount of land they can accumulate therefore cutting down the number of peasants and knights that they can produce. The next three knights are sent to take over castles. This is to ensure that the enemy cannot produce anymore knights or peasants and to ensure that if my own castle is taken over, I have a squad ready to take it back. The remaining knights are sent to attack the others knight in an effort to keep them at bay. If there are no more remaining peasants, then those first two knights are sent to attack more knights. If there are no castle, those knights also fight more knights.

If there are no knights, peasants, or castle, then the knight remain where they are and all the castle under my control produce mass amounts of peasants to accumulate land since land can bring the score up a considerable amount.


SCORES:
migrate Ruler
eykim: 445

Migrate: 113
eykim: 435
Migrate: 134

eykim: 456
Migrate: 123


Split Ruler
eykim: 236
Split: 220

eykim: 105
Split: 436

eykim: 20
Split: 480


Gang Up
eykim: 436
Gang: 237

eykim: 412
Gang: 380

eykim: 230
Gang: 234



Against the three samples, my own strategy didn't work as well as I thought it would. Against migrate though I did fantastic. All three trial yielded high scores mostly due to the fact that the peasants were killed right away, the castle taken quickly, and all the knights were hunted down efficiently. For each trial I nearly triple the score of Migrate Ruler if not more. They stood no chance.

Against Split up Ruler, I didn't fair as well. To be honest, it was a crap shoot. If I was lucky enough to take their castle right off the bat, then I stood a solid chance of clearing all the peasants and then finally going after all the knights. If I couldn't capture their castle, then i found that as soon as my peasants died, the enemy knights would stop and amass in their castle. At which point they would demolish all knights that I would send toward them.

Against Gang up Ruler it was much the same way as Split up ruler. If I could take the castle then i stood a good chance of winning. If i didn't take the castle then I stood a good chance of just mindlessly sending knights to their doom against their castle, or being completely demolished right from the start.

LESSONS LEARNED:
I've learned that eclipse can be either a very handy tool or a nightmare. At first, it was a pleasure to use because I had a lot of my coding automatically filled out for me. But as I copy and pasted item here and there, I started to get random errors that I could not fix unless i just rewrote the code all over again.

Another nightmare was javadoc and learning how to use it. At first i tried to run javadoc through the command line but it would not recognize the javadocs command. I later learned that I needed to reinstall java again. Eventually i got it to work but only after hours of research, installing and reinstalling, and a couple red bulls.

As for CodeRuler, I realized that I knew what i wanted the object to do and when I wanted them to do it but to actually code it so that they listened to you was not as easy as I thought it would be. One feature I wanted the knights to do but couldn't figure out, was to make all the knights wait until there was a large number of them before they go off attacking someone. I also wanted the castle to produce knights at first and then peasants when the enemy knights were far away. But after an hour of watching simulation after simulation, I realized that most sample ruler go after peasants too! So i had to wait until all the enemy knights were dead before I started to produce more peasants.

All in all, it was quite difficult to make the strategies themselves. I went through multiply different scenarios from just taking castles over and over to just staying in my own castle. Through trial and error, i found that the smart split style of commanding your army was the best solution yet coding my own peasants and knights to act according was very difficult.

No comments: