Source Code Update

Eggheads talking about bytes and stuff.
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Source Code Update

Post by Krishty »

The repository has been force-pushed to a new version. git pull --rebase is required.
  • fixed rendering of bullets
     
  • fixed F-22 gear not retracting
    Under some circumstances (very soft take-off or very hard take-off), the gear wouldn’t retract and the gear sound would keep playing. This error had plagued us for years.
     
  • reduced dependencies; cleaned up legacy functions
    As a side effect, we got rid of that annoying assertion upon starting TFXplorer in debug mode.
     
  • updated old commits to engine API
    Minor code fixes and corrections.
The new cannon API will land soon.
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: Source Code Update

Post by Krishty »

The repository has been force-pushed to a new version. git pull --rebase is required.
  • new API for starting/stopping simulation
    Previously, extensions had to declare vehicle structure (number of wheels, collision data, etc.) just-in-time when the vehicles started being simulated. This has now been moved to vehicle models – as tested recently with the engine API and the cannon API. It makes writing extensions easier because all resources are always available right away, and it opens opportunities to get rid of lots of ugly code in the core.
     
  • new API for shocks/vibration
    This moves the screen shaking from extensions to the core. It permits to shake the screen automatically while firing a cannon, according to recoil/firing rate, instead of having every extension re-implement it. The same applies for mechanisms like wheels, which are to come in the future.
    Notice that screen shaking may not be a great feature in itself, but it is closely related to force feedback.
     
  • various code fixes
    These were showing with Clang. The new build system can now build and run TFXplorer almost completely, but I haven’t pushed it yet due to minor issues. (Non-ASCII characters in the C++ code cause weird errors.)
     
  • updated old commits to framework
    Minor code fixes and corrections.
The new cannon API will probably come without the automatic sound system. The sound API blocks other improvements, and it needs a total rewrite. It really is my main trouble right now, but I’d rather attack more interesting things.
mikew
Data Genius
Posts: 558
Joined: 2022-Jan-09, 20:21

Re: Source Code Update

Post by mikew »

Cool! I generally delete the previous version and do a new git clone as I'm too lazy to find out how to 'stash' or 'discard' my changes to fix the rebase command not working.

While the contrails are lovely, I don't think they should disappear when the plane creating them is destroyed.
I know you're aware of this, but this is the most 'wrong' behaviour for me right now.
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: Source Code Update

Post by Krishty »

Excellent observation! There are two contrail systems: An old one for the civilian planes and a new, API-based one for the F-22. The new one already supports those features, but I still have to throw out the old one.

I’ll open a bug thread in here. It’s about time we get an overview over the bugs, because I’d like to release a new version.
mikew
Data Genius
Posts: 558
Joined: 2022-Jan-09, 20:21

Re: Source Code Update

Post by mikew »

Thanks! I guess I could just stop shooting down civilian planes instead. :D
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: Source Code Update

Post by Krishty »

The repository has been force-pushed to a new version. git pull --rebase is required.
  • fixed F-22 contrails
    I hope it works this time.
     
  • updated old commits
    Minor fixes to whitespace, warnings, etc.
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: Source Code Update

Post by Krishty »

The repository has been force-pushed to a new version. git pull --rebase is required.
  • added cannon API
    There should be no gameplay differences except for one: firing the cannon now shakes the screen.
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: Source Code Update

Post by Krishty »

The repository has been force-pushed to a new version. git pull --rebase is required.
  • F-22: disabled autopilot test
    Fixes this bug.
     
  • added screen API

    This introduces a new API for rendering screens (HUDs, MFDs) much like the engine API. There should be no changes in behavior; please report anything you notice!

    This has become one of the largest commits for a long time. I had to turn the whole way of rendering the scenario inside out and cut lots of dependencies on legacy stuff from earlier APIs. It fixes countless internal bugs, e.g. sound being computed twice (once for the FLIR display in the cockpit and once for your actual screen), various re-entrancy glitches, and bugs in fetching scenario maps.
     
  • separated rasterizer interface from implementation
  • removed legacy function for real-time MFDs
    Preparations for the above.
     
  • minor performance improvement
    Just letting the CPU’s branch prediction that critical errors are unlikely.
     
  • fixed warnings
    More Clang compatibility.
mikew
Data Genius
Posts: 558
Joined: 2022-Jan-09, 20:21

Re: Source Code Update

Post by mikew »

So far so good. :)

Today's picky comment is about the stars. They are overly visible during the daylight hours even at ground level and probably not visible enough at night.
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: Source Code Update

Post by Krishty »

Indeed, but it’s always been this way. This is rooted in TAW not being a HDR game and in its weird palette quirks. Rest assured that a future renderer will absolutely fix this :D
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: Source Code Update

Post by Krishty »

The repository has been force-pushed to a new version. git pull --rebase is required.

This update brings just a few minor API cleanups and bugfixes.

The most notable bugfix is SmartView no longer crashing (was introduced with the new screen API).

Terrains can now declare that they are compatible with Z buffering, which will open interesting opportunities in the future.
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: Source Code Update

Post by Krishty »

The repository has been force-pushed to a new version. git pull --rebase is required.

This update brings just a few minor API cleanups and bugfixes.
  • API: added brightness control to legacy draw functions
    This is a step towards HDR rendering – we can finally render brightness outside of the [0…1] range! There’s more to be done, though. A first step in fixing the star brightness bug.
     
  • API: temperature and humidity now controlled by scenario declaration
    This makes TFXplorer actually use the temperature/humidity that was provided with a specific level, instead of a desert-like curve that was hard-coded for the Red Sea theatre back then.
     
  • code: fixed bug in collision detection
    This was a nasty one and caused weird physics glitches, like planes exploding for no apparant reason.
     
  • API: fixed pointer/reference confusion in screen API
    Some drawing to MFDs worked just by accident. Back-ported to the screen API commit, hence the rebase.
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: Source Code Update

Post by Krishty »

The repository has been force-pushed to a new version. git pull --rebase is required.

This update brings just a few minor API cleanups and bugfixes.
  • fixed IRST flickering
  • now allowing objects up to 1024 m underground
    Fixes some issues that have been uncovered with Ace Combat levels as described here.
     
  • fixed memory corruption
  • fixed bullet reflection on impact
  • API: terrain collision detection now using floating-point normal vectors
    More bugfixes for Ace Combat levels; I have yet to write about them.
     
  • fixed memory leaks
    I ignored those for years due to various other issues, but now I’ll slowly attack them. The new API is a good opportunity to make wrong things right.
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: Source Code Update

Post by Krishty »

The repository has been force-pushed to a new version. git pull --rebase is required.

This update does not bring any new features; it just cleans up encoding and line endings in old commits.
mikew
Data Genius
Posts: 558
Joined: 2022-Jan-09, 20:21

Re: Source Code Update

Post by mikew »

The Norway scenarios cause a crash for me. I thought it was because I was using an extracted/modified data set, but I created a new directory with just EF2000's did.dat in it and adjusted the registry settings accordingly but get the same behaviour.
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: Source Code Update

Post by Krishty »

Indeed, there is a problem (and has been for some time).

Can you find the last version that fails? Just go back in git commits e.g. to 2020 or 2021 and see whether it persists?

Should be possible with magic spells like

git checkout 'master@{2021-01-01 00:00:00}'

Git also has a git bisect command for narrowing it down to a specific commit via binary search, but that’s rocket science software engineering :D
mikew
Data Genius
Posts: 558
Joined: 2022-Jan-09, 20:21

Re: Source Code Update

Post by mikew »

That's more effort than I have time and/or enthusiasm for especially when git is involved...

Yes, it's been like this for a while but this time I checked to see whether it was something I was doing.
I did try to run it from the command line to see if there was some error thrown, and instead of using quotes to handle the space in the filename, I just renamed it to TFXplorer_x64.exe.
This produces different behaviour when run, and I can at least enter the EF2000 world, but all I can see is sky.
EDIT: Just realized that I can't really do things like that in Windows and expect to get away with it.
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: Source Code Update

Post by Krishty »

mikew wrote: 2022-Dec-09, 11:27That's more effort than I have time and/or enthusiasm for especially when git is involved...

Yes, it's been like this for a while but this time I checked to see whether it was something I was doing.
No problem. I do have a problem in the current build that prohibits TAW and EF2000 running at the same time in the same scenario. Since TAW brings the only flyable plane (F-22), all EF2000 scenarios are effectively unplayable.

This is a deeper problem with the way extensions handle their dependencies, and I will eventually look into it.
mikew
Data Genius
Posts: 558
Joined: 2022-Jan-09, 20:21

Re: Source Code Update

Post by mikew »

OK!...and maybe I should have read the very first 'Open Bug' in the threads below... :roll:
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: Source Code Update

Post by Krishty »

I’m still updating the sound API, which is almost finished, but I’ll have to take a detour.

One of the most important tests for the new API is the tire screech sound upon touchdown. This has a variety of reasons – it’s spatially located; it’s tightly connected to the physics system; it sounds the same from inside and outside the plane; it should be heard from far away; etc.

My problem now is: TFXplorer does not have a model of when tires start screeching. There is a traction/slip model, but it assumes the tire has no mass (and thus always spins exactly as fast as the ground moves below it). In older versions, I worked around it by saying that all tires screech for a split second when they first touch ground, but this introduced crazy errors: Tires screeching when the plane spawns idle on the ground; the sound not stopping correctly when tires are retracted directly upon taking off, etc.

So, I’ll add a model of tire mass, RPM, and longitudinal slip. This will fix the tire screech sound, so that I can complete the sound API. And it will also be quite useful to add spinning tires in the future, perhaps with new cool graphics 🤷
Post Reply