Welcome to GameHourz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Worm

 
   Game Forums (Home) -> AI Games RSS
Related Topics:
TBC Fast Package(1-70) - Any Class Free 2000G - Wow per level per level. Dear Sir or Madam Hot Sale!For all of our news and are some Special Package! We now provide measured by..

A* and multi-goals - Hello, I am using A* to find the shortest path in a 3D I have waypoints at each rooms, points to create the graph. At the moment I can select a start and goal node, the A* algorithm do the rest and my

bigtest - bigtest

AI and C# - HI all... does anybody know a book about AI, which includes examples in c#? thx for reading ;)

2006 Chatterbox Challenge - The online voting for the 2006 Challenge at has begun. Visit the site and vote for the 3 best bots. No or anything required to vote. Voting ends 4/30/06. Wendell
Next:  System requirements  
Author Message
makc.the.great

External


Since: May 16, 2005
Posts: 11



(Msg. 1) Posted: Mon May 16, 2005 5:57 am
Post subject: Worm
Archived from groups: comp>ai>games (more info?)

I'm sure you all know this game... A little worm crawles on rectangle
grid bounded by 4 walls, random food appears, and when it eats, it's
getting longer... So, I am wondering what would be best strategy for
computer-controlled worm? My first try was to make it crawl along the
walls, reach out for food, grab it and get back to the wall. But then,
when I added random obstacles, such a strategy could easily lead worm
into trapping itself occasionally, so... Good strategy - what would it
be?

 >> Stay informed about: Worm 
Back to top
Login to vote
makc.the.great

External


Since: May 16, 2005
Posts: 11



(Msg. 2) Posted: Tue May 17, 2005 5:28 am
Post subject: Re: Worm [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> divide up (in the "snake's mind") the playfield into regions with a
> 1-square-wide entry point, and make sure the snake is completely
inside a
> region (such that there's a path to the open entrance) before eating
a
> pellet in it?

good idea. not-so-tricky part of this is what to do when it is not
inside? where to crowl, if it can't crawl toward the food?

 >> Stay informed about: Worm 
Back to top
Login to vote
Lash Rambo

External


Since: Apr 26, 2005
Posts: 10



(Msg. 3) Posted: Tue May 17, 2005 8:38 am
Post subject: Re: Worm [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"makc.the.great" <makc.the.great.RemoveThis@gmail.com> wrote in
news:1116248241.253411.49380@g14g2000cwa.googlegroups.com:

> I'm sure you all know this game... A little worm crawles on rectangle
> grid bounded by 4 walls, random food appears, and when it eats, it's
> getting longer... So, I am wondering what would be best strategy for
> computer-controlled worm? My first try was to make it crawl along the
> walls, reach out for food, grab it and get back to the wall. But then,
> when I added random obstacles, such a strategy could easily lead worm
> into trapping itself occasionally, so... Good strategy - what would it
> be?

Maybe divide up (in the "snake's mind") the playfield into regions with a
1-square-wide entry point, and make sure the snake is completely inside a
region (such that there's a path to the open entrance) before eating a
pellet in it? There may be other sticky points, but they can probably be
handled via similar ideas.

This harkens me back to my days trying to make QBasic "Nibbles" play on
autopilot. Maybe I'll try that again....
 >> Stay informed about: Worm 
Back to top
Login to vote
Lash Rambo

External


Since: Apr 26, 2005
Posts: 10



(Msg. 4) Posted: Wed May 18, 2005 7:12 pm
Post subject: Re: Worm [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"makc.the.great" <makc.the.great.TakeThisOut@gmail.com> wrote in
news:1116332897.167942.68940@g44g2000cwa.googlegroups.com:

>> divide up (in the "snake's mind") the playfield into regions with a
>> 1-square-wide entry point, and make sure the snake is completely
> inside a
>> region (such that there's a path to the open entrance) before eating
> a
>> pellet in it?
>
> good idea. not-so-tricky part of this is what to do when it is not
> inside? where to crowl, if it can't crawl toward the food?

Maybe have the snake zig-zag inside the region, starting as far from the
pellet as possible. Basically, you want the snake to "bunch up", while
leaving a path to the exit, while not eating the pellet. As far as
specific algorithms to do this, I'm not sure.
 >> Stay informed about: Worm 
Back to top
Login to vote
varad

External


Since: Jun 05, 2005
Posts: 1



(Msg. 5) Posted: Sun Jun 05, 2005 12:05 pm
Post subject: Re: Worm [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi,

That was nice one. Developing a fool-proof AI for the snake can be
difficult.

Ok, here is an idea. I hope this might help you:

Draw an imaginary straight line from snake's head to the food. ( I am
assuming the smallest drawing element is one 'block' e.g. food occupies
one block, width of snake is one block, length of the snake is 'k'
blocks long etc.) Now for every block on the imaginary line, move the
block vertically upwards or downwards to nearest empty block i.e. to
the block which contains no obstacle. You will have the obstacle-less
path to the food. If the length of line (in block measure) is greater
than 'k'(the length of snake) then the snake cuddles itself until its
length is less than the line length. You can also check if there is a
return path is available by drawing another imaginary line (after
drawing the first line) from food to the current position of snake's
head and assuming the first imaginary line as an obstacle. This will
give you alternate return path.
 >> Stay informed about: Worm 
Back to top
Login to vote
Display posts from previous:   
   Game Forums (Home) -> AI Games All times are: Ekaterinburg, Islamabad, Karachi, Tashkent (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]