Air Hockey AI
GameLabs222
Member Posts: 197
Hello all!
I'm somewhat new to GameSalad and I've been working on trying to make an air hockey game. I thought it would be a good place to learn a lot of basic concepts in GS. I want to be able to have two modes. One, a local multiplayer on the device and the other vs the computer with different difficulties.
I was wondering if anyone could help me better understand how to implement AI in a specific way for air hockey, or would want to help collaborate and build it with me?
I'm somewhat new to GameSalad and I've been working on trying to make an air hockey game. I thought it would be a good place to learn a lot of basic concepts in GS. I want to be able to have two modes. One, a local multiplayer on the device and the other vs the computer with different difficulties.
I was wondering if anyone could help me better understand how to implement AI in a specific way for air hockey, or would want to help collaborate and build it with me?
Best Answers
-
jamie_c ImagineLabs.rocks Posts: 5,772If you're looking for a simple 'pong' kind of air hockey game, you would just have the AI goalie follow (constrain itself) the Y attribute of the puck. You might want to add some variation to the constraint so it's not impossible to beat, or maybe only have the AI goalie follow the puck when the puck is on it's side of the screen.
-
The_Gamesalad_Guru Posts: 9,922Yep it's easy to build a invincible AI the hard part is one that performs human and makes errors.
-
The_Gamesalad_Guru Posts: 9,922Yes I use a table to store all the speed, timing et...info related to a difficulty level. This way once I have my rules and behaviors setup I only need one set and all the info for speed is directed to the table. I use a number system for difficulty so say row one is hit speed and col 1,2 and 3 are the levels.. So in the behavior speed in the expression editor it would look like this TABLECELLVALUE(difficulty.tbl,1,game.difficulty).
And as to glow hockey being the best, you haven't seen mine yet..lol. ; )
Answers
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Perhaps I should start a thread and link a shared file in which people can freely collaborate on it. I don't want to mooch, I figured many people would benefit from it.
@FryingBaconStudios I understand it would be very difficult, (esp considering I'm an artist) but I don't want to do things because they are easy.
@RP I agree. Insane difficulties ruin entertainment value and just all around aren't fun. You result to trying to move the paddle back and forth as fast as you can in front of the goal.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@FryingBaconStudios No offense was taken. I've watched your tutorials and they have helped me a lot in terms of getting the very fundamental blocks laid down. And I can tell that AI is going to be very very difficult. But I am eager to learn, and I've been giving it thought.
-I can imagine I need it to follow the puck along the y axis at a given slower speed determined by difficulty
-When to strike the puck and where on the puck (within a certain distance and a little after it crosses the middle of the board)
-When to return back to defensive mode by the goal (probably after a strike has happened)
So I have some basic ideas of the things I'm going to have to tell the computer how exactly to behave, and giving it a human feeling is going to be extremely difficult.
So as someone who has built an AI, do you have any pointers on where to start for a beginner on the issue, like should I learn how to use tables, etc?