Advertisement

Simplest AI (I really need one ASAP)

Started by March 30, 2009 07:16 AM
9 comments, last by DarkBalls 15 years, 8 months ago
Which one is the simplest AI that I can code easily in C? Is there any pathfinding that can be code easily? If none, any AI is fine at least it is for a beginner like me. I really need is ASAP. Thanks darkballs
This is the simples AI for chess:
Action Simple_AI() {  return ACTION_RESIGN;}
Advertisement
Have the AI not move, or behave completely randomly.

Have the AI move directly towards the target, regardless of terrain.

Have the AI sometimes move directly towards the target, and sometimes move randomly.

Have the AI eat punch, and maybe pie.

Have the AI offer the player cake.

Download eliza, and feed it a text description of player moves. Interpret eliza's response as moves for the AI.

[Edited by - NotAYakk on March 30, 2009 10:28:22 AM]
A 2-state, Finite State Machine (FSM).

You can do the rest of your homework yourself.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

You're asking for "the simplest AI", but do you at least have something to work with? Good luck with your homework anyway, it looks like an easy task ;)
Thanks everyone for helping me but honestly, I really don't know how to discuss my topic. I really need to show how it is related to D iscrete Mathematics? Can anyone here give me some idea how is it related with it?

[Edited by - DarkBalls on March 31, 2009 8:20:51 AM]
Advertisement
At first I was going to skip over this thread (phrases like "I really need it ASAP" just reek of "somebody do my homework for me"). But since I realize now that you're really just asking for ideas for a project to do (and that you'll do this project yourself -- right?), I'm feeling a little more helpful.

Discrete mathematics is a huge area, and without being in your course I have no way to know what's expected. Since graph theory is part of discrete math, any graph algorithm should be appropriate. Most are actually quite simple, so depending on your grade level, you should probably implement multiple graph search algorithms and compare them in order for this to be a reasonable project.

Therefore, my advice is to check out this page. A good starting point is Dijkstra's algorithm. Then, A* is just a small modification of the same basic algorithm.

You could also do a game tree search. You'd start with minimax, then look at negamax, and perhaps implement Alpha-Beta pruning to speed things up.

That should give you a starting point. Now do some research on your own.
Thanks Emergent but most of the topic you mentioned are not discuss on our class and I noticed they are almost on the back page of our book but I'll try to advance reading it later and I hope I understand it.

Logic, Set theory, Information Theory, and Number theory only. Is there any related to it? I'm new in AI and willing to learn it so sorry for my newbieness.

Yeah, I'll do it by myself. I just want to get some ideas for it because I really don't know where to start and how to relate it for our past topics. If there are no relation at all, there's no choice but to use those topic that are not discussed on our class.

Thanks
DarkBalls
Quote: Original post by DarkBalls
Logic, Set theory, Information Theory, and Number theory only. Is there any related to it? I'm new in AI and willing to learn it so sorry for my newbieness.


"Newbieness" is ok; we just want people to put their own effort into things.

From what you've said I think I have an idea for the kinds of stuff you've done in your course. If I have the right idea for what you've done, then maybe a project relating to digital electronics rather than AI would be more applicable. I'm not telling you to go build a circuit! Instead, I mean that maybe you could come up with a real-life problem that you might want to design a circuit to solve, and then design one at the logic-gate level to solve it. To do this, you wouldn't have to know anything about electricity or transistors or anything to do with how electronics actually work. Instead, you just say that you have boxes that compute the logical "AND," "OR," "NOT," etc, of different values, and your problem is how to put them together to do what you want.

For instance: Let's say you have two numbers, which you've represented in binary (it sounds like maybe you've looked at binary numbers?). How can you use nothing but AND, OR, and NOT gates to compute their sum?

Now, the problem I just mentioned has all kinds of solutions that you can just look up online -- and I assume your teacher/professor would know this -- so you should try to come up with a problem that requires a little creativity to solve. Like: You have to design a soda machine that only takes quarters, nickels, and dimes, and which dispenses three kinds of soda, costing different amounts; define the problem more precisely and come up with a logic circuit to solve it.

If you're dead set on AI, there are logic-based methods, but I think they're actually harder than the graph-based ones I mentioned (which, in fairness, are quite easy); if you're interested you might check this out, for instance (which really just gives you a link to a paper).

Or, as you said, you could always do something with graphs, which might be a little outside the scope of the course. Though even here you can apply your course. For instance, you mentioned information theory. Well, there are different representations for graphs (e.g., adjacency matrices, adjacency lists, and incidence matrices); which ones require the fewest bits to store? How big do your graphs need to be for one method to be better than another? How many edges? How many nodes?

At this point I'm just brainstorming off the top of my head, and I'm probably rapidly becoming less helpful. So I'll just wrap up and say: Look around online for ideas, and then talk to your teacher about them, and see what he/she says.
This is the simplest AI of all time:


void AI()
{
return;
}

This topic is closed to new replies.

Advertisement