I'm always interested in world building, and I saw some talk about generating entire spheres of hexes. This is not straight forward, since you can't make a sphere entirely out of hexes (you usually get twelve pentagons).
I saw one guy who embraced the variation, and would randomly make more pentagons (with a septagon to balance each past twelve). He also moved the points around, so the whole map is a little irregular.
There is another project - HexPlanet, which just has the twelve pentagons. I've found that code a lot easier to work with, and when you have 100k+ hexes, twelve pentagons is hardly noticeable...
I've finally got it into a state where I can easily generate some map data. Here is sphere 9, which is nearly 200k hexes. I should be able to get sphere 10 working (nearly 600k hexes), with an stretch goal of sphere 11 (should be over 1.5M hexes).
The terrain is a little hard to see, since it is entirely random. But you can see how small the hexes are in sphere 9.
Friday, April 24, 2015
Friday, September 05, 2014
Youtube Filter Extension - Inception
There are a lot of young kids watching Youtube videos. I went looking for the parental controls, and found Google's statement: Youtube is for people 13 and over. To which I respond, hahahahahahaha
I thought about using a Squid proxy, but the video is encoded into a GET request, which Squid didn't seem ready to handle...
Then I saw this extension, and it looks like a good way forward...
I thought about using a Squid proxy, but the video is encoded into a GET request, which Squid didn't seem ready to handle...
Then I saw this extension, and it looks like a good way forward...
Monday, August 11, 2014
Bridgehead
"Bridgehead" (David Drake) - I was unpleasantly surprised by this book. I expect a lot more from Drake, and this was not up to his usual standard. He took an unusual idea (FTL via some sort of row and column based system), and wrapped it up in a lot of mystery and drama (which are not his strong suit). The combat was a fairly minor part of the book, and always one-sided.
Tuesday, June 10, 2014
C++: make the simple case broken
I've been programming C++ for twenty years, and I learned something yesterday about a fundamental class that I use a lot...
int main(int argc, char **argv)
{
std::map<int, int> myMap;
myMap.insert(std::make_pair(0, 1));
myMap.insert(std::make_pair(0, 2));
printf("%d\n", myMap[0]);
return 0;
}
int main(int argc, char **argv)
{
std::map<int, int> myMap;
myMap.insert(std::make_pair(0, 1));
myMap.insert(std::make_pair(0, 2));
printf("%d\n", myMap[0]);
return 0;
}
What should this program print? 1 or 2? If you said 2, you'd be horribly wrong!
Because, sometimes, you just want your insert operations to fail.
If you don't want total failure, you need to write:
int main(int argc, char **argv)
{
std::map<int, int> myMap;
myMap.insert(std::make_pair(0, 1));
std::pair::iterator, bool> i = myMap.insert(std::make_pair(0, 2));
if (!i.second)
i.first->second = 2;
printf("%d\n", myMap[0]);
return 0;
}
That's why I love C++.
Tuesday, April 08, 2014
Crowdsourcing your brainstorming
Back in the days of Mudge, it was easy to brainstorm an idea like industrial applications of black holes.
Now, it's harder.
I figured I would make use of the largest collection of nerds that I know about - Reddit (seeing as how Slashdot has gone down the tubes).
Reddit is divided into groups, and finding the right one can be somewhat of a challenge.
The most direct would be /r/AskScience, since it is really a science question (or, applied science). But they take a dim view on science fictiony things.
There is also /r/AskScienceFiction, which sounds perfect. Except, everything there is in role-playing form (it should be /r/AskLARP or something). There are other more conceptual/design subreddits, but they are all low traffic.
So, I just had to ask my question in a RP fashion, and try and make sense of RP answers.
The answers weren't spectacular. But I must give credit to /u/Sriad for the best one. I had thought about using extreme matter compression, but I was thinking of something like a diamond press (which would not be forceful enough). Treating it more like a fusion bomb makes a lot of sense.
Now, it's harder.
I figured I would make use of the largest collection of nerds that I know about - Reddit (seeing as how Slashdot has gone down the tubes).
Reddit is divided into groups, and finding the right one can be somewhat of a challenge.
The most direct would be /r/AskScience, since it is really a science question (or, applied science). But they take a dim view on science fictiony things.
There is also /r/AskScienceFiction, which sounds perfect. Except, everything there is in role-playing form (it should be /r/AskLARP or something). There are other more conceptual/design subreddits, but they are all low traffic.
So, I just had to ask my question in a RP fashion, and try and make sense of RP answers.
The answers weren't spectacular. But I must give credit to /u/Sriad for the best one. I had thought about using extreme matter compression, but I was thinking of something like a diamond press (which would not be forceful enough). Treating it more like a fusion bomb makes a lot of sense.
Thursday, December 12, 2013
"Trader's World"
"Trader's World" (Charles Sheffield) - I am really liking Sheffield. This book reads like the Golden Age of SF, but is from 1988. Reminds me of the Stainless Steel Rat. Earth is recovering from WWIII, and the traders hold together the big nations through diplomacy and trade.
Saturday, November 30, 2013
Starfarers
"Starfarers" (Poul Anderson) - I'm not sure what to say about this book. The main idea is the development of a zero energy reactionless drive (so, no FTL, but lots of STL). The story is told in two parts, the first follows the first star ship (traveling thousands of light years towards signs of other reactionless ships); the second follows the second generation explorers, settlers, and traders.
The two stories help to break up some of the monotony (not much happens in 495 pages - at one point, I broke out the old "I'm sorry, my friend, but you must die to make the movie more interesting!"). However, it seems like the whole thing could have been made shorter.
The two stories help to break up some of the monotony (not much happens in 495 pages - at one point, I broke out the old "I'm sorry, my friend, but you must die to make the movie more interesting!"). However, it seems like the whole thing could have been made shorter.
Wednesday, November 20, 2013
Saturday, September 14, 2013
Voxel Worlds
I think I need to work on some sort of voxel world building game (aka Minecraft - or should I say, NedCraft, MiNed?)
Some numbers:
Figure 1 GB allocated for the world (which should fit nicely into memory on modern machines - you could go to 2 or 4, but not 10 or 20 yet). One byte per block gives 255 active textures (plus empty). That should be plenty (Minecraft has a ton of items and creatures, but those can be handled separately).
1e9 blocks sounds like a lot, until you start trying to fill a globe with them...
That's 1000 blocks cube, if each block is one meter, that's only a 1km cube (which is a pretty small planet).
You might use a lazy system for allocating, but that opens the possibility of the total storage growing enormous over time.
It seems better to limit the depth, and spread the blocks over a greater area...
Of course, you need some volume above the surface as well...
500 m high, 500 m deep... 1 GB goes fast!
Some numbers:
Figure 1 GB allocated for the world (which should fit nicely into memory on modern machines - you could go to 2 or 4, but not 10 or 20 yet). One byte per block gives 255 active textures (plus empty). That should be plenty (Minecraft has a ton of items and creatures, but those can be handled separately).
1e9 blocks sounds like a lot, until you start trying to fill a globe with them...
That's 1000 blocks cube, if each block is one meter, that's only a 1km cube (which is a pretty small planet).
You might use a lazy system for allocating, but that opens the possibility of the total storage growing enormous over time.
It seems better to limit the depth, and spread the blocks over a greater area...
Of course, you need some volume above the surface as well...
500 m high, 500 m deep... 1 GB goes fast!
Wednesday, August 28, 2013
Soylent People Are Green!
(you know, green, like they care about the environment)
I seem to remember something about some guy trying to develop a food replacement blend. I didn't think much of it until I saw it on Ars, and checked out the blog.
There is something in geek culture called "life hacking". Just like you might hack software or hardware to scratch an itch, you can hack your body to make it a little better.
That's the approach here - the creator started with a personal project (simplify meals), and is now open sourcing it for everyone. I think it will be interesting.
I seem to remember something about some guy trying to develop a food replacement blend. I didn't think much of it until I saw it on Ars, and checked out the blog.
"Suppose we had a default meal that was the nutritional equivalent of water: cheap, healthy, convenient and ubiquitous."
There is something in geek culture called "life hacking". Just like you might hack software or hardware to scratch an itch, you can hack your body to make it a little better.
That's the approach here - the creator started with a personal project (simplify meals), and is now open sourcing it for everyone. I think it will be interesting.
Sunday, June 16, 2013
Gentoo Defeated Me
You know it's bad when you start thinking about finishing your own operating system, rather than wrestling with getting an existing one to work...
My old laptop has Ubuntu 10.4 (which expired June 1). Lots of stuff has started breaking, I've known I needed to update the OS for a long time.
I hate 12.4 (which was the natural upgrade), so I figured I would try Gentoo. I'd be able to build any software I need.
I've been trying to build Gentoo on two machines since December. Neither works. They have different processors and graphics, but, ironically, they both fail in the same place (X server fails to load KMS module).
I just pulled the Gentoo live DVD, and it looks good. X starts up (although my wireless isn't recognized...). I looked for a "Install this!" button, but alas, no such thing.
I searched for "Install Gentoo from live dvd". I found a forum post which pointed to a wiki page. The wiki page wouldn't load, so I had to go through the Google cache, only to discover the page was deleted - due to incompatible license. Wonderful.
My old laptop has Ubuntu 10.4 (which expired June 1). Lots of stuff has started breaking, I've known I needed to update the OS for a long time.
I hate 12.4 (which was the natural upgrade), so I figured I would try Gentoo. I'd be able to build any software I need.
I've been trying to build Gentoo on two machines since December. Neither works. They have different processors and graphics, but, ironically, they both fail in the same place (X server fails to load KMS module).
I just pulled the Gentoo live DVD, and it looks good. X starts up (although my wireless isn't recognized...). I looked for a "Install this!" button, but alas, no such thing.
I searched for "Install Gentoo from live dvd". I found a forum post which pointed to a wiki page. The wiki page wouldn't load, so I had to go through the Google cache, only to discover the page was deleted - due to incompatible license. Wonderful.
Sunday, September 23, 2012
LoN for Noobs: Starting Out
Light of Nova has its own unique quirks which set traps for the unwary, and hide gems from the uninformed. I'll try and shed some light on them:
You want a governor with metal or crystal skill (ideally both, but that rarely happens). Fuel is useless. Crystal is needed for research, while metal is needed for advanced flagships.
Your main fighter will have tempest skill (and ideally vulcan or destroyer). This is because the computer guys love fighters and are optimized for killing cruisers and battleships (and fighters are too flimsy for big fights).
You will get fifteen commanders over time, and have upwards of six planets (each needs a governor). You will want a battleship commander, and Longbow commanders are good for killing enemy player's flagships.
Use your experience potions on your governor (your fighter will get plenty of xp from fighting). Don't worry too much about rank at first. You can rank up your governor with medals a couple times to get him more points for politics skill and his resource specialization.
- Starting out, don't worry about any mothership modules apart from crystal and metal gathering. Build the others to collect the training rewards, but focus on these two. (I'll post a queuing guide next)
- Do the first adventure - that will give you a new commander. The next commander is a ways in. Best to hit those with better tech.
- Find a governor and a main fighter.
You want a governor with metal or crystal skill (ideally both, but that rarely happens). Fuel is useless. Crystal is needed for research, while metal is needed for advanced flagships.
Your main fighter will have tempest skill (and ideally vulcan or destroyer). This is because the computer guys love fighters and are optimized for killing cruisers and battleships (and fighters are too flimsy for big fights).
You will get fifteen commanders over time, and have upwards of six planets (each needs a governor). You will want a battleship commander, and Longbow commanders are good for killing enemy player's flagships.
Use your experience potions on your governor (your fighter will get plenty of xp from fighting). Don't worry too much about rank at first. You can rank up your governor with medals a couple times to get him more points for politics skill and his resource specialization.
Light of Nova
I finally found a Stars-like that people are playing (and it was even on Facebook!)
The mechanics are pretty straightforward (build, build, build), and politics plays a pretty important part. There is even a story that is not entirely terrible.
And I've got a spreadsheet!
The mechanics are pretty straightforward (build, build, build), and politics plays a pretty important part. There is even a story that is not entirely terrible.
And I've got a spreadsheet!
Wednesday, August 22, 2012
Manic Digger
Been having a blast in Manic Digger.
It's an open source clone of Minecraft. One of the cool features is seasons; in the winter, the top layer of water freezes, and you can pick up "water" blocks.
Then, you can take those blocks and drop them somewhere, and create waterfalls.
The mountain on the left has already been covered, and you can see the water starting to flow on the mountain in the distant center.
I was working in a mine when the water hit the bottom, and found myself having to fight a flood in!
It's an open source clone of Minecraft. One of the cool features is seasons; in the winter, the top layer of water freezes, and you can pick up "water" blocks.
Then, you can take those blocks and drop them somewhere, and create waterfalls.
The mountain on the left has already been covered, and you can see the water starting to flow on the mountain in the distant center.
I was working in a mine when the water hit the bottom, and found myself having to fight a flood in!
Friday, April 20, 2012
Hell's Faire
"Hell's Faire" (John Rngo) - This is the fourth book in the Posleen trilogy. Apparently, Ringo was finishing the third book when 9/11 happened, and got writer's block through press time. This book continues where the third left off (plus a small - "we last left our heros"), and finishes the war on Earth.
Ringo says in the afterword that this series was written for his enjoyment (not intended for publishing). If you don't take it too seriously, it is definitely fun. The Sheva (named Bun Bun, after Sluggy Freelance) gets up-armored and close support weapons and fights its way towards the main character.
Ringo says in the afterword that this series was written for his enjoyment (not intended for publishing). If you don't take it too seriously, it is definitely fun. The Sheva (named Bun Bun, after Sluggy Freelance) gets up-armored and close support weapons and fights its way towards the main character.
Friday, April 06, 2012
Blackhole Applications
I've been trying to work through some of the implications of constructing and using artificial black holes.
It's particularly interesting, because the numbers are very constrained: either you get a lot of power for a short time (and light mass), or less power for longer time (and high mass).
My latest problem is dealing with increasing power over the lifetime. A hole which is going to last 20 years, will deliver 66% more power after just 10 years (and things start to get out of hand after that).
I see several possibilities:
This also brings up another issue: disposal (or recharging) of holes.
When a hole hits about 2.28e5 kg, the lifetime is roughly 1 second - that's 2e22 J released in one second (so, Watts).
Basically an enormous bomb (almost 5 million megatons of TNT).
Easy disposal is to chuck the thing into the sun before it gets to this point. But that needs to be included in the cost - you're building up a lot of energy which you are going to throw away.
"Recharging" would require putting mass back into the hole (which is likely pouring out gigawatts of hard x-rays and gamma rays). Not an easy task.
It's particularly interesting, because the numbers are very constrained: either you get a lot of power for a short time (and light mass), or less power for longer time (and high mass).
My latest problem is dealing with increasing power over the lifetime. A hole which is going to last 20 years, will deliver 66% more power after just 10 years (and things start to get out of hand after that).
I see several possibilities:
- Design for final power - with longer lasting holes, this isn't too bad. An 800 year hole (6.7e8 kg) will produce just 10% more power after 100 years. But with our 20 year hole, you are significantly underpowered (or over-engineered) for most of your usable life.
- Refit over time - either transplant the hole into a new hull every once in a while, or perform deep reconstruction every few years. This seems possible, but you need to make sure you don't miss a refit!
This also brings up another issue: disposal (or recharging) of holes.
When a hole hits about 2.28e5 kg, the lifetime is roughly 1 second - that's 2e22 J released in one second (so, Watts).
Basically an enormous bomb (almost 5 million megatons of TNT).
Easy disposal is to chuck the thing into the sun before it gets to this point. But that needs to be included in the cost - you're building up a lot of energy which you are going to throw away.
"Recharging" would require putting mass back into the hole (which is likely pouring out gigawatts of hard x-rays and gamma rays). Not an easy task.
Thursday, April 05, 2012
Solar Germany
A fascinating post from Ars:
I recently heard Germany was going to shut down all their nuclear reactors. I figured they were on a trend to freeze to death just before the lights go out (I'm pessimistic like that :)
From Wikipedia:
That is a _lot_ of solar panels. There are a lot of factors, but there is only about 1 KW/m^2 to work with (and efficiency should cut into that hard).
Or, at least 25 million square meters of panel!
US production from solar? 0.9 GW (2010) - yay us.
"That has rocketed from an installed capacity of 6GW in 2008 to 25GW in 2011—amounting to half the world's installed solar power, with 7.5GW installed in that year alone."The article has some interesting data about the bulk price of electricity, but I was startled by these numbers.
I recently heard Germany was going to shut down all their nuclear reactors. I figured they were on a trend to freeze to death just before the lights go out (I'm pessimistic like that :)
From Wikipedia:
"The installed nuclear power capacity in Germany was 20 GW in 2008 and 21 GW in 2004."So recent solar panel installations have nearly replaced nuclear.
That is a _lot_ of solar panels. There are a lot of factors, but there is only about 1 KW/m^2 to work with (and efficiency should cut into that hard).
Or, at least 25 million square meters of panel!
US production from solar? 0.9 GW (2010) - yay us.
Tuesday, March 27, 2012
When the Devil Dances
"When the Devil Dances" (John Ringo) - The third book of the Posleen War. Word on the street is this and the fourth book were supposed to be combined to make a trilogy.
It should be no surprise that I like things "epic" (very large). That's why I prefer Babylon 5 to DS9, and elements of Star Wars over Star Trek.
So, I was initially very excited about Ringo's SheVa (Shenandoah Valley) tank. Basically, a shuttle crawler armed with a cannon. It's about three times bigger, and nuclear powered. The gun fires a high velocity DU round, with an anti-matter charge.
I was compelled to break out GURPS Vehicles and start drawing it up, but the only discussion on the net I could find was at Star Destroyer dot Net. What a bunch of wet blankets!
They've soured the experience some for me, but, overall, I remember this third book as being in line with the first two - and enjoyable.
The first book introduced the setting, and the Posleen enemy. All the action takes place off Earth. The second book covers the initial landing on the east coast (Virginia and DC). The third book pulls a Dune, and skips ahead 5 years, after the Posleen have conquered much of the world. The middle of the US is still holding out, with the Appalachians acting as a Great Wall (and army elements plugging the passes).
The power armor units have taken heavy casualties, and we get more insight into the Posleen, as some of them start to smarten up after humans have killed off all the dumb ones.
It should be no surprise that I like things "epic" (very large). That's why I prefer Babylon 5 to DS9, and elements of Star Wars over Star Trek.
So, I was initially very excited about Ringo's SheVa (Shenandoah Valley) tank. Basically, a shuttle crawler armed with a cannon. It's about three times bigger, and nuclear powered. The gun fires a high velocity DU round, with an anti-matter charge.
I was compelled to break out GURPS Vehicles and start drawing it up, but the only discussion on the net I could find was at Star Destroyer dot Net. What a bunch of wet blankets!
They've soured the experience some for me, but, overall, I remember this third book as being in line with the first two - and enjoyable.
The first book introduced the setting, and the Posleen enemy. All the action takes place off Earth. The second book covers the initial landing on the east coast (Virginia and DC). The third book pulls a Dune, and skips ahead 5 years, after the Posleen have conquered much of the world. The middle of the US is still holding out, with the Appalachians acting as a Great Wall (and army elements plugging the passes).
The power armor units have taken heavy casualties, and we get more insight into the Posleen, as some of them start to smarten up after humans have killed off all the dumb ones.
Thursday, March 22, 2012
C++ Remove Thyself!
Came up against a nasty bug recently...
What do you think the following code does? (You shouldn't need to be a programmer to guess)
(this looks hideously over wordy...)
Maybe, remove all the items matching "cheese" between the beginning to the end of the container 'myArray'?
Good guess! And if you read the docs, you might think that...
What it actually does is shuffle the elements so that there are no items matching "cheese" near the front of the container. It returns a pointer to the last valid element.
This means you have to do:
(wow! they found an even more hideous way to write code!)
There's even a Wikipedia page! Erase-remove idiom
Sounds kind of ominous...
So, if you ever used std::remove, check all your code for this bug!
Enjoy!
What do you think the following code does? (You shouldn't need to be a programmer to guess)
std::remove(myArray.begin(), myArray.end(), "cheese");
(this looks hideously over wordy...)
Maybe, remove all the items matching "cheese" between the beginning to the end of the container 'myArray'?
Good guess! And if you read the docs, you might think that...
What it actually does is shuffle the elements so that there are no items matching "cheese" near the front of the container. It returns a pointer to the last valid element.
This means you have to do:
std::erase(std::remove(myArray.begin(), myArray.end(), "cheese"), myArray.end());
(wow! they found an even more hideous way to write code!)
There's even a Wikipedia page! Erase-remove idiom
Sounds kind of ominous...
So, if you ever used std::remove, check all your code for this bug!
Enjoy!
Tuesday, March 13, 2012
Gust Front
"Gust Front" (John Ringo) - The second Posleen book. I often imagine how movies might be made of books I am reading. I think this one has real potential to be something memorable (of course, it could be done as another forgettable version of "Independence Day").
There is a lot character and "big ideas" (sacrifice, etc).
There is a lot character and "big ideas" (sacrifice, etc).
Subscribe to:
Posts (Atom)