As some of you may know, I am currently working on an rpg.(Who isn't it seems like).
However, I was thinking about different AI ideas that could be implemented in an RPG. For this post, I will focus only on monster/enemy AI.
Now, the first thing that can make rpg battles/dungeons a bit more interesting is a context outside of battle, where what happens in battle does affect the overall dynamic of the dungeon. Here is one possible idea, similar in aspect to a genetic algorithm. Each enemy has a fear and an intelligence rating, randomly assigned within a predetermined racial standard deviation. Say, slimes are smarter than kobolds for example, on average.
Now what this means is that if you cross an enemy's fear/intelligence barrier, ie, "They're really tough, maybe I should run." So they'd try to escape. If they do escape, what happens? Normally, you'd never see that enemy again, or at the very least, never be able to tell. However, what if the enemies that survive or escape you, communicate with each other? And even are able to formulate plans and groups to take advantage of whatever they learn.
This can be done by giving escaping monsters a memory, a kind of statistical observation of your performance. Then in a background task, have a couple or more of such monsters communicating their knowledge to each other. Now, based on the length of time since the knowledge was obtained, the detail, and what is observed, different information will be valued more than others. By sharing the information between the monster memories, the background task is able to determine your weaknesses. Say it saw your white mage fall to two hits, but your knight took 10. That would be taken into account.
Then, the enemies would lead a charge against you, with slightly modified battle AI's. As per our example, focus on the white mage!
And since this would be largely time and number of battles based, the longer you are in the dungeon, the tougher the enemies get.
To balance that, we make it so that when you leave the dungeon, the monsters all forget about you.
This behaves similarly to a genetic algorithm, where the fitness test is fighting you. And the sharing of information is similar to swapping genes, but, in this instance, its a method that can deal with unexpected shifts of the problem space. Whereas, in genetic algorithms, the genes have to fit the problem well, and take a while to adapt. By data-mining observed actions, the enemies can adapt faster than with a genetic algorithm.
Another idea I considered was enemy genes, where each enemy you manage to kill does not reproduce, and thus, the more you fight in an area, the tougher the monsters. However, without a very flexible genetic system(IE, one too powerful to adequately simulate) this would only lead to monsters with stronger and stronger genes. Also, the algorithm would have to be tweaked to show results quicker than most GA's.
Next post: RPG AI Part II
Friday, November 9, 2007
Donating to those worthy of it
And what I mean specifically, is donating money to small, open-source, or even shareware programs.
They do not make you pay up front, and I do agree with what Jeff has to say on this issue. But for me, the best project that deserves my money, is Notepad++. It is a simple, immensely powerful text editor. It starts in less than a second, even on slower systems, makes as much of the screen available to code in, has tabs, has split screen(!!!!), and most importantly: can be extended with support for other languages.
Those two features are so huge. Say I want to learn the latest and greatest language, say FF++. Notepad++ may not have built-in support, but with a bit of work( or googling) I can add syntax coloring. And the split screen? Allows me to look at one file, in two different spots, or two different files, etc etc. It allows me to check the requirements of classes, functions, see how code works, anything.
It is above and beyond the usefulness of most of the ide's and text editors on both Linux and Windows. VS2003 is pretty damn good, features good project management, but does not start quickly. For a large project, something like Visual Studio is perfect, but for everyday needs, quick script writing, Notepad++ is perfect.
And that is why I've made a $20 dollar donation(CAD). Sorry for the exchange rate making it less than 20! And, if there any pieces of free software which you use, and love, and believe in, support it! You'd want someone donating to your project, wouldn't you?
They do not make you pay up front, and I do agree with what Jeff has to say on this issue. But for me, the best project that deserves my money, is Notepad++. It is a simple, immensely powerful text editor. It starts in less than a second, even on slower systems, makes as much of the screen available to code in, has tabs, has split screen(!!!!), and most importantly: can be extended with support for other languages.
Those two features are so huge. Say I want to learn the latest and greatest language, say FF++. Notepad++ may not have built-in support, but with a bit of work( or googling) I can add syntax coloring. And the split screen? Allows me to look at one file, in two different spots, or two different files, etc etc. It allows me to check the requirements of classes, functions, see how code works, anything.
It is above and beyond the usefulness of most of the ide's and text editors on both Linux and Windows. VS2003 is pretty damn good, features good project management, but does not start quickly. For a large project, something like Visual Studio is perfect, but for everyday needs, quick script writing, Notepad++ is perfect.
And that is why I've made a $20 dollar donation(CAD). Sorry for the exchange rate making it less than 20! And, if there any pieces of free software which you use, and love, and believe in, support it! You'd want someone donating to your project, wouldn't you?
Wednesday, November 7, 2007
Sunday, November 4, 2007
Theft aka "redistribution of the wealth"
Imagine my surprise, when I go to open up for my job this morning, and there's a police car waiting for me. Seems a bunch of laptop boxes were found nearby, and they wanted to know what was going on. I go in, start opening, and find a frickin' gaping hole in the ceiling.
It turns out they had used an axe, and cut a hole to get into the storeroom, and not the sales floor which has security. Then, they proceeded to pry open the steel cage we use for valuable inventory, and take a bunch of stuff from in there. They took almost $10k worth of stuff, five laptops, a bunch of gps units, cell-phones, and digital cameras.
Man was I pissed. And on top of the theft, they used our own garbage bags to haul their loot up through the hole, and one last thing, that really really confuses me: they took our toilet paper, and stuffed the toilet full.
Why? Thats all I have to ask. You've already stolen enough to pay for a week of crack. Why would you need to do something more?
So, we didn't open on time, waiting for the fingerprint guy to finish. We checked the roof, and found four garbage bags full of empty boxes. Plainly, the burglars had ripped what they could out, so they make off on, according to the fine officer of the RCMP, their bikes. We were robbed by teenagers on bikes. That fucking burns. They outsmarted our security, left irreperable damage, did basic vandalism, and avoided the storeroom floor with its heavy security. All done by guys who likely can't even legally drive yet.
Its times like that that remind me of Einstein's priceless quote: "Life is a contest between man and the universe, where man tries to build a better fool-proof system, and the universe builds a better fool. So far, the universe is winning."
It turns out they had used an axe, and cut a hole to get into the storeroom, and not the sales floor which has security. Then, they proceeded to pry open the steel cage we use for valuable inventory, and take a bunch of stuff from in there. They took almost $10k worth of stuff, five laptops, a bunch of gps units, cell-phones, and digital cameras.
Man was I pissed. And on top of the theft, they used our own garbage bags to haul their loot up through the hole, and one last thing, that really really confuses me: they took our toilet paper, and stuffed the toilet full.
Why? Thats all I have to ask. You've already stolen enough to pay for a week of crack. Why would you need to do something more?
So, we didn't open on time, waiting for the fingerprint guy to finish. We checked the roof, and found four garbage bags full of empty boxes. Plainly, the burglars had ripped what they could out, so they make off on, according to the fine officer of the RCMP, their bikes. We were robbed by teenagers on bikes. That fucking burns. They outsmarted our security, left irreperable damage, did basic vandalism, and avoided the storeroom floor with its heavy security. All done by guys who likely can't even legally drive yet.
Its times like that that remind me of Einstein's priceless quote: "Life is a contest between man and the universe, where man tries to build a better fool-proof system, and the universe builds a better fool. So far, the universe is winning."
Saturday, November 3, 2007
Singing, singing, away my soul or how cool Songbird is
Songbird is awesome. It has a huge amount of potential, especially in the current culture. Songbird is an open-source web-based music player. First, let me detail why I think Songbird is so awesome.
It is based on Mozilla
I'm a big fan of open-source, for many reasons, but I'll also be one of the first to admit its failures. (That shall come in another blog) Now, having Songbird based on Mozilla means that its using much of the same code that makes up Thunderbird and Firefox. Thats right, it can surf web pages.
It opens a new door on interaction
However, not only can it surf web pages, if you visit a website specifically built for songbird, using the rather well-done webpage api, it adds new features! Imagine going to your favorite band's blog, and hearing the latest sample songs they've loaded!
Or, experiencing the deep interaction that the Itunes Music store uses to offer... in a webpage. Thats right, web pages now become music stores in Songbird. But thats not the coolest feature.
Add-ons
Yep, just like Firefox, it supports add-ons, with even more potential than those in the browser. There are many many ideas here, and I'm sure you could think of a few yourself, things that you wished YOUR music player did. I'm pretty happy with what Amarok can do, and old versions of iTunes when I'm on windows. However, when I see potential, that gets me excited. And when its immense potential? You can imagine my excitement.
Now, go download it!
This is exciting stuff, and I can't wait to see what else. My experience with songbird was pretty good. I downloaded and installed it, and then checked out a few of the samples, mainly the sample music blog, and the sample music store. Try them out in songbird, and compare it to what it looks like in your regular browser. Can iTunes do that? No!
It is based on Mozilla
I'm a big fan of open-source, for many reasons, but I'll also be one of the first to admit its failures. (That shall come in another blog) Now, having Songbird based on Mozilla means that its using much of the same code that makes up Thunderbird and Firefox. Thats right, it can surf web pages.
It opens a new door on interaction
However, not only can it surf web pages, if you visit a website specifically built for songbird, using the rather well-done webpage api, it adds new features! Imagine going to your favorite band's blog, and hearing the latest sample songs they've loaded!
Or, experiencing the deep interaction that the Itunes Music store uses to offer... in a webpage. Thats right, web pages now become music stores in Songbird. But thats not the coolest feature.
Add-ons
Yep, just like Firefox, it supports add-ons, with even more potential than those in the browser. There are many many ideas here, and I'm sure you could think of a few yourself, things that you wished YOUR music player did. I'm pretty happy with what Amarok can do, and old versions of iTunes when I'm on windows. However, when I see potential, that gets me excited. And when its immense potential? You can imagine my excitement.
Now, go download it!
This is exciting stuff, and I can't wait to see what else. My experience with songbird was pretty good. I downloaded and installed it, and then checked out a few of the samples, mainly the sample music blog, and the sample music store. Try them out in songbird, and compare it to what it looks like in your regular browser. Can iTunes do that? No!
Friday, November 2, 2007
Potential job...
Today I interviewed for a job as webmaster for the UBCO Phoenix. Its an university newspaper, published bi-weekly.
They're an interesting group, pretty fun. All macs in the office, something else to note. It seems like creative groups always use macs, but thats aside from the point.
They want a webmaster, because, to put it plainly, their website is boring. Also, their was a bit of work involved in posting each story.
What they want is a rebuilt website that changes both of those, and I offered a few ideas. Of all print publications, a student newspaper can try new things out, new methods, new ways of news and interacting with their readers.
They also have the benefit that they're writing for the new generation of movers and shakers. This audience, aged 18-24, are the people that put Facebook and Myspace on the map. Okay, I grant that that doesn't mean too much in a sense, but it also means that these people love interaction. They love media. And a student newspaper can provide a new angle on news gathering and interaction.
They(the editors of the Phoenix) discussed an issue about how, due to their bi-weekly schedule, they get submissions that they just can't publish. It would be too late, or too early, or just not right. A good website could change that. One thing thats annoyed me, is how news will publish stories, but there are no updates, no follow-ups, no linking together. Its still them pushing the news, what they decide as news, to us.
I do have to point out the one exception to this generality, CBC news. (I think its them, correct me if I'm wrong) They have a tag cloud, linking relevant news stories together. That is quite cool, and very very useful. What a tag cloud does, is that it takes the tags people place on the stories, and you can check out other stories with similar tags. Take for example, "Iraq". You'd be able to see all the articles tagged with "Iraq" as well as common tags on those articles. Those tags are seen as being related, say, "US Foreign Policy" as an example.
The ideas I threw out for their website were as follows: staff blogs, forums, and online-only articles, on timely and relevant news. Say for example, the recent cougar sightings.
And here's the best idea: individualized filters, ratings for each articles that contribute to your personal filter, which will contribute to feedback to the staff members on which stories were liked, and weren't liked. Ones that people wanna hear more about will be rated higher, and the news staff can see this, and this is big: tailor their stories to satisfy this demand.
Those are my ideas for their website, and hopefully I get the job, despite the low pay. It will be a very interesting experience, will look good on a resume, and give me much needed experience.
They're an interesting group, pretty fun. All macs in the office, something else to note. It seems like creative groups always use macs, but thats aside from the point.
They want a webmaster, because, to put it plainly, their website is boring. Also, their was a bit of work involved in posting each story.
What they want is a rebuilt website that changes both of those, and I offered a few ideas. Of all print publications, a student newspaper can try new things out, new methods, new ways of news and interacting with their readers.
They also have the benefit that they're writing for the new generation of movers and shakers. This audience, aged 18-24, are the people that put Facebook and Myspace on the map. Okay, I grant that that doesn't mean too much in a sense, but it also means that these people love interaction. They love media. And a student newspaper can provide a new angle on news gathering and interaction.
They(the editors of the Phoenix) discussed an issue about how, due to their bi-weekly schedule, they get submissions that they just can't publish. It would be too late, or too early, or just not right. A good website could change that. One thing thats annoyed me, is how news will publish stories, but there are no updates, no follow-ups, no linking together. Its still them pushing the news, what they decide as news, to us.
I do have to point out the one exception to this generality, CBC news. (I think its them, correct me if I'm wrong) They have a tag cloud, linking relevant news stories together. That is quite cool, and very very useful. What a tag cloud does, is that it takes the tags people place on the stories, and you can check out other stories with similar tags. Take for example, "Iraq". You'd be able to see all the articles tagged with "Iraq" as well as common tags on those articles. Those tags are seen as being related, say, "US Foreign Policy" as an example.
The ideas I threw out for their website were as follows: staff blogs, forums, and online-only articles, on timely and relevant news. Say for example, the recent cougar sightings.
And here's the best idea: individualized filters, ratings for each articles that contribute to your personal filter, which will contribute to feedback to the staff members on which stories were liked, and weren't liked. Ones that people wanna hear more about will be rated higher, and the news staff can see this, and this is big: tailor their stories to satisfy this demand.
Those are my ideas for their website, and hopefully I get the job, despite the low pay. It will be a very interesting experience, will look good on a resume, and give me much needed experience.
Dependencies, and the interventions thereof
A current project of mine, aside from pesky schoolwork, is an rpg, with my best friend, Ruby. The first tool we need is a map making tool, which is in the progress. See, with our own map making tool, we could add the features /we/ wanted to it.
This brings an interesting problem to the table, however. How do you deal with asset management on a large scale? Particularly, for people that may not be that techologically adept. Of course, Ruby has no problem in that arena. For an rpg, even one as short as the one we plan, there will still be hundreds, if not thousands of images, music files, animations, map files, everything.
For the map maker then, it would need to, behind the scenes at least, manage the assets for the user, namely Ruby. When the user saves a map file, the assets used would be moved into their own folders, along the lines of "Animations" for the animation files, "Tiles" for the tiles, "BigTiles" for the big tiles, etc. Now, these folders will be invisible, and will sit in the same directory where the map file is saved.
The best part is this: the map file will also list the last known locations for the original assets, and if they've changed, will add them to the folders. As well, it will back up the old versions, by creating diffs of the files. So, the user can, and most likely will need to revert their files. Lo and behold, backups have been done for them!
This is kind of sneaking around the primary issue, I admit. Sneaking in primitive source control, but when you get them started on something small, and they find it useful, its easier to suggest a bigger solution. Like, say, actual source control.
Then again, adding in such functionality is kind of bigger than what is needed out of the application, and I'm still trying to decide what to do.
Any suggestions, give me a shout in the comments.
This brings an interesting problem to the table, however. How do you deal with asset management on a large scale? Particularly, for people that may not be that techologically adept. Of course, Ruby has no problem in that arena. For an rpg, even one as short as the one we plan, there will still be hundreds, if not thousands of images, music files, animations, map files, everything.
For the map maker then, it would need to, behind the scenes at least, manage the assets for the user, namely Ruby. When the user saves a map file, the assets used would be moved into their own folders, along the lines of "Animations" for the animation files, "Tiles" for the tiles, "BigTiles" for the big tiles, etc. Now, these folders will be invisible, and will sit in the same directory where the map file is saved.
The best part is this: the map file will also list the last known locations for the original assets, and if they've changed, will add them to the folders. As well, it will back up the old versions, by creating diffs of the files. So, the user can, and most likely will need to revert their files. Lo and behold, backups have been done for them!
This is kind of sneaking around the primary issue, I admit. Sneaking in primitive source control, but when you get them started on something small, and they find it useful, its easier to suggest a bigger solution. Like, say, actual source control.
Then again, adding in such functionality is kind of bigger than what is needed out of the application, and I'm still trying to decide what to do.
Any suggestions, give me a shout in the comments.
Subscribe to:
Posts (Atom)