Jump to content
COMBATSIM Forum

TFXplorer


Krycztij
 Share

Recommended Posts

  

23 minutes ago, mikew said:

It'll be a while until I get that far.

 

Going from startup to cockpit is like 5 minutes, so I don't think I'll be playing this much.

Also, it doesn't recognise my joystick.

 

I got it from Steam, and it downloads a 500MB installer first, When this is run, the play time clock starts ticking, so the download of the next 95GB is counted as playing.

This means that if the download takes over 2 hours then you go over the time that you can get your money back.

 

Plus, you need to sign in to the microsoft empire. I did it via Github, but it managed to connect it an xbox live account I have no recollection of ever creating.

 

Not that impressed to tell the truth...

 

I heard one must be thoroughly frustrated to create something really useful. Reading your comment, I guess I should start playing FS2020 as well, just to see what should be done better :)

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 334
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • 3 months later...

Just a funny thing I wanted to share:

 

My wife asked me to find an old game she used to play 20 years ago. She wanted to show it to our son. I found it: 

(It’s silly but fun, and the hype here was *huge* back then.)

 

So my son asked me why it is not possible to walk further into the scenery. I wanted to explain to him the difference between 2D sprite games and 3D games (he is only used to 3D games), and needed to extract the game files in order to do so.

 

I searched for an unpacker on the internet archive. I found one. And the readme says …

Quote

Mudge Archiver is (c) 2000 by Benjamin Haisch.

This program is FREEWARE, but it must only be distributed free of charge […]

Donations are welcome (I’m just a poor pupil …) write a mail if you want to donate.

 

WAIT I KNOW THAT NAME

image.png.73e5bb625b3051c469f672954d0261f5.png

 

————

Apart from that, I’m adding ways to customize keyboard/joystick controls (a major roadblock towards a public release) and it’s coming forward slowly but nice.

 

Link to comment
Share on other sites

Cool! So, he did that game's archiver in 2000, then TFX's RA decompresser in 2006. What next? I think we've found Satoshi Nakamoto. :)

 

That game looks typical of a bunch of Java games from that time that used the exact same game mechanic, but just varied the background and the things to shoot. That one looks like it is slightly more complex with multiple 2D layers giving some perspective.

 

Interesting to see what 'kids these days' make of old games. From what I've seen , they're (ages 8-10) not interested unless it's an 'action' game for phone or Nintendo Switch. Maybe it was always thus...

 

 

Link to comment
Share on other sites

  • 1 month later...
On 8/20/2020 at 1:04 AM, Krycztij said:

 

FS2020, very cool. Let me know if the real-time weather works. I suspect it’s not a feature but pure laziness: adjusting the atmosphere parameters by hand is annoying work and too scientific to be outsourced to the player, so just download datasets from the internet and call it a feature!

 

I’m impressed – FS2020 replaced their table-driven aerodynamics with an actual simulation:

 

I tried this with TFXplorer in 2014 and it was a nightmare. Might be easy (“easy”) with a Cessna, but for a fighter jet with its instability-by-design you better have a proper surface model *and* a working fly-by-wire system at the same time, or things go bad fast.

 

Of course MS will make it work with fighters and supersonic flight, and no doubt it will be awesome. Looking forward to it.

 

1778148505_2014-12-06aerodynamicsurfaces.png.7d4022697d2115382924693521bcc1bb.png

 

 

Link to comment
Share on other sites

  • 5 weeks later...

A general question about how computers work. This is related to the problem I get when I lose the last file when running my Python .dat extraction script which calls a dll containing the decompressor code for each file.

 

Earlier in thread I wrote this:

On 5/5/2020 at 2:15 PM, mikew said:

The reason I had trouble with that file is that it's the last to be decompressed. From my Python script, I call a DLL to decompress each file and return a result.

The DLL handles the file reading and writing, so once the last file is decompressed, the DLL returns OK and my script exits. Could it be that any ongoing file process is killed by Windows if the process ordering it isn't running anymore and I end up with a corrupt file?

To which I got this reply:

On 5/5/2020 at 2:40 PM, Krycztij said:

 

Depends on how it’s implemented and how the script exits. Windows’ file buffers are flushed in any case. User-mode file buffers (like buffered stdio in C/C++ programs) are flushed when the DLL is unloaded, due to it receiving a notification.

It would only be an explanation if the file handling used hand-written file buffering or if the process got terminated the hard way (i.e. via TerminateProcess()). Can’t tell given the information I have.

 

Now I'm running into a similar situation if I run this Python script:

import random
from datetime import datetime

time_start = datetime.now()

l = [random.randrange(100, 999) for i in range(100000000)]

squared = [x**2 for x in l]
sqrt = [x**0.5 for x in l]
mul = [x * y for x, y in zip(squared, sqrt)]
div = [x / y for x, y in zip(squared, sqrt)]
int_div = [x // y for x, y in zip(squared, sqrt)]

time_end = datetime.now()
print(f'TOTAL TIME = {(time_end - time_start).seconds} seconds')

 

..which just does a lot of calculations for benchmarking purposes, I would have thought that the last thing to happen would be the 'print' command, but 'something' continues running for some time afterwards and I finally get the command prompt back. I have no idea what though, and it's annoying me.

 

Link to comment
Share on other sites

Hmmn, looked at this in more detail and that isn't a particularly realistic test. The time between when the print line appears and when Python exits (according to 'top') seems to be taken up with giving back the vast amounts of memory/disk cache that script uses. So that doesn't explain my earlier problem with the last file in the decompression list.

 

The reason I did this was that Python was running the same scripts noticeably faster on the weakest Apple M1 machine than any of my normal PCs, so wanted to do a more substantial test but that one was a bit extreme.

Link to comment
Share on other sites

9 hours ago, mikew said:

The time between when the print line appears and when Python exits (according to 'top') seems to be taken up with giving back the vast amounts of memory/disk cache that script uses.

I hesitated to anwer because I could not see an issue with your code. The memory cleanup explains it pretty well.

Link to comment
Share on other sites

  • 2 months later...

(continuing from https://community.combatsim.com/topic/48771-tfxplorer-and-windows-10)

 

I pushed the latest commits with a few GUI fixes. Most importantly, the new layout engine is implemented, saving me lots of time in building the upcoming GUI pages for control bindings. Writing formulas by hand to place all texts and buttons dynamically was an incredibly tedious task; now I “just” need to define rules like “place these buttons and text labels left-to-right”. I’m still not satisfied with the result, but we’re getting somewhere …

Link to comment
Share on other sites

Sounds good! I'll try it out 'soon'. :thumbsup:

I fixed my problems in the other thread by adding a space if the last 3 characters in a line were 'par'. I appreciate that we will not be putting this stuff in the source code forever so haven't spent much time on it.

49 minutes ago, Krycztij said:

I “just” need to define rules like “place these buttons and text labels left-to-right”. I’m still not satisfied with the result, but we’re getting somewhere …

Incorporating the TFX2 and TFX3 GUI scripts would be good.

EDIT: or at least define your 'rules' in a way so we can convert from the TFX scripts.

Link to comment
Share on other sites

Currently introducing tiled layout into the settings GUI. The problem with the current layout is lots of wasted space on wide screens. See for example (and note that the Windows 10 Settings App has the same problem):

image.png.25bba9ffd2080d0fa3e11ec036389e3a.png

 

With the new layout type, controller settings are displayed left-to-right until the line is full, then the line breaks. This is a little more difficult to implement than I thought, because I need to take into account the different item heights and their margins, but it feels so much better now:

image.png.8266f0132aa06fc5fbabc642ac5352b7.png

 

That’s pretty important for the flight controls, where a few dozen settings are on one page and you’d be scrolling to death in a plain vertical layout. But I’ll show snapshots of those another time.

 

————

 

You can see customized names for devices, buttons, and axes in the above snapshots. These were broken for quite some time; a fix will be pushed soon. Just a detail, but handy during development.

 

————

 

On 5/14/2021 at 12:38 AM, mikew said:

Incorporating the TFX2 and TFX3 GUI scripts would be good.

EDIT: or at least define your 'rules' in a way so we can convert from the TFX scripts.

 

I guess that would be overkill. I’ve wasted too much time on the GUI already. Allowing for customized GUI would bring us closer to the original titles, but that time might be better spent in improving gameplay …

Link to comment
Share on other sites

Looks good, although I have no available hardware for it to find on this setup right now.

I assume it's your underlying Windows settings giving the dark mode? I don't see an option to change it in the program, but I'm not too good at finding things in GUIs. :)

 

Also, I really hope that your GIT repo is read-only.

Link to comment
Share on other sites

9 minutes ago, mikew said:

I assume it's your underlying Windows settings giving the dark mode? I don't see an option to change it in the program, but I'm not too good at finding things in GUIs. :)

Indeed, your Windows Dark Mode setting determines whether the GUI renders light or dark. The color variation is a result of me taking snapshots at different times of day. There will be a setting in the GUI to override this, but I haven’t added it yet due to lack of a combo box control :D

 

11 minutes ago, mikew said:

Also, I really hope that your GIT repo is read-only.

Yes it is, in the sense that no one but me can screw up anything ;)

Link to comment
Share on other sites

  • 2 weeks later...
On 5/17/2021 at 1:48 PM, mikew said:

Also, I really hope that your GIT repo is read-only.

If you intended to ask “what happens if somebody wants to contribute?”, then the answer is “send the modifications to krishty at krishty dot com”.

 

Slightly updated version is up. Please delete your checked-out repository and download it again. (Or back it up, delete it, then restore your backed-up files in the new repository.) This is because I cleaned up the repository’s history, and it turns out git doesn’t like this at all. Specifically, I

  • removed source files that were never used or had nothing to do with TFXplorer
  • converted source from ca. 2016 onwards to UTF-8 with Linux line endings, from the catastrophic mess of codepages and line endings that was there before
  • merged changes like “fixed typo”, “fixed another typo” into single commits
  • moved a few git settings back in time to make it easier to work with old versions.
Link to comment
Share on other sites

13 hours ago, Krycztij said:

If you intended to ask “what happens if somebody wants to contribute?”, then the answer is “send the modifications to krishty at krishty dot com”.

Just making sure my "contribution" isn't deleting your repo due to me pressing the wrong button in the git parts of the VS GUI. I've only ever used the command line 'git clone' to download someone's life's work from Github and maybe 'git pull' if I think there's something worth updating. A strictly one way process.

...but of course you're hosting this yourself and have control over read/write access.

 

Anyway, I've fired up my Win10 VM to make the changes you suggested and noticed that it now helpfully tells me what the weather is doing right in the task bar! Wow, I never need to waste time looking out of the window ever again. What an age of wonder we live in.

 

Link to comment
Share on other sites

My Windows 10 is so horribly broken since last month. My PC force-reboots every night to try and update the system (even though I disabled updates in the GUI, registry, group policies, and services). Then if fails with a cryptic error code and rolls back. All for nothing, except that Edge is force-installed every morning.

 

When I look up the error code, it means either “Edge cannot be installed” (why is Edge even in my security updates?), “Edge is not installed” (wrong), or “the invisible system-reserved hard disk partition created by Windows on first install has less than 500 MiB of free space” (the heck they want me to do about it?!). It’s a disaster.

 

My wife has to do with many Windows Server systems in her day job, and she says they are all better than the normal Windows 10, so I’ll give it a try: I’m doing my backups right now and after that, I will install Windows Server 2019. It has a 180-day evaluation period, and this can be prolonged six times or so. No Cortana, no Edge. I found out that you can even uninstall Defender!

 

Link to comment
Share on other sites

Rather than play Whack-a-mole, my philosophy has just been to let it update what it wants then turn off as many 'features' as possible and then only use Windows if I have to.

I also use a Win 10 Enterprise Laptop that doesn't belong to me where things seem under control, but I don't think I can even buy that as an individual.

 

All this is very tiresome and detracts from actually using the machines for things like TFXplorer. It's like I'm already in a bad mood after Win10 boots up. :(

Link to comment
Share on other sites

  • 3 weeks later...

Okay, a few words on APIs. May be useful as an overview of TFXplorer’s extension architecture.

 

TFXplorer is based heavily on extensions now (or plugins, or mods, whatever you call it). There is no built-in terrain or plane. The TAW/EF2000/TFX terrains are provided from an extension, and the F-22 is provided from an extension as well. I want to pursue the extensions mechanism because it is central to modern flight simulators like Microsoft’s or DCS.

 

So TFXplorer must offer extensions an API. Extensions must use that API to declare assets, to render their planes, etc.

 

The classic (and most simple) way to provide an API is via exported C functions. That’s what the C runtime does (fopen), or C++ (std::chrono::system_clock), or Linux (open), or Windows (CreateFile).

 

TFXplorer/3View did this when the extension system was originally introduced, and some outdated parts of its API are still provided in that manner.

 

This approach has a drawback, however, and that’s versioning/compatibility. Once a function is exported, we cannot change its interface without breaking dependent applications. That’s why Win32 provides weird names like CreateFile2 or GetVersionEx – in order to not break applications which use the old CreateFile and GetVersion.

 

Not breaking old extensions can be solved by supporting the old functions forever, but this leads to another problem: Users mixing versions of the API. You have no means of forcing users to use your new API over your old one, and they will likely mix them up (e.g. use the old ReadFile on a file opened with the new CreateFile2). To account for that, your implementation complexity no longer grows linear with the number of supported versions, but exponentially.

 

This can be solved by stepping away from global functions. Instead of offering the extension all supported functions, the extension has to ask for a specific version and will receive this specific API. This approach is known from Direct3D 9, where the only function that’s initially available is Direct3DCreate9 (similar for newer versions and for DXGI). You call it and pass the version number of the SDK you’re compiling with, and you receive an IDirect3D9 interface with the actual API matching that SDK version. The Vulkan API goes a similar way, only the version number is encoded in the structure type you pass to vkCreateInstance.

 

Internally, you can maintain the APIs isolated from one another. Extensions cannot mix up APIs except by bad intention (they’d have to initialize the API twice with different versions).

 

Problem solved. TFXplorer introduced this in 2020, though the transition is, again, incomplete. There’s another problem lurking, though.

 

TFXplorer extensions are based on callbacks. Extensions initially provide a table à “I provide plane ABC and if the user wants to fly one, call function XYZ to create it.” This makes sense as the GUI/simulation dictate what has to be done, and extensions are only asked how it should be done.

 

But TFXplorer provides a huge set of functions, and entropy dictates that extensions will eventually call them in any possible combination. There are, however, combinations that don’t make any sense – for example, an extension may start placing airplanes in the level when all we asked it for was loading its sound effects. Or it may start loading terrain data when all we asked it to do was drawing an airplane.

 

(The last example is real: When I added the moving map to the F-22 cockpit, I just threw the code for loading it right into the drawing function. This is bad for a number of reasons. But it seems that having rotten smelly code in your codebase is useful to identify problems in your API early :) )

 

The API needs separation of concerns. When an extension draws a plane, it should only use the draw functions. When an extension starts a scenario, it should only use the functions to place airplanes/tanks/buildings. So we shouldn’t let an extension access the entire API in the first place!

 

Here’s how it works now:

 

  1. Extensions provide a table à “I provide plane ABC and if the user wants to fly one, call function XYZ to create it.” The table starts with the version number of the SDK the extension was built with. (An inline function in the SDK header ensures this.)
     
  2. TFXplorer internally remembers the version number for the extension so it can return the proper API for the SDK it was compiled with. (Of course I currently maintain only one version internally and that won’t change until the first actual release in 2025 or so.)
     
  3. When TFXplorer actually calls into an extension for things like “I need plane ABC, please create it”, then it passes a minimal interface which only contains the functions an extension is allowed to call during that task. (This interface is versioned according to 1. and 2..)
     
  4. The interfaces for individual tasks are mutually exclusive. Consistency is checked whenever an API function is called.
     

This has a nice side-effect for multi-threading: The interfaces being passed to extensions need not all use the same implementation. Instead of letting extensions tinker with simulation state directly, we can now easily create job objects, call extensions in parallel, pass them individual job objects to do their stuff, and synchronize the results afterwards instead of doing it all over the place. It also has nice implications on testing.

 

This transition has just started and is not yet in the new repository, but it does work well for me so far. It uncovered a load of code smell from 2012–2014 that’s being fixed.

 

Apart from that, the repo contains a slightly extended Settings page.

Link to comment
Share on other sites

Sounds impressive, although it's a bit like when my accountant tries to explain the tax system but all I really want to know is what numbers to put in what boxes of the tax return. :)

 

The 3view dll was cool in that I could manipulate a single .3 object via exported C functions. I've been wondering what I need to do to be able to render a tile, then be able to manipulate some objects on it. Like having some cars drive down a road or planes taxiing around an airbase in order to explore how to define object behaviour.

 

Obviously, I want to use TFXplorer modules for this, but I guess we're not there yet?

 

Using something like the Castle Game Engine, https://castle-engine.io/, which has really good VRML support, so I can assemble last years poorly converted models into a single scene like this:

Selection_012.png.5d58941c77ad7422683363be901018ec.png

...but I need to learn Object Pascal in order to do much with it. It's far less scary than C++ though. 

Link to comment
Share on other sites

1 hour ago, mikew said:

Obviously, I want to use TFXplorer modules for this, but I guess we're not there yet?

 

Using something like the Castle Game Engine, https://castle-engine.io/, which has really good VRML support

 

Not, not there yet. The way civilian planes are spread out over the world is predestined for these things, but it’s not available in the API yet.

 

Castle Game Engine ftw! I actually used many of its VRML sample files to get my VRML support right!

Link to comment
Share on other sites

  • 4 weeks later...

FWIW, I committed a huge API change to the repository, which had me working on it for weeks. However, the sound/graphics API requires a final big change before I can move on to other things (mostly GUI/input again to the get TFXplorer to a usable state).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


×
×
  • Create New...