Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 


Submitted by Ciaran McCormack, posted on December 20, 2004




Image Description, by Ciaran McCormack



Here are a couple of screenshots from Crazy Pool, a 3D Physics training exercise that I have been working on for a few weeks. Whats Crazy about the game? It allows the user to specify the number of sides of the table and the number of pockets. This may result in you playing on a near round table with 17 pockets or a triangle table with 0 pockets! :S Who would win that game??

Some features:
  • Graphics/Input use DirectX 8.1
  • Table Mesh Dynamically Built to allow custom tables to be Created
  • Physics for interaction with Objects eg, Collision Detection and Response, Friction, Conservation of Momentum (angular physics still in development so no spinning balls yet)
  • Intelligent Camera which watches the action
  • Shot Assistance. Similar to Ghost Cars in alot of new Driving Game Time Trials, watch the shot unfold without affecting the table
  • Pool Referee
  • This is a very early version of the game. Alot of work still needs to be done. Table mesh/Physics needs to be Optimised. Game AI/Online MultiPlayer to be added so if someone at PC on their own they can still play against a competitor.

    Visit http://www.ciaranmccormack.tk/ to download the game.

    Ciaran


    [prev]
    Image of the Day Gallery
    www.flipcode.com

    [next]

     
    Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
     
    Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
     
    franck

    December 20, 2004, 12:12 PM

    I like your game !

     
    franck

    December 20, 2004, 12:13 PM

    And I want to know if you want to sell this game in the future ?

     
    CiaranMcCormack

    December 20, 2004, 06:32 PM

    Sure! Depends to who and for what! :)

     
    CiaranMcCormack

    December 20, 2004, 06:32 PM

    Anyone have and issues/comments about the game that can help me improve it. I would really appreciate any feedback taht you can give.

    Thanks
    Ciaran

     
    Infernal

    December 21, 2004, 12:55 AM

    something about the bottom left image upsets me. I think it has to do with the texturing though.

     
    CiaranMcCormack

    December 21, 2004, 03:15 AM

    I agree. The texturing is off and gives it a weird look. The issue is that the table top is a triangle fan with all faces shareing the center of the table as a comon vertex. Around the Pockets more faces are needed to allow the circular structure of the pocket however I still just use the same texture coordinates as the larger faces. (0,0)(0,1)(1,0)

    I was aware of this problem but never paid it much attention. I dont think it looks so bad in realtime with moving objects and a moving camera but as a valid issue I have added it to the ToDo list and will hopefully fix it soon.

    Thanks for the Comment!

     
    Ola Frid

    December 21, 2004, 05:25 AM

    Fixing this is easy, just base the UV coordinates on the vertex coordinates (like, if the table is parallel to the XY plane, set U to Xk and V to Yk, where k is the scale). If you're using OpenGL, you could probably do it with glTexGen or something, but I never tried that.

     
    mattd

    December 21, 2004, 06:46 AM

    Cool stuff! I like the Shot Assistance ghost preview thing, and the different camera angles used.

     
    cron

    December 21, 2004, 07:02 AM

    Yeah really cool game! The camera manager thing is really good, loads of tension as it zooms in on the cue ball as it creeps towards a pocket then drops from one of my crappy shots :)

    Ghost balls is better than the lines in other pool games, even if it does sound a little supernaturally perverted. Diff table shapes are a great idea, really changes the game

    Good work!

     
    Puzzler1831

    December 21, 2004, 07:55 AM

    I'm very impressed - I'll even let that part where you used DirectX slide;).

     
    CiaranMcCormack

    December 21, 2004, 08:22 AM

    Hi Ola Frid,

    Thanks for the tip. I think that makes sence. I'll have to try and implement it first to get my head around the idea.

    Thanks again
    Ciaran

     
    ravuya

    December 21, 2004, 01:16 PM

    This looks great! If only you had used OpenGL, then I could port it.

     
    toolmaker

    December 21, 2004, 01:34 PM

    It's an awesome game Ciaran. I still like to point out that the lightning is a bit too dark on my machine. The shot assistant is very well made. It got me started pretty quick.

    Toolmaker

     
    bananaboy

    December 21, 2004, 07:06 PM

    Yep that's commonly called "planar mapping". There is an article on flipcode somewhere (to do with generating texture coordinates for lightmaps) on planar mapping.

    cheers
    sam.

     
    Rui Martins

    December 22, 2004, 04:34 AM

    Can you enlighten us how you implemented the "Inteligent Camera".

    How do you choose the best angle or where "the action" is ?
    do you just try to frame the moving balls, or the fastest moving ball ? what ?

    I'm looking into that field now, and some insight on how others approach the problem would be nice.

    Thanks

     
    Rui Martins

    December 22, 2004, 04:51 AM

    I would just light to point out that pockets are too wide, look like 2 times ball radius, I think it should be smaller (1.2 or 1.5 times).

    I would sugest that you allow the use of upand down cursors to allow the player to change the height of the view when playing. Like in a real life pool game, you lower and raise you head multiple times, to have a better perception of the table and balls.

    Shot Assistant and Ghost Balls take all the guess work/experience from the game, it makes it too easy, but it's a good way to start a new player playing successfully in no time.

    I think also that you should provide camera transitions, instead of a fast switch. But it is a nice touch to have a global view when the balls start to slow down, making you read for the next shot.

    Here is where I think the game could be improved, because, you give an Overview look(camera), but when balls stop you then suddenly change to "play view" (camera behind the cue) the ball that gets selected for your next shot seems to be completely unrelated with your previous global Overview look (Camera).
    Maybe you could allow the player to rotate the camera (centered on table or white ball) while in Global Overview camera, so that he could align the camera with its intended next ball to shoot at, then player presses a key, and you lower the camera to "play view" in a continues movement.

    Just an ideia.


     
    CiaranMcCormack

    December 22, 2004, 07:22 AM

    Hi Rui,

    I will try and explain here how the "Intelligent" (used in very broad terms) Camera works. It is part Forward Prediction and part Random.

    There are two sets of balls in my game. First are the physical balls that are on the table and the player uses in the game. Second are the ghost balls. Whenever I want the camera to deside what to look at next I resync the ghost balls with their associated physical ball and forward project based on direction and velocity for X Seconds.

    After X Seconds I assign a priority to each ball based on its change of State. Black Ball Potted has the highest priority since the game is over when this happens, white ball potted has next priority then regular ball potted, ball nearly potted, ball moving fast etc..... down to pretty much nothing of real interest happening having a 0 priority.

    I now have the ball I want to look at, ie. the ball with the highest priority so where do I look at this ball from. I again decide this based on the priority. If 1 ball is potted I like to see this up close so the camera either sits above the pocket, (a pointer to which is stored in the ball which has been potted) then just follow the ball or the camera sits behind the ball and follows it until it is potted.

    Other than this the camera takes a wider angle and chooses a randon position in the X,Y,Z Asix within defined limits. This doesnt always work but I have been pretty happy with the results. Version 2 of the game will refine this to place correctly between a set of priority balls and watch the action.

    Whenever the ball I am watching stops or is potted I recalculate what is best to look at. There is also a time out. If the ball is still moving and not potted after X Seconds I recheck again so ensure that something exciting is not happening after the original X Seconds Forward Prediction.

    I hope this explination was enough to suit your needs however if you would like to discuss more issues please feel free to contact me (Contact Section of my website)

    Ciaran

     
    CiaranMcCormack

    December 22, 2004, 07:48 AM

    Thanks for the comments. Even though it is really really great to get praise for the work as above I also really appreciate the constructive comments which will help me improve the game for the next version.

    I would just light to point out that pockets are too wide, look like 2 times ball radius, I think it should be smaller (1.2 or 1.5 times).


    Yeah your right, the pockets are 2 times ball radius. I just hardcoded that value for this version. The Table Mesh Creation Routine allows the user to pass the pocket size as a parameter so in the next version it will be an option to specify the size of the pocket along with the number of sides/number of pockets.

    I would sugest that you allow the use of up and down cursors to allow the player to change the height of the view when playing. Like in a real life pool game, you lower and raise you head multiple times, to have a better perception of the table and balls.


    I was thinking about this but never got around to it. Most of my testing was done using the Shot Assistance so having a great view of the table was not a priority, but since I was thinking about it and now you have said it, its a required feature and will be added.

    Shot Assistant and Ghost Balls take all the guess work/experience from the game, it makes it too easy, but it's a good way to start a new player playing successfully in no time.


    Very true. Prehaps I should have also posted a todo list above with the description. This is one of the main points in that list. Even though the Ghost Balls are probably my favourite feature of the game it does make the play way to easy. I plan on adding different levels of shot assistance. At the easiest Level it will be as it is now. I will then add harder levels where only the cue ball has a ghost ball so you can see where this ball goes until first impact etc... Some Fuzzy Logic in the Shot Prediction would be good too. Place a human at a Pool table, they are never going to make the exact same shot twice in a row so with a small bit of random behaviour the shot prediction would be alot better.

    I think also that you should provide camera transitions, instead of a fast switch. But it is a nice touch to have a global view when the balls start to slow down, making you read for the next shot.


    Ok, thats a good point and would be pretty easy to do. Rather than just switch give the camera a desired X,Y,Z Position, X, Y, Z Rotation and a Time Frame then interpolate over the time period to achieve this.

    Here is where I think the game could be improved, because, you give an Overview look(camera), but when balls stop you then suddenly change to "play view" (camera behind the cue) the ball that gets selected for your next shot seems to be completely unrelated with your previous global Overview look (Camera). Maybe you could allow the player to rotate the camera (centered on table or white ball) while in Global Overview camera, so that he could align the camera with its intended next ball to shoot at, then player presses a key, and you lower the camera to "play view" in a continues movement.


    Since the Global Overview is just a static camera position or a randomly generated camera position it didnt really make sence to associate the new cue position with this. At the start of a new shot the cue faces the closest ball of the players color or the black ball if no player balls remaining. I think that if I A) Add the Stand Up and Crouch Down controls as mentioned earlier and B) implement the smooth camera transitions between views a suitable setup will be achieved.

    Thanks a lot for your comments. It has given me a few more points to add to the todo list which will hopefully make version 2 a much better game.

    Ciaran

     
    Rui Martins

    December 22, 2004, 08:51 AM

    Another improvement you could add is the possibility to have higher precision when selecting the cue direction/angle.

    What I mean is, currently you use Left/right cursor keys, and every time you press one of them, a small amount of rotation (movement) is done around the white ball. However, for some shots, if you press left once is too much, or if you press right once is also too much, so their is a need for smoother more precise control.

    I would suggest you use the CTRL Key, simultaneously with the cursor keys, to have a more precise movement, i.e. a smaller delta to change on every press or time delta. In fact to slow the movement, so that you can fine control it.

     
    Rui Martins

    December 22, 2004, 09:09 AM

    I also am developing a game wich involves "balls" taken in the general term.
    But it's completly different in game play and subject.

    Now my problem is that in my game/demo, they camera view has a strong influence on the players perception of what is going on.

    In your case, you shoot the ball (using the cue) and then for a time period, the camera is free to do whatever you want, because it won't influence the game play, since the balls are already rolling and the user can't act again on them until they stop.

    In my case "ball control" is done interactivelly, and the camera position influences the user perception of distance between the "balls", and since distance between "balls" is used as a factor in game play, it can have an adverse, inocuous or improvement effect on it.

    Currently I'm using a top view static camera over the "play field", which is setup at start to visualize all the balls (this is part of level building, not computed in real time).

    However I would like to develop a camera behaviour that could eventually help game play, or at least that won't hurt it. I eventually also need to develop a kind of "hint" system, so that each level could give tips (hints) to the camera system, to influence it's behaviour to improve game play which can be level dependent.

    P.S.
    A way to improve distance awareness can be to zoom in on the problematic area.
    A Way to hurt game play is for example to have two "balls" which are near each other, and place the camera so that they become partially or totatly occluded by one of them or a 3rd "ball".

    These are just ideias for eventually hint the camera system to avoid the bad situations, and converge to better views. But since the game play is always changing the "balls" position/velocity it's hard to find an easy solution.

    Currently the top view static camera seems the easier solution 8)

     
    CiaranMcCormack

    December 22, 2004, 11:35 AM

    What has one to do!!!!!

    if you either
    A) View the ReadMe.txt you can see

    ######## #Controls# ######## Default Aim Cue : Left and Right Arrow Buttons Fast Aim Cue : Hold Shift while Aiming Slow Aim Cue : Hold Control while Aiming


    B)Look at the controls option from the menu you see

    Left/Right Arrow Buttons : Rotate Cue At Default Speed Left/Right Arrow Buttons + Shift: Rotate Cue At Fast Speed Left/Right Arrow Buttons + Control: Rotate Cue At Slow Speed


    Thanks for the interest though. Glad to know you are playing around with the demo.

    Ciaran

     
    CiaranMcCormack

    December 22, 2004, 11:37 AM

    Sounds like a really interesting game. Is there any online beta demo available. If not I hope to see it here as an IOTD really soon.

    Good luck with it,
    Ciaran

     
    Rui Martins

    December 22, 2004, 12:18 PM

    Oops !

    Sorry I just gleaned over the Readme.txt and those sentences, somehow got redirect to /dev/null 8)

    Glad to know you though of it!

    See ya

     
    Rui Martins

    December 22, 2004, 12:29 PM

    well, about the "interesting" part I'm suspicious to talk about it, but I think it's a completly not twist of gamming, you actualy don't control a unit. you influence units properties which indirectly influences there behaviour.

    Some friends have tryed a several alpha versions and seem to like the twist.
    It provides some puzzling action.

    About the IOTD, you guessed it, it's on schedule, but I have to finish some stuff so that anyone can play without having me explaining the rules of the game.
    Maybe a simple ReadMe.txt would do, but I get the fealing that not many people read them, even the ones that do read, do it in an strange way (me me me).

    If I have the time to finish those small problems I'll release it after Christmas.

    Note however, that it's still in a very early stage, don't expect much besides a twisted game play 8).

     
    This thread contains 24 messages.
     
     
    Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.