Making a boat work.
by Stacy Allcock · in Torque 3D Professional · 03/17/2010 (6:58 am) · 32 replies
Hi
Can anyone help?
I am trying to get a boat to work.
I have my boat on a waterblock. But the water goes through the boat and I cant do anything with it.
I bought TGE a few years ago with the aim to make a game, I bought the 3 books recommended. But never actually got round to doing much with the engine due to work commitments. I now have come back to the idea of making a game, but things have changed, so have now bought T3D Pro. But I am totally stuck. Please can someone give me some pointers.
Kind regards
Stacy
Can anyone help?
I am trying to get a boat to work.
I have my boat on a waterblock. But the water goes through the boat and I cant do anything with it.
I bought TGE a few years ago with the aim to make a game, I bought the 3 books recommended. But never actually got round to doing much with the engine due to work commitments. I now have come back to the idea of making a game, but things have changed, so have now bought T3D Pro. But I am totally stuck. Please can someone give me some pointers.
Kind regards
Stacy
About the author
#22
i also noticed that if i open the editor i cannot tilt the boat fwd or roll it around its longitudinal axis... but if i add a mesh into the scene i can tilt and rotate it to my hearts content...
interesting...
2 hours later... moving right along... i've gotten a flyingVehicle based submarine manuvering around... seems to be the better solution for a submarine see that movement in all axises seem available...
--Mike
04/06/2010 (7:28 pm)
yes... yes i am... but i'm also looking at alternatives (hover vehicle)... and i'm looking for docs on physix to see how i can instantiate a physix object, and if it'll allow me to rotate along all axis...i also noticed that if i open the editor i cannot tilt the boat fwd or roll it around its longitudinal axis... but if i add a mesh into the scene i can tilt and rotate it to my hearts content...
interesting...
2 hours later... moving right along... i've gotten a flyingVehicle based submarine manuvering around... seems to be the better solution for a submarine see that movement in all axises seem available...
--Mike
#23
i settled on a wheeled vehicle based sub... but it took me hours to discover that i need to increase the default viscosity of the water to around 188 in order to get the thing to float to the surface realistically without either heading off into space, or plunging to the depths uncontrollably if dropped into the pond...
tommorrow i'm gonna try tweaking the logic and adding pitch and roll to the mix...
who knows... i may be able to actually start coding a game sometime in the distant future :)
the docs are really bad... poorly organized... finding what you need are really gonna be hard... but hey, what else is new...
if you're new to this your in deep kimshi... i suggest the old Finney book...
also... i just discovered the day/night object in the editor... way coooool... thx GG guys...
--Mike
04/08/2010 (5:26 pm)
ok... more swearing... i mean some serious swearing this time... then it starting working...i settled on a wheeled vehicle based sub... but it took me hours to discover that i need to increase the default viscosity of the water to around 188 in order to get the thing to float to the surface realistically without either heading off into space, or plunging to the depths uncontrollably if dropped into the pond...
tommorrow i'm gonna try tweaking the logic and adding pitch and roll to the mix...
who knows... i may be able to actually start coding a game sometime in the distant future :)
the docs are really bad... poorly organized... finding what you need are really gonna be hard... but hey, what else is new...
if you're new to this your in deep kimshi... i suggest the old Finney book...
also... i just discovered the day/night object in the editor... way coooool... thx GG guys...
--Mike
#24
04/08/2010 (6:00 pm)
Hmmm, I am wondering if that will resolve my boat for T3D... The issue I had was that the boat would only float for a few seconds before tumbling over and into the depths like you describe.
#25
if pitching and rolling aren't a requirement... that should work fine...
since i'll be needing the capability to pitch the submarine downward during diving, and upward during ascent, i needed to experiment with something else... i tried flying vehicle and wheeled vehicle, and am pretty much settled in on basing it on the wheeled vehicle 'class', despite my first dissapointing attempts at using it ( the thing dropped straight to the bottom... and depending on the density, either shot off towards deep space or floated slowly back to the surface, then dove right back to the bottom...
increasing the viscosity of the water seemed to dampen out all the exhuberant behaviors... it's floating fine now and turning as expected around the z...
today begins 'diving trials' as i experiment with logic to pitch and roll the craft...
lifejackets on everyone :)
--Mike
04/09/2010 (2:10 am)
the item based boat (talked about above) seemed to be working fine... the only issue i had with it was that it only allowed rotation about the z axis, and i couldn't get it to pitch or roll...if pitching and rolling aren't a requirement... that should work fine...
since i'll be needing the capability to pitch the submarine downward during diving, and upward during ascent, i needed to experiment with something else... i tried flying vehicle and wheeled vehicle, and am pretty much settled in on basing it on the wheeled vehicle 'class', despite my first dissapointing attempts at using it ( the thing dropped straight to the bottom... and depending on the density, either shot off towards deep space or floated slowly back to the surface, then dove right back to the bottom...
increasing the viscosity of the water seemed to dampen out all the exhuberant behaviors... it's floating fine now and turning as expected around the z...
today begins 'diving trials' as i experiment with logic to pitch and roll the craft...
lifejackets on everyone :)
--Mike
#26
04/09/2010 (3:20 am)
Good luck with the 'diving trials' Mike, let us know how it goes.
#27
after a few more days of confusion i deleted all my code and started in a new direction...
the old algorithms came verrrrry close... i could dive and surface and move in a realsitic manner... but if i tried to turn to the left or to the right while at any sort of deck angle, either in a dive or surfacing, the ship immediately departed for parts of the Torque world unknown to man or beast...
i was in over my head... and all that matrix math, which i knew precious lil about, was proving to be my downfall...
so... i decided to take a step back... take another look at what i wanted to do... (it was this point where i started wondering if i would've been better off licensing the pro version, so i could do all this in c)...
this is when i discovered the wonderfull MatrixCreateFromEuler() function...
how could i have missed this one...
now i could throw away all the matrix mumbo jumbo, and use something i was at least remotely familiar with (i'm also co developing in 3Impact based 3DRAD, and it uses eulers almost exclusively)... there was a glimmer of light ahead...
it only took me the better part of a day to get the whole thing working... as it should be... i just keep a set of 3 global variables which represent one of the 3 euler rotations, and manipulate them outside of the confusing matrix world, then create the matrix and apply it when i'm done rotating the thing around...
it seems to be working... more on this later... gotta get some sleep... but this looks like it's gonna work...
--Mike
04/12/2010 (3:10 pm)
well... finally, the diving tests are a success...after a few more days of confusion i deleted all my code and started in a new direction...
the old algorithms came verrrrry close... i could dive and surface and move in a realsitic manner... but if i tried to turn to the left or to the right while at any sort of deck angle, either in a dive or surfacing, the ship immediately departed for parts of the Torque world unknown to man or beast...
i was in over my head... and all that matrix math, which i knew precious lil about, was proving to be my downfall...
so... i decided to take a step back... take another look at what i wanted to do... (it was this point where i started wondering if i would've been better off licensing the pro version, so i could do all this in c)...
this is when i discovered the wonderfull MatrixCreateFromEuler() function...
how could i have missed this one...
now i could throw away all the matrix mumbo jumbo, and use something i was at least remotely familiar with (i'm also co developing in 3Impact based 3DRAD, and it uses eulers almost exclusively)... there was a glimmer of light ahead...
it only took me the better part of a day to get the whole thing working... as it should be... i just keep a set of 3 global variables which represent one of the 3 euler rotations, and manipulate them outside of the confusing matrix world, then create the matrix and apply it when i'm done rotating the thing around...
it seems to be working... more on this later... gotta get some sleep... but this looks like it's gonna work...
--Mike
#28
making progress... boat code seems solid... working on adding some of my modern subs and actually getting this thing underway and past the proof of concept stage... looks like the binary version will be able to handle the requirements... so far...
gotta test the planned interior and moving around inside the sub ( i had some old code that working... think it was based on an animated node... gotta ind it)... also gotta get back into adding stuff like partcles (for a bow wave) and some way to add a decent looking wake...
meantime... here's a shot of a US Sturgeon class attack sub surfaced...

--Mike
04/28/2010 (2:11 pm)
after a short break (had a legal submission that needed my fullest attention) i've been able to get back to the game development...making progress... boat code seems solid... working on adding some of my modern subs and actually getting this thing underway and past the proof of concept stage... looks like the binary version will be able to handle the requirements... so far...
gotta test the planned interior and moving around inside the sub ( i had some old code that working... think it was based on an animated node... gotta ind it)... also gotta get back into adding stuff like partcles (for a bow wave) and some way to add a decent looking wake...
meantime... here's a shot of a US Sturgeon class attack sub surfaced...

--Mike
#29
Lately I have been working on getting some animated HUD components going - but for that I had to touch the engine code. Made some switches, hand wheels, and various gauges...
04/28/2010 (4:08 pm)
Nice work Mike. I haven’t had a chance to touch my sub movement code (still jerky and based around the AI Player) - but reading your post I had a go at dropping in the Torque buggy. Turning up the water viscosity to around 1000 makes it look pretty good! (unlike the wild bouncing I got when I tried a while ago) - will have to get this working on my sub, and good to know it can be done in script.Lately I have been working on getting some animated HUD components going - but for that I had to touch the engine code. Made some switches, hand wheels, and various gauges...
#30
www.globalsecurity.org/military/systems/index.html
04/28/2010 (4:10 pm)
@Mike, this might be of interest to you. I came across it the other day and almost had an accident. Look under US Warship and then Subs... Thi has every US military vehicle in use. Some have blueprints and tons of source pics. Might be of help in your interior builds. www.globalsecurity.org/military/systems/index.html
#31
I remember discussing this on the irc channel when I was thinking about making some dungeon below a castle in the middle of a lake and had the same waterline type problem.
04/28/2010 (5:59 pm)
Regarding the original question about water going through the boat, for the interior of the boat below the waterline would it be possible to designate a zone where the water doesn't render and attach it to the boat somehow?I remember discussing this on the irc channel when I was thinking about making some dungeon below a castle in the middle of a lake and had the same waterline type problem.
#32
@Sean... Thanks for the info... looking at the site now...
@Justin... i'm looking at this as well... in an app called Virtual Sailor they solved this using a transparent texture to mask the water... not sure exactly if this approach will work in Torque though...
good luck guys with your projects...
--Mike
04/29/2010 (3:17 am)
@Martin... i'm at the point where i'm going to have to make a decision on whether or not to have 3D instruments "inside" the sub, or have them represented as a 2D gui... @Sean... Thanks for the info... looking at the site now...
@Justin... i'm looking at this as well... in an app called Virtual Sailor they solved this using a transparent texture to mask the water... not sure exactly if this approach will work in Torque though...
good luck guys with your projects...
--Mike
Torque 3D Owner Martin Masek