Saturday, June 21, 2008

== June 21 == Last couple of hurdles before the Good Stuff :)

Hello,

So, it seems like the big re-structuring I've been vaguely referring to last post finally came to pass in our generation (i.e., last week), and not without some headache, mind you. The reason for it, was that I put too much responsibility on the 'Client' class on the one hand, and diffused responsibility for communicating with the server on the other.

The first issue was problematic since the class threatened to grow out of proportion, and take over pretty much everything that was going on in the client as a whole (a big no-no in OOP ;) ). The second issue was problematic, since diffusing responsibility for client-server communication meant an uber-headache every time there is an update in protocol... plus it was just un-aesthetic the old way ;) . Now there is a class which handles the logical operation of the client (solution of the first issue!), and also now all client-server communication is handled by the 'Client' class, which makes code much more readable, class-contracts much more focused on the task-at-hand, and will save lots of headache when the protocol will change. Whew :)

There still remain a couple of things that lack support in the so-called 'game-library', which is a client-side library representing the game-world (see previous posts where it's discussed!), namely support for orders and resources, but this is a minor issue, and should be resolved without much fuss early next week. Afterwards, it's Robot Coding Time! Although I have a decent idea of the design, it will need to become concrete Java code. So, the main task for next week, will be to build all necessary infrastructure for the AI bot, and start work on it... finally!

I guess this sums it up nicely. I'll keep you posted!

____________________

Victor Ivri (vi1985)
Blog address: BLOG
You can find the project in the git repo here: REPO

Friday, June 13, 2008

== June 13 == Goals for midterm and other livestock.

This post will be divided into two parts: First of all, I'll be discussing my progress for the past week and some thoughts about the process in general. Then, I'll *officially* state my goals for the midterm evaluation, as formulated by me and my project's mentor, Kryzstof (aka Jezuch).

So, let's head off without further adieu to the "What I've been up to this week" rubric:

a) I finished the main chunk of work on client-functionality. It has demonstrated the ability to receive any and all kinds of data from the server. From now on, I'll be implementing stuff on a need-to basis, and concentrating on other things. I am considering a re-structuring of the contract of the client, but this will come later on, when it becomes more obvious how the system will operate as a whole.
*** This calls for a "whoo-hoo" ;)

b) I have decided to implement a "game-library". It will represent the game-world in a way that will be more straightforward for an AI to work with. I have almost finished work on it (perhaps a couple of days more). While this seems like a waste of time, I am actually saving myself a lot of hassle later on, since it's tailored to be more convenient to use, plus this way the AI player will stand independently of the client and of any protocol implementation.

c) I have finally gotten around to running games locally. My client successfully connects to, and interacts with the local server. Running local games will play a huge role in integration-testing, and in perfecting the robots.

Plans for next week: Finish implementing the "middleman" game-library. Make overall architecture better. Start work on AI. This will consist of two parts: First of all, it entails starting work on the robot itself. Also, I will begin working on a framework for building, and for testing different robots.


~~~ NOW FOR THE SECOND PART: My Goal for the midterm ~~~
Date for deadline: Friday, July 11, 08. This gives both me and Kryzstof some buffer zone, as the official deadline is on July 14.

As agreed by Kryzstof and me, (is it "and I"? hm... don't think so) a good "minimum" would be to have a basic, functional robot, which will implement the desired architecture for the final product. The robot will have an internal logic to it's actions, it will be able to manipulate its assets, and thus play the game (in a limited way). I will try my best to exceed this goal, and have an elaborate inner logic, and an evolutionary framework ready in time for the midterm as well.

That's all for now. Stay tuned for updates! B-)

____________________

Victor Ivri (vi1985)
Blog address: BLOG
You can find the project in the git repo here: REPO

Friday, June 6, 2008

== June 6 == Seeing the light (finally)

Finally, now I have what seems to be close to a basic, fully-functional client, which does what I need it to do (not fully, but I'm working on it!). Basically, it can now login in both autorun and user-input mode, and receive any and all kinds of info from the server. Plus, it has a few peripheral additions, which I have discussed previously.

This shouldn't have taken *this* long to achieve, but for me the learning curve was pretty steep, (especially in the beginning) due to the fact that the library I was dealing with (libtpproto-java) is pretty complex, and also because I needed to learn certain things (e.g. working with concurrency) before implementing them in my code.

But everything seems fine now, and I'm ready to move on to higher-level stuff. Next week I'll quickly finish up the remaining work on the client, and start working on processing the info, and extracting a "universe snapshot" from it. This shouldn't take too long by itself, so I'm also planning to create a threaded "pipeline manager", which will manage the connection to the server in a fast (and orderly) way. I can clearly see myself starting to work on the AI in 1.5-2 weeks from now... it's about time ;)


____________________

Victor Ivri (vi1985)
Blog address: BLOG
You can find the project in the git repo here: REPO

Monday, June 2, 2008

== June 2 == Weekly Report

Ah, have to stop forgetting to post here :) From now on (on Mithro's que) I'll be posting regularly on Fridays.

So, the past week was rather fruitful, although the pace is still not as good as I'd like it to be. Put in perhaps 25 hrs, which is not nearly what I normally do (have an excuse tho... was my b-day ;).

Since the last report, I've been concentrating on mostly peripheral things, although I did get good progress on the client itself. First off, I was busy getting the connection-event logger in working condition (still working with jezuch about submitting it as a patch to libtpproto-java, have a few minor things to sort out). It can successfully log all connection events, and dump the info to any PrintStream in a convenient format. I spent so much time on it since it's a good to know ~exactly~ what's going on in the client-server communication. Also, I worked on a feature for the client for a couple of days, which will allow the user (really, "operator", since it's doing everything autonomously) to properly shut down the client at any point in its operation. To do this, I created a wrapper-class for Scanner, and put a listener in a new thread, which detects the special exit input string from standard-in. I realize this is perhaps not what I should be concentrating on, but I allowed myself to digress and explore the implementation of a neat feature ;).

As to the client itself, I re-organized it a bit, to allow for "autorun" mode (completely autonomous) and "standard" mode (user input required to start up), as opposed to having "autologin" and "no-autologin" modes, where both required some user input. This will greatly improve on testing, and allow for various implementation of harnesses on which the client will run (since on autorun the client simply needs to be supplied with arguments).

Now that the overall architecture of the operation of the client is done, I'm starting to explore the mechanism of client-server communication. The basic method is pretty straightforward (client-driven requests for info, and some server driven stuff), but the nitty gritty of Frame-specifics is something to spend this week of coding on.

By this week, I hope to have a good prototype of a working client.

Later,
Victor.

____________________

Victor Ivri (vi1985)
Blog address: BLOG
You can find the project in the git repo here: REPO