Billiards Engine

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

No permission to download

Isaac Sauvage

Meep!
Site Supporters
Joined
Jun 23, 2003
Messages
6,815
Solutions
10
Reaction score
2,877
Points
150
Favorite Pinball Machine
Jurassic Park
i guess i should post this here also for the people who don't get over to VPF: this isn't a pinball table. it's a pocket billiards game and a billiards engine that when finished, will allow people to design their favorite pool/billiards games with a minimum of technical effort.

Billiards Engine 0.9Z.3A.zip:
[available in the download section here]

WHAT'S NEW:
-balls and decals are finished for all solid balls
-balls are now legally racked in the correct starting position
-keys added so that any ball can now be moved to whatever position you want
-more helpful status readout
-table now rotates between four different views so you can get the best view possible for your shot :D

*phew*

NEEDS WORK:
-a lot of ball through ball and ball through wall. probably needs reinforcement walls or something.
-rotating has a couple of minor bugs at the moment
-add pocketed effect
-i need to finish graphics for striped balls
-physics for english
-physics to show caroms off one rail hits?
-fix lighting bug and add more semi-lit areas


DOWNLOAD:
https://pinballnirvana.com/forums/index.php?resources/billiards-engine-v0-9z-3f-ballcleanup.4336/ (VP8 - Billiards Engine)
 

Attachments

  • billiardsscreenie9Z2Y.jpg
    billiardsscreenie9Z2Y.jpg
    77 KB · Views: 609
  • bill2_3a4.jpg
    bill2_3a4.jpg
    104.2 KB · Views: 43
Last edited:
Well, you already know how cool this is so I don't know what to say. I like the new presentation.

If you would like some inspiration, look at, if you have not lately, foobillard, 3.0 is the latest I think. I don't know how much help it is, but I think the source code is available. C++ I think, but I haven't checked. Anyway I like it much more than any freeware pool. I really can't think of a feature it don't have that I would like it to. It has it's quirks, and bugs, but I'm use to it and love it.
 
thanks, phil. i will check that out- for one thing because i'm still looking for some various pool graphics.

i also posted this here because as the project progresses i'd be interested in hearing your ideas. for example, one of the versions i want to do is a collection of trick shots, which anybody can submit of course, but i do need people to make a few.

the new version let's you set up balls in any position; i just need to add something so that when you find a good set of positions you can hit a button and save it off.

there is also ball-through-ball and ball-through-wall bugs, and i'm not quite sure how ball-through-ball is going to be solved yet.
 
Ball through ball. As far as problems go that's a whopper.
I know UC physics handle that much better. That would be a big fix though, if it was a fix, but something to ponder. Have you experimented with UC physics with this project?

Trick shots are fun, and something missing from PC pool as far as I know. I know a few, and there is one I have tried hundreds of times and never made, but I know it's possible. Maybe I will show it to you on your table when you get the save setup implemented.

Power and speed seem to be very well in sync on your table, but to get a good break seems to take too much speed. This is a problem with all PC pool games that I know of, little action on the break, but your table is best that I know of in that respect, just takes a lot of power, and what seems to be too much speed to get it. Only on the break though.

When you do combination shots on this game, in my opinion you are showing VP ball physics in a better light than any pinball table has done. I'm very impressed with that. If it could do that trick shot I mentioned, I would be blown away because though you have to hit two balls at the same time, each one of them sets two others in motion at the same time. The shot is one ball in each pocket on one shot.
 
Here's a Trick shot rack for that shot of making a ball in each pocket, it really works too. I bought one of these for my son for Christmas once. He has my old Pool table.

trickrack.jpg
 
I just downloaded the newest version. Yes, the balls jump off the table. I Made a copy of Wall1 and made it 100 units high, invisible, no hit event, still dropable and the balls quit jumping of the table, I'm saying jumping off, like in a real table, rather then they were going through the wall.

Oops, I still got a ball through the wall, I now changed the glass height to 80 and that works do far. :)

Oops, with the ball at a force of 450, I guess it does go through the walls. :) I lowered the glass to 60. I thought about an invisible wall about 60 units high, but wouldn't the glass just be an invisible wall?

OK, I thought the ball might be going through the wall at the triggers, so I made a single rectangle wall surrounding the table and pockets covering the triggers 500 units high and ball speed 500, I still got ball through the wall. I almost gave up, but I noticed the bottom height was zero, so I made the bottom height minus 10 and still eventually got a ball to go through the wall :( I'm tired now, so I'm off to bed.

It's still really cool.
 
Last edited:
@phil,
that's a good idea about the UC thing. my understanding is that UC physics are somewhat broken in the VP version, but what the hey...

speed takes more than it would normally on the break because friction is pruposefully set too high (see upper right hand corner as table runs) so that you don't currently have to wait long between shots. but try going into the top of the script and reducing it and seeing how that affects things.

also, the balls aren't racked as closely as they should be because of ball-through-ball. that loses you some efficiency right there, i figure. this again can be quickly adjusted at the top of script.


@bob,
great, that shot is just the kind of thing i'm looking for. the hermit has the table right now for script-work but when he's done i'll start work on the positional saving.

thanks for your hard work on the ball-through-wall. it sounds like you have solved it for all intents and purposes because eventually the ball speed will be capped. only the bad guy from the mummy could shoot a ball with 450 force. :)


@everyone,
so you guys did like the rotating table effect? it took me a lot of effort because of all the things it broke when i implemented it. but as i was struggling to fix them all, i thought "this effect has never been done before in VP, right?"
 
VP physics are more broken in the VP version. I hear UC physics are broken too, but I don't know exactly what. Maybe only as they pertain to pinball elements. Ball through flipper, ball through ball, and ball through wall are all either much better, or sorted. With VP physics I think the only fix would be to check and reposition, and that would be a lot of checking, and cycles that could be used for something better like English, and stuff.

I emptied a couple of tables and never saw the rotation effect. Is it auto, or manual?

Yeah, I went into the script and lowered the friction to .07, changed to UC physics, and liked that effect. I did not re-rack the balls though, but I did see the spacing code.
 
alrighty, cool.

the rotational effect (well, it's more of a feature than an effect) happens when you hit the "<" or ">" keys. technically it's period and comma because they're unshifted, tho.
 
bah, "foobilliard" was linux-only.

well, the striped balls are done. i cheated on three frames, but for 28 total frames at four images for each striped ball, i get to cut myself some slack. particularly considering that the solid balls need to be re-worked and the whole ball graphics set was only meant to be temporary anyway.

i'm also looking at shiva engine's version of the external save/load file, because saving data in VP's "stg" file will not allow as much flexibility as an external. this is the next step in allowing people to create their own trick shots.

last and most cool, the hermit has joined the project and has been busy kicking ass on code cleanup and bug squashes the last few days.
 
http://www.geocities.com/keinhong/foobillard/

Here is the windows port.
The table graphics are amazing, the physics are great, and the features. I think it is by far the best programming Florian has done. You can use a stick or not, and use a mouse to stroke with the stick.

I'll put up a screen shot with the view and shot options.
 

Attachments

  • Foo.jpg
    Foo.jpg
    350.7 KB · Views: 403
hell yea! thanks!

downloaded- will look at it tomorrow...
 
well, the striped balls are done. i cheated on three frames, but for 28 total frames at four images for each striped ball, i get to cut myself some slack. particularly considering that the solid balls need to be re-worked and the whole ball graphics set was only meant to be temporary anyway.
Great! I've cleaned up the routines for defining the ball images and animating them so that for single image balls (the spots) you only need to define the first frame. Plus you only need to define the "full bright" colours (as used for balls with no images) now also.
i'm also looking at shiva engine's version of the external save/load file, because saving data in VP's "stg" file will not allow as much flexibility as an external. this is the next step in allowing people to create their own trick shots.
This is definately the better option, that way people can save out a particular setup and send/post it to others!
 
Many trick shots use props.
Perhaps it would be nice to have a panel on the side with such props. The panel could probably be made to pop up or be covered by the background graphic. I'm thinking foremost of a que stick that can be moved to lie on the table and be rotated as needed. a few shots take two sticks. Other props used in trick shots are the rack triangle, plastic bottles made for pool, and others.

Of course you could make a resourse table as well that does nothing but hold these objects, to copy and paste to the pool table. Then of course anyone could as well, so the question is would you saction an official one.

This would be a great table for online play, and it would not have to be in real time. One shows a trick shot, and another tries to duplicate the set up and execute the shot, or be sent the set up and try to make the shot. Of course for a challenge, the que ball should not be saved in the correct position, but be in hand.
 
Hmm... Well I'm intersted in a few of those ideas, although implementing them may prove tricky... ;)
 
good point about most trick shots requiring a prop- i don't think i'd fully realised that issue until now. altho making objects becomes trickier because of the rotating effect.

one idea would be to make a grid of dropwall posts over the space of the table that could be used to form larger objects- most of them would be in the down position until a specific prop was called for, then a few of them could be raised to roughly approximate the needed object. not as pretty as custom dropwalls, but this would be much easier to sync up with the rotating feature.

i agree with jason that your ideas are interesting, though, phil. i do totally agree that trick shots should be ball-in-hand-- that's probably half the challenge there in figuring out where to place it.

i have the table right now and what i'm working on is,
- my save / load routines worked so now i'm turning it into a 10-slot system with one external save file.
- slowly and incidentaly looking over jason's updates. (little afraid to remove some of the commenting until i've sussed everything fully)
- i want to flesh out the attract mode effects a little bit more (you could say that the "follow mode" is the first one) and research how to sync them to the timing of a song (i have one in mind that i think will match beautifully)
- other various annoying issues that i'm still deciding on...
 
Yeah, the panel thing was stupid. I don't know what I was thinking. It's not like you could drag and drop objects. The only way it could be done outside the editor (inside the game), without a million dropwalls to use that would still be too restricting, would be to use balls, and they would not be stationary. Or have a library of shots built in to choose from.
 
Billiards Engine 0.9Z.3F.vpt: (good for 7 days of downloads)
https://www.yousendit.com/download/bVlDNWNvNHZEa1VLSkE9PQ

a lot done by the hermit; not much done by me. but the save/load routine is working so i figured i'd get it out there. anyone who wants to can attach 10 slots worth of saved states to a post- the file is called "billiards.txt", found in VP's user directory.

frankly the project depresses me at the moment. setting up trick shots is a lot harder than i realised, partly because of the exacting demands of ball placement, partly because of the weirdness of VP physics and partly because of no props or english at the moment. maybe we should just scrap this idea and go for a standard billiards game as the first version. i don't know, but i'm out of energy for the moment.

shots behave differently depending on which physics mode you're in, but it's currently set to "UC physics" which is the anticipated final mode. but one of the things that's irritating is that if you place a short line of exactly-lined up colored balls and the cue ball on the table and then strike them, the last ball in line will always drift off, messing up your trick shot. i'm sure there are many more examples and permutations too, but like i say i'm depressed about it at the moment.

jason, quick list of changes:
- new dim'ed variables: loadsave {flag for when you're about to load or save a slot #}, slot, ballslotX(15,10),ballslotY(15,10) {the 10 slots held in RAM}, SlotData(3,10) {short amount of data for each slot save}
- new keys: 'L', 'S', '#', 'P'- load, save, slot #, force pocket ball (helps in setting up trick shots)
- routines at end: saving and loading slots
- temporarily made pocketed balls visible again to help with setting up shots
- feel free to hold the table for a while and modify it, increasing the version numbers as you wish

*blargh*
 
I think concentrating on getting a basic game working (8-ball for example) with the correct rules and scoring would be a nice distraction if you wish to carry on with it rather than have a proper break. ;)
Like you say some shots, particularly many trick shots will not be possible until spin/english is implimented fully... and that may take a while. :( Once we have it working on the cue ball it then needs correctly transfering to any other balls it hits, and that will be an even bigger task! :help:

I'll have a tinker with the new version and see what I can do. :D
 
It really doesn't transfer from ball to ball. The energy is kept to the ball it is applied to. That's what makes it work so well in a game. The contact of a que tip to the ball, is hundreds of times greater than the contact point of two balls. It does, but the effect is minuscule, and negligible, and certainly nothing to program.

Making the rotating table is cool, but it cuts out a lot more work getting something like that working. Masse for example, will require 4 different routines to apply the same effect on the ball. English and masse are done easily in a 3D game engine, because you are applying the effect to the ball. Here you will be applying the ball to the enviroment. It would not even be straightforward without the rotating table, as I'm sure you understand by now, because you are still applying the ball to a dynamic enviroment, because every time the que ball trejectory changes, you are in a new enviroment.

I think it can be done, but I think it would require the dropping of a physics minded approach, and need to be done with simple geometry and a variable. Basically 4 routines, one for each cussion plane. 16 routines to cover the rotating table, and then you would add or subtract trejectory based only on the amount of english, and the rail hit. Masse would not be as easy unless you could apply sine to the ball coord system.

Jumping should be a piece of cake though.


YouTube - Eric Yow's Trick Shot Madness - Masse Insanity
 
Good points in there but you would only need 4 routines for the four planes even with the rotation. As it is it should be possible to do it with just one routine. All that is need is an easy method for converting co-ordinates & velocities into co-ordinates & vectors, apply the required change, then convert back... I think. ;)

Set up a perfect line of all 15 balls and with UC physics the first ball hit drifts slightly, with VP physics a nasty amount of ball melts and each balls that the cue ball then hits drifts too. Not sure if this is a problem with the aiming routine or Visual Pinball itself.
 
- did a little work on graphics cleanup of solid balls today.
- remembered an idea i had about a trick shot feature that doesn't involve traditional elements. actually there are a lot of neat trick shot ideas that can be done in virtual pool that can't be done in real pool, and i now recall that that was more my idea than the traditional trick shots. (remember, this project is at least five years old so getting into it again was like getting into someone else's project) anyway, a little bit of positive energy is restored.
 
Last edited:
Glad to hear that! With regards to balls drifting out of a straight line formation: I've noticed that the further the cue ball travels before hitting the first ball, the worse it is. Not sure what that signifys though!

To improve your chances of getting the balls in a perfect line add Int(....) to the Ball(BallMove).X & Y lines in the MoveBall_Timer sub. ;)
Code:
 	Ball(BallMove).X = Int(Ball(BallMove).X + 1 * Int(1 + MoveSpeed * .1) * CX)
 	Ball(BallMove).Y = Int(Ball(BallMove).Y + 1 * Int(1 + MoveSpeed * .1) * CY)
 
Yeah, I was thinking the same thing about 4 routines working. I was thinking there were more walls, not thinking about flipping which uses the same walls, so it might even take as many as 12 routines, assuming a wall hit is going to trigger them. 6 walls for the horizontal layout and flipped, and 6 for the vertical layout and flipped. But 4 unique routines, of course.

I've seen that drift problem in projects and experiments with UC myself.
 
the solid balls now have most of the 'bad transperancy pixels' cleaned up.

i did some work on attract modes using velX and velY yesterday and gave up. looks like making the balls move around by controlling them via formula and algorythm and direct X's and Y's is the way to go.

still getting some headaches but mostly just incredible anxiety attacks the last couple days. i still sincerely hope it's due to withdrawal symptoms for going off that med one week ago, altho the half-life is not supposed to be as long as this has been. we'll see how it goes... :s
 
Forum activity
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.
      Mibs Mibs: StevOz has posted a new reply in the thread "Post interesting videos you found on YouTube".
      Back
      Top