
-----------------------------------
implosion
Tue May 27, 2008 6:44 pm

Simple AI help ?
-----------------------------------
can someone show me an example of a simple code (for BlueJ) that has an AI that has a picture value to it and make it move across the screen from left to right so i can get a base started for making my own AI ?

-----------------------------------
Reality Check
Tue May 27, 2008 8:07 pm

Re: Simple AI help ?
-----------------------------------
You need to be more specific.  I assume you have a picture of some enemy or something that you want to move based on your location?  For me to help you with a specific AI I need to know what type of game/program you are making.  A very simply one though:

You have a paint method with your draw function with x and y as variables.  In other methods or your program you'd alter x and y based on what you want it to do and then update with your new x and y variables.  I want write for you any specific code though, that has to be one on your own   :D

-----------------------------------
A.J
Tue May 27, 2008 8:55 pm

Re: Simple AI help ?
-----------------------------------
cud u explain this game of yours please, so I can help u

-----------------------------------
implosion
Tue May 27, 2008 8:55 pm

Re: Simple AI help ?
-----------------------------------
The kind of game that we're trying to produce is a Tower Defense... you have guys coming from one end to the other and you set up towers to kill them. i don't want all the work done, but enough information to get me started. our programmer teacher isn't here anymore and we have a supply that doesn't know much about BlueJ

-----------------------------------
Tony
Tue May 27, 2008 9:18 pm

RE:Simple AI help ?
-----------------------------------
Well the "AI" requires to know the shortest path from the spawn point to the exit point, and it follows that path on the screen. Look into the A* (A-star) algorithm

-----------------------------------
cavetroll
Tue May 27, 2008 9:22 pm

RE:Simple AI help ?
-----------------------------------
I don't really know Java so I can't give you any code. However, couldn't just use waypoints and advance the unit to the next waypoint and then repeat? I would think that would work, unless of course the assignment is not so much the game as the pathfinding.

-----------------------------------
btiffin
Tue May 27, 2008 9:26 pm

RE:Simple AI help ?
-----------------------------------
Not simple;
http://www.markwatson.com/opencontent/
in particular; http://www.markwatson.com/opencontent/AIprog.pdf

Awesome technical treatise of AI in Java.

Cheers

-----------------------------------
Tony
Tue May 27, 2008 9:34 pm

Re: RE:Simple AI help ?
-----------------------------------
couldn't just use waypoints and advance the unit to the next waypoint 
Not if there's a defense tower build in between the waypoints.

-----------------------------------
A.J
Tue May 27, 2008 9:54 pm

Re: Simple AI help ?
-----------------------------------
ask fishtastic (a user on compsci).


he made an AMAZING tower defense (but its on turing though)

I can help u with anything u need in A*, but he can help u with the rest (and also A*)

-----------------------------------
tenniscrazy
Wed May 28, 2008 7:38 am

RE:Simple AI help ?
-----------------------------------
ya, his tower defense is what gave us the idea :P

thanks for the help and suggestions.  I think we have an idea what to do now
