Click to See Complete Forum and Search --> : VB: Construction Game [Source]
jonask
May 22nd, 2004, 08:44 PM
It's not a game really, but I think it's fun to play around with so
here it is anyways :p
You can get it, as allways, under Visual Basic on my homepage:
jonask.com (http://jonask.com/?lang=en)
the name of the file is
stress_and_structure_simulation.zip
Or Clicking Here (http://jonask.com/vb/stress_and_structure_simulation.zip)
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.
kedaman
May 22nd, 2004, 09:07 PM
loads of fun :afrog: 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?
Fox
May 22nd, 2004, 09:16 PM
www.sodaplay.com isn't it ;) However, well done
cyborg
May 23rd, 2004, 05:37 AM
Really nice!
jonask
May 24th, 2004, 10:25 AM
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
NoteMe
May 24th, 2004, 10:36 AM
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..:eek:..:D
Electroman
May 24th, 2004, 10:47 AM
I liked it too but I maximised the window then put it back to restored and it crashed :D
jonask
May 24th, 2004, 10:52 AM
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 :p fixed it too now, thanks =)
NoteMe
May 24th, 2004, 10:54 AM
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?
jonask
May 24th, 2004, 11:05 AM
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 =)
Electroman
May 24th, 2004, 11:09 AM
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 :D.
NoteMe
May 24th, 2004, 11:20 AM
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..
jonask
May 24th, 2004, 11:48 AM
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 :p
kedaman
May 24th, 2004, 02:08 PM
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
kedaman
May 24th, 2004, 02:13 PM
Here's a nice tutorial btw:
http://www.physics.uoguelph.ca/tutorials/torque/Q.torque.html
jonask
May 24th, 2004, 10:27 PM
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 :p
stay tuned
alkatran
Sep 8th, 2004, 10:10 PM
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.
jonask
Sep 10th, 2004, 07:40 AM
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!
alkatran
Sep 10th, 2004, 08:12 AM
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.
jonask
Sep 16th, 2004, 12:31 PM
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 :p 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? :)
alkatran
Sep 16th, 2004, 02:51 PM
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.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.