Billiards Engine

VP8 Flipperless Recreation Billiards Engine v0.9Z.3F.BallCleanup

No permission to download
Good luck with the health issue.

I tinkered a while last night with your project.
Ball hit ball events would really be nice. We should ask Randy for that, as well as ball hit flipper event if we get a chance.
I made a nine ball table, as that is my favorite game. I then looked at the English. I amped it up to see the effect better and noticed that the ball hit routine is hit and miss, and that the effect mostly showed up with subsequent ball hits that for the initial ball.

I meant to figure out if you are detecting hits with que vel changes, or detecting the other ball moving, but got too busy playing with the way it is. It occurred to me that you might be reading the vel after it is reduced to near zero sometimes, so used a real number instead of doing math on the vels and it seemed to support at assumption. I got some pretty realistic top spin and back spin on the ball after going back to math (for correct vectors) and adding value instead of multiplying and dividing it, but it was very inconsistent. A couple of things I could not understand, and altered was the effect coming into play only with a vel over 15. This increased the consistency, but it was still hit and miss and the ball hit sound confirms the hit and miss.

It was fun tinkering with it and playing it. I don't know if the things I imagined when I first saw this would fly given the way of things as they are, but it is further that I would have thought before. I bet with something like Blitz, or Dark Basic, that you could build a top notch pool simulation.
 
Last edited:
Cool, the hit sensitivity can be made to work 100%. Perhaps that is all it will take to get the rest working.
 
i must confess that i've completely forgotten what the hit sensitivity issue is. partially because of how long i've been away from the project, partially because my head is only about 70% back to normal- thankfully with each day i feel a little more normal. and no anxiety attacks today, phew!
 
Good to hear Nic.

I don't know what the issue is either. I do know that it is set to 53 or something and I did not get 100% until I set it to 100.

I don't know if this matters, but I turned off the lighting effects, and changed to 9 ball, so there is a hell of a lot less going on at the same time.

I also noticed that the lines that make up the rails are off. They should be perfectly straight, or you are not going to get true angles off of them. Also the points where the walls come together to enclose the rails are 4 units apart. I connected them because I was seeing lines there on the rendering and the whole graphic image was skewed. So I connected one end and have the other end off by one for vertical and that fixed that. It did not work for horizontal so I connected one end and overlapped the other by one and that fixed that. I also straightened the rail walls.

If this gives you a head ache, ignore it for now.

I'm going to make a new English control panel, with a ball as the marker, so it will be analog x+y. If it works out real good, I'll submit it for your approval. X axis English might be duck soup after all.
 
Last edited:
The snag with setting HitSensitivity so high it gives quite a few false hits on slow passing balls that don't hit each other. I also noticed that it works less with UC physics than VP and that UC physics also lowers the FPS!

The slightly wonky walls and how to fix were already known, but where being left until the dimensions where exact for the various table sizes.

Duck soup?
 
okay, i think i've got it. thanks, phil. and IIRC "53" was chosen because of it's relation to the spacing between two balls. i don't really understand how that number could be much greater or less than 50 if it's going to accurately indicate the touching of two 50-unit VP balls. (25 units from the core of one ball to its edge and another 25 for the same for another ball)

re: the table dimensions,
when it's possible i'm going over to a neighbors to measure and photograph the table she has. same with the pool hall in the township. once i have that i'll make up new table images and hopefully set the proper (and mathematically accurate) dimensions once and for all.

re: the overlap bug,
i couldn't figure out how to solve that at the time. if it's still a problem when the table is rebuilt, maybe i could look at your version? (sorry jason, i've forgotten what your fix was)
 
I understand the dimensions, but was trying to get a 100% hit event. The math is correct, and the logic is, well, logical.

If you let the aiming ghost ball hit the ball it is aiming at the hit will occur as far as I can tell 100% of the time. If you shoot before the aiming ghost ball makes contact then the hit will occur as far as I can tell 0% of the time. This should be a simple fix. Maybe shoot out the ghost as fast as it will go then cycle with the power based speed, or just use math if that would work. It took me a while to figure this out because I did not rely on contact of the ghost cue, and I did not miss the ball I was aiming at. It was not until I starting testing how little I could miss and still register a contact, or how close I can miss and not register a contact, using the ghost cue as intended that did not happen that I figured this out.

edit,
OK not quite 100%
 
Last edited:
re: the overlap bug,
i couldn't figure out how to solve that at the time. if it's still a problem when the table is rebuilt, maybe i could look at your version? (sorry jason, i've forgotten what your fix was)
Split the cushion on each table into 2 or more. I originally suggested one dropwall for each of the 4 cushions on each view, but it can be done with just 1 other split opposite the first.
This way you don't have to leave any gaps between points, or overlap, something I personnaly don't like.
 
Did you try Foo Nic?

You know you can set up trick shots with that. Go into training mode. Pocket all balls you don't want on the table by selecting them with the tab key then hit them into a pocket. Use tab to select the rest and drag and drop them while holding the M key to where you want them. Then select the cue ball with tab and drag it and drop it. You can't save the setup though.
 
i'm trying it again right now.

it's a little annoying having to manually pocket the balls. that's why i added the "P" key function to the billiards engine. i like the ability to move balls with the mouse and the aiming system is admirably simple and straightforward instead of clunking around with the pool cue the way some games do. but as you say, the inability to save setups is not good. .

btw, feel free to attach your "billiards'txt" file if you come up with any good setups.
 
another problem that foobilliards reinforces is that transporting pool to computer makes the game somewhat less fun by that act alone IMO.

i've tried a number of pool games at this point and have generally found that the ones which try to make the experience as realistic as possible just don't hold me as much as the ones that introduce some innovation that creates a somewhat new and different pool experience. probably because i don't ever see myself as playing serious pool on computer.

but looking around innovations and variations, games like "crazy pool" and "lightning break" create some of the most quick and enjoyable fun IMO.
http://www.onlypoolgames.com/
 
The single narrow line for aiming takes some getting use to.
You could use a cue stick if you wanted one but you need to set up your aim, then get the stick with c or F3, then hit it again to aim again. It's nice to stroke with the mouse though, but I usually don't go to the trouble.

I will set up a shot tonight with yours. My son is having his 21st birthday party in a few minutes. His birthday was actually the 24th and we went to Kennedy School, here in Portland, then he said he had another bar he wanted try out. he said it had a whole bunch of video games from the 80's though it turned out it have some from the 70s and 90s as well. It had 30 pinball machines from the 80s as well and King Pin, and some from the 90s and the new ones too. I never got around to getting a drink the whole time I was there. It's called Ground Control and it is here in Portland as well. Arcade by day, and a bar by night. It has all my favorite games, I did not count then but between 1 and 2 hundred.

Gota go. Party time.
 
Ok. I don't think I will have time to set up a trick shot, but I did get the collisions between the cue and object ball working, which automatically got the English, as it is, working too.
I went back to a hit sensitivity of 100. I know, but it's needed to give the for next loop time to go through, and I added a check to make sure that the object ball was moving or not so there will be no sound or English applied if you miss the ball, even by a hair.

Fixes - None really, though it seems to work 100% of the time on the first ball hit which is the only one English should be applied to the cue ball on.

Problems with this- Again, just one I think, and that is when the cue ball hits subsequent balls THAT ARE MOVING, the problem with the padding is back.

So my suggestion would be to have two timers. One for the initial hit with the fix, and another as you have it already that replaces the routine after the initial hit. You might be back to missing sound events, but there should not be any English events needed there.

Disregard this if you have better ideas.

I needed to point out that I am only using 9 balls and have the arrays only working those 9, and the light is gone. I could, and should have tested the original version, but this is an edit to this post.

It works with 8 ball with the light as well. I also made it where the English reverts back to none (center) after each shot. I think this is how it should be, but the reason I did it was because the English effect was happening on the subsequent hits as well, and that was not good at all.

Now I think we need an analog control for the English as well as X axis. Remember the strength of the English has only about half to do with the strength of the shot and the other half is in the area of the cue ball struck.It might even be like 1/3 and 2/3 respectfully.

I'll help when I can, but I really need to get those bottom ramps on the Flintstones done.
 
Last edited:
thanks for your work on this. head is pretty bad at the moment but i'll try to take this in as i can later on...
 
I added the call to the English Timer to the rail hit, and added basic X axis English that works on the top rail. It also works on the balls if hit straight from below, like on the default break. Still not analog, though, just a number added. Promising though.

English off the rails will be relatively easy, though still a lot of work, and would require a hit event for each rail separately. English off the balls at any angle and masse is going to be hard to impossible without using sine waves I think. Edit: maybe not sin after all. I have an idea of checking for ranges of VelX relative to VelY, to do it.

Get well soon. Try a pot of coffee, or just the pot.
 
Last edited:
i'm a little better today and thanks for the good wishes. with each day i seem to recover a little bit. what's really weird is eating a lot of hot peppers or coffee (not at the same time, heh) and feeling no effects, either relaxation or stimulation. or having to glance at something three times before it sinks in when i'm used to only having to do it once.

anyway...

regarding the hit sensitivity and english, i wouldn't know what to say at this point because i've been looking into other stuff. IMO best would be to confer with the hermit on such stuff, particularly because he was intensively working on english via some interesting experiments.

now everyone is probably well-aware of this but just in case, a note on the top and bottom english i initially included with the game- it's complete nonsense and meant to be replaced, as you can tell from playing around with it or from looking at the code.

it will be interesting to see what you email me, but again i would defer to the hermit in these particular areas. he is an excellent programmer IMO and should be the overseer in these areas.

personally i've just been doing a little more work on ball graphics the last day or two and kind of testing myself on other things to see how my level of concentration is coming along. even when i get back to mental speed i intend to work on other areas, like the attract modes and the final graphics and dimensions of the table, as i've said. even at prime productivity i do not have much of a head for math or physics, so that was never going to be something i would be very productive at anyway.

the most realistic things i could do in these areas is to test what you guys come up with and try to give you detailed feedback.
 
Well let's wait and see what The Hermit comes up with. It really is a job for an excellent programmer. If he does not have something by the time I'm done with the Flintstones, then I'll bug his ass, and I understand that I'm pretty good at bugging asses.
 
Sorry guys, I've not been well enough this last week or so to work on anything other than my job. :(
I hate it when I'm like this, not ill enough to get time off work but ill enough to feel completely drained when I get home.
 
ah, sorry to hear that. i will just throw out my standard flu line, then- garlic, onions, horseradish.
 
i finally got over to the billiard parlour yesterday and got some shots and measurements.

strangely, the tables seemed to have been built to custom dimensions, so although i measured the banks to be two inches wide i'm still not sure how standard that is. the tables were also nothing special appearance-wise, so i'm still looking forward to seeing the neighbor's table.

mostly i'm back to normal now in terms of cognition ability, although i do get weird headaches every day or two that aspirin can make no dent in. this is not very pleasant to say the least and so i'm still taking things slowly and hoping that time will take care of this.
 
Good to hear you are getting better.

I e-mailed you my 9 ball conversion that has enhanced English. Still a lot of work left, mostly applying a analog value based on how much English you want, but it does include X axis English that works just as well shooting down the table as up, and fairly well shooting left to right, but that still needs work. I have not tested it on horizontal layouts, but I know it wont work right, that would need more code. The same code actually but fiddling with the Y instead of X on those layouts. It can be combined with the Y English, and both are reset to center after the shot.

I hope the code will be replaced with something elegant and better functioning by The Hermit, but as a feasibility study, this method I believe is a success and the easiest way. There is actually just a few lines of code added or altered.
 
got it and played with it a little last night.

didn't look at the code but tried to just notice how the changes affected shots. so far i didn't notice much difference, but i'll continue to look.

to me, the biggest difference side english makes is that after striking the object ball, the cue ball will then pull to one side more than usual. IME english affects the object ball in a minor way at best but can do wonders on the cue ball.
 
Exactly. I would never code transfer English effect to any other ball. It does not effect shots, because the effect does not transfer. This is the biggest part of learning pool by a great margin. The beauty is that you can make the shot, the same shot, and leave the cue ball where you need it for the same shot. You always hit the ball with the geometry that will send it on the vector you want, regardless of what English, or masse is used.

I have won pool tournaments, and held tables all night at parties. 90% of this was skill, and 90% of this was condition (not drinking). 10% was luck (not scratching, and this is what a mastery, or even a fair skill of English can help a lot). II know the numbers don't add up, but it's true, the skill and condition overlap and both is more than 50% of the total.

Pull to one side, yes, that is the effect we are looking for. Combine it with your Y English and you can hit balls off the rail when without English you would hit a ball in the way. If this was ball physics instead of simulation of English off balls and rails then you could set a force so high that you would not need to hit a ball or a rail (masse).

You have a method. Straight up or up at a 45 degree angle, or even shallower will work. Straight down and downward angles work. This don't depend on the orientation of the table except you will be replacing X with Y using otherwise the same code. Straight side (on the computer screen) X English will have the same effect as your Y English, which works regardless of the orientation because that just reverses both axis, or boosts both axis.

The routine needs rewritten, even to work well with what I gave you. You are going to need a couple or three routines (English timers) that are called based on the rotation of the table, and the ratio of VelX to VelY. It also needs a analog value which is the force of the English to add to a fraction of the balls Vel force. Then the English will be complete. And the effect need to be made to pretty much, to totally end on contact with the object ball and rails. Masse can be used to retain a great deal of energy off the balls and rails though reduced fast, we are talking about a great deal of energy there. A center hit at the top, actually a bit off center towards the back could also be used for Jumping the ball, and there English position is the same always and the force of the shot is 100% of the distance jumped.

Computer pool in any programming environment rarely if ever goes this far, but trick shots are not the objective either.

I can imaging more elegant ways to do this, but just don't have the talent as a programmer to do it. I do know that anything you can do with keys you can do with code, and that your aiming ball holds the key to implementing elegant English and masse as well, but that would require a rewrite of the entire engine to use math to move the ball like you do your aiming ball. What I mean by this is that if there was a English selector like yours that was analog, and I moved it to the extreme left and very near the top, the ball would run a sine wave like your aiming ball does and arc to the left. This English variant is a force applied to the cue ball from the top sides of it.
 
Last edited:
Exactly. I would never code transfer English effect to any other ball. It does not effect shots, because the effect does not transfer. This is the biggest part of learning pool by a great margin. The beauty is that you can make the shot, the same shot, and leave the cue ball where you need it for the same shot. You always hit the ball with the geometry that will send it on the vector you want, regardless of what English, or masse is used.

This is so very wrong, left or right english throws the ball left or right. The more left of center you hit the cue ball, the more the object ball will be thrown to the right. This is the most difficult aspect of the game for most people to comprehend and/or use to their advantage in the game. Average players should never really use left or right english, just stick with striking the cue ball with upper or lower english and of course aiming for the dead center of the cue ball.

I've spent 1000's of hours playing pool in my day. It goes with the territory of running a private club. :)

Links below to substantiate my claims. :cheers:

http://www.easypooltutor.com/article251.html

http://www.easypooltutor.com/article63.html
 
It does, but the effect is minuscule, and negligible, and certainly nothing to program.

That of course works as set up. Close and slow, and that is why I mentioned that it does have an effect, but you can not do that across the entire table. In computer physics what are you going to do? You are not going to have a spinning ball. You have to apply vectors to the object ball, and that would work, but it would be so many calculations, and you would have to have it contained to speed and power ranges for just a very minor change that would be needed in a very limited number of shots.

Average players do need to control the cue ball and side English is not going to change the shot to any degree to worry about. Average players are not doing trick shots either.

I think the shot was make able without the English anyway, in that video. It looked like he had plenty of room, and the video changed just before the shot with even more, and certainly enough room. But even if that was just my perspective, the right English was extreme, and I think the shot was made because of the cue ball rolling around the one, something that can be done on slow and close shots, or with masse. Still as I said, the effect is real, but minuscule, and negligible as far as a poll simulation in VP is concerned. The no effect language I adopted after making that statement was for the purposes of this project.

I've beaten a few club owners in my time.
 
General chit-chat
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
      Chat Bot Mibs Chat Bot Mibs: Flipper Hermann has left the room.
      Back
      Top