Tuesday, August 18, 2009

Living and Breathing

One of the big things that makes any world is it's creatures. Some fantasy worlds are only populated by humans, some include existing mythological creatures like Minotaurs and hydras, and many contain creatures like Elves and Dwarves in the manner popularized by Tolkien.

Humans, of course, should build the cornerstone of the races in your world, because you're expecting the player to relate to them. Society works similarly, people stand on two legs and speak English (well, in the north-American localization anyways), and so on. You could build a world where singing spiders were the dominant race, and the whom the player interacts with, but people wouldn't understand it as well - although you'd be able to get away with a lot more things that would pass as odd in a world the players think they understand.

In Ronar, there are four dominant races, known collectively as 'the intelligent races'. There are Humans, the most abundant; Shadowkin an etherial race borrowing some traits of birds; Torin, the naturalistic catfolk; and Unofotine the stout underground race resembling moles. They each fit a mold a player expects, they each fill a role in the world, they each have their own societies that are based on aspects of human society, and they each are distinct from what the player might be expecting. And they're each associated with a different god - although I'll get into gods another day

Humans, of course, fill all the same positions they do in the real world. They farm, they teach, they rule, and they live in cities all about the world. They excel in anything they choose - although typically only one thing per person, and unlike in many fantasy worlds - they live about as long as any other intelligent race in the world.

The other three races I'll cover later.

Sunday, August 16, 2009

Roomy

While I deal with bugs not entrely related to the creation of the rooms themselves I should mention some of the engine I built before getting to this point.

The game is, ultimately, built on a grid map, a two-dimensional series of tile objects. Each tile has several different attributes; a ground color, a creature on it, a stack of treasure, and whether or not it can be passed over by a creature (which preempts having a creature on it, of course).

I decided to keep all the tiles in a one-dimensional array, for a specific reason I now forget, and use a function to calculate what the index of a tile at a particular X,Y coordinates is. So far, it's worked just fine.

Now, that means I'll have hundreds of tiles - heck, hundreds in each map - but I don't want to draw so many of them. Afterall, it's an isometric display, I can only fit about a ten by ten screen up at a time. So, based on the location of the player, I only draw the tiles, and the contents thereof, which are visible to the player. It does mean a lot of extra checks for tiles that aren't onscreen - but that's something I'll work out later. It's certainly more efficient than drawing the entire world every frame.

Now, the player has the world to walk around in, and while it's pretty dull before I put the dungeon on it, it's certainly servicable. Eventually, I'll need to have them connect to other maps, but I figure I can wait until I reach the second floor of teh dungeon to start worrying about that.

Saturday, August 15, 2009

Behind door number one

Dungeons are build primarily out of, believe it or not, rooms. There are big rooms and small rooms. Rooms at the top of towers, and rooms at the bottom of crevices. Some rooms have monsters, some have treasure, and some are regretfully empty.

My current challenge in my game, whose working title is TinyGame, is to find a way to figure out what the spaces are for each room.

My world is divided up into tiles, nostalgia from old rogue-likes i suppose, and each tile can either be a movable space, or a piece of terrain that can't be moved through (yet). Oh sure, there's items and creatures and so on, but this is about the rooms themselves.

Right now I generate the rooms like this:

I find a spot somewhere in the bottom middle of my map. That becomes the main doorway for the dungeon. From there I generate a width, and a height and draw my walls just inside that, leaving the middle empty. This is the atrium for the building, and it's always one of the largest rooms in the place. Sure, not every type of dungeon needs an atrium, but I'm starting simple here.

From the atrium, I randomly decide how many rooms are off the side, one, two or three. One room is off the top, two rooms is off to the side, and three rooms is all the way around. The size of these rooms is a factor of how big the atrium is. And each of them has up to two side-rooms, too. The back room's rooms are on the side, the side room's rooms are further to the side, or to the top - which can overlap with the top-rooms's side rooms.




But now, they're just walls and spaces. I need to remember them as rooms themselves, so I can do things with them, like add monsters and delicious treasure.

Friday, August 14, 2009

What's the Point?

Whenever you're building something, you have a goal in mind. If you're building a house, you might be doing it to provide shelter to your family, and you might be doing it to eventually sell for profit and become rich. When you design a program you might be doing it to teach a player a standard, and you might be doing it to entertain. Regardless, you have a goal in mind.

When you're building a world, however, your goal is probably not to house your family or entertain - although those might be why you're doing the design in the first place - you're usually designing a world to act as a background as something. Lord of the Rings is a great story, but without Middle Earth it would be fairly generic story. Final Fantasy games have been progressing to a single world for their games to take place in - the world again is the background for the story and the action.

But it's important to remember that for the things that exist in the world, it's usually not *just* a background. People supposedly live their entire lives there and have for generations. Buildings are built to be used, typically not just to be abandoned and filled with monsters. Everything needs to have some sort of purpose in the world rather than just filling it with things for the players to see on their way from point A to point B. Sure, once the purpose is served it should be interesting, but the fact of the matter is that truth is stranger than fiction. The less realistic, or at least the less plausable, an ecosystem is in a world, the more likely the player's going to pick up on it.

But i'll go into more detail in a later post.

Thursday, August 13, 2009

Nose to the Grindstone

So, I've been working on a game at my full-time job...

Ah yes, I should have mentioned - I work in the gaming industry. Sure, it's games-based-elearning, but it's a very innovative field because it's not very well developed of defined. When you come up with a new method of finding out how much someone learns from playing a game, it's a huge deal! That's not my job, that's just an example.

I'm a game developer. That means I'm the guy who implements the game. It also means I'm one of the few people with a hand in saying what's possible to do and what's not. It's a powerful position. Although in crunch time, it gets a little strenuous - after all, crunch time is when things have to all be done, and when you're the one who implements them...

Roll Initiative

I mentioned that some of my opinions on the topic of randomly generating dungeon content would be colored by dungeons and dragons. Overall I'm a huge fan, even in the controversial 4e stuff.

I've been playing DnD for about fifteen years now, and I've been dungeon master for about ten of those. I call the shots, I make the rules, I design the dungeons and the stories that go with them. In the past four years, I've been with an online site called www.dndonlinegames.com. Working on a play-by-post style, it's easy to plan moves, react to players well and so on. You don't have to have the answers at the drop of a hat, you have to have them within a few hours. I can take the time to redesign the monsters coming up in the dungeon if the players are struggling with them.

It's always part of a DMs job to balance the game for a player so that they have a challenging time - but not too hard. It's the DMs job to make it so the dungeons feel like a real place the PCs are exploring (if that's what they want). The DM has a lot of responsibility in keeping the game flowing, and all games should follow this structure.

If the DM's no good at any one of those things, the game can fall flat on it's face. Let's hope I can fake a good DM in the background, hmm?

Wednesday, August 12, 2009

Starting a blog is always the hardest

Lately, I've been working on an RPG in my spare time. The original idea is based on Squidi's Tiny Dungeon model, but it's grown a lot since then. The main point of making the game in the first place is to build some good randomly generated worlds.

I've always been a big fan of dungeon crawlers, and roguelikes in particular, but one of their big falling downs is lack of logic in their randomly generated content. You throw a bunch of rooms into solid rock and connect them with a maze of tunnels that have nothing to do with anything, and look like spagetti. Most people call this a randomly generated dungeon, I call it a spagetti-maze. Especially because the content in each room has nothing to do with the other rooms. Each room is almost exclusively a new entity in and of itself and that's just silly. Who built it? Why is it there? Some games try to hint at those answers, but never very well. Why don't all the infinite variety of monsters eat eachother?

Maybe I'm just biased because of all my years playing Dungeons and Dragons. In this world, it's much harder to get away with rooms that don't connect, or with dungeons out there in the middle of nowhere filled inexplicably with monsters... Well, usually. Lots of DMs and adventures and campaigns are all the same sort of thing - kick down the door, kill the monster, take their stuff. But what's important is dungeon layout.

In DnD, you hever have a hundred feet of twisting hallway to lead to the door to the next room. You have ten at most. Often the rooms will be pressed up against eachother, like they would be in real life. They might not be arranged in much of a logical manner, the contents may still be random, but is a realistic design really so far fetched as to be unable to be randomly generated?

Of course not. Dungeons have to start out as something - prisons, temples, towns - and all of them have distinct looks. Temples start with an atrium, then there's a main place of worship in the back, and some hallways off to the side containing smaller rooms. It's not complicated and as I continue to work on this project and update this blog, we'll see just how simple it is to mimic real-world archetecture using only the NLG.