Page 3 of 3
Re: Unreal Engine 4 & Battlezone
Posted: Tue Dec 24, 2013 7:29 pm
by Shadow Knight
TheJamsh wrote:Every Tick, the code gets the object location, and does a line trace between it and anything ### units below it. I then add ### units to the impact point of the trace and set the location of the craft to that vector. Although this works, it's incredibly uh... glitchy looking. And doesn't appear smooth like BZ. Anybody know how BZ applies altitude to it's crafts?
In order to make it smooth you'll have to slerp between the current position of the craft and the desired position, which is what you're currently just setting your position to. That won't be enough though, because you won't get the bounce that BZ2 has.
As Nielk1 said
here, you're going to essentially need spring physics. The formula isn't particularly difficult to implement, but you'll spend a while tweaking the values to get it to feel right.
Re: Unreal Engine 4 & Battlezone
Posted: Wed Dec 25, 2013 10:57 am
by TheJamsh
My biggest issue right now is creating the 'springy' impulse physics. I'm thinking that what I need to do is compare the crafts Pitch and Roll rotation to 0.0, 0.0, 0.0 every frame, and then continuously force it to rotate back to zero in all directions.
The equivalent ODF entry I suppose would be 'alphaTrack', but it looks like 'AlphaDamp' also plays a part in this. Could anyone point GSH to this thread? I'm sure he'd be able to shed some light on this area if he's willing to do so.
Oh yeh, happy holidays

Re: Unreal Engine 4 & Battlezone
Posted: Thu Dec 26, 2013 12:43 am
by TheJamsh
Re: Unreal Engine 4 & Battlezone
Posted: Thu Dec 26, 2013 5:57 am
by Nielk1
You badly need damping.
Re: Unreal Engine 4 & Battlezone
Posted: Thu Dec 26, 2013 11:20 am
by TheJamsh
Pretty much yeah, the spring itself is working which is great, but getting the damping settings or getting it to actually work right is just... interesting. Not fully sure when BZ applies it's damping
Re: Unreal Engine 4 & Battlezone
Posted: Thu Dec 26, 2013 11:17 pm
by TheJamsh
Update 3! This bit took some real fudging around... I've put the more stable altitude physics/lift spring on the original craft, and have also introduced power-based thrust, so the power of the thrusters for each direction determines the acceleration to the maximum self-powered velocity. This is both mouse-and-controller enabled. So on a keyboard your thrust power and top speed is always maximum, but on a controller you can vary it. So we currently have Forward/Aft movement and strafing, and altogether.
You can also get a quick upward boost by hitting the 'E' key, which I forgot to demo in this video. I did however make the spotlights on the front toggle-able with the 'L' key, which I did demonstrate
So, here's all the currently exposed variables to tweak the physics:
VelocForward
< Maximum Possible Self-Powered Forward Velocity.
VelocReverse
< Maximum Possible Self-Powered Reverse Velocity.
AccelThrust
< Forward Thruster Power.
AccelBrake
< Reverse Thruster Power.
AccelDrag
< How fast it stops once hands are off the controls, (all inputs are 0).
StrafeSpeed
< Maximum Strafing Velocity.
StrafeThrust
< Strafe Thruster Power.
AccelJump
< Additional lift-Spring power applied when 'E' key is pressed.
CraftAltitude
< Hover-Altitude of the craft.
Lift Spring
< Power of the altitude 'spring'. Think of this as spring stiffness.
Lift Damp
< Damping Factor (Friction) of the lift spring.
http://www.youtube.com/watch?v=cdhDASEehaE
In the video I've added a few functions to keep the craft facing the same direction for now. Though, I think I have a better understanding of Spring Physics now, which I guess is what BZ2 simulates for its hover altitudes... thanks to this:
http://www.myphysicslab.com/spring1.html
Re: Unreal Engine 4 & Battlezone
Posted: Sat Dec 28, 2013 8:47 pm
by NostalgicRCB
I tried the UDK for awhile and it made me crazy. You need small dedicated team of 5 to 15 people in order to keep your sanity. I tried Unity briefly but the lack of source control left me looking elsewhere. Both the UDK are Unity have a fair bit of overhead which was a big let down. Even some of the best indie projects using either have some glaring performance issues. Slender is one game that comes to mind, a newer incarnation using Eduke both looks and plays better. Not bad for a updated ancient engine.
Slender Woods:
www.moddb.com/engines/eduke32
Re: Unreal Engine 4 & Battlezone
Posted: Sun Dec 29, 2013 3:22 pm
by TheJamsh
UDK isn't without it's share of grief I admit, but I'm not using UDK

Unreal 4 Isn't public yet, and the new tools are vastly improved.
Re: Unreal Engine 4 & Battlezone
Posted: Mon Dec 30, 2013 3:42 am
by NostalgicRCB
I considered Torque for awhile because of my love for the older Tribes games. However after digging through one of larger Torque books all I can say is WHAT A MESS! So are you using a Beta of the newer Unreal engine? I'm confused.
I had the use the UDK in school and while I can see its appeal I doubt I will ever go back to it.