Saturday, August 28, 2010

0.0.0.9 - Item Crafting

Adventurer 0.0.0.9 is out, and I'm back on my 7 day per update average schedule. The big thing that got done with 0.0.0.9 is that the framework of item crafting is in place. You can break down any item into its components now (liquids and gases will have no container and be lost, so watch out for that). Axe becomes a wood stick and an iron wedge. The other half of all that alchemy is the construction of new items from components. If you have a stick and a wedge, you can now make an axe from it. Simply select either item you want to start with, hit [c]ombine craft, and you'll get a list of all the items you can presently make from it. Pick one, and it will be made.

The other thing, not as major as the item crafting, is I fixed up the crash-out code. I managed to trigger going into that part of the code when I was working on the rest - only to find that it had problems with simple Console output. I mean, what the heck? "The handle is invalid"? Can you be any more generic, Microsoft? Oh, wait, they can. Anywhoo, I looked up what that was about. Turns out my project isn't a Console Project, so the ball is dropped when I call console commands, because nobody bothered to set up console stuff if it's not a console application.

In retrospect, I might be able to fix that if I can find the right settings. But more importantly, I fixed it another way. Instead of Console output, whenever the game fails to continue running, it dumps whatever exception occurred into a text file at ErrorLogs/crash.txt. So if the game has crashed on you, consult that file to see if anything's there. If you email me at zahru.tesla@hotmail.com or just post a comment here or something, include that file's contents. It'll help future versions be more stable.

Next week's updates' tasks are... hrm. Wow. A lot to be done. As a new feature, skills and attributes can be in. That way you can become more powerful as you do things. Skills are going to work on a 'natural' system. You get more 'axe' skill whenever you use an axe. You get tougher body parts whenever they're injured. That could be a lot of work though - no guarantees that it will be ready. Also, AI still needs work to make use of the new armors and weapons and crafting and such. So that can use some work. Also, combat mechanics need some work - you aren't guaranteed to hit the right target if more than one is adjacent to you. So I'll see you next week with another update. And I'll post another blog post at the start of next month.

Sunday, August 22, 2010

Adventurer 0.0.0.8 - Armor and Weapons


Here's 0.0.0.8, a day later than I would have liked. But hey, it works. So! Armor and weapons are in, and a slight rework on the inventory controls. 'e' and 'd' no longer do anything from the main game. Since now there's more than health potions, you need to select those items. Hence, the inventory menu actually does stuff now. Play around with it. When you need to remove armor, un[W]ear it. When you need to put your weapon away, un[w]ield it. All from the main game.

Weapons have their attack data, which override your own when wielded. Armor shaves off some damage, if you're hit in a body part it covers. And something else I added is a random item generation system that I can use varying weights for. Which means when I implement it, YOU can modify the encyclopedia entry on items and change their drop rates. As it is, armor has about a 30% chance of generating. Which armor is all equal.

Next thing I'm working on is item crafting. Yeah. Snap that hand axe, turn that shirt into strips of cloth. You'll be able to craft them into things. And maybe, just maybe, I'll add some skill growth.

Saturday, August 14, 2010

Adventurer 0.0.0.7 Level Upgrade


Adventurer 0.0.0.7 is ready for the world. I know last time I said I was going to do armor and weapons and stuff. Well, here's how my train of thought went: "Okay, to do armor, I'll need to be able to place the items down. I could add that to the mix with potions, but... eww, the potions are all in the halls, too. They need to only be in rooms. Now how am I going to do rooms? Hmm, I could do it this way... what about doors? That would be cool. And stairs. Those could all be fixtures..." And before you know it, I'd completely rewritten the level generation.

But I think it was worth it. The dungeon layout feels a lot better, and now we've got doors that you can [o]pen and [c]lose. The goblins and rats handle it perfectly; goblins can open doors, rats can't. Rats don't have any body parts dextrous enough. Also, since I had doors working, I went ahead and made another dungeon fixture, stairs. You can now go up [<] and down [>] stairs to the next level up or down. Now, the levels aren't persistent like Nethack; that'll involve saving levels to files, and I'll tackle that once I try to tackle save files in general. You can, however, go deeper or more shallow through the dungeon, and it all seems to work right.

Also, while I was at it, I fixed up the inventory menu a little better. Still not perfect, but you can see what you're carrying with you now. Also, I used the same principle to make a health menu. You can see all the body parts you have, and the general condition they're in. Also, I color coded everything to do with health so it's easier to notice you've lost over 30% of your blood, and your head's about to be hacked off.

Next update will probably be more to do with armor and weapons and such, if I can get the equipping of items to start working right.

Saturday, August 7, 2010

0.0.0.6 - Body Parts and Combat

......_............
...../.\.I'm.Okay!.
.....\_/...........
......|./..........
......|/...........
......|............
......|............
...../.\...........
..../...\..........
...................

It's another week, another update. What gifts does Kala bring this time? Why, a Body Part system that lets rats know they don't have opposable thumbs, and lets limbs be broken, maimed, and even completely taken off. Even threw in a splash of blood for you.

So yeah, there really isn't much more to say on the matter. You can now get into fist fights with the goblins and get your arm broken. You can also bleed out. You can theoretically survive without a leg, but if your head's damaged beyond repair, you're a goner. Also, rats have finally stopped picking up potions, and going for them. The AI has been shifted over to Creatures, rather than the main Update loop. This means that the AI can be more individual to the individual creatures. Go have fun with it.

As for what I'm working on next, probably armor and weapons. And getting that inventory menu to show you your items. Same concept, a screen to show your health. From here 'till version 0.0.1, I'm going to be focusing more on stuff that will use the systems I have in place, rather than go out of my way to make more. Really, a lot of the framework I needed is up now. So expect armor and weapons, some feedback, and maybe some skill gains or something like that. And a system to save your game, that'll be useful, if complicated to make. Hey, maybe I can even do multiple levels.

Oh, and something interesting, I found a bug. Memory leaks, they're causing the memory requirement of the game to rise the longer it's run, until eventually it will have to quit. I'm downloading a program that will help me track down what's causing that. It's not of critical importance, but it's on a list of things to do. Still, I think other things could use more of my attention right now, I'll get to the memory leaks once I've done some other things. Technically, they're probably not memory leaks. Rather, some bit of code is hanging on to variables it shouldn't need anymore, and keeps making more. Not so much garbage collection's fault. But I call 'em memory leaks. They act like memory leaks, and I'm going to track those down sometime.

Sunday, August 1, 2010

Adventurer 0.0.0.5, End of Month 1 - July

I bet you're wondering what that huge image up there is. I'll tell you - it's a healing potion mapped down to an atomic level. And it's in the most recent update, which I just posted at my Google Code page. Maximize the image if you want to see just how detailed it's mapping down that potion.

Now, I'm not saying that I track every single atom or anything like that. Or even that at the moment that all of the data held within is correct. But the system is up and in place, and I can now start working with it.

Adventurer 0.0.0.5 (I'm being conservative with the version numbers: I see 0.0.1 as being something I can reasonably call a game, and 0.1 as something I can be proud of. 1.0 Will be a stable 'finished' product, though I'll likely keep working on it pretty much forever. The big thing it does above the previous is that now I'm importing all the libraries of creatures, items, materials, and what-have-you all from text files in a folder labeled "Encyclopaedia Adventura". These text files simply hold information about creatures or whatever, using a system of "[TAG] variable". So "[CREATURE] human" says that a creature type named "human" exists. [/CREATURE] closes it. Everything in the middle is information about the human creature type.

The big advantage of this is that people will be able to mod the game easily just by adding, removing, or changing stuff in the encyclopedia file for it. The game file later opens it, searches for tags and data, and compiles it all into internal lists of Creatures and Items and stuff. So all I have to do to add a feature is to tell the code to look for another tag, add a variable to a creature, and update the library. So right now, theoretically, you can create any creature of any power that you want.

But right now it's pretty generic. I only have two creature images ready, @ and r. There's only health potions. And the rats drink the potions just as readily as the goblins. So the next update is going to fix that some. I'm putting in a Body Part system. In fact, if you look at the code, you can see that I've partway implemented it already. Basically, instead of saying "You're a rat, you can't drink potions", I can say "You can't drink potions because 1 - you're too dumb to figure it out and 2 - you need a body part capable of using items." This will be much more realistic. And it leads right into the second major thing I'm doing, an AI update. Right now, all creatures act the same because the AI code is in the Update code. But that's silly, it should be somewhere in the Creature code. So I'm getting around to implementing that Sentience object I set up earlier. Every creature will have one (possibly more in the future), called 'mind'. The mind will have a function for figuring out what the creature wants to do next. So then, all I have to do is say something like "action = thisCreature.mind.thinkOfAction();". It will then figure out what it can do, and what it should do. All this is planned for 0.0.0.6, which shouldn't take as long as this update to get around.


And finally, a retrospective on Month 1 - July. I have taken the game from a rough, weak concept to something that is starting to take shape. I've got some rather impressive systems in already, though sparsely populated. And I'm just bringing in more, now that the hard stuff is going by. Overall, I would say the work on this project is a huge success so far.

On the other hand, the project has almost no one watching it or downloading it. I have a whopping total of 16 downloads, most of those from people I already know. I have zero comments, except for a brief bit of interest on the Dwarf Fortress forums. I've only had one person contact me directly. I have 133 page views, most of those I bet come from myself.

Ah well, I'm doing it for the Fun and XP, not the Fame.

Adventurer gains +1 Months of Maturity Points.
Adventurer gains +1 Level of Awesome.
Kala gains +5 Update points.
Kala gains +4 Weeks of College.
Kala gains +1 Level of Game Programmer.

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.

Tuesday, July 13, 2010

V 0.0.0.3 - Items and Optimization

What's that I hear? Is that an update? Why yes it is. Version 0.0.0.3 is up. I basically ripped the guts out of the game and stuffed them back in, in different places. I put things like Move where they belong, and simplified my 8 or 27 or so direction command sections into two simple sections. One lists those 8 directions, the second does a short loop and catches them all. 1/4th the size of before.

I've got items working now, too. Now, it's nothing too major at the moment. But it's a new toy you can play around with. The level generation creates five health potions, and puts them randomly around the dungeon. You can [,] pick them up and [d]rop them down elsewhere. You can even try to [e]at them. (I see eat and quaff as the same thing - one's solid, the other's liquid. So my [e]at command will do either.) There is a little bug though that's keeping potions from working perfectly. When I call the Eat command, it calls the Item object's Eat command, instead of Potion's Eat command. I need to look more into having Potion's Eat command override that, if the Item in question is a Potion.

0.0.0.4 should see that fixed, as well as a true inventory menu. Also, monster spawning. The most major thing I want to implement, though, is to have the game load in its libraries of default items and creatures from text files. That way, anyone outside the code can mod those text files, and mod in/out creatures and items. That should really increase the variety in the game. And you know what? I have some ideas for neat tricks I can get going without much work, I'll try to throw those in too.