Jump to content
IGNORED

pINg for INTV


freewheel

Recommended Posts

I played a few more rounds, and this time I recorded the game on screen so that I could analyse the video frame by frame. Here are a couple of things I noticed:

  • When the ball collides with the border, it goes into the wall, rather than bouncing off of it. This gives the impression of "sticking" and it throws off the timing of the volley, making it feel contrived and sluggish rather than smooth.
  • Also, once in a while, the ball goes too far into the wall and bounces inside it (moving up and down for a couple of pixels) while it continues moving horizontally. I've only noticed this on the top left corner of the screen. You can tell it's registered as a bounce, since the "Bleep!" sound sort of repeats like a machine gun during the collision.
  • Personally, I do not like the extra-wide angles on the edges of the paddle. To me they feel contrived and very un-Pong-like, and give the game a weird vibe. But that's me. :)
  • Perhaps the paddles should go "into" the walls as they move, so as to give the player the ability to control the angle of the ball by giving it "English." I believe the original Pong did this as well.
  • I am not a fan of the seemingly random and erratic speed changes. It seems that sometimes the ball accelerates much too aggressively after colliding with a paddle, and then it drastically slows down on the next hit. It seems weird. In the original, acceleration happened after a ball had been in play for some pre-determined time or number of volleys.
  • The ball still "sticks" a bit on collisions. It seems as if it just waits for a frame or two before ricocheting.

 

 

In practice, it looks like this:

.............  .............  .............  .............  .............  .............  .............
..##.........  ..##.........  ..##.........  ..##.........  ..##.........  ..##.........  ..##.........
..##......##.  ..##.........  ..##.........  ..##.........  ..##.........  ..##.........  ..##.........
..##......##.  ..##....##...  ..##.........  ..##.........  ..##.........  ..##.........  ..##.........
..##.........  ..##....##...  ..##..##.....  ..##.........  ..##.........  ..##.........  ..##.........
..##.........  ..##.........  ..##..##.....  ..####.......  ..####.......  ..##.........  ..##.........
..##.........  ..##.........  ..##.........  ..####.......  ..####.......  ..##..##.....  ..##.........
..##.........  ..##.........  ..##.........  ..##.........  ..##.........  ..##..##.....  ..##....##...
..##.........  ..##.........  ..##.........  ..##.........  ..##.........  ..##.........  ..##....##...
.............  .............  .............  .............  .............  .............  .............
                                                 ^              ^
                                                 |___ STICK ____|

It should actually be like this:

.............  .............  .............  .............  .............  .............  .............
..##.........  ..##.........  ..##.........  ..##.........  ..##.........  ..##.........  ..##.........
..##......##.  ..##.........  ..##.........  ..##.........  ..##.........  ..##.........  ..##.........
..##......##.  ..##....##...  ..##.........  ..##.........  ..##.........  ..##.........  ..##.........
..##.........  ..##....##...  ..##..##.....  ..##.........  ..##.........  ..##.........  ..##.........
..##.........  ..##.........  ..##..##.....  ..####.......  ..##.........  ..##.........  ..##.........
..##.........  ..##.........  ..##.........  ..####.......  ..##..##.....  ..##.........  ..##.........
..##.........  ..##.........  ..##.........  ..##.........  ..##..##.....  ..##....##...  ..##.........
..##.........  ..##.........  ..##.........  ..##.........  ..##.........  ..##....##...  ..##......##.
.............  .............  .............  .............  .............  .............  ..........##.
                                                  ^              ^
                                                  |__ NO STICK __|

This "stickage" occurs in dependent from the ball velocity, so the faster the ball goes, the more it seems to stick, since those extra frames take a larger part of its range.

 

  • The AI player in "Easy" mode changed from a challenging competitor with twitchy fingers to... a moron. :P Sometimes he moves away from the trajectory of the ball, even though staying still would have gain him a hit. Perhaps you overcompensated for his movements a wee-bit too much. I haven't tried the other levels, but so far, I find "Easy" much too easy--especially with those huge paddles.

 

I hope this helps. :)

 

-dZ.

Edited by DZ-Jay
Link to comment
Share on other sites

I played a few more rounds, and this time I recorded the game on screen so that I could analyse the video frame by frame. Here are a couple of things I noticed:

  • When the ball collides with the border, it goes into the wall, rather than bouncing off of it. This gives the impression of "sticking" and it throws off the timing of the volley, making it feel contrived and sluggish rather than smooth.
  • Also, once in a while, the ball goes too far into the wall and bounces inside it (moving up and down for a couple of pixels) while it continues moving horizontally. I've only noticed this on the top left corner of the screen. You can tell it's registered as a bounce, since the "Bleep!" sound sort of repeats like a machine gun during the collision.
  • Personally, I do not like the extra-wide angles on the edges of the paddle. To me they feel contrived and very un-Pong-like, and give the game a weird vibe. But that's me. :)
  • Perhaps the paddles should go "into" the walls as they move, so as to give the player the ability to control the angle of the ball by giving it "English." I believe the original Pong did this as well.
  • I am not a fan of the seemingly random and erratic speed changes. It seems that sometimes the ball accelerates much too aggressively after colliding with a paddle, and then it drastically slows down on the next hit. It seems weird. In the original, acceleration happened after a ball had been in play for some pre-determined time or number of volleys.
  • The ball still "sticks" a bit on collisions. It seems as if it just waits for a frame or two before ricocheting.

 

 

I think some of these things collision artifacts may have a common root cause: Responding to a collision merely by flipping the velocity. (Caveat: I have not looked at the code, or even a disassembly.) Really, you need to compute where you should end up based on traveling the full distance implied by the velocity, with the reflection occurring when you hit the boundary. I had these kinds of bugs all the time in various "things bouncing around" programs I used to write as a kid. They especially show up when your velocity exceeds 1px/update.

 

Here's one example of how to code this:

.

    ' X is X position, XV is X velocity, XR is position of right barrier, XL is position of left barrier
    X = X + XV  ' add X velocity to X position
    IF X > XR THEN X = 2 * XR - X : XV = -XV : HIT = 1 ' However far we moved beyond right boundary, reflect that far to the left of the right boundary
    IF X < XL THEN X = 2 * XL - X : XV = -XV : HIT = 1 ' However far we moved beyond left boundary, reflect that far to the right of the left boundary

.

How did I get the 2*XR - X formula? Suppose, for the sake of argument, your XV is 10, XR is 100, and start at an X position of 97. X + XV pushes you to 107, well beyond the boundary. You need to travel 10 units, but you should get reflected when you hit the barrier at 100. That means you get 3 units of travel toward the barrier and 7 units of travel after reflecting.

 

So instead of ending up at 107, you really want to end up at 93. X - XR gives you how far you traveled beyond the barrier (107 - 100 = 7, in this example). Subtracting that from XR gives you the position you should give you where you should end up. XR - (X - XR). A little algebra later and you end up with 2*XR - X. Working the example: 2*100 - 107 = 200 - 107 = 93.

 

There's a similar derivation for 2*XL - X. The amount you overshot XL by is given by XL - X. You want to end up at XL + XL - X. A pinch of very simple algebra later and you have 2*XL - X.

 

(Note: Things do get slightly more complicated if your velocity is supposed to change on impact, not merely flip; however, IIRC, I believe horizontal velocity does just flip most of the time, until you cross one of the volley count boundaries. Still, the velocities are close, so even if you use the old XV throughout this calculation and then update XV for the next frame's display, you'll be fine. It won't make a noticeable difference at all. The main artifact, "sticky paddles", will have disappeared. If you want to account for the magnitude of XV changing as well, you can always say something to the effect of "IF HIT THEN X = X + NEW_XV - OLD_XV". This works because the magnitude of NEW_XV is the same or larger than OLD_XV in the direction of travel.)

 

 

As far as putting English on the ball, the original PONG did not let you do that.

Edited by intvnut
Link to comment
Share on other sites

I think some of these things collision artifacts may have a common root cause: Responding to a collision merely by flipping the velocity. (Caveat: I have not looked at the code, or even a disassembly.) Really, you need to compute where you should end up based on traveling the full distance implied by the velocity, with the reflection occurring when you hit the boundary. I had these kinds of bugs all the time in various "things bouncing around" programs I used to write as a kid. They especially show up when your velocity exceeds 1px/update.

 

I've seen some Pong simulators handle this by letting the ball get "buried" within the paddle as far as it needed to go, showing the overlapping pixels with a different colour. However, I don't know if the original did this.

 

For instance, it would look like this:

.............  .............  .............  .............  .............  .............
..##.........  ..##.........  ..##.........  ..##.........  ..##.........  ..##.........
..##......##.  ..##.........  ..##.........  ..##.........  ..##.........  ..##.........
..##......##.  ..##...##....  ..##.........  ..##.........  ..##.........  ..##.........
..##.........  ..##...##....  ..##.##......  ..##.........  ..##.........  ..##.........
..##.........  ..##.........  ..##.##......  ..++.........  ..##.........  ..##.........
..##.........  ..##.........  ..##.........  ..++.........  ..##.##......  ..##.........
..##.........  ..##.........  ..##.........  ..##.........  ..##.##......  ..##...##....
..##.........  ..##.........  ..##.........  ..##.........  ..##.........  ..##...##....
.............  .............  .............  .............  .............  .............

 

 

As far as putting English on the ball, the original PONG did not let you do that.

 

It did. Well, not real "English," but it simulated it by changing the angle of reflection based on the position of the paddle where the ball collides. I believe it did allow you to dig the paddle far into the borders so that you could hit the ball with the edge of the paddle, and control the angle of report.

Edited by DZ-Jay
Link to comment
Share on other sites

Ok so personally i like how this plays now. In the old ball and paddle games your hard paddles were the size of the easy paddles. But you compensated by making it faster and the fact that you have far better control and speed with an analog paddle than you do the intv disc. So the bigger paddles make sense. However a couple things. Is there supposed to be a one player hockey? It plays 2 players when i select 1. I think there should be a two player handball as well. Also i still think hockey should be b&w as well. Seems kinda distracting to me. But that is just a personal opinion and i am biased. Plus i just want to say thank you for this game. I have for so long wanted the old school ball and paddle games and you have made it really good and reminds me so much of the old shool pong clones.

Edited by pimpmaul69
Link to comment
Share on other sites

 

 

It did. Well, not real "English," but it simulated it by changing the angle of reflection based on the position of the paddle where the ball collides. I believe it did allow you to dig the paddle far into the borders so that you could hit the ball with the edge of the paddle, and control the angle of report.

 

 

The original PONG divides the paddles into 8 sectors (two of them fused into one larger sector, so 7 effectively), and each is assigned a Y velocity. The Y velocity of the ball when it departs the paddle is solely a function of which sector it hit. You call this English, but most sources that describe the paddles point out that this is not English and are emphatic on the point that "PONG doesn't do English." Usually, putting English on the ball means taking the Y velocity of the paddle into account (because English is accomplished by putting a spin on the ball), and PONG does not do this. Like you said, it's not "real English."

 

As for paddles and the borders: I think the home Atari PONG units did let you dig the paddles into the border. I vaguely remember doing that as a kid with our Atari PONG unit. The original arcade unit leaves a gap at the top and the bottom. That Lawn Tennis PDF I linked up-thread (and again here) goes into considerable detail on that point. Despite the name Lawn Tennis, it's actually a circuit-level explanation of every facet of the original PONG and some clones that you could ever care to know about. Well worth the read if you want to know the details.

 

Here's perhaps the most salient extract:

 

post-14113-0-58876000-1416171602_thumb.jpg

 

What's also interesting is that there's a bug in the original circuit that causes the hardware to not quite implement that. Later versions of the Pong hardware corrected that error.

Edited by intvnut
Link to comment
Share on other sites

 

The original PONG divides the paddles into 8 sectors (two of them fused into one larger sector, so 7 effectively), and each is assigned a Y velocity. The Y velocity of the ball when it departs the paddle is solely a function of which sector it hit. You call this English, but most sources that describe the paddles point out that this is not English and are emphatic on the point that "PONG doesn't do English." Usually, putting English on the ball means taking the Y velocity of the paddle into account (because English is accomplished by putting a spin on the ball), and PONG does not do this. Like you said, it's not "real English."

 

 

Whatever, man. The point is that the angles are bit off in this implementation and that the collision is not too smooth. As freeweed mentioned, this is not intended to be necessarily a pixel perfect replica, but I'm hoping it at least retains the "feel" of the original. The apparent velocity changes and the collisions right now do not do it justice.

 

That said, I haven't read the document you linked to, but it does sound interesting. I'll check it out tonight. My feedback is based on just my memories of playing the arcade and the home versions.

Edited by DZ-Jay
Link to comment
Share on other sites

 

Whatever, man. The point is that the angles are bit off in this implementation and that the collision is not too smooth. As freeweed mentioned, this is not intended to be necessarily a pixel perfect replica, but I'm hoping it at least retains the "feel" of the original. The apparent velocity changes and the collisions right now do not do it justice.

 

That said, I haven't read the document you linked to, but it does sound interesting. I'll check it out tonight. My feedback is based on just my memories of playing the arcade and the home versions.

you also have to realize is that its designed more like the ball & paddle on a chip games than pong. To me the movement seem to pretty good to that. I could be wrong but i still play my odyssey 3000 and it feels good to me. But then again im no programmer. Just a player.
Link to comment
Share on other sites

you also have to realize is that its designed more like the ball & paddle on a chip games than pong. To me the movement seem to pretty good to that. I could be wrong but i still play my odyssey 3000 and it feels good to me. But then again im no programmer. Just a player.

 

Don't get me wrong, I like the game and it is has the potential of being very good. I like the AI, so far, and it feels superior than in other games. I know that part is hard to do: you either end up with a really unbeatable robot, or a push-over moron. To me, pINg has a good balance in the AI, but so far I've only played the easy level.

 

I'm not looking at the game through "programmer's eyes"; actually, I'm looking at it from a critical player's eye. Pong has a "feel" to it, essentially because it is such a pure and simple game. This game is really close, but not yet there. The issues I point out, like the collisions "sticking," are subtle and hard to perceive, but they do detract from the overall smoothness of gameplay--at least in my opinion.

 

I'm not really as talented as some of the other programmer's in this forum--certainly, not as experienced, having only made one game in my life, so far--but I'd like to think that I have a good eye for visual and artistic values. I believe it's the little and subtle things that elevate a game from "good" to "awesome!" :)

 

-dZ.

Link to comment
Share on other sites

Ouch. I'm clearly getting my PONG and Odyssey very much mixed up here. PONG used ICs eh? Kooky.

 

Anyway, I'll stop pretending I know how these games are designed and just work on one that's fun :) Here's a fix for the jitter, I think. DZ is really good at ferreting out edge cases so I'll await his verdict on if I've gotten it nailed. I'm also starting to realize the AI's weakpoints - not at I can consistently aim to exploit them. Oh, and this version is back to >45 degree angles, because I'm stubborn that way :P

 

This *might* have made the AI too easy - let me know if that seems to be the case.

 

 

BTW, on the "solo pINg" I managed to get the ball wedged in the upper right corner. It disappeared from the screen, and I heard a bunch of "bounce" sound effects for a few seconds and eventually the "ball out of bounds" tone.

 

As for the ball speeding up and slowing down... It does remind me a bit of the Atari PONG home system. (I still have it somewhere stashed in my collection, believe it or not.) My only objection is that the horizontal velocity should probably be monotonic. Vertical velocity can be all over the map, but horizontal velocity should monotonically increase. The >45 degree angles, though, are definitely something I remember (or think I remember) from the original home unit. On the original home unit, I loved it when I could hit the ball such that it'd make 2 or 3 bounces off the top/bottom before it got to the other side. Those were almost always a guaranteed point.

 

On Hockey, there doesn't seem to be an AI. If I press 1 player, I still need to control both sides. Also, I noticed if I slide my "stick" onto the "puck" at just the right time, the puck bounces back and forth within my stick until it ricochets out the end. I think this would be fixed by the reflection equations I gave up-thread.

 

EDIT: And one last thought. It seems a little too easy to "bounce" through the menus, with a single keypress registering as two. And this is in the emulator. Haven't tried it on real hardware. Seems like each level of menu should wait for a clear "all keys up" situation before accepting a new input. ie. at least a couple frames where no inputs were seen asserted.

Edited by intvnut
Link to comment
Share on other sites

BTW, on the "solo pINg" I managed to get the ball wedged in the upper right corner. It disappeared from the screen, and I heard a bunch of "bounce" sound effects for a few seconds and eventually the "ball out of bounds" tone.

 

i think this is the same thing i mentioned. Only happened on hard for me but happened several times
Link to comment
Share on other sites

Wow. I love the comments guys. And DZ, please keep being critical. You're picking up on things I kinda gloss over when I test myself, but man do they bug me in production software. I KNOW I need to fix a lot of this kinda stuff.

 

So I think I need to sorta apologize for releasing a half-baked pile of code. I know a ton of stuff is broken/not implemented. I was mostly wanting to get a sense of if I'm on the right track with the AI (sounds like I am, as most of the complaints are about things I already know about). To answer the common comments:

 

1. Yup, the paddles (and walls) are occasionally sticky. intvnut sorta nails why, but it's more subtle than that. I need to fine-tune the collision detection. What you're seeing are some really rough edges with a hastily whipped-up collision detection routine. Implementing the paddle regions (to determine the angle) is clunky as hell, slow as hell due to so many conditionals, and buggy as hell. But it's still better than what went before, which is why the hockey paddles are even worse. Pretty much all of the weird behaviour (balls stuck in places, machine gun sounds, etc) are due to this.

 

2. There is no AI in the hockey game yet. Until I get collision detection perfect, I'm leaving this guy alone. I'm torn on something - the player in front (the "forward") - when the ball is coming from "behind" him, should it bounce off or travel through? I've played PONG clones that do both. I'm afraid the AI will be very, very stupid here if the ball bounces. So I may have to do rather different AI for this.

 

3. 2 player racquetball - I hadn't actually thought of that. If it's fairly easy, I'll put it in.

 

4. The hockey background - I wanted a snow level for rev :P Plus this is a subtle nod to the old "color PONG" games, albeit very overblown. Hm. This could be an easter egg type thing.

 

5. The comment that horizontal velocity should be monotonic - I'm gonna have to play around with numbers on this because I know what you guys mean. Now, some clones did kinda work like this - they tried as much as possible to keep the overall velocity constant, which means that at some angles the apparent horizontal velocity slows down or speeds up. But I agree, it doesn't feel right here. Maybe it's just too much of a contrast between angles. I'll have to put some thought into how to smooth this out better.

 

pimpmaul, you're exactly right on one thing - the smaller paddles (that I call hard) are more like real PONG's "normal" difficulty. I haven't tried this on a real console but without analog paddles or something, I suspect any smaller might be too difficult. Also "easy" is called that for a reason. I like the idea of a game that even small children can play, without being educational. The INTV did not have a lot of those, it was generally the harder console. So it's supposed to be pretty easy to volley for a while.

Edited by freeweed
Link to comment
Share on other sites

Implementing the paddle regions (to determine the angle) is clunky as hell, slow as hell due to so many conditionals, and buggy as hell.

 

A simple implementation might take the difference in the paddle's Y position, the ball's Y position, optionally shift right (ie. divide by 1, 2 or 4), and then look it up in a table.

 

Something like:

.

            IF level = easy THEN Yvel = Yveltbl( Yball - Ypaddle ) ELSE Yvel = Yveltbl( (Yball - Ypaddle) / 2 )
...
Yveltbl:    DATA -3, -3, -2, -2, -1, -1, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3
    
Link to comment
Share on other sites

Here's a suggestion (or hack?) for dealing with stickiness.

 

If the ball is on the left side of the screen and has a positive x velocity - don't reverse the velocity.

Similarly, If the ball is on the right side of the screen and has a negative x velocity - don't reverse the velocity.

 

Since the ball is going in the direction we want it to go, don't change it...

 

You could do something similar with the y velocity and the top and bottom of the screen.

 

Just a thought...

 

Catsfolly

  • Like 2
Link to comment
Share on other sites

Oh to answer the hockey question, i think the ball should pass through your inner padded when it is bouncing forward. It is weird to me having it bounce around between the two paddles

 

Yeah. I actually like the bouncing between the paddles because it makes the hockey game more fun/challenging - but I could see it being annoying. Especially if I don't get things *perfect*.

Link to comment
Share on other sites

 

Yeah. I actually like the bouncing between the paddles because it makes the hockey game more fun/challenging - but I could see it being annoying. Especially if I don't get things *perfect*.

if you look at this pic you see that each player has paddles on both sides not both on one side

post-30773-0-93388600-1416387444.jpg

Edited by pimpmaul69
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...