Ping! Demo 1.3
A Game by Federico Pitto. July 2005 Genova Italy.
Controls
- Mouse Axis - Move Left/Right
Left Click - Forward
Right Click - Backward
Middle Click - Smash!
Keyboard Cursors - Shoot Direction / Move the Viewfinder (in Serve Mode)
Spacebar - Serve
PageUp/PageDown - Adjust Height (in Serve Mode)
F1 – standard view (fixed)
F2 – Interactive views (combination of three different views)
F3 – Bird’s eye view (fixed)
F4 – Alternative view (follow the net pitch/yaw and the player coordinates)
Control Example:
The opponent hits the ball.
If you press UP and LEFT cursors, while the ball hits your racket, then the target of your shoot will be the Up-Left corner of the opponent’s table.
The possible combinations are:
Up-Center, Down-Center, Up-Left, Up-Right, Down-Right, Down-Left, Right (by default Down), Left (by default Down).
Save and Load are fully functionals.
Troubleshooting – Quick Hack
The physic response of the ball depends on your system speed. In order to play correctly. you have to set some variables in the main script.
Open tocco.s in your script folder and find this words:
Code: Select all
FORWARD=(self.enemy_range)/5.9;
UPSHOT=(self.enemy_range)/7.3;
You will find them twice. Change the value to have a better responce of the ball. You have to increase the 5.9 value if you want to get lower force on the shot or decrease it for higher force. I suggest you to start with a 0.2 increase/decrease value. In the same way you have to incresase or decrease the 7.3 value in order to obtain the right force applied vertically on the ball. If you want the ball fly lower increase this value, or decrease if the ball hasn’t systematically enough force to fly over the net. Remember to repeat this operation twice, in both piece of code you have found.
If you notice that the ball bounce wrong you can adjust the bounce value. Find:
If you increase this value he ball will bounce higher. If you decrease it the ball will bounce lower. I suggest you to start with a 2 increase/decrease value.
Now the Opponent skill is set to maximum. You can change it opening ai.s in your script folder and find this words:
Code: Select all
//self.ThinkTime=0.001; //use this to set the opponent skill use a range from 0.001(smarter) to 0.1 (loser)
delete ‘//’ before ‘self.ThinkTime=0.001;’ (don’t touch any other ‘//’).
And change the value from 0.001 (smarter) to 0.1 (loser). Be careful. If you want to restore the original skill of the opponent, add again ‘//’ before ‘self.ThinkTime’.
Cheat/Debug
o Press ‘1’ to set the score to 10 / 10 points and 2 / 2 games. To test score Advantage/Deuce System
o Press ‘9’ to reset the ball to the serve position. It’s a panic key if you experience some unexpected trouble.
o Press the standard ‘wasd’ cursors to apply additional forces on the ball. It will be the way to implement effects on the shoots.
To Do’s (eventually…)
o The net is buggy
o Ball effects
o Graphic improvements
o Design different Ping Pong Tables, Rooms, and Rackets (Carom style).
o Create a Tournament Mode.
o RF Multiplayer…?
Download
Go to
http://realitychess.altervista.org and, in the download section, get Ping!Demo1.3.
http://realitychess.altervista.org
__________
I worked 1 month some time ago on scripted physic. I made a demo called aBallInABox that you can fnd in my download section (and a racing games on the same scripting style). It's the basis of this work. I worked 1 week to develop the table/racket movements, basical ai, targetting system. Then another 1-2 weeks to develop rules, exceptions, interactive camera, oppponent serve and many other litle things.