a windfall of success

My apologies about the lack of a post yesterday. Things were pretty stressful trying to deal with my windfall of bugs. Fortunately I got past the “deal-breakers” and got onto some real tangible bugs. As it turns out I can avoid (not fix) the “bad password” bug by sudo make installing the server instead of running it from its compiled location. Having moved on from “bugs that I have no idea how to deal with” I moved into the realm of “bugs relating to things I figured would go wrong.” More about that bug, and all my success today, after the jump…



As I was saying, I had, at yesterdays end, moved onto a bug that was far more tangible than things “just not working.” As it stood my “Planet” objects were apparently not getting enough data “packed” into them (its just wrong to say it,) and through a STREAM of helpful emails from llnz and mithro, in addition to some retrospection, I found out that my “Armies” Integer parameter was to blame. While simply (or not so simply) learning how to pack this data into the Frame would be one battle, it was one battle I did not want to fight. I realized that I could quite easily consider my armies to be a resource (which quite frankly, it is,) and forgoe a lot of trouble creating new code to pack this data. Hence I added back a lot of resource code I had originally removed from my Planet implementation, and, ta-da, I now have all my ducks in a row (quite literally.) As you will see below my client now properly connects to the server running risk, and properly displays all my planets.
tp,ducks,row



Having gotten things displaying I decided to move on to having things display properly. I spent a good chunk of my afternoon poring over star charts to name all my planets. I changed “Russia” from “Scorpius” to “Draco” as Draco is a far more fitting constellation, is made up of tonnes of named stars, and works with the connectivity of the continent. I won’t post the list in its entirety on the blog but I will link to a pastebin of it. Out of all the things I’ve done so far, including getting planets displaying, I am most proud of that list.



I also had the bright (maybe) idea of switching from “Star Systems with a lone Planet” to “lone Planets in space.” I was informed this was possible, and code-wise, it does work. The only problem is, after the conversion, no objects are visible on the map. While the objects do exist and are listed as such in the client, the objects won’t display on the map; I am thinking this has something to do with the way systems/planets are drawn. For the time being I have switched back to Star System+Planet until I can find a way to force lonely planets to draw.



In an unfortunate tiding of news I learned from mithro that drawing lines to indicate connectivity will most likely be very difficult or impossible. If I can finish the rest of my project goals in due time I would like to devote as much energy as possible to making “lines” happen.



As I mentioned earlier I switched “Armies” from an Integer to a Resource. It dawned on me after some testing that I could utilize some of “Resources” back-end to slim down on some tpserver modification. I noticed when testing that the resource “Armies” shows up as a “# of units on surface.” I had toyed with maximums for resources and found out that setting a maximum for a resource causes the info pane for a planet to display that maximum as a “# of units minable.” It would be a shame to let that feature go to waste, and I think I may be able to actively update that maximum to indicate to the player the number of reinforcements they have availible to them globally. The only drawback to this approach is in setting the “minable units” for unowned planets (the max will have to be set to 0, so nothing is displayed.) The basic “Colonize” order can’t/won’t be able to draw on a minable units # and as such players without owned planets will need to be informed via message that they have X units availible to colonize with. It has flaws, but also potential; I will have to look into this more when I get down to doing turns. (I could minimize “weirdness” by always informing players of their reinforcements. The approach also makes turn processing easier, as globally one maximum can be used as a counter for reinforcements for a player, and then all of them can be decremented once reinforcements are finished with.)