=3 Can’t wait for
Great for some reason morning when I tried to use the “Launch unreal engine” button from the epic games launcher it forced and uninstall of 4.7.2 and install of 4.7.3, anyone know if the plugin works under 4.7.3 since I’ve now got 5 gigs to download? Gonna suck to have to download and compile 4.7.2 from , takes forever to download and over an hour to compile even on my 6 core 4ghz cpu.
I’m on 4.7.3 and the plugin works just the same, relax
Great work you guys, all deserve a medal! I took a break from my project to have some fun with , suffice to say I’m looking forward to TK-Masters boat update!
TK your the man, it was just odd. I hit launch and bam, my engine folder is like 40mb and I cant open any project becauseof that obviously. I’m still waiting for it to installl. It stopped downloading about 25 minutes ago and hjas been stuck on 90% since… bah!
That boat looks sick man!
^^ Seconded. I opened your profile to make sure you didint have any WIP threads cause thaats a 2-3-4-5 hundred dollar model if its got textures. Talk about competition.
Hah! I don’t think you have much to worry about there, I’m not giving up my day job any time soon. The ship and script are going to be used in a little fun project, a la Codename Eagle!
You gotta be careful what you say on the internet I think you just gave me an idea for a title finally.
Edit: Hey I had a thought when I was testing something out.
If you bind a key to display your center of mass say (OnKeyX() { PrintString(GetCOM()) } or have it print it every second or so using a timeline or a delay tick and use on a boat floating on the waves. The boats center of mass is offset depending on where the waves move it right? makes sense on the surface due to the rocking but I was super confused that my COM was going down in the Z as my sub made a dive underwater and then I realized… cause the center of mass is now reading lower for whatever reason.
Any ideas on why happens? My mesh? The plugin? In Unity (sorry) printing out the COM will be 0,0,0 no matter where it moves in the world, or a different reading if you offset it.
Did some more research: If I move the to 0,0,0 and my boat to 0,0,0 I get a COM of 0,0,0 BUT since my root joint is +4500 in the X I get a COM reading of 0,0,0 but a transform.Location of 4500,0,0. Should I post a video of ? Its extremely weird why its happening and makes no sense as to why it should/is happening, TK//HK any comments?
The value changes are throwing my debugging off of anything with a buoyancy component.
When I think center of mass going to -xxxx in physics terms it makes it more “stable” against rolling because the weight of the object is physically lower than it visually is. For example in unity if I have a boat thats rolling way more than it should I just add in a simple statment rigidBody.centerOfMass = new Vector3(0,0,-10); to set the center of mass 10 meters below the origin of the rigidbody (the mesh).
And yes, I tested with a two differnt ways 1) just a with physics dropping from the sky into the the COM readout stays at 0,0,0. Add a buoyancy component with one test point at 0,0,0 the COM changes to reflect its translation from the world origin.
Its like as soon as you add the buoyancy component the COM changes to the world location of the root joint.
Edit2: We were able to get a nice boat sinking effect by having just certain test points slowly increase in density on a registred hit event, its not the most elegent solution, but it sure looks **** cool. I’ll wait for avo to post a video or when we swap work next I’ll take a video. Unfortunatly we are behind schedule now so.
Edit3: Well I made a giantic (some 100+ 5m tall 100m long cubes of alternating colors) depth guage to see how good the buoyancy system works underwater. After a 5 minute+, 2000 ft crash dive (way past crush depth, the depth at which the water pressure is greater than the steel can handle and the boat implodes) and it looking pretty horizontal to me right as its about to hit bottom. Albeit, its only with 4 test points as a tester, but puts more confidence in the system as a whole. The whole weird COM values from before still make no sense to me, but at least now I know I can trust my values, rather than my eyes/debug values (which is scary, not being able to trust debug values). When I get my new engine component built I’m going to build a bubble indicator (the bubble is what they use on a submarine to see how level the boat is, after a dive the divnig officer will say “level the bubble out at 500 feet” or something) that reads the pitch of the boat so that I can be 100% sure at all times since that shouldnt change with a buoyancy component added… I hope.
Edit: Since I’m the last person posted still, lets not let thread stagnate like the unity one has guys (I looked last night, no updates in 2 months and no real post in weeks or more). have you talked to V.A. about joining forces? I was looking through some of old older code he definitly knows what hes doing.
watch?v=GJRwz-MQirs
TK is why we need your point density override for every test point. Its beautiful for stuff like and pulls off a very realistic sinking. I tried with Handkors, and it would not work as smoothly as yours.
Looks good glad it works smoothly.
@
Not sure if I understood what you mean with the CoM position but sounds like you are thinking that it has to do with the pivot point, which it doesn’t… the CoM depends on the collision mesh and it’s calculated by physx so it has nothing to do with the pivot point.
The CoM offset is also an offset from the physx CoM (again not to be confused as an offset from the pivot point).
Little status update on the ships:
So I have figured out a way to use complex collision (per poly) on the ships (for pawn collisions etc.) while at the same time use a secondary simple collision for ship-to-ship and ship-to-world physics collision.
The limitation here of course is that when using complex collision you can only have a one-way physics interaction… meaning that you cannot have objects apply any kind of forces to it (hence why the buoyancy forces don’t work) but the complex collision mesh is able to push the physics objects around.
Which is fine in case since a pawn or a small rigid body wouldn’t be able to apply any relevant amount of force to a large ship anyway.
Currently I’m working on networking the whole thing… I have done some decent progress, I can have 2 or more players ride the same ship over LAN and seems to be synchronized just fine (although it’s still questionable if it will work the same with actual network latency, I might need some testers to help me with that at some point) but I have a few other non-network related problems
I posted a question about one of the issues yesterday but I haven’t gotten any reply yet… if you can help with or bump the thread that would be great!
https://.unrealengine.com/showthread.php?65709-CharacterMovement-seems-to-always-quot-Ignore-Base-Rotation-quot-%28-%29
Basically I can’t find an easy way to have a player inherit the rotation of the ship he is standing on without doing some manual setRotation (which then in turn messes up the movement… etc.)
Hopefully I won’t have to rewrite the movement component just to fix :rolleyes:
And since I can’t keep myself from posting pictures (:p)… here’s a WIP screen of the ship example with complex collision that I’m working on.
http://www.mediafire.com/convkey/8bfd/0fi3cmzheaaw5kezg.jpg?size_id=5
(Click for larger size)
Ooh I saw something directly related to that TK I think I even bookmarked it. I’ll see if I can find it in my 200+ bookmark “UE4” folder. Think it was something that I came across when I was looking into the best way to create a bridge (the part of the submarine lookouts stand on when surfaced on the top of the sail (superstructure) a player can walk on and inherit the boats rotation at all times since we are technically not possessing our ships as a “character”, we will be controlling both at once most of the time. I’ll see if I can remember the thread/answerhub link I had tomorrow morning.
In regards the CoM deal basically if I take a BP that prints its COM no mater where I place it it will always be at 0,0,0. In the air falling down. Static anwhere in the level. Underwater. Anywhere and the CoM = 0,0,0.
The second I add the buoyancy component it tells me the CoM is exactly the distance from its pivot point (0,0,0 in its local space) to the world origin (0,0,0 in world space) so it tells me the CoM has gone to -3000,1500,750 if I place the on the water 3000 units +x, -1500 Y and -750 Z. Strange is all. It hasnt caused any bugs yet, it just seems strange and I couldnt see anything in the code that would make that happen once the buoyancyComponent is added.
Another thing I was wondering. I was thinking of ways to use the GetWaveHeightValue function that is exposed to blueprints as a simpler depth checker among fancier ideas like faking bow waves and wakes and kelvin wake waves. What exactly does node return?
I assumed it to be the height of the mesh directly above whatever is referencing oceanmanger (so whereever the root component lies) on the frame its called but when I add it into my eventTick() loop with its target being OceanManager which its target is Buoyancy component then I set its location vector input as my meshes GetWorldLocation then I print its return vector in its individual X,Y & Z using a macro. When I dive my ship, or floating on the surface it reads 0,0,0. Could that be because I’ve got it to dead calm seas right now and thus no waveheight, or is node just not useful in its current state?
Heres how I was using it (link cause its 1080p res) http://i.imgur.com/rlf2WDX.png
so how is your wave direction handled in the manager - is it c++ , through the plugin or through the blueprints, reason im asking is because i might fix up your wave direction, so that it can move into the center of the mesh to simulate wave directions when standing on a island or pushing out if someone is using as a lake. also going to figure out how to simulate on how the mesh will determine the center points of multiple islands. because i noticed its looks good on one side, but the wave direction continues through the other side making it unrealistic
Look at the code with notepad++ or visual studio. I just happened to have open still from examining GetWaveHeight… its not terribly hard to figure out if you know how to program in any language, its the Unreal API that confuses me a little.
AOceanManager::AOceanManager(const class FObjectInitializer& PCIP)
: Super(PCIP) {
MeshCenter = FVector(0, 0, 0);
WaveDirection = FVector(0, 1, 0);
WaveSpeed = 1.0f;
GlobalWaveSettings = FWaveParameter();
WaveSet1 = FWaveSetParameters();
//WaveSet2 = FWaveSetParameters();
PrimaryActorTick.bCanEverTick = true;
EnableGerstnerWaves = true;
}
FVector AOceanManager::GetWaveHeightValue(FVector location) {
//FVector sum = FVector(0, 0, 0);
// Flat buoyancy optimization
if (!EnableGerstnerWaves)
return FVector(location.X, location.Y, RootComponent->GetComponentLocation().Z);
float time = GetWorld()->GetTimeSeconds() + NetWorkTimeOffset;
return CalculateGerstnerWaveSet(GlobalWaveSettings, WaveSet1, FVector2D(WaveDirection.X, WaveDirection.Y), location, time * WaveSpeed);
}
FVector AOceanManager::CalculateGerstnerWaveSet(FWaveParameter global, FWaveSetParameters ws, FVector2D direction, FVector position, float time) {
FVector sum = FVector(0, 0, 0);
// Calculate the Gerstner Waves
sum += CalculateGertnerWave(global.Rotation + ws.Wave01.Rotation, global.Length * ws.Wave01.Length,
global.Amplitude * ws.Wave01.Amplitude, global.Steepness * ws.Wave01.Steepness, direction, position, time);
sum += CalculateGertnerWave(global.Rotation + ws.Wave02.Rotation, global.Length * ws.Wave02.Length,
global.Amplitude * ws.Wave02.Amplitude, global.Steepness * ws.Wave02.Steepness, direction, position, time);
sum += CalculateGertnerWave(global.Rotation + ws.Wave03.Rotation, global.Length * ws.Wave03.Length,
global.Amplitude * ws.Wave03.Amplitude, global.Steepness * ws.Wave03.Steepness, direction, position, time);
sum += CalculateGertnerWave(global.Rotation + ws.Wave04.Rotation, global.Length * ws.Wave04.Length,
global.Amplitude * ws.Wave04.Amplitude, global.Steepness * ws.Wave04.Steepness, direction, position, time);
sum += CalculateGertnerWave(global.Rotation + ws.Wave05.Rotation, global.Length * ws.Wave05.Length,
global.Amplitude * ws.Wave05.Amplitude, global.Steepness * ws.Wave05.Steepness, direction, position, time);
sum += CalculateGertnerWave(global.Rotation + ws.Wave06.Rotation, global.Length * ws.Wave06.Length,
global.Amplitude * ws.Wave06.Amplitude, global.Steepness * ws.Wave06.Steepness, direction, position, time);
sum += CalculateGertnerWave(global.Rotation + ws.Wave07.Rotation, global.Length * ws.Wave07.Length,
global.Amplitude * ws.Wave07.Amplitude, global.Steepness * ws.Wave07.Steepness, direction, position, time);
sum += CalculateGertnerWave(global.Rotation + ws.Wave08.Rotation, global.Length * ws.Wave08.Length,
global.Amplitude * ws.Wave08.Amplitude, global.Steepness * ws.Wave08.Steepness, direction, position, time);
return sum / 8;
}
FVector AOceanManager::CalculateGertnerWave(float rotation, float waveLength, float amplitude, float steepness, FVector2D direction, FVector position, float time) {
float frequency = (2 * PI) / waveLength;
FVector dir = FVector(direction.X, direction.Y, 0);
dir = dir.RotateAngleAxis(rotation * 360, FVector(0, 0, 1));
float wavePhase = frequency * FVector::DotProduct(dir, position) + time;
float c = FMath::Cos(wavePhase);
float s = FMath::Sin(wavePhase);
float QA = steepness * amplitude;
// Leaving as a FVector to possibly extend it's usefulness to the BuoyancyMovementComponent (dir.X/.Y)
return FVector(QA * dir.X * c, QA * dir.Y * c, MeshCenter.Z + amplitude * s);
}
Its all handled c++ through the manager. You can adjust some values via public properties from the details tab but none of these are UFUNCTION(BlueprintCallable). look at the header and .cpp file for the oceanmanager.
ah ok cool, ill have a look at it tonight, tho im still learning C++ but i know blueprints, might get a friend to help with
Yeah its not easy just doable I might have overstated it. I know how to program basic C++ and have a background in C# but the unreal API the whole USTRUCT and UPROPERTY and FVector and stuff is confusing until you know exactly what it does (which I dont) plus as far I know you have to write the code, compile it, then you find out that missed a single semi-colon or a closing curly bracket and have to find the error, re-compile and then hope you got it right. Every. Single. Time. You want to make a change.
Hey sorry for double posting, (2 days bump isnt that bad) anyways something I noticed. It might be our pivot point is offcenter a hair, it might happen to any floating object that isnt perfectly mirrored down an axis, or it might be the code but with our current setup your boat will roll or flip over eventually if you dont have your test points tweaked perfectly. You may think thats not happening to me well I made a check of the pitch and roll of our boats on the surface and our subs, it didnt mater surface boats and submersibles both had happen:
You may think 4 test points in an equal square around your floating actor say (400,1000,0) (400,-1000,0) (-400,1000,0) (-400,-1000,0) would lead to a perfectly stable boat in perfectly flat seas. Again may just be inaccuracies due to float not being accurate enough, the physics engine, our meshes, maya, blender, UE the code it could be anything but a perfect rectangle/square 4 point test point setup will SLOWLY roll and pitch (and maybe yaw but I havnt checked it out since that wont matter to us) one way or the other constantly, although very slowly. At stock with a setup like above my boat was rolling about 1 degree every 30 minutes and pitching about 1 degree every 45 minutes. So it would take hours to see it visually and is on a flat calm plane, of course its gonna roll and pitch in moving seas.
Anyways, by offseting the left and front side test points using the divide by 2 method (inital value is 1000 you try 1500 and its too much so you try 1250 and its now going the other way so you try 1375 and so on and so forth until you reach the floats accuracy I was able to get it to be perfectly stable in flat seas. With about 30 minutes of tweaking 3 test points I was able to get the pitch down to 0.001 degrees every 5-10 minutes or so and the roll about 0.001 degrees every 3-5 minutes or so.
If anyone else has happen and it will affect their game, let me know I can make a quick video showing why its happening. (PS I havn’t tried the stay upright constraight yet to see if that helps too, gotta see exactly what it does first).
really would only be an if you intend to have something floating for hours or like us have a time compression system so that hours and days go by in minutes of game time and I would GUESS (no evidence to back it up) that something mirrored perfeclty in all axis’ like a or sphere wouldnt run into.
Edit: Under more investigaiton its the mesh. Make sure your root joint is placed well or any submersibles will pitch/yaw/roll on their own
I replaced the mesh as the parent, with a block of roughly so same volume and made the sub a child of that and just turned the block invisible. Now its working fine and does not throw it out of wack… Its the mesh for some reason throwing it off.
Hey guys so I have a question regarding the time of day settings for the day night cycle. The default Hour - is it a 12 hour clock or 24 hour? It seems if I punch in 12 I get noon and if I punch in 1 I get 1am. If its a 12 hour time, how do you specify am or pm?
HOW? Please, looks incredible.