Jump to content

  • Log In with Google      Sign In   
  • Create Account


pong game and opengl


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
15 replies to this topic

#1 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 18 August 2013 - 04:39 PM

well I want to  post a pong game I am working on, I am almost finished, I wanted to get some feedback on my game. I am using vs 2012 and I am compiling the release version of my game, are there any switches I should use in order for my compiler to put out the release version of my game.

 



Sponsor:

#2 Joshhua5   Members   -  Reputation: 436

Like
0Likes
Like

Posted 18 August 2013 - 09:17 PM

At the top next to your Local Windows Debugger (play button) two to the right it should say Debug, click on this and go Release.
you probably only set to include things (if you include any other libraries) in the Debug mode so you have to reset them for release in your project properties.



#3 Bacterius   Crossbones+   -  Reputation: 8533

Like
0Likes
Like

Posted 18 August 2013 - 09:47 PM

Also, if you can, test that your program runs on another machine than your own (even a virtual machine) before and inform people of what they need to download (any frameworks and so on) if you can't bundle them along. That way you can avoid the predictable 5+ posts of "it doesn't work".


The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#4 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 18 August 2013 - 09:49 PM

well here is my pong game let me know what you think, Attached File  pong.zip   593.93KB   134 downloads



#5 Bacterius   Crossbones+   -  Reputation: 8533

Like
0Likes
Like

Posted 18 August 2013 - 10:09 PM

It doesn't work. More specifically, it still links to a bunch of debug-level DLL's, including msvcp110d.dll, msvcr110d.dll, and so on.. if you're a Visual Studio developer you will have those, but other people certainly won't. What you need to do is:

 

1. ensure you are building everything in release mode

2. if at all possible, link statically to the MSVC libraries (see google, stackoverflow, ..)

3. test yourself that it works on a different computer before providing a download link!!

 

Until you do that, nobody except you and possibly other VS developers here will be able to run your pong game without going dll-hunting.


The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#6 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 18 August 2013 - 10:11 PM

ok cool thanks



#7 phil67rpg   Members   -  Reputation: 767

Like
1Likes
Like

Posted 18 August 2013 - 10:38 PM

Attached File  pongzip.zip   643.45KB   250 downloadswell I tried  this on my laptop and it works except that you have to extract it to a regular folder and I cant get the sound to work also.



#8 Bacterius   Crossbones+   -  Reputation: 8533

Like
1Likes
Like

Posted 18 August 2013 - 10:49 PM

attachicon.gifpongzip.zipwell I tried  this on my laptop and it works except that you have to extract it to a regular folder and I cant get the sound to work also.

 

Works! No sound, it seems to be that the audio library you're using doesn't seem to support wave files with format other than PCM. If I substitute the .wav file with a PCM-encoded audio file, it works fine. Perhaps you can reencode your file to PCM and it should work then (did the sound work on your development machine?)

 

Some feedback:

- the paddle isn't very responsive, to move it quickly we either have to bash the up/down keys (which is slow) or keep them pressed (which has a delay before you start moving). I know this comes from how keystrokes are handled in Windows, because I assume you are relying on the KeyUp/KeyDown events. To make this better, you can try not using the events but instead, in your game loop, checking the keyboard state to see if the up/down arrow keys are pressed or not, and react accordingly.

- there is something wrong with the collision detection at the edge of the paddles, the ball will start spasming inside the paddle instead of bouncing back at an angle, eventually coming back out the same way it entered. We'd have to see the code to diagnose this one.

- the AI is unbeatable.

- after some period of time, everything gets slower (not sure if this intended, but it does make the game easier).

 

Other than that it looks pretty good! Are you going to share the source code as well?


The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#9 Joshhua5   Members   -  Reputation: 436

Like
0Likes
Like

Posted 18 August 2013 - 10:53 PM

The other paddle moves at the speed of the ball on the y axis, theoretically making it impossible to even get one point.



#10 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 18 August 2013 - 10:56 PM

the sound  works on my desktop, are you using windows? maybe my collision detection is flawed. and my AI needs to be tweaked.



#11 FLeBlanc   Crossbones+   -  Reputation: 3101

Like
0Likes
Like

Posted 19 August 2013 - 08:26 AM

I'm guessing you built it 64-bit, because it no worky-worky on my crappy work XP box.



#12 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 19 August 2013 - 02:21 PM

I did it on win 8  32 bit I think it could be 64 bit



#13 Satharis   Members   -  Reputation: 949

Like
1Likes
Like

Posted 19 August 2013 - 02:49 PM

I'm sort of wondering why you didn't just provide the source along with the binary so we could give a better analysis of why things might be broken or ways you can improve your design/literal code.

#14 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 19 August 2013 - 06:16 PM

Attached File  pongsrc.zip   2.55KB   71 downloadsok I am still learning how to be a better coder so go easy on me.



#15 jbadams   Senior Staff   -  Reputation: 17998

Like
0Likes
Like

Posted 19 August 2013 - 08:26 PM

It's relatively easy to build a "perfect" computer player for Pong, but a bit more challenging to provide a beatable but fun opponent.  Take a look at how human players typically play the game, and try to add in some of the same behaviours and mistakes.

 

Try the following:

  • When the ball is moving away from the AI paddle, move the paddle back to the centre position.  A real person might overshoot or fall short by a small but randomised amount rather than moving exactly to the centre.
  • When the ball is moving towards the AI paddle a typical human player will try to anticipate where the ball is going and move the paddle there, but will make small mistakes and occasionally mis-predict, especially if the ball is bouncing up and down a lot.  Add in some small random variation to have the paddle overshoot or fall short of the correct position.
  • Have the paddle attempt to correct any errors when the ball is getting close -- a real human player always panics and tries to correct their mistakes once they notice they're in the correct spot.

You can probably improve further on the above method, but it should be a good starting point at a more realistic, less unbeatable computer player. smile.png



#16 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 19 August 2013 - 08:31 PM

well I tried to get the computer to  move up and down and up on its own again but cant seem to figure it out, could I get a little help on this problem.AI is new to me.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS