• entries
707
1173
• views
436744

My first attempt at AI

726 views

Wow, I went to PlanetSourceCode.com and found some of my old code, including my first attempt at AI. It was done two years ago, so I don't think its so bad (especially since I've never read any articles or actually tried to learn AI.)

Here's a link (7/13/05 doesn't work)

I just want to point out that this is old code and uses coding techniques and naming conventions that I DO NOT. I have greatly improved both since I uploaded this code to PSC (2/16/2003).

haha, PlanetSourceCode was halarious. I used it for everything about four years ago. When I decided to finish up with Visual Basic and move onto C++, I put up some of my stuff: for shame!

Nice state machine ya going there :)

Rob, that is a sweet tutorial on DLLs.

Hey, Programmer16 I didn't know you had a journal :)

Good luck with your library, I'm doing kinda the same thing too.

Hey Mindset! I just started it (actually, after reading yours :D)

I think you're missing the point of a state machine. You use them so you don't have that use hugely ugly case statement. You pretty much have a base class named State (or something like that) and have all states that you plan on having derived from this base state class. Therefore when you do an update all you do is call CurrentState->SomeFunction and it manages calling the correct function for you instead of having to do something like:
switch(*Dtrmnr)
{
case Hungry:
{
....

Yeah, this was when I was just starting though. I've got a class based state machine that I use now (maybe I'll update the code using my new state machine. Maybe add a few states... hmm gives me something to do.)

Create an account

Register a new account