I was poking around the game programming wiki and saw that an article on Rule Based AI was wanted. So I wrote a very basic one with a description. I intend to write something similar for my game at some point, so this is a small prototype.
There's an interesting postmortem on Stardock's Galactic Civilizations II: Dread Lords over on Gamasutra, registration required.
As for me I have simple ascii village generation working now, which is nice. My next todo is sorting the namespaces out correctly. I've been playing around with the Scheme programming language too - a dialect of Lisp. I haven't got too far yet but it's something I've been meaning to do for a while.
I've stopped using a .txt Todo list and I've started using a one-page-wiki called GTDTagglyWiki. I store it locally and have it as a bookmark when firefox opens. For some reason it comes with crappy and really slow animations - there can be turned off in options and after that it's quite useful.
7 comments:
I just encountered the most stupid bug imaginable, at least by me.
I had the RelationKey struct definition in a different code file than KnowledgeBase class.
Because of this, knowledge.ContainsKey(key) would always fail to return true.
What helped? Either move the struct definition to same file as the KnowledgeBase, or add namespace.RelationKey to the struct definitions in the KnowledgeBase class.
Kinda stupid, but...
and another one:
I could not get knowledge.ContainsKey() and knowledge[key].Contains() to work.
The problem was probably because Relationship and RelationKey didn't have GetHashCode() overridden.
I did a simple GetHashCode() function for both and ta-dah, it worked nice. Relationship class also needed a override of Equals()
Strange, you shouldn't need override anything for it to work correctly. I'll zip up the source code today and then upload it tonight.
If you're interested my source is available now here.
Your code works without the overrides. My code is almost identical, I have no idea what's wrong with it :P
plz upload ur source code to another website coz iam unable to download it from gpwiki :(
Post a Comment