Noob needs help on AI

smgran
Unregistered
 
Post: #1
***I tried to post this but for some reason it didn't show up so excuse me if this posts twice***

I am Noob programmer and have done a few simple projects in Cocoa. I'm getting close to finishing off my first major (well, what I call major) project. It's a baseball game. If anyone is old enough to remember these, it's basically like APBA or Strat-O-Matic. So it's not really a graphic game but instead just a text based sort of statistical strategy game.

Anyway, it can be played solitaire with the player (that would be me of course) making the decisions for both teams (again, very much like the old board baseball game APBA). However, I would like to create an AI so that games could be played vs. computer or even computer vs. computer (hard to get through a 162 game season playing every single game myself).

Being a noob, I'm not quite sure how to implement an AI. I mean should I think of it as being a single class whose methods (rules that I would create like "if runs scores > 5 replace pitcher") are called in my main game loop? I'm looking for just general help here and ALL comments and suggestions are welcome. Again, this is not a graphical game and the game loop (and of course it's really like a turn based game) is nothing more than...


Set Lineup (who's At Bat, who's in the field, etc.)
Defense selects play (usually just pitch)
Offense selects play (again, usu just hit away)
Determine outcome
Update Game Situation (and stats)
etc.

I hope this is enough info for someone to provide some guidance.
Quote this message in a reply
Member
Posts: 78
Joined: 2004.06
Post: #2
I don't really know much about coding AI, but I can give you this one piece of advice I learned from experiance:

Most of AI coding (at least for me) seems to be about dumming the AI down. It's really easy to make a perfect AI; the more 'real' and 'vulnerable' you want your AI to be, the more you'll have to put into it.

What I usually do is just that; create a class whith a bunch of methods, which can read the current game status, and then just do a bunch of ifs ands and ors from there.

When in doubt ... read the Read Me
10.5.6 | MacBook Pro 2.5x2 | 4 GB RAM | GeForce 8600M GT
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #3

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
smgran
Unregistered
 
Post: #4
Shunter Wrote:I don't really know much about coding AI, but I can give you this one piece of advice I learned from experiance:

Most of AI coding (at least for me) seems to be about dumming the AI down. It's really easy to make a perfect AI; the more 'real' and 'vulnerable' you want your AI to be, the more you'll have to put into it.

What I usually do is just that; create a class whith a bunch of methods, which can read the current game status, and then just do a bunch of ifs ands and ors from there.

Thanks. That is what I had thought, but since all my other projects were just little utilities (a DVD Library app, To Do List, etc.) and this being my first venture into a game, I wasn't really sure if there was some special way in which AIs are managed.

The gameplay itself is pretty simplistic, since you only manage the team and some basic baseball strategy. So my task of dumming the AI down should be fairly easy to do.

Thanks again.
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #5
This may be useful: ObjectiveCLIPS
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Noob Cocoa and Carbon Questions MonitorFlickers 15 6,217 Feb 23, 2006 06:01 PM
Last Post: Tesselate
  Noob Fullscreen.. Robertseadog 5 3,138 Mar 29, 2005 03:15 PM
Last Post: TomorrowPlusX
  Noob: Copying Classes hangt5 3 3,464 Mar 9, 2005 12:52 PM
Last Post: codemattic