|
-
Senior Member
[Beta]Gravity Pong
Just a simple game I made in the weekend. The AI still needs some work, as its too easy to win but difficult to lose. It probably has high requirements too. It handles 100 particles, so it might run slow. The number in the upper left corner indicates how long the last 30 frames took (it should be 1000, 1 second).
So, any advice/suggestions before it ends up at the half-finished graveyard (the folder called Flash in My Documents )?
Play Gravity Pong
-
very nice game (you dont see creative ideas like that here very often)
right now it´s not yet that fluent but I could imagine that beeing improved just with some tweaking. How about a vacum- power (inverted direction of the space- key corce)?
Also I would limit the forces to only one own half of the playfield
-
Senior Member
If you don't press the key, the ball is attracted to your paddle.
Originally I had masses that attracted the ball instead of forcing it away. The problem was that the force on the ball reached infinity when the ball was right on it. This caused some acceleration and speed problems, so I reversed the field.
I'll have to test limiting the force to only my side. good idea
-
Style Through Simplicity
It reminds me a lot of plasma pong. Nice though, shows that pong can still be fun 
Ali
-
Senior Member
 Originally Posted by alillm
It reminds me a lot of plasma pong.
*Whistles and pretends like nothing has happened*
Thats where I got the idea, but flash isn't powerful enough for such a great game
-
Style Through Simplicity
hehe yea, if only 
Ali
-
file not found
I love your menu.
The is pretty fun once you reed the directions...
I'd agree with you that your AI needs work, it's not real great right now.
You should definitely put a cap on how much you can repel the ball though, the game is incredibly easy if you just hold down space.
Also, maybe you could either rotate the sparks that come out or make them circles, it doesn't flow very well when they're perpendicular to the direction they're moving.
Promising start, I can't wait to see the final version of this game.
-
M.D.
 Originally Posted by ihoss.com
*Whistles and pretends like nothing has happened*
Thats where I got the idea, but flash isn't powerful enough for such a great game 
i reckon its possible (with AS3) just would have to use a less dense velocity grid
http://www.red3d.com/cwr/steer/FlowFollow.html
-
Senior Member
Captain 404, I like the idea about the repel cap. Will add that to the game. I'll also make the particles particles, instead of lines.
mr_malee, the current game uses 100 particles each affected by 1 source. With 4 sources you could then have 25 particles. Thats not enough
-
M.D.
not sure i really understand. You mean not possible graphically? because yeah, flash can't do what plasma does in that department.
i was referring to the physics side.
-
Senior Member
I've updated the game based on the suggestions. I uploaded the flash file if anyone is interested
gravitypong.fla
-
file not found
It's odd, there seems to be a weird amount of gravity based stuff all coming out at once...
There's the two threads on here for one thing, but I just finished the basics for something I've been working on as well.
Have a look if it interests you: http://ian.janasnyder.com/planets.htm
spacebar = inverse acceleration
sorry for straying a little bit off topic there for a second.
EDIT: I just noticed that all the particles are affected the gravity too, nice little touch there.
Last edited by Captain_404; 03-04-2007 at 11:13 AM.
-
Watch out for playing it partially loaded. I played it at first and for some reason it didn't load correctly and so what happened is the code was a bit funky. The paddle wouldn't follow the mouse. it would only move to the mouse when you click and stay there until you click again. It is a fun game, change the ai so that it moves faster maybe? I like it how those orbs form on your opponent's side every 5 points. Maybe make them attract on the side it's on and repel for the opponent?
Edit: The acceleration problems come from 0. If they're right on top of each other then 0 will come into the equations.
-
Senior Member
 Originally Posted by swak
Edit: The acceleration problems come from 0. If they're right on top of each other then 0 will come into the equations.
Yup. I thought about having a constant force if the ball is within the radius of the sphere. Like:
if(r<20){
a += _root.g*obj[i].m/r/r;
}else{
a+= _root.g*obj[i].m/400;
}
This would solve the problem. I also tried to make the ball collide and be deflected by the spheres, but I couldn't get it to work. Anyways, I won't be doing any more work on this game. If you have some ideas you would like to implement, feel free to download the fla file and mess around with the code.
-
When in doubt ask
 Originally Posted by ihoss.com
I've updated the game based on the suggestions. I uploaded the flash file if anyone is interested
gravitypong.fla
Unable to download. Which version of FLASH is it?
<signature removed by admin>
-
Senior Member
Flash 8. It worked here, but Firefox thought it was a Word Document.
-
Please, Call Me Bob
eh, i didnt enjoy it that much, maybe im missin out on some gameplay here
if you want to improve your ai, you could have a simpler, line-based gravity source (like in most platformers) as opposed to the central gravity points you have right now. that way, you could calculate the intersection point of the parabola-path formed by the ball's path and the verticle line that the paddles can move on to determine where the ball is headed
the standard parabola is something along the line of y=a*(x^2)+bx+c
but in a neater format!
-
Senior Member
I could estimate it now too, it would just be a more complicated formula. The thing about AI is that you don't want it to be able to predict where the ball will land, you want it to be able to estimate it to the same accuracy a human could do. I certainly can't estimate where it ends up with all the gravity points, so instead I make it move to the balls current _y position, because thats what I do when I play.
If you look at the source-code you will find that the AI changes tactics a few times. In the beginning it moves to where the ball is, and it ejects it when its moving away from it, same as I do when I play. When you reach level 15, the AI changes, and now it tries to slow down the ball when it moves towards its paddle. Beyond level 20 it will try to force it away all the time, which is what I found to be the best tactic.
-
Please, Call Me Bob
you could do a combination to vary the difficulty, just average out where your current ai thinks it will go, to where it actually will go
this will give the impression that the paddle is following in front of the ball (like people do; it only has a rough estimate of where it will go)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|