The time has come yet again for another weekly report. I have to admit I didn’t think time would fly by so quickly at the beginning of the week. But as they say, “time flies when your having fun.” It holds a lot of truth as I am really starting to enjoy myself this week. While last week, and the weeks earlier, were a monotonous “toe-dipping” into a frigid lake, this week is more like just diving in. While I can honestly say I made tonnes of mistakes (some I noticed, some I fixed, some I spent to long fixing, and others I have yet to discover,) I have also taken a tremendous amount of risks and chances; From trying things without aid, to creating more original code.
Even though at times the difficulties I’ve ran into have been trying I’m not without fault, and some of my more glaring deficincies have come to light. Thankfully these problem spots were identified by my mentors, and through some very constructive criticism I am now aware of them. If I could only take one thing away from GSoC I would hope that it might be the ability to either reflect and improve on my own flaws, or to learn how to take criticism effectively. I would hope other GSoC students have the opportunity to receive good criticism, and welcome it.
Shifting gears a little bit; Mithro anecdotaly shared with me that little things can often take far more time then you would like. I’ve seen a lot of that this week in dealing storing my graph and getting my orders to display properly. This week I largely tackled, wrestled, got pissed off at, and ultimately ditched boost graphs because of the level of complexity in using them. I opted instead to create a simple graph implementation using some STL containers; I think that things will be a lot easier now. With dropping boost graphs I am also dropping the ability to import graphviz graphs. In my opinion this is actually a gain for me because it gives me the opportunity to learn some file importing techniques, and while I may have saved time importing via graphviz, I would have spent a lot of time getting boost/graphs to work.
Its about time to move onto a recap of what I accomplished this week:
Monday
-
Submitted first bug report. here.
-
Statically ID’d all elements, which I learned from llnz is a very bad practice and have since undone. It was nice to find out, however, that IDs for objects are allocated first-come, first-server, and in order.
-
Struggling with how to represent adjacent planets. Started looking into boost::adjacency_list. boost graphs.
-
Reordered map to make it more visible between constellations. Unfortunately I didn’t snap a picture and the map has since changed. Here’s a link to the commit.
Tuesday
-
Added general turn processing, and pseudocode of code to be implemented, to the RiskTurn class. This code wasn’t what I intended for turn order, but got me going with my own turn order. commit.
-
I started using a few more tags like CHECK, FIXME, TODO, LATER to my code. TextMate has a TODO bundle that wrangles up any tags I specify and puts them in a list with links to code, etc. It’s been very helpful for jotting down a quick TODO or FIXME for things I know are wrong or need to be implemented.
- Added shell code to all 3 orders, move, reinforce, and colonize. A few of the mechanics of the risk game will require change to tpserver-cpp. For instance colonize orders currently will not show up on an unowned planet. As well some fiddling will need to be done to have order’s display properly with a list of adjacent planets populating it. Llnz has said he will help here. commit.
- Read existing turn/order code from other rulesets. Unfortunately the development of my own moves has been hindered by representing adjacency internally.
Wednesday
- Removed static ID setting. Llnz informed me this was a bad practice, I did nail down the ID layout for my objects though, it’s currently listed in comments above Risk::createUniverse(). commit.
- Switched over from Galaxy to Constellation. A bit of an exercise in mass find and replace, mainly I was glad to switch over to the more context specific name “Constellation.” commit.
- Finally settled on storing a players reinforcement total in a std::map in Risk. Also added some code to Planet::doOnceATurn that updates the current “minable” Armies as the players reinforcement total. commit.
- Implemented what I believe to be proper turn structure for Turn::doTurn. At the moment I haven’t tested the code due to the lack of doOrder code for my orders. commit.
Thursday
- Finally removed my default map (of 42 objects) with a smaller test map with only 4 objects. Things should hopefully be easier to test now. commit.
- Created some settings that give the player a little more control over reinforcements and how the game starts. commit.
Friday
- Finally got Risk::randomlyAssignPlanets working. I am now able to actually OWN some planets and start to work/test Orders. From what it looks like quite a bit of work will be needed to get orders displaying properly. commit.
- Ditched boost/graphs in favor of implementing my own graph. The graph I developed is internally a map of ID to a Node. Each node has its ID and a list of node pointers to its neighbours. commit.
Next Week:
My sole purpose next week is to implement Orders. I believe I’ve gotten through enough of the little things, particularly graphs, that I will be able to complete the actual Orders.