Thursday, December 6, 2012

Timesink part 13: Not dead

Been a while since I posted anything, so I thought I would say everything is still going.

Minecraft has gone through a number of updates, and as a consequence I decided to roll a new world. As this is version 2 of the idea, I realized the number of cities I had created was far too many. 30+ abandoned cities might be great on a server with a hundred or more players, but the server I admin has under 20 players, and there are rarely more than five people on at a time. For that reason, I have lowered the total number of cities to 19.

Along the way, I have revised and extended my various scripts. Right now I have two basic ones: cityPlacer.py and mapExplorer.py

The cityPlacer is pretty straight forward: it uses method I described previously to teleport an admin around the world, leave them in a spot to allow cities to generate around them, and then moves them to their next spot. The mapExplorer script is pretty cool, though. It, too, teleports the player around, but it does so only to expose a map the player holds.

In this way I can have maps for each city without having to manually fly around. An interesting consequence of this is if the rate of teleporting is high enough, the maps will not fully render. This creates a really delightful ancient feel to the maps.

Being able to automate the exploration of the city centers is pretty sweet.

In upcoming posts, I'll share the new look of the teleportation gates.

Sunday, July 8, 2012

Timesink part 12: Something H found

After writing some basic text introducing the player to H and their notes, and ending by saying that H was going through the gates, I needed to find someplace interesting for H to set up shop.

This is complicated slightly because the server is "live" in that there are players on it. They have figured out how to use the gates in a simple fashion and go on trips, which meant anyplace I found had to be somewhat isolated. I chose a location that is a few gate trips away from the spawn gate in the thought that the further away, the less chance of being visited. I also scouted the area looking for evidence that people had been visiting. It was a nice area: hilly, but with lots of water, which meant the architectural style is patterned after the Maya, but it also has sort of stilt houses built on water. I found a temple not too far from the gate with a house, which meant H could have a home near what he found in the temple.

 So, what did H find? A sort of map room showing a global view of where cities are in the world. The interior of the temple was hollow, which gave me lots of floor space, so I started by making a series of concentric circles. From the top of the temple I took a screenshot and overlaid it with a spiral plot of city locations (discussed inpost 10).
Concentric circles with the city-spiral map overlay
It is hard to tell in the above image, but the actual city locations are small blue circles. In each of these locations I placed a redstone lamp and started wiring each spiral arm up. The end result, as seen from the top, is pretty darned good.

Map as seen from above.
The map isn't really meant to be seen from straight above, though. It's meant to be viewed from a special area where the player steps on pressure plates. Each plate lights up a different spiral arm and plays a different musical note. Hopefully the players will start to figure out the musical connection to the gate addresses. If not, H will lay it all out in one of his notes.

Since the map is really meant to be seen in action, how about a video? 


Maybe more notes from H next time.


Wednesday, July 4, 2012

Timesink: Redstone interlude

I've been working on an abandoned building that H finds which has a map of the cities on the floor in the form of redstone lamps.

Since I'm still working on it, I'll share this:



More soon.

Tuesday, June 5, 2012

Timesink part 11: "H"

When I started planning all this, I knew I wanted there to be a series of notes left for the player. There's a delightful bukkit plugin called Courier which let's one use maps as notes. It's really very neat. It might be outdated when writable books are introduced in the next Minecraft release, but the maps are great for now.

The notes are left by a character the player never sees, and the notes are only signed "H". "H" is someone that awoke in the strange world of minecraft, and started keeping a journal. It is meant to act as both story facilitator and tutorial. God, Minecraft needs some sort of tutorial. Hey Mojang: I have an idea on how to provide a tutorial that seasoned played would approve of. Drop me a line, huh?

The more astute reader that happens to play Minecraft might be able to guess who "H" is, in the end. But let's not drop that spoiler just yet. Suffice it to say that things don't go well for "H", and they don't make it home again. They're trapped forever. (For those that have figured it out: wouldn't a tutorial as told by H be a great tie in?)

Ok. Here are some drafts of the notes written by "H". Maybe too many? The idea will be to place them in various places "H" will have stayed. So, once the player is on the trail of "H", they can follow and find more notes. In time, these notes should help the player learn how to correctly operate the gate network, build their own gates from scratch, and eventually explain what happened to these cities and, what became of "H".


If you are reading this note, you have somehow found your way to this...place. I have been here for a few days and still don't know where I am or even how I arrived here. I went to bed and when I awoke, I was standing in the center of a stone ring. Perhaps the same happened to you.
Luckily I was able to find this nearby village. In the time I have been here the locals have not uttered a single word. I wonder if they can talk.... I have tried to get information about this place using gestures, but they either don't understand, or don't care.
Or maybe they they know the answers themselves.
-H
===================
I've come to the conclusion that the natives did not construct the stone circles. I don't think they built this large building--I think of it as "the storehouse" because it has so many chests--either. The architecture is too different from the other buildings here. The same goes for the market square with the colourful stalls and small fountain. But if they didn't build the stone rings and the other, obviously different structures, who did? It's almost like this place was built as a place to trade with the natives. But where are the builders, and can they help me get home. 
I'm settling into my bedroom, and least I am comfortable.
-H
===================
What is this horrible place! When I arrived, there was a new moon in the sky. Over the past several days I have noticed the villages become extremely agitated at night, rushing into their homes and refusing to emerge until the morning. I have heard some things in the night, but didn't think anything of them. 
But tonight is the new moon and the might is full of horrors! There are things that can not be in the dark. Half rotten beings assault the doors in the village. I saw one zombie succeed in entering a home and the inhabitance.... Skeletons--SKELETONS--walk the streets, firing arrows at anyone unwise enough to go out. Green...things silently lurk in the dark and giant spiders roam the landscape. 
Through the town giant iron men patrol the streets, battling the night creatures. These robots, these golems of iron attack everything up the green creatures. 
I have fled the comforts and warmth of the guest rooms and moved into this dank cellar. 
Tomorrow I will do what I can to hide this place. And I must have weapons.
-H
=================
The new moon has passed and the diversity of creatures in the night is decreasing. Maybe with the full moon the creatures will be gone. 
I have fashioned a simple pickaxe and have begun looking for iron. Coal is plentiful, so I hope I will be able to build a simple furnace for smelting iron. With metals comes machined tools.
-H
================
If you had told me I would be able to work diamond into tools, I would have doubted you. But here.... What is this place?
-H
===============
The creatures are back, but I feel safe in my subterranean home. I'm still very frightened by the creatures in the night, and dread to think about the villagers, but I also know that the strange iron golem will protect them. 
I have made a curious discovery. There are strange red stones found deep un the earth. I initially tried to mine them using my iron tools, but they disintegrated. My bizarre diamond pickaxe was able to extract them however. The ore, when struck, glows with a light of its own. My initial fear was that they were radioactive, but I do not believe so, now. Whatever these red stones are, they can be used as an inextinguishable source of light. One can also draw on surfaces, like chalk, and the red stone dust will convey power certain distances. 
This gives me ideas on how to better hide my home.
-H
================
I have turned my attentions to the stone circle, trying to understand its purpose. It's clear that the upright ring is composed mainly of obsidian, with a single block of lapis lazuli in the base's center. The glowing block is yet another mystery, as is the sign. Domanvisce. Is that the name of this place? Maybe some warning? When I first arrived I did not notice the water bucket that hovers. I can see it, yet can not touch it. Another mystery. This place is maddening. 
There is a button, and when I press it, an apparatus lights up, but that is all. Could the ring be a mechanism of some sort?
-H
================
While exploring, I came across a statue of a sphinx to the southeast of the village. I am embarrassed I had not seen it before. The black sphinx rests upon a huge sandstone base. I am slightly embarrassed to say I began tunneling into the base. I can't really say what for. I was driven by the stories about the great treasures of Egypt. 
I immediately broke through into a large chamber. There were more of the strange hovering items, and a chest full of redstone, signs, and obsidian. I was this a storehouse? I claimed the redstone but left the rest behind and bricked up the opening. I do not know if the villages would dare loot from the statue, and I feared they might become angry if they saw the damage I had caused.
-H
================
I have discovered an entrance to the mechanism of the ring! I believe it is a machine. There are a series of red stone wires drawn onto the floor, leading to and from a number of devices, eventually ending at a second sign, repeating the same word: domanvisce. It's my hope that I'll be able to repair the device, but I need to mine for more of the redstone; I used all I had found for torches.
-H
================
An astounding discovery! While mining, I came across a small vein of lapis lazuli. After I had extracted it, I was cleaning one of the shards, accidentally hit it against a stone, and suddenly found myself standing at the stone ring. I thought I had gone mad (madder?) but upon making the motions like I was going set down a block, or make a redstone wire, I was again transported to the stone circle. No matter where I have gone, the lapis lazuli fragment will bring me back to the ring. Quite a handy thing to remember. I swear I will never set out without at least one fragment.
-H
================
Repairing the ring's mechanism was simple in the end. There was a single wire which had broken. Now the strange current flows from the button and produces musical notes from the mechanisms. Thus far, I have only activated the machine from the interior. It grew too late in the day for me to stay out and try the mechanism. Tomorrow I will see what the ring does.
-H
================
Thank god I always carry a piece of lapis lazuli with me, now. If I hadn't I fear I would be lost! Well, more lost than I am just being in this land. 
I activated the gate and it was filled with beautiful, clear water, but it did not cascade down. It remained within the confines of the ring. Another wonder. I stepped forward and touched the water and suddenly found myself in another place, at another gate! All about the outside, objects floated: earth, a water bucket, a torch, a feather, plant, egg, and a piece of redstone. Another sign hung, visible from the gate--Derclocdoman--and surrounding me were numerous buildings, all in a style unlike what I had grown accustomed. Unlike in Domanvisce, I could find no villagers.  
Hoping the gate mechanism worked, I pressed the button, the gate filled with water, and again I was transported. But not back to where I had come from; to a new land, with new structures. Each new place had a structure of obsidian, but few could be called rings. Each took me to a new place--Derclocanmith, Derclocoplandi, Dercloaer, Derclocovisce, Derclocotine--and then back to Derclocodoman. There didn't seem to be any way to return to the place I started, Domanvisce. Then I remembered my lapis shard and returned...if not home, than the place I have come to regard as safe. 
My mind is too awhirl to try and understand how these gates work. I feel certain there must be a way to return to Domanvisce using the gates.
-H
=================
I have taken numerous travels through the gates, and have explored the 'Derclocs'. I have seen massive castles. Strange homes on stilts, floating on water. Ancient temples. But no people. In some places I have seen iron golem patrolling, but what happened to the people they protected? 
As much as I fear doing so, I should travel though the gates for an extended time. If I am going to understand the gates and how to use them, I have to actually use them. 
If you have found these notes, then seek me out through the gates. I will leave redstone torches as a sign.
-H
=================

Sunday, May 27, 2012

Timesink part 10: A working gate network

I have been spending far too long thinking about the gates and entire gate system. I finally just sat down and made myself start implementing things. So let's look at some sketches:


Once I drew arms onto the plot, everything clicked as to how I could set up the network. I have something like 40 more gate to place and setup. Let me just pimp the bukkit plugin Gates. I mentioned it before, but it really is worth another (short) plug. If you run a bukkit server and are looking for a gate-based teleportation plugin, you really need to check it out. The biggest downside with it is the inability to design gates of custom shapes like you can with some of the other gate-based teleportation plugins. But the use of a chest to enter a gate address really makes this one shine for me.

One can get around the custom shape limitations a bit with some creative use of the WorldEdit plugin tools. Once the gate has been created and correctly activated, one can change the type of blocks or even remove them using WorldEdit tools and the gate will still work. On the server I'm running, lapis lazuli has special teleportation-related abilities, so the center point of the gate is a lapis lazuli block. I also remove portions of the outer ring so each arm of the spiral has a specific gate shape.



You may note that each gate has distinctive markings on the ground in front of the gate as well as items to the sides leading up to the gate. These have to do with which arm the gate is in, and also encodes information about the address of the gate you are at. Hopefully other things found on the server will make it clear how the addresses work.

With each gate, you can either enter a destination address, or just hit the button, 
which will take you to that gates pre-set autodial location. Under each gate site are a series of music blocks and redstone circuits, so before the gate activates, a series of music notes play. 

The sequence of the notes, again, conveys information. Specifically, it can tell the user how far out on a spiral arm they are, as well as gives hints about relating alchemical-based items (earth, fire, water, etc) to numbers.

To wrap everything up, here are some shots of the various "cities" that can be found around six of the gates. In some images, iron golems can be seen patrolling the areas around gates. Remember: the placement of all of the buildings was done automatically (as described previously). The placement of the gates and the size of the gate areas were done manually and are meant to (again) give information to the player about the gate networks and where other cities are.


Once I finish placing the gates (I try and do at least 6/night), I will start writing the notes as left by the unseen "H". Next time, who "H" is, what he learned, and what became of him.

Tuesday, May 8, 2012

Time sink: Interlude

I have not abandoned things, but testing the server setup is going slower than I would like. For the time being, enjoy something from the interwebs.


Saturday, March 24, 2012

Timesink part 9: Requiem for a plugin

Whenever there is an update to Minecraft, the good folks at the Bukkit Project need to update the Craftbukkit server. This, in turn, means that some plugins might need to be updated.

Most plugins are made by the Craftbukkit community of users, which means that for any given plugin the developer's interest in maintaining might drop to the point that it is abandoned.

Such seems to be the fate of the brilliant plugin ItemCommands. I honestly don't know why every server didn't use this. Let me try and explain just why this was such a great plugin.

I know there are a few people reading this that haven't actually played Minecraft, so for those dear reader, in Minecraft the player ispresented with a screen which has a crosshair in the center. When the player is within a certain distance of a block, the block's edges are hilighted in black. This means the player is close enough to interact with the block by clicking on it. The clicks can either be a normal mouse click or a cntrl+click (I don't know the Window's left/right mouse click convention).

The vast majority of plugins for Craftbukkit allow the player to execute commands by first typing "t" which opens up a chat window. The player then has to enter some character that tells the server that the player wants to execute a command and not send a chat message. The character is "/". So, for example, if the player wants to teleport to the in-game spawn point, they type:
 t<return> /spawn

Example Minecraft interface. Note the crosshairs (center screen) on the block outlined in black lines. The ability to execute commands via the chat interface is visible. In this case the command /spawn would teleport the player to the in-game spawn point. For those interested in the city-related stuff, note the presence of Mayan-inspired buildings in the distance.

This is fine, but it breaks the arm-flailing convention of Minecraft and makes immersion into the game hard. Enter ItemCommand.

ItemCommand allowed server admins to link items in a player's inventory, or what they did with items in their hands, with commands. For example, on the server I was running prior to the crash if one was holding a compass and they cntrl+clicked on a location, it would execute a command that would make the compass point to that location. It would link the action of the player holding the compass to the command "/compass here" enabled by the CompassEx plugin. If the player just clicked the mouse while holding the compass, it would make the compass point to the spawn location (executing the command "/compass reset").

It was brilliant! Players could teleport to their home or spawn using chunks of lapis lazuli (depending on whether it was a click or a cntrl+click), change where the compass pointed, etc. Even very young kids could get into it and there was far more suspension of disbelief.

Unfortunately, with the recent updates to CraftBukkit, the plugin no longer works and it looks like the author is no longer active. The code is on github, but frankly, I'm rubbish with Java. There's a project out there that allows one to write plugins in python, but it's not very well documented.

So, consider this a plea: if there's anyone out there that loved ItemCommands or thinks the idea of letting players execute commands without having to type is cool, AND they can update the Java project, please oh please update it and let me know.

Timesink, part 8: Automating city placement with python (and some Excel help)


People actually read this? Well gosh....


It has been a while, and before I start talking about how I largely automated city placement, let me offer an explanation as to why it's been quiet.

To avoid a tl;dr version: the computer hosting the minecraft server had several drive die one after the other. One of the drives had the running server. Another had the backup.

Dust in the wind.

Couple that with the release of Minecraft 1.2.3 (and now 1.2.4) and the lag between Minecraft updates and plugin updates, and things have been really dead.

Things are officially back up, though. A brand new world for people to explore.

But in the last post I said I would talk about the tools I'm using to automatically place cities, so let's get to that. Warning: this is a pretty boring post.

If I just wanted clusters of buildings to appear on the minecraft landscape, I could probably do that with just the Terrain Control plugin and the BOB files. What I'm trying to accomplish is complicated by the fact that

  1. There is a mathematical pattern to where each city is
  2. There are five distinct architectural styles
  3. Each of the architectural styles appears in specific biome types, but are not strictly limited to a certain biome. It makes no sense for a civilization from a forest biome to refuse to build anything in a plains biome just to the west, for example.
  4. If you are placing more than 20 cities, the process of teleporting to a set of coordinates and waiting 10 minutes for all the buildings to render (sometimes it can take longer depending on the buildings being placed) is tedious and should be automated.


To address the first point, I made myself an excel worksheet (which I'm happy to make available if people are interested).

The user enters two values--# of cities wanted and a scale multiplier (see post "Timesink, part 3" for details)--and then places a * next to the in-game spawn location, and the sheet does the rest...with the exception of the biome type. I'll get to that in a bit.

As a guide to understand the excel sheet, things which are underlined are things which the user must input. Anything in italics represents something which has been automatically calculated. Bold things are just headers. It's a convention I worked out for myself many years ago to quickly allow me to look at an excel sheet I made (maybe years ago) and understand what are the inputs and outputs.

The excel sheet assumes that at the center of my spiral is some sort of main complex. The Capital or Holy City...something. Of course, if you have a Holy City, you probably think of it as being the center of your world; your 0,0 starting point. In the story I'm working on for the server, the main city and the new player spawn point(set to in-game's 0, 64, 0) are different. This is why the excel sheet calculates a city's coordinates from the Holy City's perspective and from the in-game spawn point's perspective.

In the example excel image I posed city #3 is centered at in-game coordinates -203,595. That same city, if one assumed the Holy City was 0,0 is at -75, 164. This allows me to use the in-game coordinates(-203,595) to go to that location, but use the story related coordinates(-75,164) to provide a gate address to reach the city(see post "Timesink, part 4").

What my sheet can't do is tell me what biomes are at those coordinates. For that, I used screen and python.

If you are not familiar with screen, you can think of it as a command-line way to keep a "window" open, even if you are not actually connected to a computer. In practical terms, it means one can log into a computer, make a screen session, close your connection, and the computer you had logged into continues to behave as though you are still logged in. It lets one start and keep a minecraft server up and running even when one is not logged into the host computer, for example.

You can name your screen sessions, which then allow you pipe commands into the session. For example

screen -S minescreen

will start a new screen session named "minescreen". And we can send it commands from a python script.



To determine what biomes are present at various coordinates, I wrote a quick little python script that tells the cratbukkit server running in the "minescreen" screen to force a player (me) to teleport to a location and then force the player to query what biome they are in. Wait five minutes and repeat. The five minutes is because, just because you happen to land in an Ocean biome doesn't mean that's the biome you should use. If gives the user some time to look around and make a judgement about what the biome should be.

Write down the biome or notes in the Biome column, and you're ready for step two: splitting things up by biome.

I have split each of my architecture types up by biome and named the files and folders accordingly. The folders and files have common prefixes--"_swamp", for example.


This allows me to use command line tools to move files found.


Now, I admit that this isn't the exact script I used; I cleaned it up for posting so it might not actually work lol. When I was using it, I would do a single biome type since that means 10 or more cities were placed, and it often took a few tests to get the right settings for the BOB files to make sure there were a decent number of buildings, but not too many, and not too much overlap as buildings were rendered on top of or into other structures.

So I think that's it. As of today, the server is back up, all the cities are placed and I'm starting to place the Gate rings. There's still a lot of testing that needs to be done to makes sure all the plugins are working as they should.

Left to do:

  • Place all the Gates and test them
  • Start writing the messages from the enigmatic "H" who acts as the players absent guide and breadcrumb leaver.

Thursday, February 23, 2012

Timesink, part 7: Schematics to bobs to oh god snore

There have been a few people that have asked how I'm getting buildings and such into the minecraft world. I can assure you that I am not lovingly hand crafting them. Today, I'll talk a bit about how I am doing it. It'll be a pretty boring post for anyone that doesn't run a minecraft server though.

First, let's start with schematic files. I'm not going to go into detail about what a schematic file is exactly. If you are really interested, you can visit other sites. Suffice it to say that schematic files are the way some applications and bukkit plugins allow server admins to save things made in game to a file and/or import objects into a server. There's a whole community out there where people make and share various schematic files. These files can range from trees to entire cities. The down side is that schematic files are not human readable.

There is a (somewhat) competing format variously called bo2, bbob, and bob. These files are meant to be used with the TerrainControl plugin. In addition to allowing admins to create some pretty amazing looking worlds, TerrainControl also allows for the placement of things like custom-made trees as the world is being made. What this means for an admin is that the world can be populated with ruins, giant trees, unusual looking cactus, etc, and it all gets added as a player explores the world, based on frequency rules and spawning locations defined in the bo2 files.

For example, one could have an igloo object and have it only appear in cold, snow filled biomes. One can also define whether the landscape is covered with igloos, or whether igloos appear in clusters. One really nice thing about bo2 files is that they are human-readable, basically defining an x,y,z:block type. There are downsides, but this isn't a review.

Now, there are tools out there that allow one to batch convert schematic files into bo2 files, so here's what I did:

1.) I decided on five different environments a player sees in a minecraft game--snowy, desert, plains, forest and swamp--and I started looking on http://www.mcschematics.com/ for building types that would fit the environments. For example, the desert environments have lots of sand and not so much wood, so I chose building types with lots of sand, sandstone and stone. In general, things worked out like this:
     Desert- Ancient Egyptian/Sumerian/Babylonian/Arabian styles
     Snowy- Chinese/Japanese styles
     Forest- European Medieval styles
     Plains- Ancient Greek/Roman/Byzantine styles
     Swamp- Mayan/Aztec/Khmer styles

2.) After I had accumulated enough municipal buildings, temples, towers, monuments, houses and shops for a given style, I would convert the schematics to bo2 files.

3.) I batch replaced certain block types to make the styles look more uniform. For example, I decided the Swamp architecture should not have any wood and should mainly use cobblestone. By replacing more exotic materials (like a diamond step pyramid) with materials more in line with the rest of the buildings, it makes sure everything seems consistent.

4.) Dialing in the details about how often buildings appear was the hardest part. Partly based on the area of the building, partly based on the type of building (municipal buildings, temples, towers, monuments, houses and shops), I would experiment with settings and then see how things looked.

So there you have it. The details are far more boring than this boring-filled post could take. At this point I have all my architecture types sorted and am pretty happy with the resulting cities. Next post I'll talk about how I'm using a python script to help me place the cities.


Wednesday, February 8, 2012

Timesink, part 6: Home, home on the range

I think I've finished the architecture types for the culture that will appear in the more grassy areas of the game:


I still need to monkey with the frequency at which things appear, but I'm nearly ready to start really putting the things onto the server.

Next time, where are these buildings coming from and how am I getting them to appear in the game.

Thursday, February 2, 2012

Timesink, part 5: Woodland architecture

I think the building types destined for wooded areas are finished:


I think the only environment I have left are the more grassy plains.

Tuesday, January 31, 2012

Timesink, part 4: A way to get around

YEAH. THERE ARE SPOILERS HERE.

While I've been planning the placement of cities and their architectural styles, I had a vague idea of how I'd like to see players get from one city to another, but there really wasn't an existing mechanism in place.

I guess I should explain a bit about multiplayer Minecraft for those that don't know anything about it.

Mojang, the company that makes and sells Minecraft provides a server people can use to set up multiplayer games. But the truth is that it isn't very good. There's a server made by a group of enthusiasts named Bukkit. The appeal of Bukkit is that anyone can make plugins to extend the server, and the range of plugins is quite extensive at this point. There are plugins which allow admins to protect their worlds from goons, provide new ways for players to craft items, and even change the basic game mechanisms.

One of those mechanisms are "nether portals". These portals are meant to allow players to move to a different world which is sort of a hell-world. Lot's of fire and lava. For a long time, though, portals did not work on multiplayer servers and plugin designers seized upon the fact. Pretty quickly plugins emerged that allowed players to use portals to teleport from place to place on servers. Eventually portals worked as designed, but the teleportation-style plugins stuck around, most of them having a Stargate theme to them.

None of them allowed one to enter an address of the destination gate, which is really what I had in mind. I'm not a Stargate fanboy, but what I really wanted was a way players could somehow enter coordinates into a teleportation device. Just a few days ago, I discovered a plugin that fit what I was looking for. Appropriately named "Gates".

An example of a Stargate-inspired teleportation device on a Minecraft server.
Gates allows one to make gates and set how to dial them by placing items into a chest. In Stargate parlance, the chest then serves as a "dial home device" (dhd). After setting the items necessary to each gate A, one can teleport from gate B to gate A by placing the correct items, in the correct order, into the chest in front of gate B.

To translate x,y coordinates on the server into items in a chest, I came up with this realationship: the first row of the chest is what's used to place items, and there are 9 potential spots. Therefor, the first 4 spots would be for x, the middle spot left blank, and the last four spots for y. Specifically, the first 3 spots would be for x, the fourth spot would be a multiplier for x, fifth blank, spots six to eight(inclusive) for y, and the 9th spot the multiplier for y.

Perfect. To tone down the Stargate theme a bit, I thought I'd go for a more alchemical feel when it came to the items used to dial locations. Here's what I'm going to try:


Air (blank spot)=0
Earth (a dirt block)=1
Water (a bucket of water)=2
Fire (a bucket of lava)=3
Clay (water+air)=4
Brick (earth+fire)=5
Snow(water+air)=6
Cobblestone (water+fire)=7
Animal (an egg)=8
Plant (a sapling)=9
Ten items to be used in entering teleportation coordinates.
With these items, I have the digits 0 to 9, and can define numbers. For example, 102 would be a dirt block, a empty space and a water bucket. To get values greater than 999, then multiplier space would be used. I haven't decided what the x10, x100 and x1000 items will be though.

Another thing I want to include is a musical element. Minecraft allows one to make note blocks. These blocks can be activated in game by pressing buttons, so my hope is that I can set things up so that when a player presses a gate's button, it makes some hidden note blocks play. The notes played would correspond to the coordinates of the gate the player was at. So, by pressing the button and hearing the notes, the player could figure out the items needed to teleport _to_ the gate they are at. It'd also give them the x,y coordinates for their current location (see the previous post).

To help the player figure all this out, imagine that each city the player could find had a park or museum in it. There, the player could see small pillars that had items displayed above them.

An example of how items could appear.
Maybe there are even signs helping the player understand what number the object represents. And if the objects are placed in a circle, hidden note blocks could be chiming from under each item in a sequence.

Next post, hopefully more architecture shots.



Sunday, January 29, 2012

Timesink, part 3: Did someone say loops?


SPOILER ALERT: Those interested in playing on the server and taking part in the story I am planning should probably NOT read the following. It won't reveal any specifics, but it will disclose technique.

I'm still working on the next architecture type that will be destined for more woody biomes, so I thought I would take some time to describe how I plan in placing cities in the Minecraft world in an automated, systematic way which will appear random at first, but will eventually allow players to figure out where other cities are.

As a plant biologist that models hoe plants grow, I'm interested in the Fibonacci numbers (http://en.wikipedia.org/wiki/Fibonacci_number). This sequence of numbers (1,1,2,3,5,8,13,21,34,55,89,144...) is cool for a number of reasons I won't go into here, an will only point the enterprising reader to Schimper (1836), Braun (1831) and Niklas (1992) for some thoughts on the relationship between the sequence and plant biology.

One can predict the next number in the sequence for values greater than 1 using the equation:

Ni=ROUND(Ni-1*phi)

where phi can be approximated as 1.618.

Given this, one can make some interesting visuals, such as spirals. If you were to decide you wanted to make a plot where the Fibonacci numbers are both the radius and arc length, and if you multiply the resulting x and y coordinates by the sequence number of the Fibonacci sequence, than you end up with a spiral like this:



Throw in a consistent multiplier to make those x,y coordinates be really big, and you can see how you can easily determine city locations that would be separated by so much space that it would be hard for a player to accidentally find a lot of them.

But, let's assume the player _did_ find some. In fact, let's assume that the player started in one of the defined locations. How could one encode information that would allow them to find other locations?

Well, assuming the player knows their x,y, they would need to know:

1) That the cities are placed in a spiral.
2) What the multiplier used is

The first can be hinted at by placing spiral motifs all over the place for the player to find. One could even find ways to visually show the first few numbers in the Fibonacci sequence; maybe as pillars which appear in a sequence of 1, 1, 2, 3, 5, 8, and 13 blocks high.

The multiplier could be encoded into an important, central part of each city. Suppose the multiplier were 400. One could place those Fibonacci pillars on a very plain box that is 5x5x16 blocks. One could even encode which Fibonacci number the city represented by having a circular plaza where the radius of the plaza was the number.

Let's do an example for clarification, and you can check my math. The player finds themselves in the center of a circular plaza which has a radius of 10 blocks. The circular plaza has a conspicuous spiral pattern in the blocks used, and along the outside of the plaza are small towers which are 1, 1, 2, 3, 5, 8, and 13 blocks in height. "A-ha!," says our hypothetical player. "I recognize that pattern of numbers!" A quick check on the internet and they can either calculate or look up the sequence of Fibonacci numbers.

In creating the spiral as I have described, one of the cool things is that the angle in radians for each successive Fibonacci number in the sequence is it's order in the sequence. For example, the first value of one, with an arc length of one and radius of one, would be 57.32 degrees or one radian. The second value of one and radius one would be 57.32 degrees+57.32 degrees(114.65 degrees), or two radians. The tenth number of the Fibonacci sequence, 55, would mean n arc length of 55 and a radius of 55, which would be 573.24 degrees or ten radians.

If our enterprising player has figured things out, then hopefully they will know that a radius of ten in the plaza would mean they are at a point that corresponds with the tenth location on the Fibonacci spiral (Of course, there is room for confusion since the ten blocks of the radius might be thought to be a part of the arc length/radius relationship. Any suggestions on a way to clear up confusion?).

So in theory our player knows _where_ in the spiral they are, but not where other cities are. If they assumed there was another location with a plaza with a radius of nine (i.e. the ninth city in the sequence), they wouldn't even need to know their x,y coordinates to find the coordinates of he next city.

X=N*cos(radians)
Y=N*sin(radians)

where N and radians are the same value. In this case:

X=9*cos(9)
Y=9*sin(9)

or x=-8.200172357 and y=3.709066367

And here's where our multiplier comes in. If the plaza the player is in faces our 5*5*16 monstrosity, and they multiply the x and y by 400, they get:

x=-3280.068943
y=1483.626547

Throw in some clever means whereby the player can enter coordinates into a teleportation device (think Stargate), and the player can find other cities to explore.

What bothers me is that the player would (rightly) assume that the center of the spiral would contain something interesting. I'd rather if they didn't just jump straight to the first point in the spiral, but haven't thought through how to prevent this.

So, thoughts? Is my math wonky? Too confusing?

Tuesday, January 24, 2012

Timesink, part 2

Just tested the architecture I had in mind for swampy, wet areas.


Some work still needs to be done to make sure the materials used in the buildings are consistant, but I'm really pleased with the test. Look at those temples embedded into the hills. <swoon>

Timesink, part 1

Just a edit test

I recently helped a friend set up a Minecraft server. I had set one up nearly a year ago, and had _some_ experience. Since the server became impossible to admin because of the frequent Minecraft updates (which would break the server), the Bukkit project has matured and become a really nice, solid server with lots of fun plugins.

While looking at plugins, I started to come up with a storyline that people could dive into on the server. Lost cities? Mathematical clues to finding them? A mysterious catastrophe? Yes, please, with a Coke.

For the past few weeks I have been working out ways to auto-generate cities; I'm willing to be Dungeon Master for the server, but I don't want to spend my life building pretend cities one block at a time.

Here are some of the first tests. A desert-type architecture (I know it's in a swamp)

and a colder, architecture


I still need to work on getting the building types for swamps, plains and forests, but these first two have shown me the steps I need to take.

Soon, I'll talk a bit about the mathematical puzzle about where to find the cities.