Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / Pinball! DBPro 5.8, 20 Line Coding Challenge

Author
Message
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 10th Jul 2005 03:58 Edited at: 10th Jul 2005 04:18
Pinball Demo. Give it a try - I think you will be surprised.

I've still got about 3 lines left to play with. If peeps like this, I'll go on and make full pinball game then. Comments and feedback are always welcome.

Enjoy!

Edit: Oh. Use left & right control keys for the flippers. Use enter to launch the ball. Use space bar to 'push' the game (no "Tilt" added... yet )



"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 10th Jul 2005 11:46
Wow thats really cool. Never seen a 20 liner pinball game done. There is something that bugs me though... maybe the gravity is a tad bit strong?


"Lets migrate like bricks" - Me
EvMaster
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Australia
Posted: 10th Jul 2005 12:21
That's cool, but yeah gravity is too strong.

-Ev

AMD939 3500+, Gigabyte PCI-E X800XL 256mb, 1024mb RAM
Logitech Z680 5.1 Speakers
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 10th Jul 2005 16:43
Thanks for the comments , and here's a fix.

All that can be adjusted fairly easily. I can tilt the table down a bit or lower the gravity (which is a bit more complicated).

The table above was at an angle of 6 degrees, this one is 3. You can adjust the table angle by changing the:
Pitch Object Up 2,3
which is located in line 5 about 13 or so commands in.

I am working on a version with more "stuff", and should be able to post something soon. I'll adjust the gravity in that version, so the table angles can have a little more range. Maybe I'll add in a table angle adjust cheat or something like that.



"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
EvMaster
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Australia
Posted: 10th Jul 2005 17:39
Yeah that's better.

-Ev

AMD939 3500+, Gigabyte PCI-E X800XL 256mb, 1024mb RAM
Logitech Z680 5.1 Speakers
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 10th Jul 2005 20:01
Thats really good. Can you give some kind of explanation of how the collision works? Looks complicated!

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 11th Jul 2005 02:16 Edited at: 11th Jul 2005 02:21
Quote: "Can you give some kind of explanation of how the collision works?"


The collision itself is not all that. There are a few steps.

1) Start by making a "map" (using an array) of the vectors of a limb. For the pinball itself, this is limb 0. I also did a map of the flippers (limbs 1 & 2 on the board) to help "kick" the ball a little more than the flippers could do alone. The map ignores duplicate vectors and vectors that are "very close" to each other. This helps reduce the number of collision checks needed - which improves speed. In future versions of this collision system, I plan on making the "closeness" of "duplicate vectors" a variable setting, so that very complex objects can be used with this system as well. For example, I had to reduce the ball sphere object to 10r x 10c, and it is noticeable. But after that upgrade, I could make a 50x50 or better sphere, and it would have roughly the same number of collision checks.

2) Cast rays (Intersect Object) from the center of the limb to each mapped point. This will return the distance from the center to the point of collision. At this point there are two sub-steps that happen. a) The distance from the vertex to the point of collision is calculated. b) The actual coordinates of the collision are calculated.

3) This next part isn't really needed, but it is very valuable: The point of collision is subtracted from the center point of the limb, giving the point opposite (of the limb center) of the collision point. These resulting coordinates are stored and totaled, then divided by the total number of collisions (returning an average point away from all collision points). This resulting point is where to place the object so that it is not touching any point on the collision object(s).

4) Some options were applied to help manage the collision system. a) An accuracy value was added, which basically translates into a Step value on the For/Next check of the vector coordinates. This was done to also help improve speed (but at the cost of accuracy). b) A cycle value was added. I have to admit that at first, this was intended to help balance out the accuracy setting by storing the results of the previous cycle's check with the current cycle check, and adding an offset to the For/Next loop through the vector map. Instead, it turned out to be a great way to add resistance to movement of the object. It's not perfect, but with a little fine tuning, it will do a great job as an acting "mass" setting.

5) Then there is the part that Dmitry K helped with. The problem was that limb verticies are always returned as their base values - not adjusted by the limb's coordinates or rotation. The coordinates offset was the easy part, but the rotation part is something I am only beginning to understand. Basically, Dimitry's function takes a point in space relative to a limb's 0,0,0 coordinates & 0,0,0 rotation and offsets and rotates it to the limb's current position rotation. While this part isn't too useful for the ball, it is critical to the flippers.

6) This isn’t part of the collision system: Using the collision system, everything else just fell into place. I added simple gravity by positioning the ball at a lower Y-coordinate value than its current coordinates. I added momentum by storing the previous pre-gravity and pre-collision coordinates, subtracting that value from the current coordinates, then adding the results to the pre-collision movement (which is where the gravity is done as well).

Starting with this, I placed the ball on a basic board, tilted the board and watched the ball roll down the board. I added edges, and the ball “bounced” quite nicely off the edges. This bounce-effect is how I managed the kickers; when the ball passes in range of a kicker (using basic Object Collision) , the ball is placed inside the kicker and the new coordinates are recorded in place of the previous stored coordinates along with an adjustment for momentum. Then the collision system takes over and moves the ball outside the kicker-object and the new momentum is recorded.

That's it. It may seem complicated, but it's really just cycling through vectors to cast rays that check for collision. Then manipluate the results. Add gravity and momentum, and shake well. Serves about 3-5 people.

Here's my WIP additions. Also, it's in extended format, so it's easier to read. Enjoy.



"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 11th Jul 2005 03:59
Thanks for the explanation - always know I'm going to get a quality response from you. Also useful is the uncompressed code - I'll spend some time studying it. Getting an error message on the latest version though as soon as a flipper is used - "Check_collision(): limb was not prepared. Use Prepare_limbe() function first."

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 11th Jul 2005 04:53 Edited at: 11th Jul 2005 04:54
That's odd. Works fine here. I take those error prompts out for the 20 line version, so the 20-line should actually crash if that were the case. Another thing I do for the 20 line version is add in dim statements up front, even though they aren't used until later. Here is the code with the dim statements added up front. Let me know if it works.



"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
EvMaster
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Australia
Posted: 11th Jul 2005 15:52
I'm getting the same error with that latest version.

-Ev

AMD939 3500+, Gigabyte PCI-E X800XL 256mb, 1024mb RAM
Logitech Z680 5.1 Speakers
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 12th Jul 2005 01:33
...(The following rant is not aimed at EV or Ric, but at DBPro in general)...

[rant]
Okay - that's just really annoying. This has happened twice now where the code I write works fine on two of my pc's and doesn't work for others with the same version of DBPro. It's difficult enough to debug on my own pc, and I know code should be "tested for all environments" - but this is a short code, a 20-liner.
[/rant]

Fine, now that that is out of my system, I'll be taking a look at the code and trying to see what could possibly be causing the error.

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 12th Jul 2005 01:41 Edited at: 12th Jul 2005 01:44
Alright, let's give this a shot. It should not work, but it will at least tell us if the error-trapping is the problem, or if the problem is somewhere else. This is simply with the error-trapping removed. Please give it a try and let me know what happens. Thanks.



"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Jess T
Retired Moderator
20
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 13th Jul 2005 02:04
RiiDii,
That's some very very nice code there
( I love pinball! )

All the snippets you've posted work fine for me (I'm compiling under 5.8)

The only crit I have for the kickbacks/slingshots, they need to have more power behind them... In real pinball machines, those things really pack a PUNCH

Good job

Jess.

Team EOD :: All-Round Nice Guy
Want Better dbHelp Files?
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 13th Jul 2005 07:20
Quote: "The only crit I have for the kickbacks/slingshots, they need to have more power behind them..."


The problem is the ball can't move too fast, or else it will skip a collision check. I can probably overcome that by adding in a predictive check using Intersect Object. But that's not likely to happen in 20 lines
Right now, the movement cycles twice for every sync. I am trying to improve the calculations speed so I can squeeze in a third update between syncs. If I can manage that, I can slow down the ball's normal speed, but increase it's maximum speed.

Quote: "That's some very very nice code there"


Thanks Jess! I learned a lot about using the new vertex commands from your "help" site. I check it often for any of the new commands.

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 13th Jul 2005 15:59
Okay - I've got massive improvements on speed (though I'm not sure if it will fit in 20 lines or not - I'll give it a try soon). I'll also point out that the ball is a lot smoother looking (higher poly-count). The kickers kick hard and the ball is lightening fast. I think I could even add a multi-ball function now... maybe. Wouldn't that just kick? Really; next step is to add some drop-down targets in the upper left corner.

Enjoy!!



PS: Ric, Ev, any luck?

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Jess T
Retired Moderator
20
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 13th Jul 2005 17:13
:o

Nice! That feels alot better now when it's kicked back
I love it!

Quote: "I learned a lot about using the new vertex commands from your "help" site. I check it often for any of the new commands."


Glad It's helped you in your coding

Keep up the good-work.

Jess.

Team EOD :: All-Round Nice Guy
Want Better dbHelp Files?
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 14th Jul 2005 16:01
Some more improvements. I am still tweaking some settings like gravity and tilt of the board - maybe some collision settings, but this is it as far as actual "improvements" go. I've added in the drop-downs in the upper left corner. Each 1 is 10 points, all 3 is 100 points + reset. I've improved the collision and gravity and kickers a bit. There was a problem with the ball jumping the flippers and the side kickers. Both issues are resolved. Added a "glass" lid onto the board to help keep the ball from jumping out, though it can power through (I think I've got that under control - should rarely happen if at all). Also added 5 balls per game and a final score. So now peeps can post their scores. I will be converting this to a 20 liner - I'm sure I can get it to fit; I'll just go get my sledge hammer...

Enjoy!



Please post any feedback soon so I can start on the conversion. Thanks!

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 15th Jul 2005 06:14
And here's the 20-line version as promised.

Left Ctrl Key = Left Flipper
Right Ctrl Key = Right Flipper
Enter = Launch Ball (not key-pad Enter)
Space = Shake board.

Enjoy!



"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Jess T
Retired Moderator
20
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 15th Jul 2005 10:55


Wow, that's brilliant!
How'd you squish all that into just 20 lines!? With almost a full line to spare, too!

If I were the one judging these 20-liners, I'd say this is a winner!
But, I'm bias cos i love Pinball

Good luck!

Team EOD :: All-Round Nice Guy
Want Better dbHelp Files?
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 15th Jul 2005 12:18
Thanks Jess!

Actually, I think per the rules I am allowed 25 commands per line. I only use 20 to be safe. So I really have 4+ more lines if I really wanted to squeeze.

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
PiratSS
21
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 16th Jul 2005 08:26
That's crazy. Very nice work, can't believe you got it all into 20 lines.

VG Cats: How I mine for fish?
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 16th Jul 2005 09:12 Edited at: 16th Jul 2005 09:13
Thanks Piratss! May not believe it, but there it is. Wasn't easy though... had to re-write a bit (I was worried for a while there). Also no-media, so the board is built using up code as well as the physics and game-play being handled.

Edit: High scores yet? I got about 5000+/- (but I hit enter too fast before I wrote the exact score down).

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Robot
19
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 18th Jul 2005 02:31
Is there a compiled .exe available?

The happenings of tommorow are behind us now
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 18th Jul 2005 05:52
Even compressed it's too large to post. Someone would need to host it. Any volunteers?

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 18th Jul 2005 08:18
That's superb physics Rii. No crashes now - do you know what the problem was? Only problem I have is that the ball sometimes goes through the flipper - it happens only when the ball is falling down and the flipper is flipping up, so I gues the closing speed is just to quick for the collision detection - at least on my aging PC. For the rest of the time, though, the motion of the ball is very convincing. Look forward to the full media version!

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 18th Jul 2005 10:06
That is very odd. Both the flipper speed and the ball speed are capped to prevent that. For example; the ball's speed is limited to just slightly under 1/2 it's diameter - even on angles now. Also, the movement isn't timer-based movement because I was worried about that exact thing happening (increase the move because the time between cycles increases, and that increase would exceed the collision capablility).

I did encounter a similar bug for a while, but then I noticed the ball was actually jumping the flipper. I thought I had fixed that. I even added a "glass" lid to help keep the ball in (a hidden limb on top). The ball can still "bust" through the lid, but it should be very rare.

As far as the pc goes, I tried it on my pc at work, which I can't even get 60 FPS for code that spins a cube. The pinball game ran at a blazing 40 FPS - looking like some special effects from the Matrix. But the collision worked fine.

Any thoughts on what the problem could be; Jumping, Collision, Something else? I'd really like to fix it if I can.

Also, I have no idea what was causing the crashes in the earlier version. The 20-Line version is modified from the extended version. I really had to get tricky to squeeze it all in. So - does the extended version work on your pc? That'll give me some clues.

Thanks Ric!

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 18th Jul 2005 21:24
Very nice! I'm now getting same problem as Ric where ball goes through right flipper when travelling at full speed, usually from top left. Previous versions did not do this. Other than that it is great.


RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 19th Jul 2005 01:15
Thanks Spooky and Ric. It definately sounds like a collision issue then (not a jumping issue). I have an idea on how to correct it (although I am afraid it will mess with the other collision effects, like bouncing). Well... to work then.

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 19th Jul 2005 09:05 Edited at: 19th Jul 2005 09:08
Same problem with the extended version I'm afraid. Perhaps stating the obvious, but I suspect that the collision checking is fine, but when the ball is travelling at speed it isn't actually passing over every point; instead it performs a 'quantum leap' from one position to the next. These leaps, I guess, are bigger than the collision zone of the flipper. I usually get around this problem by increasing the collision zone (eg. the distance returned by interect object) as the moving object increases speed. To use an analogy, a speed camera works by taking two photos of your car as you pass over a callibration strip. Theoretically, if you drive fast enough, you can avoid being caught because you will have passed beyond the callibration strip before it takes the second photo. To counter this, they make the callibration strips much longer on motorways than on slow roads.

Sorry if it sounds like I'm rambling - I know what I mean at least!

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 19th Jul 2005 09:38 Edited at: 19th Jul 2005 09:46
Quote: "Same problem with the extended version I'm afraid."

I guess that means you can play the extended version (just trying to clarify).

I get what you mean about the collision. The flippers are handled in the loop well after the ball collision and movement occur, so there should be no "overlap" as far as that is concerned (I learned that lesson the hard way). This should mean that the flippers are treated like any other wall in most respects except one:

1) If the ball has passed the center-point of the flipper's next position.

So that's where I need to look. I add in a positive z-momentum to the ball when a collision with a flipper is detected - but it may not be enough. I'll try for an update tonight. Thanks again Ric!

Edit: Please give this a try. The trick I used to get the ball to move so fast is to do 3 move-frames per single sync frame. This is a frame-per-frame version - so it plays a lot slower. I am still not getting a pass-through. Let me know the specifics of the pass-through if you can. Thanks.



"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 19th Jul 2005 19:21
Quote: "I guess that means you can play the extended version (just trying to clarify). "


Yes they both play, but both have the collision issue.

Your latest update however doesn't compile. The error message is:
'declaration name '1' is not valid at line 11'.

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 20th Jul 2005 01:55
That is very odd. The only change was to line #7:

If Sync_Flag=2
to
If Sync_Flag<5

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 20th Jul 2005 09:38
Ok - just tried the same code on my desktop at home (previously was using my laptop at work), and it compiles, but still the same old problem unfortunately - ball passing through flipper when flipper moving up and ball moving down at speed.

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 20th Jul 2005 12:21
Okay - let's give this a try. I lowered the maximum speed of the ball very slightly (by 0.1). I also changed the maximum velocity cap calculation from Scale Vector3() to Multiply Vector3(). Hopefully one of these (or both) will solve the problem. Please let me know.



"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 20th Jul 2005 16:04
"Your latest update however doesn't compile. The error message is:
'declaration name '1' is not valid at line 11'."

I am getting the same error whenever I try to compile any version posted here (and I'd really like to see it). I'm using DBPro 1.057, could that be the problem?
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 21st Jul 2005 03:24
Come to think of it - not sure if my work laptop has 5.8 either - that's probably the reason for that error. Back to desktop - 5.8 - and your latest version still has the same problem I'm afraid. Don't give up on this - once you crack it it's going to be great!

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 21st Jul 2005 04:50
Version does have to be 5.8 as I used a lot of the new vertex commands.

It's tough to fix because I'm not getting that problem. That's not to say I don't want to fix it - it's that I just have no idea really how to go about it.

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 23rd Jul 2005 01:22 Edited at: 23rd Jul 2005 01:23
Can you give this one a try (re: the pass-through flipper issue)? For the ball, I doubled the number of points on the vertex map that is used to check for collsions. This also might impact the speed (slow down), but only on pc's this was pushing the limits anyway (like my pc at work).



"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Robot
19
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 29th Jul 2005 15:17
With the new 10mb file attachments would it be possible to post a compiled .exe?

The happenings of tommorow are behind us now
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 29th Jul 2005 18:11 Edited at: 29th Jul 2005 18:11
I will give it a try.

Edit: Looks like it worked.

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II

Attachments

Login to view attachments
Robot
19
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 30th Jul 2005 12:42
Thats amazing! I didn't have any trouble with the ball going through a flipper. It all worked perfectly .

My score was 5934.

The happenings of tommorow are behind us now
The Nerd
19
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 30th Jul 2005 17:51 Edited at: 30th Jul 2005 17:53
Hi RiiDii!

I really like this! Good job!

First i tried the version we're the ball just ran through the paddles sometimes. Then i figured out there was a version we're it was fixed. But in the version we're the problem should be fixed i got a much slower fps speed than in the version we're the ball could go through sometimes. Although in the version we're it should be fixed the ball can still go through at the very top of the paddles. Wich can be irrateting sometimes

But else... I really like it! Keep up the good work!

Visit PanzerGames here
Data
19
Years of Service
User Offline
Joined: 26th Nov 2004
Location: Winnipeg,Canada
Posted: 5th Oct 2005 02:38 Edited at: 5th Oct 2005 02:39
I'm amazed.......What is the programming world coming to? that's some great program

I think therefore I am.
CPU
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 15th Oct 2005 18:54
Nice job rii! Now I'm debating if I wan't to post my 20 liner or wait till next month...

Nahh, I'll post it... so do go check it out sometime

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 16th Oct 2005 21:27 Edited at: 16th Oct 2005 21:27
Thanks for the comments all.

I still can't figure out why the ball would go through the paddles.

Here's a quick diagram of how the collision works using Intersect Object. The fact that this works on some pc's and not others leads me to believe that some graphics cards handle surfaces (what Intersect Object checks for collision against - hidden or culled surfaces won't register) differntly.




Open MMORPG: It's your game!

Attachments

Login to view attachments
CPU
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 16th Oct 2005 22:46
The only thing I can think of is if what you said is true, that intersect object doesn't work against culled backfaces, then the only thing I can come up with is that the part of the flipper that colides with the ball might be getting graphicaly culled, thus making the ball go through the flipper, don't know if this could be true, but it's only a suggestion....

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 17th Oct 2005 18:33
The mystery is...
1) It doesn't happen on all computers. This is the big one.
2) The flipper is culled on the inside.
3) The ball is moved in increments of 3 steps for every single move that's updated by sync - so the movement is a lot more granular than it appears. Due to limits set on the ball's speed, these steps can never exceed 1/2 the ball's size.


Open MMORPG: It's your game!
CPU
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 17th Oct 2005 19:46 Edited at: 17th Oct 2005 19:47
1) - if like you said, that intersect object is handeled by the graphics card, then some might colide with culled polygons and some might not, or there may just be slight differences in the collision for different graphics cards...

2) - true

3) hmm, if the ball is moved at say 1/3 of the balls size and the end of the flipper moves at 1/3 the speed of the ball then that combined gives a total of 2/3 "movement" which would put the ball behind the wall of the flipper...

My suggestion would be to "screw 20 lines" for now, put in some error checking code that say writes information to a file every time a colision occures, then post that code, and tell the people that if it happens when someone is testing it to post the log file here... Just what I would do, but the fact that it's not the same on different computers is just plain annoying...

Good luck finding the bug!

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 18th Oct 2005 00:41
Quote: "but the fact that it's not the same on different computers is just plain annoying"

Not only annoying, but darn near impossible to find out what the problem is. If it ain't broke, I can try to fix it, but how would I know if the fix worked? I have to post, ask folks to try, and hope for the best (been there, done that). Annoying is right.

I worked out the flipper-to ball collision so that the flipper moved first and checks for collision with the ball. If there was a collision, then the ball gets moved back a bit (relative to the flipper flip speed). Then the ball movement happens and the collision check with the flipper occurs. Using this method - the worst case situation should be if the flipper collides with the ball on the "down swing" and moves the ball back onto the playing field, instead of down the drain.

Also, the collision map is actually set to slightly larger than the ball's size to compensate and ensure that near-misses go to the player. Using the diagram I posted above, picture the yellow lines actually shoot past the edge of the ball a slight bit.

I really just need to chalk it up to graphic card differences.


Open MMORPG: It's your game!

Login to post a reply

Server time is: 2024-03-29 14:43:57
Your offset time is: 2024-03-29 14:43:57