Unreal Engine 4 & Battlezone

Moderators: GSH, VSMIT, Commando

Shadow Knight
Thunderbolt
Posts: 158
Joined: Sat Feb 19, 2011 6:39 am

Re: Unreal Engine 4 & Battlezone

Post 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.
User avatar
TheJamsh
Bull Dog
Posts: 689
Joined: Sat Feb 19, 2011 5:49 pm

Re: Unreal Engine 4 & Battlezone

Post 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 :)
Developer @ Stormtide
viewtopic.php?f=4&t=2350#p40547 << My UE4 Battlezone Project

ModDB - Battlezone II Unofficial Expansion Pack
User avatar
TheJamsh
Bull Dog
Posts: 689
Joined: Sat Feb 19, 2011 5:49 pm

Re: Unreal Engine 4 & Battlezone

Post by TheJamsh »

Developer @ Stormtide
viewtopic.php?f=4&t=2350#p40547 << My UE4 Battlezone Project

ModDB - Battlezone II Unofficial Expansion Pack
User avatar
Nielk1
Flying Mauler
Posts: 2991
Joined: Fri Feb 18, 2011 10:35 pm
Contact:

Re: Unreal Engine 4 & Battlezone

Post by Nielk1 »

You badly need damping.
User avatar
TheJamsh
Bull Dog
Posts: 689
Joined: Sat Feb 19, 2011 5:49 pm

Re: Unreal Engine 4 & Battlezone

Post 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
Developer @ Stormtide
viewtopic.php?f=4&t=2350#p40547 << My UE4 Battlezone Project

ModDB - Battlezone II Unofficial Expansion Pack
User avatar
TheJamsh
Bull Dog
Posts: 689
Joined: Sat Feb 19, 2011 5:49 pm

Re: Unreal Engine 4 & Battlezone

Post 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
Developer @ Stormtide
viewtopic.php?f=4&t=2350#p40547 << My UE4 Battlezone Project

ModDB - Battlezone II Unofficial Expansion Pack
NostalgicRCB
Drunken Constructor
Posts: 34
Joined: Sat Dec 21, 2013 3:47 pm

Re: Unreal Engine 4 & Battlezone

Post 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
User avatar
TheJamsh
Bull Dog
Posts: 689
Joined: Sat Feb 19, 2011 5:49 pm

Re: Unreal Engine 4 & Battlezone

Post 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.
Developer @ Stormtide
viewtopic.php?f=4&t=2350#p40547 << My UE4 Battlezone Project

ModDB - Battlezone II Unofficial Expansion Pack
NostalgicRCB
Drunken Constructor
Posts: 34
Joined: Sat Dec 21, 2013 3:47 pm

Re: Unreal Engine 4 & Battlezone

Post 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.
Post Reply