oneslime.net Forum Index oneslime.net
Slime talk
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

One slime source

 
Post new topic   Reply to topic    oneslime.net Forum Index -> Programming
View previous topic :: View next topic  
Author Message
dave
Inferior Human Controlled Slime


Joined: 21 Dec 2006
Posts: 2

PostPosted: Thu Dec 21, 2006 9:17 pm    Post subject: One slime source Reply with quote

I salute you!,
I'm doing a fourth year project on reinforcement learning and was thinking the one player version of the game would be a good thing to write it on. Had a look round for the source code for the one player version without any luck. Was wondering if it was available anywhere. I could write it into the two player game if I had to, just would be easier if I could get hold of a version with AI already in.
Cheers,
Dave
Back to top
View user's profile Send private message
wedgey
Site Admin


Joined: 01 Mar 2006
Posts: 207
Location: three quarters of a mile from the surface of the sun

PostPosted: Wed Dec 27, 2006 4:33 pm    Post subject: Reply with quote

Hey Dave
The source for One Slime isn't available, sorry. You would probably be disappointed by the AI code if you saw it too, it's really simple (no learning or planning at all). The two player source is available at many places, but this version is probably the easiest to read.
Good luck!
Back to top
View user's profile Send private message
dave
Inferior Human Controlled Slime


Joined: 21 Dec 2006
Posts: 2

PostPosted: Sat Dec 30, 2006 10:59 pm    Post subject: Reply with quote

Cheers for the pointer. Wasn't expecting advanced AI as such, just a list to do in various situations which is what I'll (hopefully) being getting the slime to learn. I'll send show you what I do, if I get round to doing it, and your interested.
Thanks for the help,
Dave
Back to top
View user's profile Send private message
bshepetofsky
Inferior Human Controlled Slime


Joined: 14 Oct 2010
Posts: 3

PostPosted: Thu Oct 14, 2010 4:25 am    Post subject: Reply with quote

Just how do you make an AI, and how do you set the AI's difficulty?
Back to top
View user's profile Send private message
wedgey
Site Admin


Joined: 01 Mar 2006
Posts: 207
Location: three quarters of a mile from the surface of the sun

PostPosted: Sun Oct 31, 2010 5:41 pm    Post subject: Reply with quote

Good question. The One Slime AIs aren't smart at all, they just try to hit the ball, there's no planning involved at all. The main differences are thresholds specifying at what point they should hit the ball (i.e. in front of them, on top, how far above the ground).

The Slime Tennis AIs do consider where you are in the court and will try to move you around the court. However this doesn't always happen as planned, mainly because although it knows how the ball will move (spin-wise) after hitting it (it has to do this so that it doesn't hit the ball out of the court for example), it doesn't know how much spin *you* have put on the ball, so it may be out of position when it hits the ball. Of course it *could* know the motion of the ball perfectly but that's not fair.

I can't remember anything about the Slime Cricket AIs. I'd assume that it's similar to One Slime - just try to hit the ball.
Back to top
View user's profile Send private message
bshepetofsky
Inferior Human Controlled Slime


Joined: 14 Oct 2010
Posts: 3

PostPosted: Mon May 16, 2011 8:21 am    Post subject: Reply with quote

But how do u put an AI into the game?
Back to top
View user's profile Send private message
wedgey
Site Admin


Joined: 01 Mar 2006
Posts: 207
Location: three quarters of a mile from the surface of the sun

PostPosted: Tue May 17, 2011 6:56 pm    Post subject: Reply with quote

The game has a main loop contained within run() which moves the ball using MoveBall(), the slimes via MoveSlimers() and then redraws the applet. If you look at MoveSlimers(), you'll see that's where the slime positions p1X, p1Y, and velocities p1XV and p1YV are updated. You could put a call inside MoveSlimers to call your AI code which updates those position and velocity variables.
Back to top
View user's profile Send private message
bshepetofsky
Inferior Human Controlled Slime


Joined: 14 Oct 2010
Posts: 3

PostPosted: Mon May 23, 2011 3:42 am    Post subject: Reply with quote

And that's it? After that, you have an AI?
Cool.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    oneslime.net Forum Index -> Programming All times are GMT + 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot 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


Powered by phpBB © 2001, 2005 phpBB Group