TV Tennis

Community Forums/Showcase/TV Tennis

pixelmischief(Posted 2014) [#1]
This is a video demonstrating the full player experience for "TV Tennis"; a PONG clone I am developing in "BlitzMax". It is currently in version 5. The IDE I am using is "BLIde Plus". Sound effects were generated using "Sfxr".

https://www.youtube.com/watch?v=9FOJEC4SbEU&feature=youtu.be


Derron(Posted 2014) [#2]
May I ask what evolutionary steps got achieved between versions 1,2,3,4 and 5?

I just ask because pong is one of the games beginners will achieve to finish during a day whacking on their keyboard - so you surely did something "additional".


bye
Ron


pixelmischief(Posted 2014) [#3]
You know, you'd think that. I know I used to. But not so much. Here, have a read here and then take a look at the "ToDo" I use to keep track of where I've been and where I'm trying to go.

http://tinodidriksen.com/2003/05/06/but-can-you-make-pong/

TODO:

Version 1
+ basic pong rules implemented
+ 2-player keyboard control
+ collision sound
+ game to 10 points

Version 2
+ Use RectOverlap for collisions
+ Score font is too big?
+ Score font to model original?
+ Use font for score and messages instead of brute force READ/DATA bit patterns
+ Iterate through players using FOR EACH instead of repeating code
+ Try white draw colow like original?
+ Variable boop and beep
+ "Get Ready!" prompt before launching in start and after score
+ Implement Pause
+ "Game Over" pauses and returns to Main Menu
+ Make board still visible on all GAMESTATES
+ BUG: Ball gets stuck along bottom
+ BUG: On new game and after every score, ball always comes to left


Version 3
+ Set maximum velocityY to avoid ball bouncing too steeply between top and bottom
+ Add DEBUG block
+ Make ESCAPE more immediately responsive in all GAMESTATES
+ Clear keybd buffer before transition from GETREADY to PLAYING so that irrelevent SPACEBAR PAUSE gets dropped
+ player left Gamepad digital control


Version 4
+ Switch source to "SuperStrict"
+ Upgrade to BlitzMax
+ Fix variable deflection and maximum Y velocity once and for all!
+ Change variable sound to low for wall collisions and high for player collisions


Version 5
- bin include all assets; get game down to single exe
- Clear all keyboard buffers on escape
- Dotted center line (2:3)?
- 2 Gamepad DIGITAL contorol
+ GAMETYPE: 1 player vs AI
+ Add simple AI Player
+ Add score sound?


Version 6
- re-engineer code to OO


Version 7
- Menu with options:
- OPTION: Keyboard/Gamepad/Mouse
- OPTION: Player passthrough Y/N
- OPTION: Ball Speed?
- OPTION: Bat Length
- Help Screen
- Add debug console


Version 8
- OPTION: Select HID
- Make all game factors configurable
- AI Player variable diffculty
- GAMETYPE: 1 player vs AI sides and tops/bottoms
- GAMETYPE: 1 player "static back wall" mode, set wall distance
- GAMETYPE: 1 player "approaching wall" mode
- GAMETYPE: 1 player "hit this spot" mode


Version 9
- Add modifier "pills"
- Score saving
- Soccer mode
- Big ball (large ball that players can't touch but is effected by the ball)
- Obstructions
- English


Version 10
- Net Play
- Mouse control
- Gamepad analog control (variable speed)
- OPTION: program all controls
- OPTION: save default confguration
- OPTION: Save named configurations
- Light trails
- Hint lines
- Stereo Boinks
- accomplishments and trophies

Version 11
- 3 and 4 player mode (top and bottom walls)
- Select Skin (classic, green screen, tron)
- Select Music
- Select Sounds
- Construction set


Version 12
- mobile tilt play
- mobile multi-play
- android
- iPhone


pixelmischief(Posted 2014) [#4]
I think the takeaway is that the core mechanics - two paddles and a ball - might be a day "whacking on their keyboard", but a complete end-to-end experience is something else. Ever try it yourself? It's not nearly as simple as the game might look in comparison to more "modern" offerings.

Among the real challenges was creating an AI player that was challenging, but not impossible. Variable deflection angles off the paddle, calculating destination for the AI, limiting velocity to avoid unplayable volleys. It wasn't a "single pass" kind of thing.

Also, preserving the look and feel - the charm - of the original game wasn't as automatic as it might seem. I went first with "green" elements and tried a big, custom coded retro font. It lost a lot until I just went back to the original style elements. And I see this mistake made almost invariably by other developers. They open up a paint program and create colorful raster images for the paddles and ball. They use realistic sound samples of clanks and clunks for the audio. But in the end, it seems to make the game feel...cheap. At least to me.

Finally, creating responsive UI, even one as simple as this, takes multiple iterations; at least it did for me. Little things like the space-bar pause, "Get Ready" after score but before serve, exit confirmations. They all really add a lot to the experience, but are overlooked by eager "Pong Clone" developers.

As you see, I have a long way to go to get where I want to with it. What you see in the video took me about 20 man hours, all things considered. I expect it to take at least another 100 or so to get it to Version 10 and maybe another 100 after that to port it to Monkey and get it on mobile.


Derron(Posted 2014) [#5]
It all depends on the experience and existing "framework code" (eg. if your framework allows for "screens" that whole pause/menu/newgame/... things are a lot easier to implement).

@Gamestates

if KeyDown(KEY_SPACE) then Game.SetPaused(1 - Game.IsPaused())

Shouldn't be that hard to react to multiple Gamestates then (eg. SetPaused() would run SetGameState(STATE_PAUSED) or SetGameState(STATE_RESUME)).

@AI:
Calculate distance to the position the ball will have when the players side is reached ("target"). If the distance is not reachable within time (maxDistance = availableTime * speed) then eg. the AI could have a text bubble or sound like "arggh / oh nooo!!!"). If the distance can be moved within time, you can decide how to play the ball (angles).

In all cases the AI would play "perfect" (regarding "accepting" the ball). To make difficulty less, you have to make the ai doing wrong things (by a random chance). This random chances could be lower - according to the current score. Playing the ball to the opponent is purely a matter of doing the same thing you did when the ball came to you: calculating distances. So if you know, that X is the impossible to reach distance, you try to play the ball towards this or even further. Using simple math you will get the needed angle (take into consideration playing on the sides to reverse the angle) so the player is not able to reach the ball.
If there is not such an distance - just play the ball with a random angle (you could of course do some prediction but this is not hmm that simple and wont improve AI that much).


@networking
When writing the code, check that you have functions doing specific actions, something like "MovePaddle(plusminus)" so you just have to call the same function when you receive specific commands via networking. What benefit do you have from this? You can have "local delay": you send your movement as soon as you pressed your key, but the local paddle is moved some milliseconds later - so it will hopefully be "executed" simultaneously on local and remote. Of course you have to execute things without delay as soon as you get the command via remote.
Another option is to let the remote verify certain thigs ("did not hit the ball") but this is then not the nicest visual representation as you locally see the ball not getting hit by the paddle, while the remote sees that hit. After verification failing, the ball will suddenly be bounced by the paddle.

As ping between ween LAN is <20ms this wont be recognizeable, during online game the latency will be higher, the ping (a->b + b->a) doubled. Such an "speedy" game wont be nice to play with a ping of 150 or higher as you then have recognizeable local lags.



bye
Ron


pixelmischief(Posted 2014) [#6]
It all depends on the experience and existing "framework code" (eg. if your framework allows for "screens" that whole pause/menu/newgame/... things are a lot easier to implement).

I agree. Experience is certainly a factor. But your hypothetical Beginner will most likely not start this journey writing framework code. I didn't. It wasn't until later, after I had the core game mechanics implemented and decided to implement PAUSE and GAME OVER and ATTRACT MODE that I realized I needed the concept of game states.

Shouldn't be that hard to react to multiple Gamestates

When I read this, I realize that you have not given this a try on your own. If you are interested in game development, I strongly recommend you do it. Develop the humble PONG from soup to nuts. It might be an eye opener.

the AI could have a text bubble or sound like "arggh / oh nooo!!!"

This sounds like a good idea and it is the kind of modernization that PONG cloners often code in. It has been my experience, though, that things like this actually take away from the quality of the development. "Tropes" are a real psychological phenomenon when it comes to game development and PONG is, in total, its own trope. Any variation from the original has the potential to "violate" player expectations. These kinds of things must be done extremely well to be effective.

Thank you very much for your advice regarding AI and network play. I think you have some well thought-out plans here and I will definitely keep some of this in mind when I am developing these components in my game. I hope very much that you are posting information and video links to your own PONG clone soon. Trust me, the project is a real and unexpected education.


Derron(Posted 2014) [#7]
I am coding a weather simulation for my game at the moment (as I broadcast weather news in it, which influence potential broadcast audience etc.), so not much time for pong.

I also would not like to post video links for a pong game, I think people will not really bother watching them.

BTW the first real game I tried to code was using ASCII and was a roulette game I wrote on a B/W screen ... guess what: the whole roulette table does not fit on an default 80x25 - and at that time I did not have "internet" nor "programming books" so I did not know how to change to 80x43 or even higher. Ended up having an ugly table (leaving out some decorations) but it worked. Maybe arcade games are a bit tougher as you have to pay attention to performance, realtime AI etc.


bye
Ron


pixelmischief(Posted 2014) [#8]
Do you have some finished projects I can take a look at? Maybe I could ask a few questions? Get some pointers?


Derron(Posted 2014) [#9]
You can see my current project at http://www.tvgigant.de (there is a github link for the sourcecode too).

The last bigger project I have done was a customizeable sudoku "yourdoku" (for my girlfriend) with a twirl: instead of numbers you could use pictures of your friends (or other symbols) but I have lost the sourcecode of it with a double hdd crash - one failed, the other has fallen to the ground, thanks to our cat :p.

Another unfinished game is a match3 with a dragons/knights setting (medieval) but never finished it after multiplayer was possible and interest of my buddies moved to other things.

Other things were simulation/measurement tools for an institute so nothing of interest.


bye
Ron


pixelmischief(Posted 2014) [#10]
Thank you! I downloaded and played your game a little bit. Love the music! And the art style reminds me very much of Leisure Suit Larry. Whimsical and funny. Also, the configuration screens are very polished. Did you use a UI library?

Your Sudoku concept sounds interesting. You definitely missed the right name by a letter though. It should have been, "YouDoku". =). You should consider developing that again, maybe leveraging a popular property. I'd bet "Dragon Ball", "Pokemon", or "Mario" themed versions would do very well. Or maybe piggyback on a popular game in the FaceBook space. Just some thoughts.

And you know what they say about backups? There are two kinds of people. Those who back their stuff up, and those who have never lost their stuff because they didn't back it up. =). Yeah, I do feel like a jerk saying it.

I am thinking about doing a non-game project using BlitzMax as well. Has your work in this space been successful for you? Was it adopted at a department level or was there any commercial opportunity?


Derron(Posted 2014) [#11]
@UI
It uses my custom ui which I extracted into a little framework:
https://github.com/GWRon/Dig

As the whole thing relies on our custom functions (sprite atlas, event system, xml resource loader) there are more dependencies than in other systems. Also CeGUI is way more advanced than my system (man it was hard to get DragnDrop halfway acceptable working than I wanted it to - but now my game objects can extend from the guiobjects and benefit from the DND-system).


@Yourdoku/Youdoku
Yeah it was more for "your personal sudoku" so I sticked with "your".

@Backups
Like said: I had a backup on an external hdd - but as my hdd in the computer crashed I tried to backup things to my external hdd ... which my cat (the male one) achieved to sweep from the table ... it then just did "click click". I lost many things that time (asset originals - psd/psp files - and sourcecodes, and of course many photos).
Todays sudokus provide way more features than mine did. Albeit I thought my "swirl" was also a nice bonus: there was a sand clock ticking and after acertain time numbers got "exchanged" ... so 2 got 9 and 9 got 2 etc. While this does not change game logic, it puzzles the brains :D - especially if the symbols were christmas items or famous persons ("arghhh Beethoven just got Brahms").

@Images/Themes
You have to take care, not to violate copyrights. Older pictures might be PD'ed, your own pictures are useable for sure - and numbers, yeah ... think nobody claims rights on them (yet).


@non-game projects:
They got used to make hardware useable. The hardware existed and generated output. I was reliable to make the output somehow "viewable" or "processed". Eg. were was the functionality to analyze incoming data and categorize them according to some kind of bayesian rules, it was an analysis of poo running through a tunnel to generate fermentation gas - and the analysis was there to measure humidity and so on. The system has to automatically recognize incorrect "mixture" (there is some kind of perfect mixture for that poo :p) so another automatism could correct things. Next to it people needed a "viewer" to visualize what happens there and to manual mark things so the filters could improve.
That tool was an inhouse production and is not sold outside.

The benefit of producing something in BlitzMax: there are not that many persons in a company able to modify your code that easy than it would be with C or Java. So you have a fertile future with supporting that apps. But this is also a disadvantage as you might not be the one they choose to write a little support tool.


bye
Ron


Steve Elliott(Posted 2014) [#12]
It's an interesting concept...That 'whacking on the keyboard' will get something that works...But even very old games had more to them than first meets the eye - to make them interesting to play. Something subtle in the mix. That subtlety is often over-looked in remakes.

Some here have derided match-3 games...Then after attempting to write their own discovered there were some programming 'gotchas' to overcome...Theory is not the same as practice, however simple the theory may at first appear.


Derron(Posted 2014) [#13]
For me the gotchas in match3 were to delay block collapsing, not to miss "chain effect"-blocks, to delay bonus blocks (explosion, after explosion after ...). Another hard part is/was balancing (when to make the game more difficult, how many bonus stones should be existing at the same time ...).

The "hardest" part was - as always - to create "decent" media assets. Same for good looking particle effects (medieval games have fire... torchlights - or an engulfed game title).

For me an unachieveable target: making the game music. I know what I want to hear, but not how to make it.


Each part in game development has his gotchas and the theory is always easy to read ("just place some sound samples") - especially if you have some knowledge in that matters.


bye
Ron


pixelmischief(Posted 2014) [#14]
Derron said:
May I ask what evolutionary steps got achieved between versions 1,2,3,4 and 5?


Thanks for this. It has helped me realize that version numbers set expectations of functionality and that being at Version 5 without a complete, release ready product is incongruous with those expectations. I have refactored my versioning as a result and identified the point at which I think the game will be ready for release. This will be version 1.0. Everything before that will be version 0.X, which I think is more consistent with the way it is normally done.