Noob needs help on AI
***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.
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.
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.
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
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.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Kind of a noob question - finding artwork within my .app?? | Nethfel | 2 | 2,464 |
Mar 8, 2010 08:00 AM Last Post: AndyKorth |
|
| Noob: Accessing Structures from Cocoa Classes | MikeC | 15 | 6,581 |
Oct 19, 2007 02:42 PM Last Post: MikeC |
|
| Noob Cocoa and Carbon Questions | MonitorFlickers | 15 | 5,797 |
Feb 23, 2006 06:01 PM Last Post: Tesselate |
|
| Noob Fullscreen.. | Robertseadog | 5 | 2,866 |
Mar 29, 2005 03:15 PM Last Post: TomorrowPlusX |
|
| Noob: Copying Classes | hangt5 | 3 | 3,161 |
Mar 9, 2005 12:52 PM Last Post: codemattic |
|

