Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Not Quite Pong  (Read 34833 times)

0 Members and 1 Guest are viewing this topic.

l0calh05t

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Not Quite Pong
« on: July 24, 2008, 05:36:10 pm »
having a little free time this week i decided to write a little pong-like game. except with better "physics". you can add spin to the ball, the paddles have rounded corners etc. for collision detection and most of the physics calculations i use box2d, graphics is immediate mode opengl at the moment. the physics are mostly fake though, since the velocity of the ball is fixed (but increased after each paddle contact) and it has a minimum x-component (so that the ball doesn't get "stuck" somewhere in the middle of the playing field). the game part itself is not quite finished yet (no scoring, and the ball bounces off the ends of the field). but i thought someone might want to try anyways (and tell me if the physics are ok)

controls:
w - player 1 up
s - player 1 down
i - player 2 up
k - player 2 down
r - reset

get source code and binary here:
http://cid-c017d9fd84c56d75.skydrive.live.com/browse.aspx/Public

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Not Quite Pong
« Reply #1 on: July 24, 2008, 06:08:19 pm »
Nice ! (red "angry" spinning ball is fun ! =p)

Physics seems ok (paddle recoil and spinning are great ideas), just a thing : French player really need key configuration (W is under S on azerty keyboard), maybe a simple file for custom config.

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
Not Quite Pong
« Reply #2 on: July 24, 2008, 06:37:46 pm »
You should share the DLL if you compiled in dynamic mode.
You should share the DLL if you compiled with VC++.

I can't run your pong :P.
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.

l0calh05t

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Not Quite Pong
« Reply #3 on: July 24, 2008, 07:00:01 pm »
Quote from: "SirJulio"
Nice ! (red "angry" spinning ball is fun ! =p)

Physics seems ok (paddle recoil and spinning are great ideas), just a thing : French player really need key configuration (W is under S on azerty keyboard), maybe a simple file for custom config.


Done. (new version already uploaded with example binding file, just rename to bindings.txt)

Quote from: "Daazku"
You should share the DLL if you compiled in dynamic mode.
You should share the DLL if you compiled with VC++.

I can't run your pong :P.


Hm, I thought everyone around here would have the VC2008 runtimes already installed... Added to archive.

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
Not Quite Pong
« Reply #4 on: July 25, 2008, 02:11:07 am »
Good thanks!

It's seem laggy on my comp but its how the game is designed... (The ball flash and when we move bar its the same.... That not cool...)

Binding function is cool.
The deplacement of the bar is nice. (When you touch border you added a nice effect.)

You should throw the ball at a random angle at begenning...
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.

l0calh05t

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Not Quite Pong
« Reply #5 on: July 25, 2008, 08:24:17 am »
Quote from: "Daazku"
Good thanks!

It's seem laggy on my comp but its how the game is designed... (The ball flash and when we move bar its the same.... That not cool...)


I'm not sure what you mean, could you explain please?

Quote

Binding function is cool.
The deplacement of the bar is nice. (When you touch border you added a nice effect.)

You should throw the ball at a random angle at begenning...

Actually I was planning to have one of the players "throw" the ball at the beginning (like in many wallbreaker games), but I still need to figure out how to do that. (probably by adding a distance joint between the ball and the paddle and destroying it just before throwing the ball)

l0calh05t

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Not Quite Pong
« Reply #6 on: July 25, 2008, 01:58:00 pm »
another update:

-basic audio added
-physics updates are now frame-rate independent
-physics updates are no longer performed in render thread
-much less locking
-should an old state be encountered by the renderer, the current state is extrapolated (prevents visible stutter)

the last two should fix most lag issues (that is, if you experienced any. i didn't)

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
Not Quite Pong
« Reply #7 on: July 25, 2008, 05:53:05 pm »
-physics updates are now frame-rate independent

Ya its the good way to do it but your pong take 50-90% of my computer cpu and the ball is now teleported during the game :P

I can't try to find what wrong because i don't have box2d and i'm to lazy to install it :P.
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.

l0calh05t

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Not Quite Pong
« Reply #8 on: July 25, 2008, 06:51:21 pm »
no jumping/teleporting on my pc... and only ~12% cpu load. what kind of cpu do you have, and what is your screen refresh rate?

edit:

new version upload, could you try if it is any better?

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Not Quite Pong
« Reply #9 on: July 25, 2008, 08:07:03 pm »
I could't see the ball in the previous version but this one seems to work.

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
Not Quite Pong
« Reply #10 on: July 25, 2008, 08:12:37 pm »
It's like the first one. The ball seem to flash and i see 2 balls like if i cross my eyes XD.

I think you should try to put vertical sync to off.
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.

l0calh05t

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Not Quite Pong
« Reply #11 on: July 25, 2008, 08:15:58 pm »
Quote from: "Daazku"
It's like the first one. The ball seem to flash and i see 2 balls like if i cross my eyes XD.


very strange. can you tell me your configuration? (cpu,refresh rate,graphics card)

Quote
I think you should try to put vertical sync to off.

meh. rather not. why waste cpu cycles on drawing (almost) the same picture again and again and again. (uploaded a no vsync exe anyways)

Wizzard

  • Full Member
  • ***
  • Posts: 213
    • View Profile
Not Quite Pong
« Reply #12 on: July 26, 2008, 01:13:31 am »
It may just be me or my computer, but depending on the ball's speed the ball turns a shade of red. This is especially so in the executable with vertical sync. In the executable without vertical sync (where it's not so bad) the ball can turn almost completely red for a split second if I get it stuck between the side and my paddle.

Anyways, good work. I really like the flow. Now I just need a score system to prove to my buddy I just wiped the floor with him.

l0calh05t

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Not Quite Pong
« Reply #13 on: July 26, 2008, 11:10:15 am »
Quote from: "Wizzard"
It may just be me or my computer, but depending on the ball's speed the ball turns a shade of red. This is especially so in the executable with vertical sync. In the executable without vertical sync (where it's not so bad) the ball can turn almost completely red for a split second if I get it stuck between the side and my paddle.


The shade of the  ball depends on the ball's spin, not on it's speed. Try moving the paddle quickly just before the ball hits it. It should turn pink to red (depending on paddle speed

Quote
Anyways, good work. I really like the flow. Now I just need a score system to prove to my buddy I just wiped the floor with him.

Working on it :-)

EDIT:
Basic score system is in place, also, the no-vsync version is now included in the archive.

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
Not Quite Pong
« Reply #14 on: July 26, 2008, 04:00:16 pm »
Look REALLY REALLY REALLY better with no v.sync.... Do you clear the scren with 0,0,0,255 ? Because i think that can be why the ball is not perfect.

Ps: You reset the score at 100 that not cool !
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.

 

anything