Sunday, February 28, 2010

Going Underground

You know what difference is between a building on the ground and a building underground? A front door.

I've been working on tweaking spawn points, item generation, and a number of other little adjustments to tinygame, none of which would make good blog posts, really, but one thing I did accomplish that's worth talking about is the creation of underground dungeons.

Now, before this point, there were staircases randomly generated on a map that would link to a staircase randomly generated on a different map. Good for them, that part had my brain wrapped around it like a small slice of lemon wrapped around a large gold brick. Now that I have staircases working, the next step is to get them working predictably.

The first item of business was to have the staircases generated only inside the buildings. So, after randomly generating a spot inside a random room (tweaked of course by my code which now almost always works for getting items inside rooms). So the staircase on the ground floor where I had the building now appeared inside. Unless the building was really small, then it occasionally appeared inside the walls instead. Like I said, not quite perfect.

Now that we had it appearing in the building on one floor, we needed it to appear inside on the next floor down (down being my decided direction for this first generation to go). But all I had was code to generate a randomly colored ground with a building with a nice front door. Obviously, both of those had to go.

I added new ground tiles to represent being underground, (and ones to represent sky, though they're not in use yet), and added a new algorythm to generate a building without a door, for use on non-ground floors.

And, now we have actual floors underground! My next planned step is to properly tie the spawn points to rooms in the dungeon - so you no longer see the monsters all wandering around underground, outside the dungeon!

Friday, February 26, 2010

Unlikely Candidate

I don't just play games cause they're fun. I play them for science. The case in point, is noticing procedural content in one game that I certainly never expected to be talking about.

Animal Crossing.

You might ask what about animal crossing is procedural, and that's the obvious question, because everyhing *seems* the same each time you play, right?

It's not, not quite. There are a few dozen characters you can ecounter in the game, many of whom are the same, but some of whom are random. I don't know what, if anything, the generated characters are based on, but simply having a random assortment of pre-generated characters who will react to you in a somewhat random way makes the game procedurally generated. They can move out, and more characters move in and so on - to some interesting results, though as a downside, there's a lot of the game you cannot get unless you have a group of friends playing the game at the same time.

There are other aspects of the game that are procedural too. Weeds grow randomly around town, fish and insects appear randomly based on the time of day and the season, amongst other things.

I suppose some of this could be considered 'random' instead of 'procedural', but I like to think this sort of programming is making it's way into a wider spectrum than just RPG games ad the occasional shooter.

Wednesday, February 24, 2010

Back!

I've just returned from my recent vacaton, an it was good. But, this blog's not about my personal life, it's about gaming, really.

While I was on vacation, I started playing a DS game called Eterian Odessey. It's not procedurally generated, per-say, but it acts like it, which I find really interesting.

Basically, it's an isometric rpg where you go around and fight monsters, level up and your goal is to get to the bottom of the dungeon, exactly like the type of procedural game I'm working on now - except that in EO you've got a 3d view of the map in addition to the isometric view, except it doesn't do much other than give some nice extra visuals.

I find it particularly interesting as the game itself is the sort of thing I would want tinyworld to create. Ambitious sure, but not as much as it might be - I'm already generating dungeons as nice as sections of the map, I just need to make them more than a dozen rooms.

Friday, February 12, 2010

How much is too much?

One question that always comes up when working on a game is how much information to store. Do you store everything that's running in the game at once? Do you only store some minimal information about the game, like accomplishments?

In tinygame, I'm attempting, at first, to store and run *all* content on all maps simultaniously. I've only got a half-dozen maps running right now, and they're not even connected in the complex way I want them to be eventually connected, but I'm running all the content on all the floors and calculating everything at once.

Which means I have to be very careful how many monsters I let spawn on each map, the size of maps and so on.

I've touched on the game recently (no, really, I do work on this thing!) and I've decided that about eight monsters per spawn point is a good starting value. Eight monsters per flor, plus the player, and... well, it can get a little processor intensive.

One way I've premtively attempted to divert some of the processor chug is to break the game down into running at different frames per different things. Things like the player run a few times per second, most spawn points run once every three seconds, monsters act every one or two seconds. This has a umber of immediate effects. First, the player has the advantage over all monsters that he can act several times faster than them. They'll still chase him, but he can outrun them, he can outfght them, and so on. A clever player could fight a powerful monster and win without damage by moving at the right times. Secondly, it means not everythinbg in the world needs to be calculated at the same time. If there are ten thousand monsters, they migt be broken up between a hundred cycles of processor, which is a hundred monsters a cycle, and while it might become slow is still a huge advantage over ten thousand in the same time frame - and only a very minor change in the game play.

What do you all think? Anyone who'se out there?

Thursday, February 11, 2010

Historical Architecture - Part 6

The flying castle

In the age of magic, gravity was no longer a law. For, with near limitless power at one's fingertips, it became possible to fly, or even to levitate a small building. Such was the power trapped forever within the weapons of the elements.

One of the weapons of the elements harnessed the power of the air, and it was a bow. Hundreds of years later, a shadowkin got his hands on it, and the power drove him to the heights of shadowkin culture. His name was Marshal Hian.

He harnessed the near limitless power of the elemental weapon to create a massive fortress bound instead of to the ground, to the sky. It became, over the years Marshal Hian was alive, one of the most powerful and influential cities in the world, though like all good things, it came to an end one night when Marshal Hian passed away in his sleep. The castle carshed to the ground in the jungles of Grittlanni, killing everyone inside and destroying all the great art and culture that had been built around this nigh-utopian society.

Today, still people make it their quests to locate and delve into the ruins, if not in search of treasure, in search of the elemental weapon of the air - for since from that day, it has been lost to the pages of history.

Thursday, February 4, 2010

Historical Architecture - Part 5

Altar of the third god

In Ronar, Geisfarl was the first to gain awareness, and he created the second god, Garsog. Third, the world was created, and then the six goddesses. The altar of the third god is a location confused in it's purpose but signifigant nonetheless.

The altar of the third go was actually created by the Fallen Angel, the Reality Master who began the conflict of the universe for mortals to worship himself. He apeared to mortals in their dreams to cause them to seek it out and venerate it, though they do not know why.

Though it serves no true divine purpose, the altar is a menangere of goddess worshipers, faithless who serve no gods, and those who worship natural powers as if they were gods themselves. It has become a hub of those who are unsure of their own destinies, unsure of their place in the world, and a place where soothsayers travel to tell the future to them.

Tuesday, February 2, 2010

Historical Architecture - Par 4

The Temple of Pain

Ner, the goddess of pain and suffering, has always been an active force within the world since the day she was created by Garsog and Geisfarl. Before the Age of The Faithless began, however, she was particularly active, even to the point of travelling to Ronar to aggrivate the dragon wars to cause more strife between the races, and even the dragons themselves.

On one of the southeast banks of Maxitone stands a large temple structure, now long destroyed by time, and by repeated attempted ressurections and seiges. When it was new, it was the size of a small city, with a wall of obsidian around the perimiter, and a central structure of the same black stone. The stone holds no true signifigance, but Ner likes black, for the only reason that it makes most mortals feel more uncomfotable - as is the case for most things Ner likes at all.

For centuries following, the structure was one of Ner's only places of worship, and doubtlessly the most impressive. The central structure was dedicated to three purposes, worship of Ner in the central altar, and the holding and torture of prisoners. Out of deference to their god, Ner's clerics ate, slept and performed all other duties away from the main structure. In the event that triggered the age of the faithless - where great heroes struck down an avatar of Ner's for the torture and destruction it and she were causing - the avatar's bones were fused to the central altar as it's energy exploded from it's body when it was struck down.

It was, for a long time, a place of mixed powers. Heroes and Villians alike would search out the temple to try and gain power from Ner's avatar's remains, as did the heroes who first struck it down. Some of them ascended into godhood from it's presence, it is said. And so, those seeking godhood, or to worship Ner, or those who fought against them, travelled to the temple again and again, each year bringing about more damage to the temple until it collapsed and was eventually left to rest. Some still say there is power hidden within the bones of the temple structure.