Librelancer 2022.02
-
So I thought I’d have a go at rendering some of the HUD
Collision models are working, and the ship can move around and bump into things. There’s also a ton of background improvements, including a DX9 backend for old systems (which is terribly slow), and native support for MSAA, which once there’s a proper GUI can be exposed in the graphics options. I’m getting rather out of my depth in the area of physics and such though, so any help with that would be appreciated.
Furthermore, I haven’t figured out how to do the sun lens flare or almost anything related to the AI. If someone has documentation based on that, you’d be my new favs.
Gameplay demo should be out once the HUD is functional and the defender engine fx is working properly.
-
Worked a little more on the ALE engine. Progress is slow, but it’s progress none-the-less!
https://www.youtube.com/watch?v=eYWUgz-t1vQ
EDIT: how do you guys get the embed to work?
https://www.youtube.com/watch?v=eYWUgz-t1vQ -
New build in the OP!
-
Is there any way to rotate camera in the system view? I just see controls to move around.
And unfortunately when clicking on Gameplay Demo, the music of Liberty starts, but the game is stuck in a loop. No errors, only “no sur found” warnings.Edit: When moving around in LI01 the game also gets stuck when approaching Fort Bush or getting Manhatten in my view.
-
So… here is Thn! Or at least a buggy implementation of it. (As usual, click image to make it bigger).
This is yet to be committed due to how buggy it is, but this has allowed me to go through and remove practically all the bugs in my lighting implementation!There’s still bugs with IllumDetailMapMaterial, and FxRectAppearance in the Ale, but progress is progress.
-
The project now has a website - http://callumdev.github.io/Librelancer/ !
I’ll be posting screenshots and releases here from now on, as maintaining two different forum threads is a bit silly.Releases will be named in YYYY.MM format
The website is fully editable at - https://github.com/CallumDev/Librelancer/tree/gh-pages , so if you feel like adding information to the tutorials section, please do!
-
Version 2017.03 released. This is the first under the new release format.
-
Quite a few systems at the moment crash due to the Alchemy engine crapping out. I think you can get to Br02 though.
Will put remembering FL install location on the todo list.
-
Attempting to load the discovery mod: http://imgur.com/a/Dw4ez
Tons of crashes due to missing zones + CRC errors, but the stuff that loads is pretty. I even managed to crash radeonsi though I’m not sure how yet
-
Preview of some features coming up:
https://www.youtube.com/watch?v=gdF5Tf_b3do
- Atmosphere rendering
- Speed properly matching up with FL physics
- HUD things
- Multiple resolutions
(also any information on how FL physics works would be greatly appreciated)
-
Well, the physics in Freelancer are a lot like flying an airplane rather than a ship in space.
That means that every force has a counter force and that’s why you stop if you turn off your engine (not engine kill!).
So the standard physic equations for speed, distance and acceleration, etc. apply to FL.I’ve added some info regarding engines and thrusters to the wiki, so head over if you got any questions. I’ll write something on ship handling in the next weeks.
-
Thrusters! https://www.youtube.com/watch?v=qBlxLtTxXgo
- Ships now go at speed using values from INI
- Thruster drain is correct
- Turning is still incorrect (so much math)
- Still got camera and selection work to do
-
-
-
https://www.youtube.com/watch?v=1RRxP4oQZZI
Glitchy New London THN aesthetic. (Click here, youtube embed still not working?)
-
Version 2017.10 is now released! (Check the first post for link)
-
Starship flight physics in Freelancer is pretty much Newtonian (barring rounding errors and of course the fact that masses don’t attract each other as they would in reality). The reason you stop when you throttle down is linear drag (compare to Stokes’ friction) and hardly a good model for atmospheric flight, really.
Anyway, when you kill your engine, the engine’s drag is not taken into account any longer, and so the only thing (literally) “dragging” you down anymore is your ship’s linear drag which tends to be rather small by comparison (in vanilla it’s 599 on the engine and 1 on the ship, if memory serves).
So if x( t ) is your location at time t, m your total mass, b( t ) your raw thrust force (be it from engine, or thruster, or indeed any other accelerating influence, like explosions can be, or the sum of any of the above) as a function of time t, v0 your velocity at t = 0, and d your linear drag (be it from engine, or ship, or the sum of both), then your velocity v( t ) as a function of time t is given as
v( t ) = v0 + ( b( t ) * t - d * x( t ) ) / m ,
<=> dx(t) / dt + d / m * x( t ) = v0 + b( t ) / m * t .
This is an inhomogenous linear first order differential equation with constant coefficients. An implementation of this sort of mechanics of course doesn’t require understanding the theory behind forms like these. Suffice it to say that our b is bounded (there is, after all, a maximum thrust for any accelerator in the game, and only a finite amount of them can be effective at once because computers have finite memory) and if we keep it constant at any value, then in the long run our speed approaches the familiar old thrust/drag ratio c = b / d as I will demonstrate now, along with what I mean by “the long run” and how it is a matter of the ratio j = d / m of drag and mass:
Assuming that your thrust b is constant, and that we start at the location x0 = 0, the exact analytic solution x( t ) to our motion equation is
x( t ) = c * t + ( c - v0 ) * ( exp( -j * t ) - 1 ) / j .Already we see j both scaling how far x deviates from a linear expression, as well as how quickly that linear expression is reapproached. x is also shifted by something proportional to the difference of thrust/drag and starting velocity. Let’s see how velocity behaves:
v( t ) = dx(t) / dt = c - ( c - v0 ) * exp( -j * t ) .
We could see it before, but now it’s a lot more obvious: At t = 0 our velocity is exactly v0. As t gets very big, the latter term vanishes almost completely, effectively only leaving behind The promised thrust/drag. We also see that j scales how quickly the latter term vanishes even more clearly now. We can now choose a speed w between v0 and c but not equal to c, and find out how long it takes for our ship’s speed to pass by it as it keeps approaching
t( w ) = ( log( c - v0 ) - log( c - w ) ) / j ,where ‘log’ denotes the natural logarithm.Now, of course, there are rounding errors due to the discretion of values inherent in digital computing systems. Not even space in vanilla Freelancer is truly continuous which is why we see our ship jitter ever more as we move further away from the system’s center. The formalism I presented is an idealized, mathematical, analytical model, and as we measure the actual motion we are bound to find slight errors and imprecisions, but this is, as far as I know, how Freelancer’s physics are at least supposed to behave.