Wednesday, June 23, 2010

It puts the treasure in the dungeon

Rewards require several things before they are actually rewarding. They are required to increase something, somewhere - be it your score and sense of self value, your stats, or simply a counter saying 'treasure collected'. They also need to have some sort of challenge to attain them. This challenge can range from the simple 'wait ten seconds to claim treasure' or 'overcome this specific challenge'. The quality of the reward is usually matched to the difficulty of the challenge. Make it too rewarding and the reward feels cheapened, make it too challenging and the reward feels lacking.

Overcome a challenge, get a matching reward. It's a simple formula, and in a game you're planning out ahead of time it's a simple matter of putting the challenge in between the player's starting location and the treasure.

In a procedural game, it's a lot more complex than that. You don't know where the treasure is going to be located, and you don't know what the map is going to be. You can't assume anything.

Currently, there are three types of treasures, ground, monster, and trap. ground is pure reward, and monster and trap are both challenges. Logically, I'd be most likely to create a good challenge to reward ratio. But it's not just as simple as choosing a floor, piling treasure on it and moving on. I have to keep track of when the floors don't connect all the way, or when there are multiple branches. The monsters won't be in the way, if they're in the shallow dungeon to the left, and the treasure is in the deep dungeon to the right.

I have no current plan for how to deal with this, but I'll let you all know when I do.

Monday, June 21, 2010

Loot!

The goal of every game, on some level, is to collect stuff. In herocrawler, that goal is no different, and in fact the primary goal of the little delvers in the world, to collect all the treasure.

The laws to do so are fairly simple. Every hero has a number of types of treasure they want to look for. Delvers look for loose treasure, monster hunters look for monsters, thieves look for traps. They generally ignore one another's goals, but the goals don't always ignore them, though I'll get to that in a moment.

Beyond a 'type' each treasure has two numbers. How valuable it is, and how much it weighs. Each delver can only carry so much treasure at a time (why you may need all eight heroes), and when they hit their top load, they climb out of the dungeon and move on. The more a treasure weighs, obviously, the few other treasures the character can carry at once, and the more it's worth.

The three different primary types of treasure so far all haev different rules regarding how they act when players move past them. Ground type treasure, which is picked up by delvers, is ignored by the other types of heroes. Traps have difficulties and dangers and while thieves are immune to them, non-thieves have a chance to trigger the trap and take damage based on their stats. The higher the stats, the less chance they have of tripping it, and the less damage they'd take if they did. Monsters are similar to traps that always trigger. I'm planning on, but haven't implemented yet, an equipment system that allows the characters to wear armor and equip weapons that will allow them to boost their 'do damage' and 'dont take damage' stats.

The next question falls to where in the dungeon does the treasure get placed, and I'm still working on that. I'll post up my thoughts on it later.

Sunday, June 13, 2010

Crawler Dungeons

While I'd like to start with the character and player classes, I'm going to start instead by talking about what's already done. Basic dungeon generation.

I've actually already worked out a lot of the kinks in the system, so I'll talk about the problems as I'd seen them.

Firstly, I know the top floor of the dungeon is going to be the ground. I'm going to be adding above ground 'building' dungeons too, but they're not ready yet. Anyways, the top floor is the ground, and there are three types of tiles. Floor tiles the character can walk on, wall tiles the character cannot walk on, and ladder tiles the character can walk across, and also climb up and down. Simple.

Really, what this is is a conditional type of simple maze. When a hero looks for a treasure, they calculate all the paths based on moving left and right or up and down, then they go to it. there's less need for the algorythm I wrote now then there originally was, but for the moment it's still in there. I might make the dungeons more complex again, though they look far better when simplified.

Pathfinding aside, the first way I generated random floors was to pick between one and five floors at random, and fill in the entire floor as walkable space. Once all teh floors were filled in, for each floor I picked another floor to connect with a ladder. It was a little complex, and it made it possible to have disjointed underground sections. Also, it made it possible to overwrite floors that already existed with ladders as the ladders came afterwards. Sometimes, there were just huge bricks of space with one ladder next to another and it was hell on the pathfinding, as well as looking ugly.

The first improvement I made was changing how I picked the floors. Rather than picking two to five floors at random, every floor is now picked to be one to three levels below the last randomly chosen floor, counting the ground. That allowed for potentially more floors, and no longer were there floors regularly all pressed up against one another.

The next major improvement I made is the ladder creation. Ladders had been previously started after all the floors were made. They would randomly connect from one floor to any other random floor in the dungeon. So, it was possible with six floors for all the ladders to cut through all the floors above it to reach the ground level, which looked terrible. So, I changed the ladder code. The ladders now pick a random X location on the current floor (as they did before) and they go upwards until they hit any other walkable space. This solved both the problems of having disjoined space (no longer can the ladders pick to go to a space below them), but also with the mess of ladders cutting through multiple floors. If that were to happen, it would just result in one floor acting as a junction between the next, and a sort of staircase effect. Overall, elegant I think.

But, it was still boring. Everything was flat, the dungeon floors always spanned every space on a particular level. So, the most recent change to dungeon generation I made was that floors now span a random number of spaces, from three to two less than the map is wide. They're placed randomly across the map, and with natural random staggering it creates a really nice, burrow-look. Some places have a large deep room with several smaller ones below it and a single separate hole off to the side, some are zig-zagging holes where the characters have to walk the whole length of the dungeon to go down a floor. It's really nice looking.

But what good is a dungeon without treasure? I'll get to treasure, it's mechanics and difficulties next time.

Friday, June 11, 2010

HeroCrawler

Okay, I said I was working on a new project, this is it. HeroCrawler. Hero Crawler. Hero Crawler: Adventuring Agency.

The name is not totally nailed down, just close. But, that's not the point here, really.

HeroCrawler is a game with a simple premise. You have a group of heroes under your control, you have a (not randomly, but) procedurally generated map, and you set loose your heroes to collect as much treasure as they can carry from within.

The idea came from, interestingly, raindrops in a game I talked about a while back, Paradise Island. The raindrops fell from the sky, hit the ground, and randomly moved left or right each time they struck, until they enter the sea, or a pool.

So, in a similar style, the heroes arrive, and descend, but unlike the raindrops they both know where they're going and then come back up afterwards.

Unlike Tinyworld, this game has a defined ending. As you collect all the treasure from dungeons across the world map, your party gets stronger, eventually strong enough to conquor a super dungeon. The specific goal of that dungeon is still in the air, but there are three sub-goals, one of which is defined as most important at the start of the game. There's collecting an artifact, conquoring all the map, and... probably amassing a certain wealth. Once those are done, you get legendary hero characters related to those quests. The most important one of them actually unlocks the final dungeon, and when you beat that dungeon you win. Probably there's a specific evil monster at the bottom of the dungeon - though that goal isn't decided yet either.

I've got a good chunk for the game ready already - I'll be talking about that as I get even more on it done. Sounds awesome.

Tuesday, June 8, 2010

Desktop dungeons

I played another almost-procedural game today, Desktop Dungeon. It's a little game, very pared back to it's basics. You are an adventurer with a race and a class in a dungeon, you start at level 1 and your goal is to beat the level 10 monster.

I haven't managed to beat it yet, but it's a fairly simple little ditty I should be able to, the biggest problem is that I haven't beaten it yet.

Now, some would say that it increases the difficulty factor if you know you're not going to win all the time. But in this game it's not 'not winning all the time' it is 'you only win one in ten games' more-less. It's all at the whim of the RNG, because of the locations of the monsters and the mechanics of the game, there are hundreds of ways to generate impossible scenarios, and only a few winnable scenarios - even then you have to know what you're doing.

The map is linear, literally. You start off iwth a solid 2d space, and start drawing straight lines through it. When you wind up with no wall thicker than one space, you go to monsters.

Monsters are roughly one for every four open spaces in the dungeon, or maybe every five or so. There's a lot of them, and with most of the space linear corridors, that means you have to fight through one monster after another to explore. Okay idea, but where the problem comes in is monster levels. Each monster is assigned a level from 1 to ten, with only one monster being level 10, and more of each level the lower it gets. But just because there are lots of level 1 monsters doesn't mean they're based near you. Or even after you beat them all you'll have enough EXP to fight the level 10 monster. Some games, you'll start trapped in a hallway with no exit but to fight a level 6 monster. There's no fun there.

I think the game is good, but not great. There are lots of things that could be improved upon, especially regarding the dungeon generating. if the monster's strength was based on where it started relative to you, you automatically drop out most of the unwinnable scenarios, only leaving those where there's not EXP to be had on the map.

More on this later though, I just wanted to give you guys something to read.

Saturday, June 5, 2010

Coolest cave design method ever,

http://roguebasin.roguelikedevelopment.org/index.php?title=Cellular_Automata_Method_for_Generating_Random_Cave-Like_Levels

Whoever said the game of life was just a game, huh? It's a frigging life-based random level generator.

Thursday, June 3, 2010

Blog? What Blog?

OKay, okay, I've fallen behind in posting. I know.

Recently, I've come to the realization that tinyworld is a good idea, but without having planned things out in advanced, the code is becoming more and more, well, dangerous. I love the progress I've made, but I think I'll leave it as it is, a super simple dungeon generator with a little dude to run around. If I ever want to build it again, which I'm sure I will, I will absolutely have to plan things out better in the future.

But, that's not the end of game projects from me. I'm still working slowly on Ronar, I've also been working on a choose-your-own-campaign The Genesis Gauntlet. It takes a few weeks for each adventure, then there's testing and playing, and finally release. Release, you say? Well, it's going to be run for Comminuty Supporters over on a website I'm part of, www.dndonlinegames.com

I've got another procedural game in the works, and I'll start talking about that shortly too. More pressing though, I'm starting up a Pathfinder Campaign.

I love what pathfinder's done to the OGL d20 system, and while the existance of the super-bard orginization reeks of product placement, the system is otherwise polished to a near mirror finish. Which is awesome. You'll be hearing more from me on that, too.