The lack of native support for strings in C++ was a determined decision on the part of Stroustrup (I'd love to read his book on the history of the development of C++).
It is largely this decision which has made C++ everything it is (good and bad). Templates are driven by the need to implement vectors, so that strings can be vector<char> (or vector<short> for unicode). Allocation and comparison get added to the template implementation, which requires default parameters. Horribly long and ugly template definitions (std::vector<char, std::alocator, std::traits<char> >::basic_function, etc.) lead to changes in error detection and reporting.
What if we take a step back.
What if we look at a few simple additions to C, that will bring in some of the functionality people have come to enjoy in higher level languages (and what functionality is "good", how do we define "good").
Saturday, February 21, 2009
Friday, February 20, 2009
std::string
I was reading the Daily WTF (which is can be a great learning resource on the potential horrors of any programming language and development system).
I saw the most incredible claim, "C/C++ has no native support for such a structure [strings]. It's only in the STL.".
Err, yea, it's hard to do C++ nowadays without the STL.
You might think this code won't work:
But it resolves to
Of course it leads to the horror I have to deal with:
I saw the most incredible claim, "C/C++ has no native support for such a structure [strings]. It's only in the STL.".
Err, yea, it's hard to do C++ nowadays without the STL.
You might think this code won't work:
std::string arg("Hi me");
if( "Hi me" == arg ) { printf("Yup"); }
But it resolves to
operator==(const char*, std::string &);
Of course it leads to the horror I have to deal with:
Ret myFun(const char *charp)
{
FX::FXString foxStr(charp);
randomFoxFun(&foxStr);
std::string stlStr(foxStr.text());
randomStlFun(&stlStr);
// convert STL string to Fox String
// convert STL string to char*
}
Thursday, February 19, 2009
Stuff I've read lately
"March Upcountry" (John Ringo and David Weber) - I was looking for more John Ringo. This series is in the library under Weber. I wasn't sure if it would be more Weber or Ringo. I would say it is more Ringo's style. Straight up marines slogging through enemy territory. Well done.
Sunday, February 01, 2009
Stuff I've read lately
"Manxome Foe" (John Ringo) - This is the third book in the "Into the Looking Glass" series. This is really excellent space opera. Ringo is pacing himself nicely - I think he will be able to avoid painting himself into a corner (ala Peter Hamilton's Reality Dysfunction). Good space combat and marine boarding action scenes. The right mix of humor and seriousness.
Friday, December 12, 2008
Stuff I've read lately
"Ghost" (John Ringo) - I wasn't happy with this one. More Tom Clancy than SF. Also, the whole middle of the book is like a weird ad for kinky sex. Not sure what Ringo was trying for. But, I guess you have to give extra points for the main character killing Osama Bin Laden and sending his head to President Bush...
Wednesday, December 03, 2008
Stuff I've read lately
"Von Neumann's War" (John Ringo) - This is a standalone novel. It covers an invasion of the solar system by self-replicating robots (ala a proposal by Von Neumann for a method for us to explore the galaxy). Fortunately for us, the probes programmers didn't expect concerted, intelligent opposition - humans are able to reprogram them just in time to prevent our extermination. Think "Independence Day", with more marines and less Jeff Goldblum.
Saturday, November 29, 2008
Stuff I've read lately
"Vorpal Blade" (John Ringo) - This is the second book in the series starting with "Into the Looking Glass". Ringo is doing an excellent job of building up a rather unique space opera universe. Pretty hard SF, with good characters and the right mix of humor (like, a giant alien squid trying to eat their space going submarine!). I'm looking forward to more.
Wednesday, November 19, 2008
Stuff I've read lately
"The Family Trade" (Charles Stross) - I have been loathe to start in to these, as they are marked "Fantasy". I haven't read any fantasy in a long time (in all starts to be the same after a while). Sadly, Stross seems determined to continue this series...
That said, this book feels a lot like a hard SF version of "Chronicles of Amber" - so, that's good. For example, once the main character gets back from her first "hell ride", she starts planning all sorts of experiments and evidence gathering!
That said, this book feels a lot like a hard SF version of "Chronicles of Amber" - so, that's good. For example, once the main character gets back from her first "hell ride", she starts planning all sorts of experiments and evidence gathering!
Tuesday, November 18, 2008
New Stars Status
Some big changes in store (not much visually...)

Here we can see the recent files list. It does not re-sort when you select a previous file (I am undecided whether that is a good feature or if some sort of better LRU might be nice).
I also fixed the C++ code to use 64 bit numbers when interfacing to Tcl. I think that just went in to Tcl 8.4. That will get things ready for the object id redux.
Finally, I fixed the new game wizard to actually generate the turn files when you start a new game. That is much better than having to save out the new game def, switch to a terminal, and do a 'newStars -n', then switching back to the client...

Here we can see the recent files list. It does not re-sort when you select a previous file (I am undecided whether that is a good feature or if some sort of better LRU might be nice).
I also fixed the C++ code to use 64 bit numbers when interfacing to Tcl. I think that just went in to Tcl 8.4. That will get things ready for the object id redux.
Finally, I fixed the new game wizard to actually generate the turn files when you start a new game. That is much better than having to save out the new game def, switch to a terminal, and do a 'newStars -n', then switching back to the client...
Sunday, November 09, 2008
Stuff I've read lately
"Into the Looking Glass" (John Ringo) - This is the first book by Ringo that I have read. It was pretty good. Kind of a mix of David Drake and some harder SF guy (Niven?). The story is about a physics experiment gone horribly wrong. The initial experiment blows up UCF, and starts opening stargates to all sorts of different places. Soon, evil aliens start pouring through some of them. Lots of action. In the end, they have to nuke Eustis.
Ringo had an interesting weapon system, a "quarkium bomb" or "quark ray". The exact mechanics weren't clear, but it was supposed to be more powerful than anti-matter. So, it can't be that the quarks are the direct objects converting to energy at the target (that would be equally powerful). Perhaps there is some way a form of quarks could trigger a chain reaction of disrupting nuclei. That would be scary...
Ringo had an interesting weapon system, a "quarkium bomb" or "quark ray". The exact mechanics weren't clear, but it was supposed to be more powerful than anti-matter. So, it can't be that the quarks are the direct objects converting to energy at the target (that would be equally powerful). Perhaps there is some way a form of quarks could trigger a chain reaction of disrupting nuclei. That would be scary...
Saturday, November 08, 2008
Tcl and Ini files
The NewStars client GUI is proceeding pretty well. I am finally getting tired of navigating from the client start directory to the regression directory (up two! src/testfiles/twop).
This is the implementation for the "Recent file list" in Tcl:
Create the resource file if it doesn't exist, or process it if it does:
The ini file is a series of Tcl statements. That way, I can just "eval" the file to bring it in.
Then to handle saving the preferences:
The previous files is a map from the numbers ("1" to "9") to full path filenames. I can grab all the set values (which may be none) and write them out to that file.
By renaming "exit", I can trap any point in the program that is trying to exit. That way, I'm sure that the preferences are saved.
This is the implementation for the "Recent file list" in Tcl:
Create the resource file if it doesn't exist, or process it if it does:
if {![file exists [file join ~ $resourceFileName]]} {
close [open [file join ~ $resourceFileName] w]
} else {
eval [read [open [file join ~ $resourceFileName]]]
}
The ini file is a series of Tcl statements. That way, I can just "eval" the file to bring it in.
Then to handle saving the preferences:
rename exit origExit
proc exit {} {
set f [open [file join ~ $::resourceFileName] w]
foreach n [lsort [array names nsGui::prevFiles]] {
puts $f "set nsGui::prevFiles($n) \{$nsGui::prevFiles($n)\}"
}
origExit
}
The previous files is a map from the numbers ("1" to "9") to full path filenames. I can grab all the set values (which may be none) and write them out to that file.
By renaming "exit", I can trap any point in the program that is trying to exit. That way, I'm sure that the preferences are saved.
Wednesday, November 05, 2008
Improving C
A lot of programming languages have been inspired by C. I can easily list C++, Java, and D; there's probably more (Wikipedia lists Perl, I think Perl is a very different sort of C - and Python and Ruby feel more like cleaned up Perl. I always thought of JavaScript as more like VisualBasic, which is more Pascal-ish - Pascal being a sibling of C, both derived from Algol). There is a pretty cool family tree of programming languages, which shows Python as independent of Perl. I'm not too familiar with Python...
C is a pretty good language. Developed in 1972, it served as a sort of "cross platform assembly language". It allowed UNIX to spread to many different computer systems and provided fertile ground for thousands of hackers.
The main problem with C is the lack of support for object inheritance (you can actually do object oriented programming, but it is kind of a pain). But to implement object inheritance, you must relax pointer conversion warnings (I'm not sure how strict modern C compilers are on pointer conversion, C is classically very relaxed).
The other problem is the lack of generic programming, sometimes called template programming. This allows one set of code to work with various underlying types. The most obvious application is in basic data structures and common algorithms (vector, map, sort). Sorting through void* and size is kind of a pain...
C is a pretty good language. Developed in 1972, it served as a sort of "cross platform assembly language". It allowed UNIX to spread to many different computer systems and provided fertile ground for thousands of hackers.
The main problem with C is the lack of support for object inheritance (you can actually do object oriented programming, but it is kind of a pain). But to implement object inheritance, you must relax pointer conversion warnings (I'm not sure how strict modern C compilers are on pointer conversion, C is classically very relaxed).
The other problem is the lack of generic programming, sometimes called template programming. This allows one set of code to work with various underlying types. The most obvious application is in basic data structures and common algorithms (vector, map, sort). Sorting through void* and size is kind of a pain...
Tuesday, November 04, 2008
Language is a Tool
Is it right to make fun of a programming language? I mean, "it's just a tool". That's what everyone says. You don't mock a hammer for not being a screwdriver (although screwdrivers can be usable hammers ;)
Of course, language is more than a tool.
It is also a means of communication, which means that you've got multiple entities involved.
The main communication is from the programmer to the computer. That means:
Of course, language is more than a tool.
It is also a means of communication, which means that you've got multiple entities involved.
The main communication is from the programmer to the computer. That means:
- The programmer needs to be able to express himself efficiently (in a matter which makes sense to him, in a reasonable amount of time)
- The computer needs to be able to understand (computers are really bad at English! and not just because English is a terrible language for specifications!)
Monday, November 03, 2008
Steam INNN SPAAACE!
So, I've been thinking about the space elevator, mostly about powering the climbers. Everyone seems to be backing laser power (using ground based lasers to shine on solar panels on the climber).
And, I've been reading Ken Macleod's "Fall Revolution" books, which have "steam launched spaceships". I read them completely out of order, so I never got any details. There is a little in "The Space Fraction".
After looking into it more, I found an excellent source. "Steam" propulsion is somewhat of an exaggeration. The recommended propellants are hydrogen and nitrogen. Water is possible, but not optimal.
But pretty cool, for small scale, high volume launch capacity.
And, I've been reading Ken Macleod's "Fall Revolution" books, which have "steam launched spaceships". I read them completely out of order, so I never got any details. There is a little in "The Space Fraction".
After looking into it more, I found an excellent source. "Steam" propulsion is somewhat of an exaggeration. The recommended propellants are hydrogen and nitrogen. Water is possible, but not optimal.
But pretty cool, for small scale, high volume launch capacity.
Sunday, November 02, 2008
New Stars Status
Tada!

A lot of visual changes!

A lot of visual changes!
- Fixed a bug in the defenses calculation (max at 100, please!)
- Implemented hab view mode (circles represent current hab value, flags show ownership)
- Fixed unexplored planets to show gray (both views)
- Fixed the bug I knew would be there when removing too much
- Fixed a bug when adding multiple items to the top of the queue (visual bug, data was ok)
- Fixed the mineral labels to be colored (iron - blue, etc). I made the germanium one more gold than yellow. I find that yellow hard to read...
- Added view planet window (shown, missing mining rates, capacity, hab value, and production queue right now...)
Saturday, November 01, 2008
Stuff I've read lately
"The Star Fraction" (Ken Macleod) - This is apparently the first in the "Fall Revolution" series. I didn't find anything new and incredible in here. It did give a little more insight into the "steam rockets" mentioned in the other books. That is worthy of its own research...
Friday, October 31, 2008
I Love Tcl
So, I have been grinding through a lot of GUI code (NewStars update coming soon!)...
In the process, I have been shifting code from C++ to direct XML access. Part of this involves something called "XPath" (which I had never heard of before).
The key is, you can query an XML document like a database (including wildcard and logical test patterns). So, if I want the node with the planet with object id stored in variable 'pid', I can do:
'//' means a relative search (not necessarily from the root). I need "PLANET_LIST" because there is another list of planets, called "UNIVERSE_PLANET_LIST". The outer square bracked "[]" are part of Tcl (execute this part, and resolve it to the string that is returned). The inner (escaped) brackets are part of XPath (return nodes which satisfy "[logical_condition]").
Of course, any language can support XPath. But, in Tcl, I can open a console session, source the stars.tcl, and start issuing XPath commands against the turn file. That allows me to rapidly tune my request to get the results I want (eliminating the compile/re-run steps). Especially since the W3C XPath docs are unreadable...
Then, once I have the planet node, I can pick off attributes:
That replaces:
Especially since that used "xml2list", which can't always parse some XML...
In the process, I have been shifting code from C++ to direct XML access. Part of this involves something called "XPath" (which I had never heard of before).
The key is, you can query an XML document like a database (including wildcard and logical test patterns). So, if I want the node with the planet with object id stored in variable 'pid', I can do:
set n [$nsGui::turnRoot selectNodes //PLANET_LIST/PLANET\[OBJECTID=$pid\]]
'//' means a relative search (not necessarily from the root). I need "PLANET_LIST" because there is another list of planets, called "UNIVERSE_PLANET_LIST". The outer square bracked "[]" are part of Tcl (execute this part, and resolve it to the string that is returned). The inner (escaped) brackets are part of XPath (return nodes which satisfy "[logical_condition]").
Of course, any language can support XPath. But, in Tcl, I can open a console session, source the stars.tcl, and start issuing XPath commands against the turn file. That allows me to rapidly tune my request to get the results I want (eliminating the compile/re-run steps). Especially since the W3C XPath docs are unreadable...
Then, once I have the planet node, I can pick off attributes:
set concs [$n selectNodes string(MINERALCONCENTRATIONS/text())]
That replaces:
set planXML [xml2list [newStars $::ns_planet $id $::ns_getXML]]
set mainXML [lindex $planXML 2]
set cargoXML [findXMLbyTag "CARGOMANIFEST" $mainXML 2]
set tuple [lindex $cargoXML 1]
Especially since that used "xml2list", which can't always parse some XML...
Thursday, October 30, 2008
Const Fail
I only recently discovered an oddity in the C++ "const" feature. Consider this code:
Anyone see it? A const function is changing the state of the object!
Oops, turns out C++ const is not "transitive" (the D docs call it "head const").
This bit me big time on my previous project. To the point that I developed a "const pointer" class to wrap all my pointers (only got partially deployed into the project).
D 1.0 lacks const (because it is hard to get right, witness C++). D 2.0 wants const done right.
Also, there is a great slam on Java and const. (I can't help myself when it comes to slams on Java! :) Yea, no const for you Java-kins!
class Foo(I've left out some boiler plate)
{
int *i;
void foo(void) const
{
*i = 4;
}
};
Anyone see it? A const function is changing the state of the object!
Oops, turns out C++ const is not "transitive" (the D docs call it "head const").
This bit me big time on my previous project. To the point that I developed a "const pointer" class to wrap all my pointers (only got partially deployed into the project).
D 1.0 lacks const (because it is hard to get right, witness C++). D 2.0 wants const done right.
Also, there is a great slam on Java and const. (I can't help myself when it comes to slams on Java! :) Yea, no const for you Java-kins!
Sunday, October 26, 2008
New Stars Status
I've been struggling with whether to extend the regression, or to get things into shape for a pre-Beta test. I like the regression (being repeatable and all), but it takes as much work as playing the game (more, since I have to play both players).
Of course, shaping things up for a live test requires different sorts of GUI programming...

Here we can see the major changes:
I also need to implement the hab view.
And fleet split/merge. Fleet numbers. Fleet (friendly and other) and planet list.
Of course, shaping things up for a live test requires different sorts of GUI programming...

Here we can see the major changes:
- I added the icons for two of the planet views (ship view - mostly implemented, and planet value view - next to be implemented)
- Lots of production queue stuff...
- Shift and control with Add/Remove (10 and 100 respectively, 1000 together). 889 = 1000 - 100 - 10 - 1
- Added "End of queue" (add is "add before", so we need end - original Stars uses "add after", oops!)
- Fixed quirks in selection (previously, I deleted the queue and reconstructed it from the current orders - now the C++ code communicates queue changes and the GUI selectively rebuilds the view)
- Added a binding to the "q" key
- Fixed a bug related to pressing "Change" queue button multiple times
- Fixed a bug in the max usable factories calculation (population was divided by 1000 instead of 10,000 before multiplying by race factory operation factor)
- Fixed a typo in the component map for Interspace 10. This caused a Tcl error when opening the Ship Design Wizard for players with that access to that component.
- Fixed key bindings for '-' and '+' on the numeric keypad (linked to zoom) for Linux. On Windows, <plus> and <minus> catches both versions. On Linux, the keypad keys generate <KP_Add> and <KP_Subtract>. May be an X server thing...
- Fixed transport amount carrying over between different fleets (and players!). The most confusing thing was - a player could order a load 2500 colonists, save and load another turn, and see that load 2500! Except, the order wasn't given, so they'd launch with no colonists! Ops!
- Unlinked open file command from "Find" operations (it was intended as a place holder, I find "" makes a better one!)
I also need to implement the hab view.
And fleet split/merge. Fleet numbers. Fleet (friendly and other) and planet list.
Thursday, October 23, 2008
Stuff I've read lately
"The Sovereign Grace of God In Salvation" (John Roden) - Reviewed on my faith blog.
Sunday, October 19, 2008
New Stars Status
BOOM!

Further work on the battle VCR.
First, I ran through this battle in the original Stars, and noticed that the Warmonger Armed Probe should be crossing the board faster. I found that the Warmonger did not have his +.5 move bonus. Fixed.
That gave me a test case for a "FIRE" token in the battle report (missles still not supported).
I also updated the selection logic, so that changing the current event (next and previous buttons) selects the acting token.

Further work on the battle VCR.
First, I ran through this battle in the original Stars, and noticed that the Warmonger Armed Probe should be crossing the board faster. I found that the Warmonger did not have his +.5 move bonus. Fixed.
That gave me a test case for a "FIRE" token in the battle report (missles still not supported).
I also updated the selection logic, so that changing the current event (next and previous buttons) selects the acting token.
Wednesday, October 15, 2008
Stuff I've read lately
"Murder in the Solid State" (Wil McCarthy) - Interesting pun. When you think of "solid state" you think of "state of the art" and "cutting edge". But, in the age of nanotech (full of tiny machines and their moving parts), "solid state" is the failure mode (your tiny machines have jammed)!
This book is a murder mystery. Things go pretty well (very suspenseful) for the most part. Although, the ending was a little confusing and unsatisfying.
This book is a murder mystery. Things go pretty well (very suspenseful) for the most part. Although, the ending was a little confusing and unsatisfying.
Friday, October 10, 2008
Stuff I've read lately
"The Sky Road" (Ken Macleod) - Wikipedia says that this book presents an alternate time-line in the "Stone Canal", "Cassini Division" series. I'm not so sure. It's certainly not obvious. One character, "Ellen May" seemed younger than I remember, but I can't be sure. The "Sheenisov" are still marching across the earth, and the "tinker" society seems a believable precursor to the communes in "Cassini". Overall, ok. I still like "Cassini" the best.
"Why I am So Wise" (Friedrich Nietzsche) - Reviewed on my faith blog.
"Why I am So Wise" (Friedrich Nietzsche) - Reviewed on my faith blog.
Saturday, October 04, 2008
Aluminum + 1000 resources
= Space Elevator! (thank you Civ 4). Of course, if you build in in the city with the Iron Works (excellent Texas barbecue results in double resource output!), it's only 500 resources; a good city can do that in ten or eleven years.
I've been following discussions on building a space elevator for some time now. I was surprised to see CNN discussing it!
There are two primary challenges connected with building a space elevator:
The hazard to lower orbiting satellites is more than offset by the increased launch efficiency. (There would need to be a workforce assigned to pushing satellites out of the way, or a way to shift the tether around them - such a shift might even be useful in dodging meteors or terrorist suicide attacks).
The good news is that the space elevator used to be considered a tech level 9 or 10 achievement. It appears, it will be completed easily within the tech 8 time frame.
I've been following discussions on building a space elevator for some time now. I was surprised to see CNN discussing it!
There are two primary challenges connected with building a space elevator:
- The cable (or tether) - Spans 100,000 kilometers from the surface of the earth, up past geosynchronous orbit (the center of mass is at the geosynch point)
- This cable need not be one single piece. This is a confusion many people have ("We can't build a carbon nanotube that long!!111eleven!").
- The cable need not be of super materials (100% carbon nanotubes, positronium, etc.) You can make it out of bubble gum, although you'd probably need enough to alter the center of mass of the earth-moon system :)
- Better materials translate into less mass for the initial tether. That means fewer rockets to get all the materials into space.
- Once the initial tether is up, the first cargo can be more tether, to increase the capacity of your elevator (and build new ones).
- The cars (or climbers)
- The tether does not move, instead, the cars pull themselves up or down.
- The climbers are actually the hard problem!
- They must travel the hundred miles or so into the edge of space, and possibly, the 36,000 km to geosync orbit (especially if they are going to be used to add on to the tether).
- It is unlikely we will want to carry enough fuel for a 36,000 km journey (at 200 mph, that's about a five day trip - one way).
- That means we need a means of power distribution to generate power on the ground, and get it to the climbers (most likely lasers and solar panels).
The hazard to lower orbiting satellites is more than offset by the increased launch efficiency. (There would need to be a workforce assigned to pushing satellites out of the way, or a way to shift the tether around them - such a shift might even be useful in dodging meteors or terrorist suicide attacks).
The good news is that the space elevator used to be considered a tech level 9 or 10 achievement. It appears, it will be completed easily within the tech 8 time frame.
Tuesday, September 30, 2008
C-piphany
(rhymes with epiphany)
At some point, I realized why C++ is so unwieldy.
It is really three (or four) different languages:
At some point, I realized why C++ is so unwieldy.
It is really three (or four) different languages:
- Macro preprocessing language. #define, #include, etc. Mostly deprecated in C++, except for #include, and #ifndef protection in header files. Except when someone drops 300k lines of 15 year old code on you, and it is filled with all sorts of "horrors man was not meant to know" (TM).
- Base C language (and C++ extensions, which can be considered a language unto themselves). What we normally think of as the language, with declarations and operators. I think this is where C++ shines, with lots of tools to wedge things together (operator overloading, references, etc.).
- Template programming language. This is needed for the standard library (arrays, etc.). Except, it becomes all to easy to start coding everything in templates. Then, you're hardly using C at all. It's all bizarre template stuff. It's all in header files, and it's all ugly and hard to understand...
Monday, September 29, 2008
Stuff I've read lately
"The Stone Canal" (Ken Macleod) - This is the precursor to "The Cassini Division", which I read first. I find it didn't add much, although it was ok.
"Why God Won't Go Away" (Andrew Newberg, Eugene D'Aquili, Vince Rause) - Reviewed on my faith blog.
"Why God Won't Go Away" (Andrew Newberg, Eugene D'Aquili, Vince Rause) - Reviewed on my faith blog.
Monday, September 22, 2008
New Stars Status
Big landmark! The Battle VCR!

It also includes the battle report window (very small, just left of the top of the VCR). This allowed me to find an interesting bug. Scan was comparing pointers, so the same ships were getting scanned over and over.
I also added the detailed scan for ships in battle (still need to make this the behavior for WM scans).
This check-in also includes a top level Tcl XML DOM. That's a complicated way of saying Tcl now has access to the parsed XML file at any point. Previously, it required C++ to parse the XML, and could only query the XML for individual objects. This should allow me to migrate to an all Tcl client (or at least one independent of server code).

It also includes the battle report window (very small, just left of the top of the VCR). This allowed me to find an interesting bug. Scan was comparing pointers, so the same ships were getting scanned over and over.
I also added the detailed scan for ships in battle (still need to make this the behavior for WM scans).
This check-in also includes a top level Tcl XML DOM. That's a complicated way of saying Tcl now has access to the parsed XML file at any point. Previously, it required C++ to parse the XML, and could only query the XML for individual objects. This should allow me to migrate to an all Tcl client (or at least one independent of server code).
Sunday, September 21, 2008
The Horror, the Horror
(Continuing my rant on g++ 4, which is a part of my musings on D)
Ok, take the code from last time, and add this after the "class Par" definition:
Err, excuse me! x_ is inherited from the parent. Just look, it's 'int x_'. It's protected, that means it's visible to any children! How can I fix this! I don't know what to do!
After about five minutes of careful Googling, I found a site that seems to understand what's going on. They say:
There is a fix:
Ok, I can see how that helps the compiler figure stuff out. However, it hurts my brain... If somebody else sees this code (and isn't familiar with this change in the compiler, like say they've been programming C++ for the last ten years and never seen it - like I was until this week) they are going to say, "Oh, that 'this' isn't needed. I'll just remove it." Let's say it's in some utility header (like a good template should be). And that it takes an hour to recompile (like my project does). And they change a lot of other stuff before starting a full recompile (because you don't want to wait an hour between every one line change). And then they get that bizarro error. Yea, they're gonna be mad. And they're going to have to back track through all the changes they've made, google for the page above (assuming they can find it, I only found it by looking for "two stage name lookup" - yea, that's intuitive), and recompile another hour or two.
Enjoy! :..(
Note: apparently, it went into g++ 3.4, only 3.2 is safe!
Ok, take the code from last time, and add this after the "class Par" definition:
This code should compile on on gcc 3.4 or in Visual Studio. g++ 4 gives the following error:
template<typename T>
class Child : public Par<T>
{
public:
void fun(void)
{
x_ = 4;
}
};
main.cpp: In member function 'void Child::fun()':
main.cpp:22: error: 'x_' was not declared in this scope
Err, excuse me! x_ is inherited from the parent. Just look, it's 'int x_'. It's protected, that means it's visible to any children! How can I fix this! I don't know what to do!
After about five minutes of careful Googling, I found a site that seems to understand what's going on. They say:
"The C++ standard prescribes that all names that are not dependent on template parameters are bound to their present definitions when parsing a template function or class."There is actually a good reason behind this. People were having problems where templates were full of buggy code, but no one knew it until you tried to use them (because the compilers were just turning off error checking when interpreting template code). So now, compilers are trying to understand the template code, and check it for errors. The only problem is good code is now wrongly flagged as erroneous code. Oops!
There is a fix:
this->x_ = 4;
Ok, I can see how that helps the compiler figure stuff out. However, it hurts my brain... If somebody else sees this code (and isn't familiar with this change in the compiler, like say they've been programming C++ for the last ten years and never seen it - like I was until this week) they are going to say, "Oh, that 'this' isn't needed. I'll just remove it." Let's say it's in some utility header (like a good template should be). And that it takes an hour to recompile (like my project does). And they change a lot of other stuff before starting a full recompile (because you don't want to wait an hour between every one line change). And then they get that bizarro error. Yea, they're gonna be mad. And they're going to have to back track through all the changes they've made, google for the page above (assuming they can find it, I only found it by looking for "two stage name lookup" - yea, that's intuitive), and recompile another hour or two.
Enjoy! :..(
Note: apparently, it went into g++ 3.4, only 3.2 is safe!
Saturday, September 20, 2008
c++->fail()
(Continuing my musings on D)
(that code actually works, try (assuming C has a method fail):
C cAry[2];
C *c = cAry;
c++->fail();
)
I got bit by several very ugly bugs in g++ 4 this week. This is about code that works in gcc 3.2, 3.4, and Visual Studio. But breaks in g++ 4.
This is because g++ 4 is more closely matching the C++ spec!
See below for the exact code.
The first problem is mixing implementations of template member functions. This might be because you need to specially handle certain types (like strings), while having a generic implementation for the standard types (int, bool, float, etc.).
The notation in pre g++ 4 is straightforward (if ugly)
and
When I compile under g++ 4, I get this error:
In the code below, line 16 is:
Well, there is the template parameter! Right there! "std::string", it's string! What more do you want from me!
Here is the working code:
Oh! Of course! Duh! I should of known that. The earlier code was obviously so ambiguous that only every compiler before g++ 4 could figure it out. I'm so glad they fixed that for me!
Here is the total code:
(that code actually works, try (assuming C has a method fail):
C cAry[2];
C *c = cAry;
c++->fail();
)
I got bit by several very ugly bugs in g++ 4 this week. This is about code that works in gcc 3.2, 3.4, and Visual Studio. But breaks in g++ 4.
This is because g++ 4 is more closely matching the C++ spec!
See below for the exact code.
The first problem is mixing implementations of template member functions. This might be because you need to specially handle certain types (like strings), while having a generic implementation for the standard types (int, bool, float, etc.).
The notation in pre g++ 4 is straightforward (if ugly)
returnType ClassName<SpecificType>::functionName(args) { specific implementation }
and
template<args>
returnType ClassName<args>::functionName(args) { generic implementation }
When I compile under g++ 4, I get this error:
main.cpp:16: error: too few template-parameter-lists
In the code below, line 16 is:
void Par<std::string>::fun(void)
Well, there is the template parameter! Right there! "std::string", it's string! What more do you want from me!
Here is the working code:
template<>
void Par<std::string>::fun(void)
Oh! Of course! Duh! I should of known that. The earlier code was obviously so ambiguous that only every compiler before g++ 4 could figure it out. I'm so glad they fixed that for me!
Here is the total code:
#include <cstdio>
#include <string>
template<typename>
class Par
{
protected:
int x_;
public:
Par(void) {}
virtual void fun(void);
};
void Par<std::string>::fun(void)
{
printf("String ver\n");
}
template<typename T>
void Par<T>::fun(void)
{
printf("Generic ver\n");
}
int main(int argc, char **argv)
{
Par<std::string> p1;
p1.fun();
Par<int> p2;
p2.fun();
return 0;
}
Friday, September 19, 2008
Stuff I've read lately
"The Cassini Division" (Ken Macleod) - This is actually the third book in a series. I am really enjoying Macleod. His writing is reminiscent of the "good ole days" of science fiction; with big ideas and epic happenings. And there is a good amount left to be mined here (Cassini is from 1998). Stross is writing too much fantasy (Merchants), and horror (Atrocity Archives). Scalzi has just gotten started.
The Cassini Division is a military unit stationed near Jupiter (and, apparently, a gap in the rings of Saturn). They are charged with protecting Earth (and the orbital settlements) from "post-humans", a group of people who uploaded themselves into computers and set off runaway technological progress (the "singularity").
Macleod has an interesting take on the STL/FTL problem. He uses the "hard" sci-fi notion of wormholes (paired creations, which must be moved apart at STL). However, he also allows that the moving end of the wormhole keeps its own time frame - thus, you can travel 10,000 light years (to a point 10,000 years in the future) fairly soon after the wormhole is created. Interesting stuff.
The Cassini Division is a military unit stationed near Jupiter (and, apparently, a gap in the rings of Saturn). They are charged with protecting Earth (and the orbital settlements) from "post-humans", a group of people who uploaded themselves into computers and set off runaway technological progress (the "singularity").
Macleod has an interesting take on the STL/FTL problem. He uses the "hard" sci-fi notion of wormholes (paired creations, which must be moved apart at STL). However, he also allows that the moving end of the wormhole keeps its own time frame - thus, you can travel 10,000 light years (to a point 10,000 years in the future) fairly soon after the wormhole is created. Interesting stuff.
Thursday, September 18, 2008
Decoys
(Continuing my musings on D)
Garbage collection:
Garbage collection:
- Although it's always fun to mock people who fail due to memory leaks while using a garbage collected language...
- I think D simultaneously defeats C++ and Java/C# here...
- But, but, C++ has garbage collection libraries! Yea, in ten years of programming I haven't used a C++ garbage collection library. I have used Purify, Valgrind, and even overloading new and delete; looking for memory leaks (not to mention the NewStars code is loaded with memory leaks...)
- Java has garbage collection, and only garbage collection - unless you use Embedded Java, then you get no garbage collection! Enjoy!
- D "makes the easy case work". The default is garbage collection, with overrides for self-managed memory (of various forms).
- Doxygen ('///' and '/***/') works on C++ and Java (it's an extension of JavaDocs)
- However, it needs to run as a separate step of the build.
- This can be confusing. For example, I ran the debug build, and didn't see Doxygen (although it might be in there, with make spewing thousands of pages of output...). Some of the code uses it, some doesn't. So, I started converting everything to not use it (it's ugly and confusing, if you're not going to generate the docs). Until I discovered than there is a build that does use it (and the code not using it, needs it)
- Less ugly Doxygen style comments are built into the D spec. There is a compiler switch to do the docgen run.
- Programming is all about assumptions. When writing new code, you've got some idea of what's going on in the program, and what the inputs will be, and what sort of outputs you can create.
- Of course, assumption are made to be broken. That's why I'm always sprinkling my code with plenty of 'asserts'.
- DBC formalizes all of this. 'assert' is part of the spec (rather than being an ugly macro). Also, there are 'in' and 'out' blocks for functions (to check inputs and outputs). Classes have 'invariant' statements, which are processed before and after functions (to ensure class invariants are maintained).
Wednesday, September 17, 2008
Duck Hunt
(Continuing my thought process for considering a new language)
Nine to five, I hack C++. Not just any C++. Imagine hundreds of thousands of lines of code, spread across dozens of directories in a twisty maze. Make takes from twenty to thirty minutes (that's a parallel make, serial is over an hour), and sometimes fails in odd ways.
The program has to run on about five different compiler/platform environments (Windows, plus various forms of UNIX - including a Sparc).
Over the past few weeks, I've been running into all sorts of nasty C++ problems (weird template problems, compiler mismatches, spaghetti recompilation).
As I've been looking for solutions to the problems on the Internet, the C++ Frequently Questioned Answers keeps coming up.
The guy makes a lot of good points. And I started to wonder, does he have some constructive recommendation (besides, "Don't use C++").
It's called D.
I think, what I'm looking for isn't Python or Ruby to replace Tcl. I need something to replace C++. With features like Python or Ruby (rapid development, functional programming).
That's D.
Things are still a little fresh (spec is rapidly moving, environment issues). But considering that, it is working remarkably well. I mean, C++ is way older, and still has issues!
A good place to start is with the overview.
Nine to five, I hack C++. Not just any C++. Imagine hundreds of thousands of lines of code, spread across dozens of directories in a twisty maze. Make takes from twenty to thirty minutes (that's a parallel make, serial is over an hour), and sometimes fails in odd ways.
The program has to run on about five different compiler/platform environments (Windows, plus various forms of UNIX - including a Sparc).
Over the past few weeks, I've been running into all sorts of nasty C++ problems (weird template problems, compiler mismatches, spaghetti recompilation).
As I've been looking for solutions to the problems on the Internet, the C++ Frequently Questioned Answers keeps coming up.
The guy makes a lot of good points. And I started to wonder, does he have some constructive recommendation (besides, "Don't use C++").
It's called D.
I think, what I'm looking for isn't Python or Ruby to replace Tcl. I need something to replace C++. With features like Python or Ruby (rapid development, functional programming).
That's D.
Things are still a little fresh (spec is rapidly moving, environment issues). But considering that, it is working remarkably well. I mean, C++ is way older, and still has issues!
A good place to start is with the overview.
Tuesday, September 16, 2008
New Stars Status
Finally getting to the point where I can start on the battle VCR!

It took a lot of bug fixes to get to this point...
The battle was really anti-climatic. The current battle engine has the JOAT scout escape without a shot fired. I will need to investigate that outcome...

It took a lot of bug fixes to get to this point...
- Implemented ship to ship scanning
- Fixed bug causing battle messages between fleets the player owns
- Fixed a bug where planets could not see enemy ships in orbit
- Added a speed spinner to fleet move orders
- Fixed a bug when right-clicking on mixed friendly and enemy fleets in one point
- Fixed a bug where some fleet GUI items would appear in view planet mode
- Fixed widths of some widgets to fix jumpy universe view size
- Added previous and next buttons to the message pane
- Removed ship object id from ship names (just in fleet)
- Improvements to the scripting interface
The battle was really anti-climatic. The current battle engine has the JOAT scout escape without a shot fired. I will need to investigate that outcome...
Friday, September 12, 2008
Need a New Duck
And show me how to get downI've probably forgotten more about programming languages than most people know (since most people know zero programming! :)
How to get down baby
Get it?!
Quack, Quack, Quack!
Basic, Pascal, Visual Basic, C, C++, Perl, Verilog, Java, various assembly languages (including PipeWrench, don't ask), Awk, Tcl, Lex, Yacc, ML (which we all thought stood for "My Language"), VHDL.
At this point, I've pretty much settled on C++ and Tcl. (plus Perl for text processing).
Tcl is great for rapid development, and GUI design.
C++ is great for interface definition, large projects, and general hacking. I don't know Bjarne's background, but it must include a lot of hacking.
But I've been getting the feeling I need a new language.
I tried Ruby. But "everything is an object" doesn't seem any better than "everything is a string" (Tcl).
I've played with Python, but again, it doesn't really replace Tcl for me.
I've used Darcs, which is the poster child of Haskell. That's pretty much turned me off that... The other functional languages are even more obscure.
Erlang seems to have potential for the multicore future. But it seems to be different in annoying ways, "just cause".
Tuesday, September 09, 2008
Stuff I've read lately
"The Birth of Christianity" (John Dominic Crossan) - Reviewed on my faith blog.
"Patriots" (David Drake) - Not your typical Drake. Ok, but more character focused. He should stick to tanks and such :)
"Patriots" (David Drake) - Not your typical Drake. Ok, but more character focused. He should stick to tanks and such :)
Saturday, August 30, 2008
New Stars Status
Trying to work up to a battle in the two player game. I am trying to actually walk the players through their turns as they would be doing them (i.e. spending a lot of time micro-managing).
Part of that is implementing the "accelerated BBS" option (so I don't have to generate 30 turns before reaching colonization pop).
Then, I added the research tax option (visible in the dialog below). This uncovered several bugs in communicating this information from the player file to the server.

I also fixed the scanner pane so that it resizes itself to fill up the window. There is a somewhat annoying flicker as you click from explored to unexplored planets (due to different widths on the left)...
I also found/fixed a bug for JOAT w/o IFE getting Quick Jump 5 instead of Long Hump 6 (IFE properly gives the Fuel Mizer).
As well as a bug in the growth formula when planets exceed 25% capacity (aided by AccBBS).
Interesting note, on Linux, the two players are right next to each other. That means I can use it for some quick battles (and I need to fix the homeworld placement logic...)
Part of that is implementing the "accelerated BBS" option (so I don't have to generate 30 turns before reaching colonization pop).
Then, I added the research tax option (visible in the dialog below). This uncovered several bugs in communicating this information from the player file to the server.

I also fixed the scanner pane so that it resizes itself to fill up the window. There is a somewhat annoying flicker as you click from explored to unexplored planets (due to different widths on the left)...
I also found/fixed a bug for JOAT w/o IFE getting Quick Jump 5 instead of Long Hump 6 (IFE properly gives the Fuel Mizer).
As well as a bug in the growth formula when planets exceed 25% capacity (aided by AccBBS).
Interesting note, on Linux, the two players are right next to each other. That means I can use it for some quick battles (and I need to fix the homeworld placement logic...)
Wednesday, August 13, 2008
Stuff I've read lately
"Dark Light" (Ken Macleod) - Sequel to "Cosmonaut Keep". Very short, but pretty good. Follows the adventures of the previous characters on a planet some light years from the last (they got their light drive working). The libraries here don't have the third book...
"In My Place Condemned He Stood" (J. I. Packer and Mark Dever) - Reviewed on my faith blog.
"In My Place Condemned He Stood" (J. I. Packer and Mark Dever) - Reviewed on my faith blog.
Tuesday, August 12, 2008
New Stars Status
Started in on more bugs:

Here we can see the new universe caused by fixing the randomization of the hab distributions. I also added the player relation dialog, and changed the underlying implementation. With those changes done, I can revamp the battle engine - in preparation for the battle VCR.
I also fixed some of the automation, to improve fuel consumption during scouting missions.
I looked into the fails during generation huge universe (dense and packed). They are running out of planet names. We will need to generate another 1k names...

Here we can see the new universe caused by fixing the randomization of the hab distributions. I also added the player relation dialog, and changed the underlying implementation. With those changes done, I can revamp the battle engine - in preparation for the battle VCR.
I also fixed some of the automation, to improve fuel consumption during scouting missions.
I looked into the fails during generation huge universe (dense and packed). They are running out of planet names. We will need to generate another 1k names...
Friday, July 18, 2008
Stuff I've read lately
"Cosmonaut Keep" (Ken Macleod) - This is some of the best space opera I've read in a long time. Really what I've been looking for lately. Reminds me more of Asimov, and the like. The story is a little confusing at first, because it covers two time frames: the first is in the future on a distant planet, where humans and aliens live together; the second is the near future, where humans make first contact with the aliens.
I look forward to the next book, "Dark Light".
I look forward to the next book, "Dark Light".
Wednesday, July 16, 2008
New Stars Status
I started in on some of the bugs:

Here we can see the new fleet composition pane. I still need to connect the "battle plan", "estimated range", and "cloak" areas. Also, I need to add a drop down with other fleets in this location (for fleet to fleet transfers). I also need to implement the Split/Merge buttons.
I also fixed the "close enough" check when adding waypoints. That was one of the first features in the GUI, when the canvas had a lot fewer things floating around. At some point, all the new canvas objects threw off the logic. It should work much better now. I also fixed the "redraw paths on delete" bug.
Then there is the production queue. I fixed the "remove all" problem mentioned, and improved the checks which combine nearby items. Also, the production queue and waypoints list should behave better when adding multiple (always inserting at end, rather than sometimes at the beginning).
I looked into the research tax. It is a top level XML thing, so I may want to adjust that through the C++ interface. I also gathered some data on the hab distribution. It is looking fairly flat. I want to gather a few more data points to be sure... I also started on handling shift and control down, but that will need more effort.
I'm not entirely happy with where this check in is (should have a few more features), but the code has been this way since Saturday (IIRC) and I haven't had a chance to work on it, and might not for a few days...

Here we can see the new fleet composition pane. I still need to connect the "battle plan", "estimated range", and "cloak" areas. Also, I need to add a drop down with other fleets in this location (for fleet to fleet transfers). I also need to implement the Split/Merge buttons.
I also fixed the "close enough" check when adding waypoints. That was one of the first features in the GUI, when the canvas had a lot fewer things floating around. At some point, all the new canvas objects threw off the logic. It should work much better now. I also fixed the "redraw paths on delete" bug.
Then there is the production queue. I fixed the "remove all" problem mentioned, and improved the checks which combine nearby items. Also, the production queue and waypoints list should behave better when adding multiple (always inserting at end, rather than sometimes at the beginning).
I looked into the research tax. It is a top level XML thing, so I may want to adjust that through the C++ interface. I also gathered some data on the hab distribution. It is looking fairly flat. I want to gather a few more data points to be sure... I also started on handling shift and control down, but that will need more effort.
I'm not entirely happy with where this check in is (should have a few more features), but the code has been this way since Saturday (IIRC) and I haven't had a chance to work on it, and might not for a few days...
Monday, July 07, 2008
New Stars Status
Some more operative bugs (and much needed new features):
- Floating-point exception while generating a huge universe (names underflow?)
- Need a redraw of paths on delete waypoint
- Waypoints always insert at 0 (should be end)
- Fix close enough on shift-click (canvas is returning a list?)
- Feature - drag waypoints
- Need to clear the current filename on open (fixed locally)
- Feature - recent files, remember working directory (.ini)
- Production Queue (PQ) - shift/control click, hot keys
- Generate player files automatically on new game
- PQ - "Remove" removes all on a multiple item!
- Messages on planetary build (will need filter!)
- Research tax in GUI
- Ship Designer - delete needs a refresh
- PQ - collect ships above and below on add
- Messages for fleet complete orders and new planet scans
- Feature - View all fleets (F3)
- Feature - Fleet composition and split/merge
- Scanner pane focus arrow, update on next (fleet/planet)
- Hab distribution is uniform
- Speed and fuel in fleet orders
Wednesday, July 02, 2008
Stuff I've read lately
"God and Religion" (Bertrand Russell) - Reviewed on my faith blog.
"Surprised by Hope" (N.T. Wright) - Reviewed on my faith blog.
"Introduction to Christianity" (Joseph Cardinal Ratzinger) - Reviewed on my faith blog.
"Agent to the Stars" (John Scalzi) - I'm running out of Scalzi and Stross to read at the local library. I had actually seen this book. But the cover art is really bad. I didn't even realize it was science fiction. I found the text online, and read a bit, and realized it is sci-fi, and classic Scalzi. Very enjoyable.
"Surprised by Hope" (N.T. Wright) - Reviewed on my faith blog.
"Introduction to Christianity" (Joseph Cardinal Ratzinger) - Reviewed on my faith blog.
"Agent to the Stars" (John Scalzi) - I'm running out of Scalzi and Stross to read at the local library. I had actually seen this book. But the cover art is really bad. I didn't even realize it was science fiction. I found the text online, and read a bit, and realized it is sci-fi, and classic Scalzi. Very enjoyable.
Friday, June 06, 2008
New Stars Status
Trying to crush off the bugs from the last bug report...

Here we can see the main fixes. I've added a player command to the Tcl interface, mainly to implement player relations. However, I think the main player relation code will need to be reworked...
I also fixed the mining rate calculation, and max defenses calculation (and the resources now say max/max instead of 0/max).
I also added some menus (view race - previously only accessible through F8, research - ditto/F5, battle plans - stub, change password - stub).
I fixed a bug where using the race wizard would break viewing your current game race, and another where planetary resources display as 0 on the first turn.

Here we can see the main fixes. I've added a player command to the Tcl interface, mainly to implement player relations. However, I think the main player relation code will need to be reworked...
I also fixed the mining rate calculation, and max defenses calculation (and the resources now say max/max instead of 0/max).
I also added some menus (view race - previously only accessible through F8, research - ditto/F5, battle plans - stub, change password - stub).
I fixed a bug where using the race wizard would break viewing your current game race, and another where planetary resources display as 0 on the first turn.
Wednesday, June 04, 2008
Stuff I've read lately
"Halting State" (Charles Stross) - This is very near future fiction, about 10 years out. It is basically a mystery/spy thriller featuring a nerdy programmer and an accountant. I found it pretty well done. The zombie flash mob at the end was a nice touch.
Tuesday, May 20, 2008
Stuff I've read lately
"Nebula Awards 26" (James Morrow ed.) - I guess 1990 wasn't a very good year for short stories in science fiction. I didn't like any of them, at all. There was one by Ursala Le Guin, which was just ok. I read "Left Hand of Darkness" about three years ago, and couldn't remember the specifics. The novella by Haldeman was kind of interesting, but was very Hemingway specific, and I didn't really get it.
Thursday, May 15, 2008
Stuff I've read lately
I finished the Simak book, the last stories were:
"All the Traps of Earth" (1960) - Very reminiscent of Asimov's "Bicentennial Man", which I guess, wasn't written until 1976... so a point for Simak, there.
"Death Scene" (1957) - Very short, somewhat ominous feeling, but ends well.
"Reunion on Ganymede" (1966) - War heroes overcome their differences by blasting robot animals.
"The Money Tree" (1958) - Alien botanists help out a local thug.
"Party Line" (1978) - Interstellar communication via psychic hot-line/chat room.
"The Answers" (1953) - Man loses his drive to expand after learning life has no purpose.
"The Thing in the Stone" (1970) - Ironically, I picked up Simak because he is listed as a Christian author. The previous stories weren't exactly pinnacles of Christian doctrine. This one at least had a touching ending. The "thing" in the stone is some sort of universal war criminal. The main character meets an energy being attendant, which he first takes as a sort of "loyal pet". But, in the last paragraph, this being is revealed as a "shepherd", waiting for the redemption of the "thing". So, not all bad.
"All the Traps of Earth" (1960) - Very reminiscent of Asimov's "Bicentennial Man", which I guess, wasn't written until 1976... so a point for Simak, there.
"Death Scene" (1957) - Very short, somewhat ominous feeling, but ends well.
"Reunion on Ganymede" (1966) - War heroes overcome their differences by blasting robot animals.
"The Money Tree" (1958) - Alien botanists help out a local thug.
"Party Line" (1978) - Interstellar communication via psychic hot-line/chat room.
"The Answers" (1953) - Man loses his drive to expand after learning life has no purpose.
"The Thing in the Stone" (1970) - Ironically, I picked up Simak because he is listed as a Christian author. The previous stories weren't exactly pinnacles of Christian doctrine. This one at least had a touching ending. The "thing" in the stone is some sort of universal war criminal. The main character meets an energy being attendant, which he first takes as a sort of "loyal pet". But, in the last paragraph, this being is revealed as a "shepherd", waiting for the redemption of the "thing". So, not all bad.
Thursday, May 08, 2008
Stuff I've read lately
"Inheritor" (C.J. Cherryh) - The third book in the "Invader" series. It feels like Cherryh has slowed things down a little. The story is taking longer to progress, and the stress for the characters isn't quite as challenging. But, the story is still pretty compelling, and the universe is interesting.
I've also started a collection of short stories by Clifford D. Simak. The collection is called "The Creator amd Other Stories".
The first story (from 1935!) is called "The Creator", about a couple of guys who meet an energy being who claims to be the creator of the universe -- and kill him. Not a high quality story.
"Shotgun Cure" (1960). This is shorter and punchier, but the ending falls flat. Aliens cure the human race of all disease, but we get kind of dumber. How much dumber? Do the aliens come back to harvest us for lunch? It doesn't say...
I've also started a collection of short stories by Clifford D. Simak. The collection is called "The Creator amd Other Stories".
The first story (from 1935!) is called "The Creator", about a couple of guys who meet an energy being who claims to be the creator of the universe -- and kill him. Not a high quality story.
"Shotgun Cure" (1960). This is shorter and punchier, but the ending falls flat. Aliens cure the human race of all disease, but we get kind of dumber. How much dumber? Do the aliens come back to harvest us for lunch? It doesn't say...
Thursday, May 01, 2008
Stuff I've read lately
"The Last Colony" (John Scalzi) - This is the last book in the "Old Man's War" trilogy. I think it ended strongly. Scalzi's humor remains, and there is some good action. I thought it was interesting that the base colony size is 2500 colonists, the same as Stars.
Wednesday, April 30, 2008
New Stars Status
Started in on the bugs from last update...


- Fixed names with spaces (caused planet names in the test bed to shift... which required an update to the orders.tcl)
- Added display of max infrastructure (which is stored in the turn file). This caused me to realize that turn 0 does not have a max infra calculation. I also realized we did not factor in OBRM and JOAT...
- Added display of defenses (including max)
- I moved the "bottom right" frame (which shows planets, fleets, minefields, etc.) over to the left. This makes more room for the starmap. I also changed the display to 800x600, and shrunk the hab bars to make things fit better, and fixed the hab pluses to use a brighter color.
- Fixed message display when you have no messages.
Thursday, April 24, 2008
New Stars Status
Bug report:
- Planet names file stopped at first space (no multi-word planet names)
- No max calc for planetary mines, factories, and defenses
- No mining rate calc
- Missing pop-ups on population, resources, scanner, defenses
- Missing gui cargo transfer (work-around: use waypoint 0 load/unload)
- Missing clear planetary queue button (work-around: manually clear, who ever uses this button?)
- Missing route button (not a big usage, it adds a move order on newly constructed ships, basically automation)
- Missing starbase display panel
- Missing mineral display in bottom right
- Missing message display
- Need menu commands for Research (dialog is done, use F5), Generate (done, F9), Planet/Fleet view (not done, F3), battle plans (not done, F6), Player relations (not done, F7)
- Battle engine improvements
- Report menu
- Scanner pane filters/options
- Starbase and fleet icons in bottom right
- Pop-ups in bottom right
- Should probably disable add to queue from empty/unowned planets... (server will reject the commands... I hope...)
Sunday, April 20, 2008
New Stars Status
A few more minor improvements, but they're the sorts of things that are important for playability:

Here we can see the path highlighting I added last time. It also shows a ship with no engine being rejected. I also made the ship designer window a default size, which should reduce window resizing jitter. You can also see the cost/feature labels below the ship layout.
- Implemented slot compatibility checks (no engines in weapon slots!)
- Implemented slot moving (used to have to discard and re-add)
- Implemented cost and design feature labels in ship designer
- Fixed a crash when the production window is not open, and a new design is created (tried to update the production list with the new design...)
- Improved zoom-in/zoom-out behavior (less shifting of the center point)

Here we can see the path highlighting I added last time. It also shows a ship with no engine being rejected. I also made the ship designer window a default size, which should reduce window resizing jitter. You can also see the cost/feature labels below the ship layout.
Wednesday, April 09, 2008
Stuff I've read lately
"The Faded Sun: Shon'Jir" (C.J. Cherryh) - This is the second book in the Faded Sun universe. I hadn't realized there was a trilogy here. In the first book, "the People" (mri) were reduced from millions to two (and brother and sister at that). The second book focuses on a human sent with the last two mri on a journey to their homeworld. Not the best Cherryh, but pretty good.
Saturday, April 05, 2008
New Stars Status
Ok, sorry, been a long while... things are pretty close now, and it is sometimes hard to be motivated to finish :)

I've fixed the clearing of private information from enemy scans. This was a lot more intrusive than I had imagined.
We have to clear the fleet and design names from enemy scans. So what do we put there? I'm leaving it blank (so players can't name their designs "War Pig Scout" and confuse people...). But then, I had to update the client to fill in "War Pig Scout" when it sees a scout with a blank name. Except, where does "War Pig" come from? Seems, we never added a place to store the names of known enemies (players start without knowing the names and ids of other player races).
So, then I had to update the PlayerData structure, and the toXML and parseXML, and the regression files...
In other news, I added a highlight to the path of the currently selected ship (not shown).
I also fixed the next turn generation in the client. Note, it just goes ahead and generates a multi-player turn when any one player hits generate...
I've fixed the clearing of private information from enemy scans. This was a lot more intrusive than I had imagined.
We have to clear the fleet and design names from enemy scans. So what do we put there? I'm leaving it blank (so players can't name their designs "War Pig Scout" and confuse people...). But then, I had to update the client to fill in "War Pig Scout" when it sees a scout with a blank name. Except, where does "War Pig" come from? Seems, we never added a place to store the names of known enemies (players start without knowing the names and ids of other player races).
So, then I had to update the PlayerData structure, and the toXML and parseXML, and the regression files...
In other news, I added a highlight to the path of the currently selected ship (not shown).
I also fixed the next turn generation in the client. Note, it just goes ahead and generates a multi-player turn when any one player hits generate...
Tuesday, April 01, 2008
Stuff I've read lately
"Old Man's War" (John Scalzi) - This is the first book in the series including "Ghost Brigades". I didn't mind reading them out of order, there is not much overlap. Scalzi has an interesting universe here, it will be interesting to see where he takes it.
Monday, March 31, 2008
Card Game Client
Friday, March 28, 2008
Stuff I've read lately
"Manifold: Space" (Stephen Baxter) - This is a continuation of the Manifold: Time "manifold universe". It is basically an alternate history (near future), where now there are many alien intelligences (thanks to our hero's efforts in the first book). Baxter attempts to deal with the Fermi paradox by claiming galactic catastrophes. I'm not familiar with the physics involved, but it wasn't real satisfying. I liked the first book better, but this one had some touching points, and some interesting tech.
Sunday, March 23, 2008
Card Game Client
I've gotten the hello protocol working. Here you can see a jumble as three clients connect to each other on my machine.

The network topology is arbitrary. That is, any client can act as a server for new players to join. In my example, the client on the left started serving. Then the client on the right connected. The first stopped serving, then the second started. The third client connected to the second. You can see the third client sees welcome from both when it connects. The original two only see the new player when added.
I need to add the in-game messages. And I should probably handle clients quitting gracefully...

The network topology is arbitrary. That is, any client can act as a server for new players to join. In my example, the client on the left started serving. Then the client on the right connected. The first stopped serving, then the second started. The third client connected to the second. You can see the third client sees welcome from both when it connects. The original two only see the new player when added.
I need to add the in-game messages. And I should probably handle clients quitting gracefully...
Saturday, March 22, 2008
Card Game Client
I haven't forgotten NewStars! I'll have another update soon...
But I have also thrown together a card game client (modeled after Apprentice). My client allows any card set, and will support any number of connected players (eventually). I have shuffling, drawing, and playing cards (including moving cards around) done.
Here is an odd nine card hand (and I forgot to shuffle until after drawing about six cards):

The main thing I need to add is the network messages for starting the game, and reflecting playing and re-arranging cards (I have the network connectivity [listen and call], as well as the code to reflect messages to everyone).
But I have also thrown together a card game client (modeled after Apprentice). My client allows any card set, and will support any number of connected players (eventually). I have shuffling, drawing, and playing cards (including moving cards around) done.
Here is an odd nine card hand (and I forgot to shuffle until after drawing about six cards):

The main thing I need to add is the network messages for starting the game, and reflecting playing and re-arranging cards (I have the network connectivity [listen and call], as well as the code to reflect messages to everyone).
Friday, March 14, 2008
Stuff I've read lately
"Manifold: Time" (Stephen Baxter) - I was very curious where Baxter was going with this book. He starts with solid premises: the promise of off earth expansion and the inevitability of entropy (heat death of the universe). This theme peaks about halfway through (~page 206), as the main characters watch a video stream from the end of time.
Turns out, Baxter is bootstrapping himself an alternate history series (not that there is anything wrong with that). I have started the second book (Manifold: Space). We'll see how it goes...
Turns out, Baxter is bootstrapping himself an alternate history series (not that there is anything wrong with that). I have started the second book (Manifold: Space). We'll see how it goes...
Friday, February 29, 2008
Stuff I've read lately
"Invader" (C. J. Cherry) - Second book in the "Foreigner" series. It picks up right where the last left off. Cherryh is always rough on her poor characters. But Cameron (the guy in this one) spends a lot of time struggling with a powerful sense of loneliness. Kind of unusual for Cherryh, but very well done.
"The Ghost Brigades" (John Scalzi) - Apparently this book is a sort of sequel to "Old Man's War". At least, it is set in the same universe. I will have to read that one, because it is a pretty interesting universe. Scalzi does a good job with building deep characters.
"The Ghost Brigades" (John Scalzi) - Apparently this book is a sort of sequel to "Old Man's War". At least, it is set in the same universe. I will have to read that one, because it is a pretty interesting universe. Scalzi does a good job with building deep characters.
Saturday, February 23, 2008
Stuff I've read lately
"The Android's Dream" (John Scalzi) - This is the first Scalzi book I've read. I find his humor to be unique, and I like it a lot. I found myself laughing out loud frequently (first book to do that to me was the Hitchhiker's Guide).
Friday, February 08, 2008
Stuff I've read lately
"The Far Side of the Stars" (David Drake) - This is the third novel in the Lt. Leary series. It is classic Drake, classic Lt. Leary. I was surprised to see an all-knowing tree, though. Don't normally see something so mystical from Drake. Of course, Leary uses it to find a bauble for his current employer, and protect his country from a sneak attack :).
Wednesday, January 30, 2008
Stuff I've read lately
"Diamond Dogs, Turquoise Days" (Alastair Reynolds) - This is two novellas bound together, set in the "Chasm City" universe. I found the first to be way too much "Cube" (although Reynolds is at least gracious enough to give Cube a nod). The second story, about an ocean of biological computers storing personalities, was much better. Although Reynolds tries to tie it back to the first in one line, which seemed a stretch.
"Foreigner" (C. J. Cherryh) - Classic Cherryh. Although the main character doesn't start his stress time until about one hundred pages from the end (of 373). The subtitle is "a novel of first contact", which I find an overexploited topic. Actually, it is a "novel about how first contact can seem to go well at first, then later it turns out the parties were talking past one another, leading to lots of misunderstanding and tragedy." Of course, that is too long for the subtitle :)
"Why the Ten Commandments Matter" (D. James Kennedy) - Reviewed on my faith blog.
"The Selfish Gene" (Richard Dawkins) - Reviewed on my faith blog.
"Foreigner" (C. J. Cherryh) - Classic Cherryh. Although the main character doesn't start his stress time until about one hundred pages from the end (of 373). The subtitle is "a novel of first contact", which I find an overexploited topic. Actually, it is a "novel about how first contact can seem to go well at first, then later it turns out the parties were talking past one another, leading to lots of misunderstanding and tragedy." Of course, that is too long for the subtitle :)
"Why the Ten Commandments Matter" (D. James Kennedy) - Reviewed on my faith blog.
"The Selfish Gene" (Richard Dawkins) - Reviewed on my faith blog.
Thursday, December 27, 2007
Stuff I've read lately
"Understanding the Dead Sea Scrolls" (Hershel Shanks ed.) - Reviewed on my faith blog.
"In the Shadow of the Ark" (Anne Provoost) - Ditto.
"In the Shadow of the Ark" (Anne Provoost) - Ditto.
Tuesday, December 18, 2007
Stuff I've read lately
"The Sharp End" (David Drake) - Drake delivers once again. You can always count on him for quality military SF. This story covers the less told story of a squad of Slammers sent to investigate new "business opportunities".
"The Bondage of the Will" (Martin Luther) - Reviewed on my faith blog.
"The Bondage of the Will" (Martin Luther) - Reviewed on my faith blog.
Saturday, December 08, 2007
New Stars Status
Friday, November 30, 2007
Stuff I've read lately
"Rainbows End" (Vernor Vinge) - Vinge hasn't written a lot of stuff. I've read his far future stuff (A fire upon the deepness in the sky), which is pretty good. This book is much nearer future. Wearable computing is nearly ubiquitous. And medical technology has gotten pretty good (the "heavenly minefield" as Vinge calls it). The book follows several viewpoints, but the key one is an Alzheimer's patient recently cured. He is trying to adapt to the new culture, and restore some of what he's lost (as well as finally maturing!).
Saturday, November 17, 2007
New Stars Status
Lots of minor problems need fixing. So, I grabbed a bunch and fixed them:

This is taken from the JOAT the turn after they detect the WM scout. I suspected the scan code was not clearing private info. Now I am sure...
- Selecting a planet crashes the program, if the production window has been closed.
- Fixed the update calls to check for the window's existance
- Added the "change production" button to bring the window back
- Defaulted the window to not be shown
- No enemy designs in the ship designer
- Added an interface from the nstclgui dll back to Tcl
- Updated the ship designer code to show it
- GUI oddities when clicking near planet names and fleet flight paths
- Fixed the ordering of canvas objects so planets are on top

This is taken from the JOAT the turn after they detect the WM scout. I suspected the scan code was not clearing private info. Now I am sure...
Wednesday, November 07, 2007
Hey Taxi!
I was looking for a fun little game to play when I get tired of whatever it is I'm working on. I'm tired of solitaire, and the statistics in free cell make it too stressful (same for spider solitaire).
So, I've started hacking Hey Taxi into Tcl. I worked on it about 5 minutes last night, and in less than a half hour this morning, I've got a pretty fun framework. Here's a screen shot:

I've bound up arrow to -10 Y acceleration. If you go below 0, you move up properly. Not sure how much I'll need to add to keep it fun... I think I at least want X thrust.
Update: I added X thrust.
Source for heytaxi.tcl
So, I've started hacking Hey Taxi into Tcl. I worked on it about 5 minutes last night, and in less than a half hour this morning, I've got a pretty fun framework. Here's a screen shot:

I've bound up arrow to -10 Y acceleration. If you go below 0, you move up properly. Not sure how much I'll need to add to keep it fun... I think I at least want X thrust.
Update: I added X thrust.
Source for heytaxi.tcl
set ::gravX 0
set ::gravY 1
set ::velX 1
set ::velY 1
set ::taxiID 0
proc eventLoop {} {
if {$::taxiID == 0} { return }
incr ::velX $::gravX
incr ::velY $::gravY
set coord [.c coords 1]
if {$::velY < 0 || [lindex $coord 3] < [.c cget -height]} {
.c move $::taxiID $::velX $::velY
}
after 1000 eventLoop
}
proc thrustUp {} {
incr ::velY -10
}
proc thrustLt {} {
incr ::velX -5
}
proc thrustRt {} {
incr ::velX 5
}
pack [frame .fVel] -side top
pack [label .fVel.lLX -text "X Velocity:"] -side left
pack [label .fVel.lVX -textvariable velX] -side left
pack [label .fVel.lVY -textvariable velY] -side right
pack [label .fVel.lLY -text "Y Velocity:"] -side right
pack [canvas .c] -side top
set ::taxiID [.c create rectangle 10 10 20 20 -fill yellow]
bind . <keypress-up> thrustUp
bind . <keypress-left> thrustLt
bind . <keypress-right> thrustRt
after 1 eventLoop
Thursday, November 01, 2007
New Stars Status
Small changes, but good.

I added the calculations for terraforming to the planet display. I haven't updated the environment bars to show the swing, but you can see the final habitability. I have also been working on correlating our planetary production formula to the original Stars algorithms.
Interesting thing, I found a "bug" in Stars. Stars keeps population in terms of kilotons (100 people per kiloton). When your population grows, you often generate some fraction of a kiloton of people (0..99 people). We weren't previously storing or calculating with this. When I added it, I noticed a difference between our calculations and Stars (the Stars.xls sheet has been invaluable).
So, should the fraction of a kiloton of people contribute to population growth? I thought so, but apparently, the fraction is kept on the side and added in after growth is calculated. I have implemented "bug compatibility", although the other way is commented in the code.

I added the calculations for terraforming to the planet display. I haven't updated the environment bars to show the swing, but you can see the final habitability. I have also been working on correlating our planetary production formula to the original Stars algorithms.
Interesting thing, I found a "bug" in Stars. Stars keeps population in terms of kilotons (100 people per kiloton). When your population grows, you often generate some fraction of a kiloton of people (0..99 people). We weren't previously storing or calculating with this. When I added it, I noticed a difference between our calculations and Stars (the Stars.xls sheet has been invaluable).
So, should the fraction of a kiloton of people contribute to population growth? I thought so, but apparently, the fraction is kept on the side and added in after growth is calculated. I have implemented "bug compatibility", although the other way is commented in the code.
Wednesday, October 31, 2007
Stuff I've read lately
"Glasshouse" (Charles Stross) - This book made Stross and Morgan start to run together in my head. Stross depicts another version of "life eternal" after the singularity. It didn't seem very pleasant. Hacked assemblers editing people's memories, huge wars fought across the galaxy against dictators willing to do anything. Life so painful, you willingly submit to have your memories erased. But at least Stross managed to fit in an interesting mystery :)
"The Creationists" (Ronald Numbers) - Reviewed on my faith blog.
"The Creationists" (Ronald Numbers) - Reviewed on my faith blog.
Saturday, October 20, 2007
New Stars Status
A lot of progress. Some highly visible, some more subtle.
I added the JOAT's final ships (destroyer and remote miner).

I fixed the scrap code to take into account the proper return (was just 100%, now it takes into account Ultimate Recycling, and presence of a starbase. (The JOAT immediately scraps his remote miner). I also had to update the client code to allow issuing the scrap command.

I finally fixed the client to show resources generated (currently pulled from the turn file, not calculated).

The availability of the destroyer also altered the scanning pattern for the JOAT:
I added the JOAT's final ships (destroyer and remote miner).

I fixed the scrap code to take into account the proper return (was just 100%, now it takes into account Ultimate Recycling, and presence of a starbase. (The JOAT immediately scraps his remote miner). I also had to update the client code to allow issuing the scrap command.

I finally fixed the client to show resources generated (currently pulled from the turn file, not calculated).

The availability of the destroyer also altered the scanning pattern for the JOAT:

Wednesday, October 17, 2007
What is Nuclear Fusion?
Normal matter (stuff) is made up of atoms. These atoms (normally) are made up of protons (positive particles) and neutrons (neutral particles) in a "nucleus", and surrounded by electrons (negative particles). The negative particles repulse other negative particles, while attracting positive particles. The positive particles act in the opposite manner.
In nuclear fusion, very high temperature and pressure are used to squeeze nuclei together. When done to lighter elements (hydrogen - 1 proton, and boron - 5 protons, are favorites), energy is released.
Nuclear fusion holds great potential for cheap, plentiful energy. Hydrogen and boron are very plentiful fuel sources. It is not free from radioactive concerns. Different forms of fusion involve different amounts of radioactive materials (inputs and byproducts). Some are somewhat higher than current fission reactors. Some are less.
The sun is an existence proof for fusion power. There, huge pressure is available due to gravity (the hydrogen is compressed to 150,000 kg/m^3). This allows fusion to occur at a relatively low temperature - 13.6 million degrees. At this temperature, the hydrogen gas becomes "plasma" - the fourth state of matter (after solid, liquid, and gas). In a plasma, the electrons are separated from their nuclei, and the whole thing can be manipulated using electromagnetic fields (very convenient for us).
A typical commercial power planet produces around 1 gigawatt (1 billion watts). Using fusion as the sun does would require 170 billion tons of hydrogen, in a cube-shaped reactor 1 mile on a side (and it would have to sustain the enormous pressure and heat of the sun).
Obviously, some innovation is required to make fusion power work here on Earth. The most promising current projects are:
In nuclear fusion, very high temperature and pressure are used to squeeze nuclei together. When done to lighter elements (hydrogen - 1 proton, and boron - 5 protons, are favorites), energy is released.
Nuclear fusion holds great potential for cheap, plentiful energy. Hydrogen and boron are very plentiful fuel sources. It is not free from radioactive concerns. Different forms of fusion involve different amounts of radioactive materials (inputs and byproducts). Some are somewhat higher than current fission reactors. Some are less.
The sun is an existence proof for fusion power. There, huge pressure is available due to gravity (the hydrogen is compressed to 150,000 kg/m^3). This allows fusion to occur at a relatively low temperature - 13.6 million degrees. At this temperature, the hydrogen gas becomes "plasma" - the fourth state of matter (after solid, liquid, and gas). In a plasma, the electrons are separated from their nuclei, and the whole thing can be manipulated using electromagnetic fields (very convenient for us).
A typical commercial power planet produces around 1 gigawatt (1 billion watts). Using fusion as the sun does would require 170 billion tons of hydrogen, in a cube-shaped reactor 1 mile on a side (and it would have to sustain the enormous pressure and heat of the sun).
Obviously, some innovation is required to make fusion power work here on Earth. The most promising current projects are:
- Tokamak - this is the most well funded type of project. A big donut-shaped container, surrounded by magnets, is used to hold the fusion plasma.
- Laser inertia - powerful lasers push two nuclei together directly. This is how fusion bombs work.
- Polywell - this design was championed by Robert Bussard (of Bussard ramjet fame). Unfortunately, Dr. Bussard died recently. The project is continuing without him.
Monday, October 15, 2007
Stuff I've read lately
"Broken Angels" (Richard Morgan) - This was the second book in the Takeshi Kovacs trilogy. If I had read them in the proper order, the whole Martian thing would probably made a whole lot more sense :)
"The Rebirth of Orthodoxy" (Thomas Oden) - Reviewed on my faith blog.
"The Rebirth of Orthodoxy" (Thomas Oden) - Reviewed on my faith blog.
Saturday, September 29, 2007
New Stars Status
Wow! I got to use polar coordinates (I couldn't remember how to figure it out with regular geometry :)

Here we have the JOAT turn 4. The JOAT's armed probe has been refueled, and is moving along. The WM's armed probe has been spotted by the planetary scanner. I still need to work out some information hiding.
I've also implemented the last direction logic (and draw it in the GUI).

Here we have the JOAT turn 4. The JOAT's armed probe has been refueled, and is moving along. The WM's armed probe has been spotted by the planetary scanner. I still need to work out some information hiding.
I've also implemented the last direction logic (and draw it in the GUI).
Friday, September 28, 2007
Stuff I've read lately
"The Jungle" (David Drake) - This is Drake's cover of the story "Clash by Night" by Henry Kuttner (which is at the back of the book). Not the greatest Drake (no real military action, just hacking through a very dangerous jungle). I think the most interesting part was that the two commanding officers each thought they personally were cowards, and the other man a true hero.
"Evolutionism and Creationism" (Ben Sonder) - Reviewed on my faith blog.
"Evolutionism and Creationism" (Ben Sonder) - Reviewed on my faith blog.
Wednesday, September 19, 2007
New Stars Status
Tuesday, September 18, 2007
Stuff I've read lately
"Woken Furies" (Richard K. Morgan) - Apparently the third Tak Kovacs book. Poor Tak, he seemed to be getting his rage/father anxiety under control at the end of Altered Carbon. But things took a turn for the worse at some point and he is raging again. I'm a little disappointed in Morgan for going with the "Martians" deux ex machina. They made some interesting flavor for his universe, but I don't like them as plot elements. In fact, I think he may have killed off this storyline, which is too bad.
"Kingdom Principles" (Myles Munroe) - Reviewed on my faith blog.
"Kingdom Principles" (Myles Munroe) - Reviewed on my faith blog.
Monday, September 17, 2007
Tech Level 8 Approaching!
"What do you mean, 'Tech Level 8 approaching?'"
"On a Hawkman rocket cycle. Shall I inform his majesty?"
"Idiot! The emperor would shoot you for interrupting his wedding with this news!"
(with apologies to Flash Gordon)
GURPS uses the concept of tech levels running from 1 to 16. There is a general, societal tech level, but it can also be broken out into categories like power generation, medicine, motive systems, etc. When GURPS was originally written (~1980's) first world nations were described as tech level 7.
So what is predicted for tech level 8?
"On a Hawkman rocket cycle. Shall I inform his majesty?"
"Idiot! The emperor would shoot you for interrupting his wedding with this news!"
(with apologies to Flash Gordon)
GURPS uses the concept of tech levels running from 1 to 16. There is a general, societal tech level, but it can also be broken out into categories like power generation, medicine, motive systems, etc. When GURPS was originally written (~1980's) first world nations were described as tech level 7.
So what is predicted for tech level 8?
- Computers are about 10 time more powerful. The GURPS authors beat themselves up a lot over this. Computers are probably thousands or millions of times more powerful from a frequency/number of transistors point of view. But from a functionality point of view, it's not too bad.
- Human cloning. This one looks on target.
- Prosthetics/Bionics. I think we are close on this one. The war in Iraq has been a big driver just in the last few years. We are getting pretty close to full functionality and look for prosthetics.
- Robots. I forget the exact capabilities for TL 8. But we are getting pretty good here. Things like humaniform and combat robots are not until TL 9 or 10.
- More efficient in-system space travel. I think the development of ion engines has made this possible. There is also some cool ideas in fission driven (but non-radioactive exhaust) rockets. Unfortunately, I doubt governments will do much innovation. The private sector might have some effect (but would they be allowed to develop a fission rocket?).
- Fusion power. Ahh, fusion power. Always twenty years away. One of the first things I researched on the world wide web (back in 1998). I'll look into this more depth.
Saturday, September 15, 2007
New Stars Status
Some good progress the last week. I discovered the "JOAT w/IFE" is actually a JOAT w/cheap engines. StructuralElement::isBuildable did not include LRT or PTR calculations.

This screen shot shows the changes in the client. I've always displayed fuel, but the engine was not giving ships their fuel. And moving was not consuming fuel. I've used the War Monger's armed probe to test running out of fuel, and initial speed selection (which ignores return trip, right now). Planetary scan also works (although you can't see it here).
Next step, I think, is to add more player orders to the Two Player test and re-create some of the other tests (fleet follow, combat, bombing, load-unload, and planetary invasion).
I will see what opportunities present themselves for adding some code useful for computer guys.

This screen shot shows the changes in the client. I've always displayed fuel, but the engine was not giving ships their fuel. And moving was not consuming fuel. I've used the War Monger's armed probe to test running out of fuel, and initial speed selection (which ignores return trip, right now). Planetary scan also works (although you can't see it here).
Next step, I think, is to add more player orders to the Two Player test and re-create some of the other tests (fleet follow, combat, bombing, load-unload, and planetary invasion).
I will see what opportunities present themselves for adding some code useful for computer guys.
Friday, September 07, 2007
Stuff I've read lately
"Altered Carbon" (Richard K. Morgan) - This book was very well done. Morgan creates a very interesting universe. People can be saved and restored, and transmitted digitally (and FTL). Bodies are considered temporary and interchangeable (people refer to them as "sleeves"). The main problem I had was trying to understand why more people don't have backups, and why rich people only have one. Also, why there weren't more crimes that carried the erasure penalty? "Double sleeving" (being in two bodies at once) was the only crime on Earth, most colony worlds didn't have any such crimes.
"The Probability of God" (Stephen Unwin) - Reviewed on my faith blog.
"The Probability of God" (Stephen Unwin) - Reviewed on my faith blog.
Thursday, September 06, 2007
New Stars Status
Things are starting to come together. I have worked mostly on the two player test case. I ended up going after the initial fleet code.
Here is the JOAT w/IFE player (the warmonger posted previously is the other):

Note that JOAT gives all tech at 3, and IFE is good for +1. The fuel mizer is available, so the starting long range scout makes use of it (as well as the Rhino Scanner). I expect a bug, in that IT plus IFE and CE gives Prop 7, which can use Alpha 8. But for some reason, Stars! only gives the Long Hump 7. I'm not worried enough to change anything.
Note that we are not seeding the random generator, so player 1 is back at Marge :)
Thanks to John for adding in all the scanners. I had added the Bat Scanner in XML myself, but I wasn't looking forward hacking in all the others.
I also hacked up a quick tech browser in pure Tcl (using tdom to parse the XML):

Next step will be to add the tech readouts to this, and probably making it editable to enable quick fixes.
For the engine, the next step is scan. Then I will modify the tests to send the scout before the colony ship.
Here is the JOAT w/IFE player (the warmonger posted previously is the other):

Note that JOAT gives all tech at 3, and IFE is good for +1. The fuel mizer is available, so the starting long range scout makes use of it (as well as the Rhino Scanner). I expect a bug, in that IT plus IFE and CE gives Prop 7, which can use Alpha 8. But for some reason, Stars! only gives the Long Hump 7. I'm not worried enough to change anything.
Note that we are not seeding the random generator, so player 1 is back at Marge :)
Thanks to John for adding in all the scanners. I had added the Bat Scanner in XML myself, but I wasn't looking forward hacking in all the others.
I also hacked up a quick tech browser in pure Tcl (using tdom to parse the XML):

Next step will be to add the tech readouts to this, and probably making it editable to enable quick fixes.
For the engine, the next step is scan. Then I will modify the tests to send the scout before the colony ship.
Saturday, September 01, 2007
New Stars Status
Some good progress on the code base. Not a lot visible, because a lot of it is in the initial conditions (making sure all players get the same mineral concentrations and minerals - trying to figure out the distribution of starting minerals).
I started work on the research control dialog, then discovered that players were not getting initial tech. I have it fixed for some of the races now.
I also took care of the initial conditions of the starting starbase (which was initially empty).
Another irritating bug was that the client would open to planetMap(0). That is just what planet is first in the client data. I've fixed it so it goes to the lowest object id planet you own.
The colonize test is looking really good. With initial minerals and factories, the colony ship builds fast, and can move and colonize in one turn. I am moving off of it for now (since the next step would be to give players the initial colony ship - which is supposed to be built with max available tech, which is the beginnings of computer players...).
I created a new two player test. This should be a base for the most of the other existing tests.
Here is the initial load of the war monger player, with a quick F5 to bring up the research panel:
I started work on the research control dialog, then discovered that players were not getting initial tech. I have it fixed for some of the races now.
I also took care of the initial conditions of the starting starbase (which was initially empty).
Another irritating bug was that the client would open to planetMap(0). That is just what planet is first in the client data. I've fixed it so it goes to the lowest object id planet you own.
The colonize test is looking really good. With initial minerals and factories, the colony ship builds fast, and can move and colonize in one turn. I am moving off of it for now (since the next step would be to give players the initial colony ship - which is supposed to be built with max available tech, which is the beginnings of computer players...).
I created a new two player test. This should be a base for the most of the other existing tests.
Here is the initial load of the war monger player, with a quick F5 to bring up the research panel:

Monday, August 27, 2007
Stuff I've read lately
"Remnant Population" (Elizabeth Moon) - meh. The story of an old woman contacting an alien civilization is just kind of weird. What really bugged me was a universe with both STL sleeper ships and FTL. It made me want to break out GURPS Vehicles and try to come up with an economic situation where that could possibly make sense.
"The Exemplary Husband" (Stuart Scott) - Reviewed on my faith blog.
"Once a Hero" (Elizabeth Moon) - This looks like a mil-SF book; but it's more like a drama set in a military background. I'll probably read one or two more in this series to see where she is taking it. That's three Elizabeth Moon books in a short span, I still like "Speed of Dark", but I'll probably take a break.
"The Exemplary Husband" (Stuart Scott) - Reviewed on my faith blog.
"Once a Hero" (Elizabeth Moon) - This looks like a mil-SF book; but it's more like a drama set in a military background. I'll probably read one or two more in this series to see where she is taking it. That's three Elizabeth Moon books in a short span, I still like "Speed of Dark", but I'll probably take a break.
Saturday, August 18, 2007
New Stars Status
Not much progress the last month.
I created a command line version of the client. It just loads the C++ New Stars Tcl library, and issues a bunch of commands. A lot of them use information eye-balled from the files. Here is a sample from orders2400.tcl (which updates the first turn file):
Another file is applied in 2403 to give the load colonist, move to planet, and colonize orders.
Here is the final screen shot:

I had to fix the server to properly update client object ids to server ids (I didn't see this before, because the client actually generates the turn through the client data - that's a bug...).
I also had to fix the client to properly use GUI load commands (otherwise you need another turn).
The mining rates are probably off. There is an oddity in the battle engine, in that the colony ship and star base try to fight. I need to add lots to the client to get a better feeling for how much ships cost and how long they will take to build.
I created a command line version of the client. It just loads the C++ New Stars Tcl library, and issues a bunch of commands. A lot of them use information eye-balled from the files. Here is a sample from orders2400.tcl (which updates the first turn file):
#### copy the colony ship
set colShipId -1
for {set i 0} {$i < $::numHulls} {incr i} {
if {[newStars $::ns_hull $i $::ns_getName] eq "Colony Ship"} {
set colShipId $i
}
}
Another file is applied in 2403 to give the load colonist, move to planet, and colonize orders.
Here is the final screen shot:

I had to fix the server to properly update client object ids to server ids (I didn't see this before, because the client actually generates the turn through the client data - that's a bug...).
I also had to fix the client to properly use GUI load commands (otherwise you need another turn).
The mining rates are probably off. There is an oddity in the battle engine, in that the colony ship and star base try to fight. I need to add lots to the client to get a better feeling for how much ships cost and how long they will take to build.
Wednesday, July 25, 2007
Stuff I've read lately
"The Speed of Dark" (Elizabeth Moon) - I liked this book a lot. On the surface, it is a book about autistic people. But it is also a book about being different. About trying to fit in, being pressured to fit in. Not just fit in, but to be like everyone else.
And everyone knows the speed of dark is faster than the speed of light (Neverending Story 2). That's why it's dark until light gets there. Dark got there first!
"Misquoting Jesus" (Bart Ehrman) - Reviewed on my faith blog.
And everyone knows the speed of dark is faster than the speed of light (Neverending Story 2). That's why it's dark until light gets there. Dark got there first!
"Misquoting Jesus" (Bart Ehrman) - Reviewed on my faith blog.
Monday, July 16, 2007
Gianormites of the World Unite!
Gianormous has made it into the dictionary! Except the dictioneers (who else compiles dictionaries?) misspelled it! Everyone knows it's giant-enormous, not gigantic-enormous. Their spelling (ginormous) looks like "djinn-or-mus". Blech!
So everyone needs to start using gianormous. Then the dictioneers can get it right next edition.
So everyone needs to start using gianormous. Then the dictioneers can get it right next edition.
Monday, July 09, 2007
New Stars Status
Ok, more progress. We almost have a game:

Here is page 2 of the New Game Wizard. I recreated the race from the colonize test (Ugly Ducklings), and made a tiny sparse game for them by themselves.
Here is the first turn in the client:

I've added 30 factories and 50 mines to autobuild. I had to fix the code to handle this. It would try to build the factories, see no G, and then skip to research. It now works. Here is 2401:

18% growth rate. 20 resources, mines are 5 per. Autobuild shows 0% done for all.

Next turn. 23,600 * 1.18 = 27,848. 23 resources gives 2 factories, and 1 at 30%. Mining rates may be off... concentrations are 80, 76, 20. I forget how to calculate it right now... Original G must of been 15 or 16.
I need to repair the regression. Lots of them have uninhabitable home worlds. The old code was more forgiving of this...
I'd also like to develop a command line version of the client (for regressions to insert player commands).
Then I will add the intervening turns to colonize test, to make it a new game -> first world colonized test. Then I can check the numbers.
Here is page 2 of the New Game Wizard. I recreated the race from the colonize test (Ugly Ducklings), and made a tiny sparse game for them by themselves.
Here is the first turn in the client:
I've added 30 factories and 50 mines to autobuild. I had to fix the code to handle this. It would try to build the factories, see no G, and then skip to research. It now works. Here is 2401:

18% growth rate. 20 resources, mines are 5 per. Autobuild shows 0% done for all.

Next turn. 23,600 * 1.18 = 27,848. 23 resources gives 2 factories, and 1 at 30%. Mining rates may be off... concentrations are 80, 76, 20. I forget how to calculate it right now... Original G must of been 15 or 16.
I need to repair the regression. Lots of them have uninhabitable home worlds. The old code was more forgiving of this...
I'd also like to develop a command line version of the client (for regressions to insert player commands).
Then I will add the intervening turns to colonize test, to make it a new game -> first world colonized test. Then I can check the numbers.
Subscribe to:
Posts (Atom)