Friday, July 16, 2010

Version 0.0.0.4 - Work in Progress

WWWWWWWWWWWW
WW....@....W
WW........@W
.@.........W
WW......@..W
WW.........W
WWWWWWWWWWWW

So I'm working on version 0.0.0.4 of Adventurer, and I know it's been just two days since my last update. But I just had to share some of the cool things I'm doing, and have already got done. If you want to, check it out at the http://code.google.com/p/adventurerroguelike page, I've got a little mid-progress file up. Some of the new things I've got done already are: potions are working correctly, multiple monsters, monsters respawn, a scent trail system, a message system, and some optimization code. Next up is a sound system, and the aforementioned importing of libraries of creatures and items. I'll throw in whatever else I can. I want to keep a weekly major update schedule.

Let's go over this.

Potions work. You can [e]at them, which refills your health by 5. Monsters pick them up and know how to use them too. If you manage to kill one before they can drink what they've got, they'll drop everything in their inventory.

There's multiple monsters that respawn now. The level starts with five, and after a mystery number of turns, there's a random one out of the number of creatures on the level chance of spawning a new creature. The creature AI got some updating so that they can handle having others on the board with them. There's still a couple oddities, the most major being that they get a little confused if they bump elbows, take a 'wander' step, then are back at chasing the player next turn. They may also whack each other if they're both adjacent to the player and another creature. But overall, they play nice. That'll get a lot more work when I get around to working in individual personalities.

The scent trail system is an interesting and simple system that does a surprisingly good job. Put simply, every creature gives off its own distinct scent onto the tile it's on. Every cycle, the scent spreads. It does this by checking all tiles on the board, and setting each tile to the average of itself and its neighbors, minus some scent degrade. If a creature is on a tile where the scent is higher than their scent sensitivity, they'll know it's there and what it smells like.

I've got a message system working. You know that box in the bottom right that used to say only "Welcome to Adventurer"? Well, that's now your message box. Whenever your character notices an event that triggers a message, it ends up there. Later I'll put in an optional full message menu. Ignore the "You smell a goblin" spam in this one. Later, I'll code it to not bother with the obvious messages.

And finally, some optimization code that will be really useful in the future. See, there's multiple places it can process code. From the moment the player pushes a button, it heads down code paths. As it was before, it would have to complete absolutely everything before giving the controls back to the player. I figured it would start getting sticky feeling at some point. So I looked at the other place it can process: When the player isn't pushing anything, and it's waiting on a button press. So I put in another place in the code where I can put some processing, that will only activate if it has time for it. And it won't just throw it out if it doesn't have time; it'll queue up the cycles. That way, when it does have time, it catches up to where it would normally be. This should have almost nil effect on internal physics, and only when the player is rapid-firing button presses like move. But it should have a huge performance boost whenever it needs by putting off stuff for later.

And that's it. Expect the full 0.0.0.4 in a couple days.

No comments:

Post a Comment