Tuesday, August 19, 2008

== August 19 == The day after.

Hehe, it was a close one! I wasn't even sure myself, but at the end I made it... just narrowly squeezed in. It was a really interesting experience to code 1k lines or so in the last couple of days, then debug, playtest, debug some more, and finally tidy it up. Intense!! There's nothing like the smell of burning asphalt in the morning...

On a more technical note, here's how it's looking right now:
1) A working client, with game-world representation of both RFTS and Risk.
2) Several semi-working algorithms to play RFTS.
3) A fully functional Risk bot, which successfully plays the game, with some moderately complex control-flow, and decision making algorithms.
4) A "genetic" framework, which reads, writes, and decodes "genome" files, which specify bot behavior.

Here's what's missing:
1) An "evolutionary framework", to automatically pit bots with different genomes against each other, and slowly breed a set of successful solutions. For now, I'll provide a guide of how to manually tweak genome-files, to affect the robot's behavior in a desirable way.

Here's what needs more work:
1) Certain core algorithms in the bot need to be scrutinized further, to tweak them to the desired condition.
2) Re-visit the genetic framework, such that it would allow for different genetic formats between rulesets.

All in all, and with due humbleness and realization of its shortcomings and such, I feel that presently the project is in decent shape. In the few days that remain of summer, I'll work on tweaking the project further in the desired direction of... taking over the universe! (or is it multiverse by now? whichever.)

As to my experience of GSoC, it was such a booster and catalyst of my rather modest skills. After all, I'm a second-year CS student (3 Java courses, 3 math and theory courses behind me), and taking on a project of this magnitude and difficulty was somewhat of a gamble. I also really enjoyed interacting with the Thousand Parsec community. Hope this project prospers, and lives to see true exposure in the public. The open source community was a new thing for me, both software and concept wise, and I do feel priviliged to have entered this community as a contributor, with some responsibility on the shoulders.

Well, thanks for baring with me. This might just be the last post here (unless there's something important and relevant to say later on) . So long, and thanks for all the fish!

____________________

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

Tuesday, August 12, 2008

== August 12 == Final 100 meters...

This would be the time to say "hooray, I did it!", but I didn't; not just yet. I still have several things to tinker with, but if I really push it (like I already did several times before), the 18th is definitely a realistic deadline. I'll make it, because... because I have to :). So stay tuned, there will be more news on Friday!

Later,
Victor.
____________________

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

Friday, August 1, 2008

== August 1 ==

Hi all,

Well, I can say that all ~preparations~ to start coding for Risk are finished; the libraries are now nice and generic (framework is tested-working for RFTS), the ruleset is set up and working on my local server. Hell, even the protocol has been patched up for Risk recently (thanks, Kryzstof!). Now I've got two small, insignificant tasks ahead of me (namely, creating game-world representation for Risk, and making the actual AI logic...), and some two-plus weeks to do it. Sounds like a job for... never mind, I'll do it myself ;). And the best part is, I'm going white-water canoing until Monday (inclusive), and will start work only on Tuesday. But hey, I'll stock up on Redbulls and sugar-pills, and hack the remaining 2 weeks away, like they were... like they were one week! Well, wish me luck on the rapids (or, better yet, skill!), and I'll be with you again shortly ;).

Till later,

Victor.
____________________

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

Tuesday, July 29, 2008

== July 29 == Risky Business!

There has been an unexpected turn of events last week, which significantly altered the nature and scope of the project. Long story very short, I've been asked to look into creating an AI for the Risk ruleset (currently under development by a fellow GSoCer), which I gladly accepted, due to the persistence of a nasty bug in RFTS (unable to utilize colonized planets), which refuses to get mended. So what I've decided to do, is leave all the support for RFTS in my client, and add to that libraries, which will represent the game-world of Risk, and play it.

This presented an unexpected challenge, and a sobering realization. I really did try to organize the project into logical units, which were "modular", and meaningfully connected to each other, but what I realized when beginning to make this whole thing more generic (to allow for more than one ruleset), is that the overall design was far from optimal. This required a substantial re-organization of the different classes and libraries, which I'm still in the process of finishing. This was a really interesting and even somewhat enlightening experience, one which made me re-think the way I normally do things. (Definitely more planning from now on!)

This process should not take more than an additional day or two, and from then on I'll have to start building logic and game-world representation into the Risk modules... did anyone say that the project's due on the 18th of August?


Later!
____________________

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

Friday, July 18, 2008

== July 18 == TP04 Support

The midterm rush is over, and I'm a bit ashamed to admit that this week I took a bit of a rest, compared to the usual pace. I spent my working hours this week on moving from a client that supports TP03 to a client that supports TP04. A good part of it is done, but I'll need to spend some time on interpreting Objects next week. Also, I added some logic to the normal operation of the game, and locally set up tpserver-cpp 0.5.1. Seems to be working just fine! ;-]. Next week I'm hoping to finish the move to TP04 as fast as possible, and continue on the AI logic.

Till then!
____________________

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

Friday, July 11, 2008

== July 11 == Midterm Report

This time I'll be brief.
For the past week I've been working over-time to get the project in great shape for the midterm. This included work on pretty much everything...
I'll let the 'official midterm report' do the rest of the talking : <<>>

There's a screenshot there as well, for the graphically oriented ones ;]


Till later,
____________________

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

Friday, July 4, 2008

== July 4 == Ye Famous Travelling StarFleet Problem :)

It's that time 'o week again for me to write about my progress. The previous post is only three days old, but I got some stuff to blah about ;].

So, for the most part I've been splitting my time between getting the client ready, and preparing the actual robot for some action. I've been having some issues with the ruleset and the low-level library (see last post), but mostly they've been resolved (except for the annoying bug of being unable to colonize!), and now it's a matter of some time until the client gains complete functionality.

In parallel to that, I've started to work on the actual AI mechanism and infrastructure (by infrastructure, I mean creating the necessary framework for the robot to function). I have decided to forgo the original plan of running a natural-selection mechanism for actions on each and every move for the sake of a simpler, more conventional, but still (I think) very elegant solution (which still implements a genetic selection process, only this time during its creation).

The reason for this was twofold: first of all, I discovered a couple of problems in the design that were hard to overcome; the simulation of each move would've been a real issue, and the mechanism for illegal-move sifting would not have been very difficult to implement, due to "hypothesizing" game-eventualities many moves ahead. Another, equally important reason for me to change the plan, is that this was really a two-fold project, as I had to spend (and still do, to some extent) an incredible amount of work on getting the Java client started, even before getting started on the robot. Hence, de-facto I've only started work on the robot almost at the midterm-point, and I need to simplify the design a bit to get it in good shape before the fat lady sings! ;].

I'll have much more to say on the alternative solution by next Friday, but in short it will be a four-part project: a) the client and game library, b) robot logic, c) a robot-factory for creating new robots, and d) an evolutionary framework for optimizing them. Each robot will have 'behavioural characteristics', by which its behavior will be guided, and which will be susceptible to mutation in the evolution-simulator.

Here, I guess that's it for this week.

PS - Do check out the code in the repo in the "ActionMethods" class for a home-brewed solution of Ye Famous Travelling StarFleet Problem + some mathematical analysis on it! (It's not very tested yet, but I've got faith in it).


Till the dolphins leave,
____________________

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

Tuesday, July 1, 2008

== July 1 == Problems, Solutions & Starting the fun part

Ahoy. I wanted to post this report on Friday, as usual, but due to some extraneous circumstances (coupled with a 3-day wilderness trip Saturday-Monday) I was only able to get one out today.

In the past week of coding I have encountered several problems. First of all, there are a couple of issues related to the ruleset, which are still standing. First of all, there is the issue of mapping numeric-to-actual ship-types. I was hoping that it would be hard coded (e.g. scout is always 1, Mk.1 destroyer is always 3, etc) , but nash suggested that it might be determined by the server at runtime. I'm still waiting for the final word from xdotx on that.

Another issue with the ruleset I encountered, was the complete inability to produce anything on newly colonized planets, since any amount of colonists magically disappears from the surface, and no resource-points are being generated thereafter (although I still apparently own the planet). This observation was made on tpclient-pywx, and confirmed by my own client. I'm still waiting for word from xdotx for what this might be. (Smells like a bug, but perhaps I'm missing something?)

Finally, there was an issue with sending orders, that was related to the proto-library, which jezuch quickly remedied, and now I'm able to successfully pass orders to my assets in the game-world. I proved this by implementing the "fleet-move" order, and successfully moved my fleet around the universe.

So, what is still missing in terms of client functionality (out of the stuff that I really need, that is), is production, fleet merge, fleet split orders, and numeric-to-actual ship mapping. What I want to concentrate now on, is the actual logic and overall architecture of the bot. I already introduced some convenient algorithms into my representation of the universe map (get n-closest star systems, get contents of star system, get distance). I will be adding to these as I go along developing the robot logic, and hopefully by the end of the week I'll have a good skeleton to build on, and some concrete algorithms to control the behavior of the bot.

Later,
Victor.

____________________

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

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

Monday, May 26, 2008

== May 26 == Official Start?

Official start? Don't know about other programmers (can't say I'm the most experienced of the lot), or other projects (maybe it is just pretty hefty relative to others), but if I were to only start coding just now, I'd be in a big pile o'something right now, trying to figure out how to minimize my losses.

Can't say I'm 100% satisfied with the progress so far, either. What I have is a semi-functional client in working condition, which still cannot do most things I need it to do. Hopefully, by the end of the week I'll finish the bulk of the client (and the peripheral support stuff), so that I can test it, and start on the AI part.

This past week I have enhanced the functionality of the client a great deal; it can now connect to server both on autologin, and manual login mode, and I believe that it's internal architecture has reached a rather stable state. I have also implemented a helper logger of connection events, which I believe will come in handy both for the inner working of the client (or any other client, for that matter), as well as for debugging purposes.

The main challenge as of now, is in sending/receiving frames. I am confident that by the end of the week this hurdle will be behind me.

Till later.
Vic.

Thursday, May 15, 2008

== May 15 == Seeing some progress :)

This week has been pretty productive for me, as I feel that I'm on my way to making a functional client using libtpproto-java.

There have been a couple of setbacks... first, I accidentally received a bone-deep gash last Friday, while trying to jump on an especially high boulder. Fun times. Now I'm stuck with a limp (and some general discomfort) for god knows how long... But hey, on the bright side I cancelled a 3-day wilderness trip due to the injury, and will spend most of the weekend on the project instead. The second setback happened when all of a sudden I couldn't log into the remote git server. I spent the whole day trying to fix the problem (even posted it on the ubuntu forum), then the next morning I get the word that the problem is global, and that I simply need to generate a new key. Done!

On the positive side, I have produced some code towards making a functional client. It is still very much in the prototype stage, but I believe that the basics shouldn't change much. You can find the latest git push in the repo.

Looking forward to getting the client nailed... hope it happens sooner than later, so that I can start work on the AI bot! (My personal deadline for finishing the client is May 26. Testing will follow).

Later,
Vic.

Wednesday, May 7, 2008

== May 7 == Internim report

The past week I spent buried in Socket Programming tutorials (continually referencing back to libtpproto-java to understand its functionality) .

I also decided to first proceed with building a basic functional client, and only then concerning myself with building an AI on top of it. This way, I'll know from the start how the AI and the client will communicate, which will prevent compatibility issues later on.

Next week I intend to have a basic working client, and will have started to work on a tester for it.

Wednesday, April 30, 2008

== April 30 == Internim Report

Well this has been an interesting week. After lots of pain trying to get stuff running on cygwin, I made the switch to linux. The timing couldn't have been better; I just caught the new Ubuntu release as it was rolling out of the factory.

Spent several days I've been struggling configuring it and getting used to the new environment (I use linux at the university, just never had to install or configure anything there!), But finally I got the hang of it.

So far, I have set up the following:
-Java SDK
-Eclipse IDE (will do the development on it)
-Git
-Cogito
-tpclient-pywx
-tpserver-cpp
+ all the necessary packeges and tools needed to run the above.

I believe these are all the necessary tools needed to proceed with development and testing.

The next stage will be to start a git repository for the project, and figure out libtpproto-java (see what's there and what's missing on the 'low-level' client-server communication).

Afterwards I'll start work on completing any unfinished 'low-level' components in the libtpproto-java. Finally, to finish the initial stage of preparations, I'll develop a test-harness for the client. All of this should take an approximated 2-2.5 weeks.

Monday, April 21, 2008

==April 21== First Post

So, this is it. I spent a nerve-wrecking hour peeking in my inbox, and then the word arrived: "congratulations!". Thanks again to the TP mentors for the vote of confidence!

The following week I will be studying the libraries and tools relevant to my work, and have everything set up on my machine. More specifically, I intend to:
a) Finish configuring git, then make a first post to the TP repository.
b) Install the tpserver-cpp locally, and run games on it.
c) Start a project on Eclipse, using the existing classes in libtpproto-java as my starting point.

I'll keep this blog alive by posting a progress report on a weekly basis.