View Full Version : Pong using 3D models anyone?
Ive thrown together 3D pong, and Im still finishing off the collision detection and adding my personal touches that my friend and I thought would be interesting, but here it is so far.
There is going to be the addition of a sloped plane that the ball will be affected by, but that will come when the collision detecting is sorted (and code optimised).
And yes, this is a hint that I might be using full 3D for Pea Adventures 360 now ;)
Known bugs:
- Ball can stick to a paddle and speed up insanely.
Known user friendliness issues:
- You cant exactly tell where the ball will bounce.
Keys:
Player1:
- a = left
- s = right
Player2:
- left key
- right key
General Keys:
F4 goes to full screen
F5 goes to windowed mode
If you are desperate for widescreen press F3. :) (1024x900)
http://realdev.co.za/egfiles/3Dp.bmp
Source: here be source (http://realdev.co.za/node/10832)
XNA .ccgame: File (http://realdev.co.za/egfiles/3D%20Pong-Windows.ccgame)
Unpackages Game (exes + folders found in the .ccgame file): File (http://realdev.co.za/egfiles/unpackaged.rar)
(need: .NET 2, XNA, and c# runtime aparently)
dINGLE
08-07-2008, 11:27 PM
Can you not upload a compiled version so that XNA is not required?
Im an XNA noob, so maybe this isn't possible?
Chippit
08-07-2008, 11:38 PM
The XNA runtimes are always required, but the game needn't be in .ccgame format. The runtimes themselves are fairly small, though. 2.1MB from here (http://www.microsoft.com/downloads/details.aspx?FamilyID=15fb9169-4a25-4dca-bf40-9c497568f102&displaylang=en). That's all you need assuming you have .NET already. I'm not certain whether those runtimes give you what you need to unpack the ccgame package though, but edg3 should be able to upload an unpackaged version. It's probably a better idea anyway.
I will do so soon, and also will be uploading a version where the collision has been sorted out properly to prevent its from bugging out on you, but that probably wont be today.
I'll post the link to the unpackaged game when its done uploading.
EDIT:
Done
And also, has anybody dabbled with creating a height map and a 3D model from it at runtime? I sort of am thinking along the lines of creating a script the runs on initialisation and generates a new random heightmap, and then that will affect the balls movement (one of the ideas my friend helped to come up with), not to the point where it will stop the ball from having perpetual motion, but so that it curves and arcs around the field.
dislekcia
09-07-2008, 12:34 PM
And also, has anybody dabbled with creating a height map and a 3D model from it at runtime? I sort of am thinking along the lines of creating a script the runs on initialisation and generates a new random heightmap, and then that will affect the balls movement (one of the ideas my friend helped to come up with), not to the point where it will stop the ball from having perpetual motion, but so that it curves and arcs around the field.
That sounds like a cool idea, Like red-blue areas replusing/attracting the ball a little. What about having the repulsion/attraction reversed for balls hit by the other player? That'd be interesting :)
Aeq's busy doing some XNA examples right now that load heightmaps (http://www.riemers.net/eng/Tutorials/XNA/Csharp/series1.php)... And you should be able to generate textures in XNA quite easily, just search for Perlin Noise generation or something similar.
-D
Thaumaturge
10-07-2008, 01:42 AM
I haven't tried the game out myself, but it sounds and, by the screenshot, looks good. ^_^
I really like the idea of a height-map-influenced ball path.
As to the actual method, I would be inclined to suggest finding the slope at the given point and using that to apply a force to the ball. I also like Dislekcia's suggestion of the force application inverting for the two players, something that shouldn't be difficult with the slope system, I don't think.
The only problem that I see is in making sure that the ball doesn't stop. You may well already have a solution for this, but just in case, here is mine:
1) Store a copy of the velocity as it was before the force was applied.
2) Apply the appropriate force over the appropriate time, and with the appropriate mass (it's probably simplest to specify a mass of 1 and thus essentially eliminate the variable).
3)
- If the resulting velocity is zero, reset to the old velocity.
- Otherwise, normalise the resulting vector and multiply it by the ball's desired speed, thus keeping the speed constant, but not the direction.
Finally, a thought has occurred to me; it probably doesn't fit well into your game, but nevertheless, you (or someone else) might like it, so here it is: You could combine the game with pinball, placing bumpers and suchlike around the play-field to both provide scoring opportunities and to affect the ball's direction.
Fengol
10-07-2008, 07:49 AM
What about putting some different coloured light sources around the map which affects the paddles as they move through space?
Fallen
18-11-2008, 11:18 AM
Very cool!
BlackShipsFillt
05-12-2008, 12:21 PM
Cool idea! Pong has been cloned so many times, but it sounds like you'll actually improve it...
Though this might be a little off your concept, how about bringing in some break-out elements... Things that the ball bounces off, things that break or things that drop powerups for the player the touched the ball last...
Though two player break-out might have been done already... ?
A bumpy terrain would make it very interesting, or alternatively attractors and repellers...
nice!
dislekcia
05-12-2008, 12:26 PM
Though this might be a little off your concept, how about bringing in some break-out elements... Things that the ball bounces off, things that break or things that drop powerups for the player the touched the ball last...
Have you seen GLDM's Arkapongtris? Interesting game ;)
BlackShipsFillt
05-12-2008, 01:35 PM
Very interesting indeed!
I'm suddenly thinking about making my own pong experiment....
Seeing as this has somehow sparked interest of sorts here goes:
- basically a randomised heightmap is what will mak a trrain of sorts, I thought a bit and 1 or 2 bumps should do it. Ive thought of a simple method of handling the actual effect of slopes on the ball movement so that isnt a problem.
- while novel, all the ideas are basicaly too fluffy on the outside and I dont feel like they would sufficiently contribute to make it any better.
- I am no longer going to use cheap collision hacks
more to come
Powered by vBulletin® Version 4.2.4 Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.