Results 1 to 21 of 21

Thread: VB: Construction Game [Source]

  1. #1

    Thread Starter
    Member jonask's Avatar
    Join Date
    Apr 2004
    Location
    Sandefjord, Norway
    Posts
    38

    VB: Construction Game [Source]

    It's not a game really, but I think it's fun to play around with so
    here it is anyways

    You can get it, as allways, under Visual Basic on my homepage:
    jonask.com
    the name of the file is
    stress_and_structure_simulation.zip
    Or Clicking Here

    This program alows you to place points into a 2d world, and then
    connect these points with links. You can also add factor like
    gravity, and muscle movement to the links. When the simulation is
    run the links will atempt to retain their length, and if not stress is
    calculated.

    This makes for a rather interesting physics simulation. You can
    construct all kinds of machines, structures and animations and
    test how they react under different forces.

    and so on, and so on with the sales pitch...

    Credits should go to the good people at sodaplay for giving me
    the inspiration to make this =)

    Anyhey, I found it to be a very interesting piece of code, and I
    really think it is worth having a look at.
    Last edited by Electroman; Jun 3rd, 2004 at 05:25 PM.
    --
    Jonas

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    loads of fun I couldn't get my stickguy to stand no matter how i constructed him, could you add an option to set resistance between two links from a node, so that they will also try to retain angle?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    www.sodaplay.com isn't it However, well done

  4. #4
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    Really nice!
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  5. #5

    Thread Starter
    Member jonask's Avatar
    Join Date
    Apr 2004
    Location
    Sandefjord, Norway
    Posts
    38
    Yeah, I know what your mean about locking angles between points. But if I were to add that it would mean rewriting most of the physics engine, pluss it would be a whole story with torque and frankly I'm not sure I can come up with a smart way to do that :P

    But if anyone has an idea on how to do eighter of the following, I would REALLY appreciate if you shared it with us here =)

    1. Locked angles
    2. "solid" lines. Lines that vertixes cannot pass through
    --
    Jonas

  6. #6
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Was it ment to be flat when it hit the earth???....BTW I got an overflow when I did set the strech bar to zero....

  7. #7
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    I liked it too but I maximised the window then put it back to restored and it crashed
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  8. #8

    Thread Starter
    Member jonask's Avatar
    Join Date
    Apr 2004
    Location
    Sandefjord, Norway
    Posts
    38
    Yeah, I see... MaxStress was calculated like this:
    MaxStress = SetVal(4) / SetMax
    with no limitation... it's fixed now =) thanks for pointing it out

    What did you mean by something beeing flat when it hit the ground?


    ---
    I think I know what you meant, Electroman, about minimizing the app. it has to do whith the resizing of the picture box, i think fixed it too now, thanks =)
    Last edited by jonask; May 24th, 2004 at 09:56 AM.
    --
    Jonas

  9. #9
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    In the version Fox showed us it kind of bounced when it hit the gorund, but in your app when it hits the ground it craches together and all the points land on the ground like a line...is that what is supposed to happen?

  10. #10

    Thread Starter
    Member jonask's Avatar
    Join Date
    Apr 2004
    Location
    Sandefjord, Norway
    Posts
    38
    Well, that is one of the advantages of my model vs Sodaplay's.
    In mine you can choose whether or not you want to follow the simpler sodaplay model or if you would like the links to snapp under stress, thus allowing for a "Bridge Builder/Pontifex" feeling =)
    --
    Jonas

  11. #11
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    Posted by jonask
    Well, that is one of the advantages of my model vs Sodaplay's.
    In mine you can choose whether or not you want to follow the simpler sodaplay model or if you would like the links to snapp under stress, thus allowing for a "Bridge Builder/Pontifex" feeling =)
    hehe...yeah I saw that, I was pulling things about and they started to fall apart .
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  12. #12
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by jonask
    Well, that is one of the advantages of my model vs Sodaplay's.
    In mine you can choose whether or not you want to follow the simpler sodaplay model or if you would like the links to snapp under stress, thus allowing for a "Bridge Builder/Pontifex" feeling =)

    Did you try this???

    http://www.sodaplay.com/constructor/index.htm

    Lift it up and let it fall to the ground...then see...it doesn't break...just bounces a bit..

  13. #13

    Thread Starter
    Member jonask's Avatar
    Join Date
    Apr 2004
    Location
    Sandefjord, Norway
    Posts
    38
    yeah, yeah they do. Because the stress is to lagre due to the impact and stuff, and so they snap =) But if you look under settings, you'll se you can turn that off.
    I shouldve mentiond this before I guess
    --
    Jonas

  14. #14
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    For solid lines you would need to do a line/line collision detection between the solid line and the line that starts at the vertex in one frame and ends in same vertex in the next. The vertex would then have to bounce off at an "intermediate frame" which is not displayed, I guess thats how they do collisions in pool games.

    Torque is radial force.. or is that tangential, dunno but I guess it must be stronger the further away you are from the vertex, so the radius must be in the equation
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  15. #15
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  16. #16

    Thread Starter
    Member jonask's Avatar
    Join Date
    Apr 2004
    Location
    Sandefjord, Norway
    Posts
    38
    Thanks for the link =) I guess I'll dig up my old notes from physics class, load up that page and get crackin. Maybe I can get it to work, but i doubt it
    stay tuned
    --
    Jonas

  17. #17
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860
    BUG: Place a single point, and attach many many bars to it. Don't have them move or anything (do this while simulate is off)

    Put about 20 bars attached to the one point. Click simluate or start or whatever it was.

    Watch the big spiky thing go nuts and explode.
    Don't pay attention to this signature, it's contradictory.

  18. #18

    Thread Starter
    Member jonask's Avatar
    Join Date
    Apr 2004
    Location
    Sandefjord, Norway
    Posts
    38
    Haha, yeah, so it does.

    I know why, approximation problems :/ no easy fix I can think of as for now, but I'll keep you posted =)

    Thanks for letting me know!
    --
    Jonas

  19. #19
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860
    Also:
    Build a starshape, with have two adjacent points being fixed (do this in simulation mode) (don't build the shape extremely large... medium to small sized)
    Make sure every point is hooked to every other point
    Set the stretch factor to max
    Take adjacent fixed point #2 and place it at the position of fixed point #1.
    The line between the two fixed will break, but the rest of the shape will begin rotating around them!
    I tested to make sure it was actually generating force by attaching certain shapes which would brush the wall (high friction, no bounce). The speed would go up to whatever value all the time.
    Don't pay attention to this signature, it's contradictory.

  20. #20

    Thread Starter
    Member jonask's Avatar
    Join Date
    Apr 2004
    Location
    Sandefjord, Norway
    Posts
    38
    I havn't tried it out, but i'm sure your right.
    There are several 'flaws' that in the physics modell, and they are all related to the quantitative nature of the cumputer calculations... I can think of ways to correct some of the artifacts, but the code would be too extensive, and i feel that it would ruin some of the beauty in the simulation E.i. if I were to add many if conditions, trying to control every one of these small misshaps it would contradict with the "one pure law" that I'm unsing.

    I don't know it that came out right, but who's gonna care?
    --
    Jonas

  21. #21
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860
    The rotating thing can make some weird effect... and the exploding point one is impossible to contain. I tried putting support against the walls.. but no luck.
    Don't pay attention to this signature, it's contradictory.

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