Alice Community  

Go Back   Alice Community > Alice 2 > Share Worlds

Reply
 
Thread Tools Display Modes
Primitive AI
Old
Chris101b
Senior Member
 
Chris101b's Avatar
 
Status: Offline
Posts: 361
Join Date: Jun 2007
Default Primitive AI - 10-25-2009, 03:26 AM

This has been one of those things that has kept bugging me for a while. I have always wondered how to add a sort of primitive AI to a game. Well, I am currently testing a method. In the world below, the cow is only allowed to move to squares that are within its vicinity. So the cow can't move from one of the squares closest to you to one of the squares farthest from you without going to one of the ones in the middle.

This is very simplistic, but imagine replacing those "move to's" with different methods. You could make an enemy with different methods such as rolling left or right, jumping, shooting, crouching, etc. I am actually testing if I can stack different methods. This will make it so that the current AI that is there is for moving, while another will be for if he shoots or not, and another will be if he yells at you or not. I will test this. Tell me what you think.


I am nowhere and everywhere at the same time.

www.facebook.com/chris101b
Xbox Live GT: Chris101b
Youtube: (You guessed it) www.youtube.com/chris101b
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 10-25-2009, 04:15 AM

Two things:

There's no world there. You must have forgotten to attach it.

I just released version 3 of Resident Penguin, have you tried it?


(')>
   
Reply With Quote
Old
Chris101b
Senior Member
 
Chris101b's Avatar
 
Status: Offline
Posts: 361
Join Date: Jun 2007
Default 10-25-2009, 05:02 AM

Wow, I am stupid. Haha, oh well. I was able to figure out and perfect "Stacking". I have 2 systems implemented right now: Movement and talking. I want them to be running simultaneously but at the same time separate. I figured out how to get this done and now I have the cow moving from square to square correctly and also have him "talking" (a splash sound) at random times. I only have one sound in there now, but could easily add more. This would be a very effective method of making randomly occurring dialogue during a firefight in a game. I will attach it this time. :P

(I would suggest making the world run at 10x speed)
Attached Files
File Type: a2w ai test2.a2w (1.19 MB, 58 views)


I am nowhere and everywhere at the same time.

www.facebook.com/chris101b
Xbox Live GT: Chris101b
Youtube: (You guessed it) www.youtube.com/chris101b
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 10-25-2009, 10:09 PM

Pretty cool! I've been thinking about a way to incorporate AI into a game, and this is one good way to do it! Great job!


(')>
   
Reply With Quote
Old
Chris101b
Senior Member
 
Chris101b's Avatar
 
Status: Offline
Posts: 361
Join Date: Jun 2007
Default 10-26-2009, 02:30 AM

Thanks, the main thing I want to try and incorporate is multiple enemies doing things at once without colliding with each other. I will try to experiment with it. I'm not sure if anyone has tried to make something like this before. I may work on making a more complex version where instead of a cow moving from point A to point B, that it can be a human with a gun that rolls, jumps, attacks, and talks realistically, just like in a game.

The good thing is that once you make one person, all you have to do is copy them and all of the methods will transfer over. As you can see I added a few more cows to the mix. I also made them start at random times. This is a good way to make a swarm of enemies attack.

Edit: I made the swarm more realistic. Press play, wait for the swarm to start up, enjoy.
Attached Files
File Type: a2w Ai swarm test.a2w (2.38 MB, 24 views)


I am nowhere and everywhere at the same time.

www.facebook.com/chris101b
Xbox Live GT: Chris101b
Youtube: (You guessed it) www.youtube.com/chris101b

Last edited by Chris101b; 10-26-2009 at 03:29 AM.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 10-26-2009, 04:24 AM

Seems solid, but for some reason ran choppy on my PC. I helped the situation a bit by deleting the bunnys' turning loops, though.


(')>
   
Reply With Quote
Old
Chris101b
Senior Member
 
Chris101b's Avatar
 
Status: Offline
Posts: 361
Join Date: Jun 2007
Default 10-26-2009, 04:20 PM

Yeah, the bunnies were there as a visual marker. I made it so that after the cows move to the squares, they move left/forward and then right/backwards a random number of meters as seen by the bunnies. This makes the swarm effect look slightly more realistic. I just made the bunnies turn forward and backwards as well so that the cows would move up and down as well as around. I could also make it so that the blocks are invisible and they move forward and backward to make the swarm even more realistic. I could even make the blocks fly so that the swarm can move as one. A lot can be done with this.


I am nowhere and everywhere at the same time.

www.facebook.com/chris101b
Xbox Live GT: Chris101b
Youtube: (You guessed it) www.youtube.com/chris101b
   
Reply With Quote
Old
Chris101b
Senior Member
 
Chris101b's Avatar
 
Status: Offline
Posts: 361
Join Date: Jun 2007
Default 10-28-2009, 03:01 AM

Okay I made a new test with enemies that move around and "dodge". This is a first version, so right now, all of the enemies move in random directions and also dodge (This is a super simple animation, but could later be replaced by a realistic rolling animation). In versions to come, I will have the enemy shout things at you, and maybe have a gun and shoot at you. With this method of creating AI, you can basically get them to do anything.

Use the arrow keys to move and "A" and "D" to strafe.
Attached Files
File Type: a2w testtestest2.a2w (1,015.3 KB, 21 views)


I am nowhere and everywhere at the same time.

www.facebook.com/chris101b
Xbox Live GT: Chris101b
Youtube: (You guessed it) www.youtube.com/chris101b
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 10-28-2009, 03:39 AM

Not too bad. Definitely looking forward to the newer releases. Are the new releases going to have the enemies' movements constrained so that they don't go offscreen?


(')>

Last edited by x2495iiii; 10-28-2009 at 04:01 AM.
   
Reply With Quote
Old
Chris101b
Senior Member
 
Chris101b's Avatar
 
Status: Offline
Posts: 361
Join Date: Jun 2007
Default 10-28-2009, 04:28 AM

I will have to mess around with that. The problem is that having constraints like that will have to interrupt the code telling him to move. I will have to mess around with it, but will most likely think of a way. Also take in to account that you can move around as well, so keeping him inside the camera range is pointless. I may have him stay within a certain area though.


I am nowhere and everywhere at the same time.

www.facebook.com/chris101b
Xbox Live GT: Chris101b
Youtube: (You guessed it) www.youtube.com/chris101b

Last edited by Chris101b; 10-28-2009 at 06:10 AM.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.