A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: Ball rolling over a 3D surface, like Mini Golf

  1. #1
    Junior Member
    Join Date
    Mar 2001
    Posts
    14

    Question

    Bit lame, but here goes. anyone know how to start coding a game like Mini Golf on the Electrotank site where the ball (or any other object I guess) can follow a 3D looking surface, gaining momentum on ramps etc. I've done golf games before in 2D as well as games coded in real 3D, so the maths isn't a problem... just the concept.

    Here's how I've got it (2 variations):

    1) The game/motion is actually coded in a simple 3d world and the ball is using some weird technique of defining intersecting points of planes in 3D space. Er... how?

    2) It's all done in 2D where the up and down ramps are simply rollover hotspots that add a certain 'vector' to the existing ball vector to give the impression of speeding up/slowing on hills. I.e. it pushes/pulls the ball more in certain direction if it's rolling over a 'hill' area.

    Anyone got the actual method used? Ideally with enough finesse to allow a ball to bounce off a ramp if struck too hard etc.

    Cheers

    Dino


  2. #2
    easily distracted mattGuest's Avatar
    Join Date
    Jun 2001
    Location
    USA -> NJ
    Posts
    353
    I don't know how they actually did it, but I've been thinking of experimenting with using a tile based map and assigning a vector to each tile to affect the ball.

    When the ball hits a tile apply the new vector and that's it. The only problem is that I would like the ball to be able to leave the ground, like if it hit a ramp or something, so you'd have to add an extra dimension.. I guess you could make it pseudo 3d or something.

    anyway, that's the direction I was headed in when I thought about it.

    -matt

  3. #3
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Just want to point, that Electrotanks golf IS NOT 3D, its isometrics. Isometrics is faked 3D, not real.


    Maybe this is helpful:

    http://www.setpixel.com/content/demo.php?ID=22

  4. #4
    Elvis...who tha f**k is Elvis? phreax's Avatar
    Join Date
    Feb 2001
    Posts
    1,836
    http://www.wireframe.co.za made some open source suggestions on how to solve this the iso way...only one problem - I can't remember the link, and you can't access it from the main site Hopefully someone has the link!

  5. #5
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223

  6. #6
    Elvis...who tha f**k is Elvis? phreax's Avatar
    Join Date
    Feb 2001
    Posts
    1,836
    yup yup, that's the one

  7. #7
    Flash Developer on a break
    Join Date
    Jun 2001
    Location
    The Netherlands
    Posts
    1,370
    One of the jail***** tutorials had a similar thing. Just seach for Jail***** Turorials..

  8. #8
    Originally posted by tonypa
    [B]Just want to point, that Electrotanks golf IS NOT 3D, its isometrics. Isometrics is faked 3D, not real.
    Why is the isometric perspective not 3D? in engineering terms isometric or isometrical would be defined along the lines of: projected so that the plane of projection of a three dimensional drawing is at an equal angle to each of the three axes of the object drawn. This strongly suggests to me that an isometric game is a 3D game.

    Anyway its all a bit picky really

    Thanks
    Matthew

  9. #9
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    I am not engineer, so perhaps isometrics are part of 3D world, but when you say "this is 3D game", people tend to think it is something like "Doom" at least. When you say "I want to make 3D golf game", its not exactly same as isometric golf game.

    For me isometric is not real 3D, because items further are not drawn smaller.

  10. #10
    No no, fair enough, I think when you spend all day working on isometric environments one can get a bit defensive I personally think isometric perspectives work really well in flash, but hey ho

  11. #11
    Senior Member Ray Beez's Avatar
    Join Date
    Jun 2000
    Posts
    2,793
    Isometric worlds are typically 2D grid based (array) just like standard "tile based" games, except you render out your array a bit differently...


  12. #12
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    ISO is just 3d without perspective, but we never change the camera, so we never need to do complicated math. You can get ISO rendering in 3d Max (just rotate camera, turn on Orthaganic Projection), And it's still 3d.

    3d means 3 dimensions, which ISO does have. 3d does not mean with perspective. You can have a 3d Matrix, it's still 3d.

  13. #13
    Flash Developer on a break
    Join Date
    Jun 2001
    Location
    The Netherlands
    Posts
    1,370
    The first Doom wasn't even 3D... it was all fakes with sprites...

  14. #14
    easily distracted mattGuest's Avatar
    Join Date
    Jun 2001
    Location
    USA -> NJ
    Posts
    353
    the buildings were 3d, it was done with raycasting. All the characters were sprites but the game itself was true 3d

    -matt

  15. #15
    I struggled for most of the past year over the same issues - trying to get realistic movement over an isometric map with topography types affecting movement. Let me know if I can help.

    GyroWorld (my isometric Flash 5 game) uses most of the principles you described:

    http://www.happymonitor.com/gyroworld

  16. #16
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    Yes, I've seen this game posted before, and it is really great (though, I don't have the patience you do.. A weekend is usually all the attention anything I start gets).

    What's the underlying principle you used for the ball to be effected? Did you say, look up what tile it was on in some object and then apply forces applied in it? Did the individual tiles chose what the thing did? Did it use some wacky method?

    All this has put me in a marble maddness mood. If it lasts til the weekend, I may have a go yipee!

  17. #17
    Junior Member
    Join Date
    Mar 2001
    Posts
    14

    Angry

    Top stuff! I owe you all a pint! ;-)

    The article at http://www.setpixel.com/content/demo.php?ID=22 did the job, but there's been some good food for thought here too! I can sleep easy tonight... but I've set the coding wasps loose in my head now! I'll keep you posted.

    Thanks again

    guruOfSparkle

    // *** //

    BTW, I also found this very smooth example a while back. http://www.hp-expo.com/winabeetle/uk...etlebuggin.asp . All I want to achieve. Damn!

    And if you're into marbles (!), I did this quick game a few months ago... maybe pseudo 3D next??? http://www.foxkids.nl/localise/croky/game/index.html . It's in Dutch, but essentially click and drag the marbles to launch them, jump on the cups to... hit the parrot! (long story!). The more you get on a cup, the bigger the bonus, but you can knock 'em all off if you goof up.

  18. #18
    EdMack - the gyroscope MC contains a bunch of topology functions, so once the MC knows which zone it is with an x,y hit-test, it acts accordingly altering it's own velocity, acceleration etc depending on the zone - as opposed to the tiles telling the MC what to do.

    This required a lot of function re-writes to try and make them as efficient as possible to keep overheads low for one MC.

    In the end I was able to create pretty much one function for all slopes, one for all corners, one for all collapsible tiles to maintain a fairly good frame-rate.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center