Jump to content
COMBATSIM Forum

Recommended Posts

15 minutes ago, mikew said:

I think we already know that Wine hasn't implemented the input method that you're using for the joystick.

Your programs usually work quite well in Linux, even with zero special configuration as I just double-click on the exe.

 

Wine is not really a viable Windows replacement though as I get some serious lockups (that require holding the power button down for 5 seconds) with some games. No doubt it's possible to find out why that happens for a particular game, but it would be a time consuming process.

This is somewhat irritating as I only normally reboot Linux every couple of months or so.

 

Indeed, such lockups shouldn’t normally happen. But I suppose if you stack enough complexity, programs become unpredictable. Much like us emerging from a veeeery complex wave function :)

 

That’s also the reason I implement the Raw Input error handling even though your Wine isn’t my target audience. If I have learnt one thing from my other projects, it’s that every error path will eventually be reached by someone somewhere, and a proper warning/error message can save days of remote diagnosis.

Link to post
Share on other sites
  • Replies 302
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

On 7/26/2020 at 12:07 AM, mikew said:

Wine 5.13 now, and we're back to where we were.

Joystick recognised by TFXplorer at startup, but inoperative in-game.

 

I’ve found a race condition with the multithreading in the new splash screen. The key mapping would sometimes be initialized before all joysticks were processed, therefore mapping the controls to the keyboard instead of the joysticks.

 

Here’s a new build with a fix; please give it a try: http://krishty.com/taw/tfxplorer/2020-07-27/TFXplorer.7z

 

It also comes with a *very* rough controller settings page.

 

Changes:

  • added new splash screen
  • added controller settings page
  • removed console window
    • all TFX shape notifications are redirected to the loading screen
  • removed many Visual C++ runtime dependencies
  • improved loading screen performance
  • improved colors on Windows XP and Windows 7 with Classic theme
  • GUI uses accent color more often
  • fixed Windows 7 crashes
  • fixed joystick mapping race condition
  • fixed USB HID names if manufacturer string is not provided
  • fixed initialization errors due to COM initialization with worker threads
  • fixed game stuttering when using up/down arrow keys
  • fixed crashes closing TFXplorer without a scenario loaded
  • fixed GUI not adapting accent color
  • fixed GUI not adjusting to DPI
  • fixed GUI button hover color
  • fixed focus rectangle on loading screen
  • fixed mouse activation not taking place properly on text labels
Link to post
Share on other sites

Oooh, a new build!

 

I've only tried it on Linux so far, but already see some significant changes.

First, I haven't experienced any start up crashes with Wine. Before, and particularly with the x64 version, I'd get the 'encountered a problem and must shut down' type message maybe half the time. I put this down to Wine, so didn't bother mentioning it.

The joystick is active now, so they really have been working in this area.

The axes are messed up though.

tfxp1.png.2466005411b7b5d452b27816c3f38743.png

On this stick, what you have as 'X' seems to be the pitch control,

'Y' is the throttle slider

'Z' is the twist control

'Z Rotation' is related to the hat and switches.

Moving the joystick from left to right (roll) doesn't register.

 

'Hat Switch' sometimes shows some numbers, but those can't be changed by manipulating the stick.

Link to post
Share on other sites

That is some fantastic news!

 

Wine’s behavior is interesting. It may still be an error on my end, rooted in how the USB HID standard treats data indices. We will see when my axis/button remapping dialog is finished :) 

 

Thanks again for testing! I hope we will get to interesting new features soon.

 

Link to post
Share on other sites

Some more Wine weirdness is the keyboard handling in that I have to select US keyboard layout in order to turn on the right engine. The left engine works OK for some reason.

On Windows, it works fine with my european layout.

I have no idea how the keyboard is handled though. For TAW, I guess we want to know when the 2 physical buttons to the right of 'P' are pressed for engine start. On a US keyboard, these correspond to '[' and ']'. In Wine, if I use ']' to try to start the right engine (in this case Alt-Gr-9) it doesn't work either. So, neither the 'physical' or 'symbol' systems work in a logical way.

Link to post
Share on other sites
25 minutes ago, mikew said:

Some more Wine weirdness is the keyboard handling in that I have to select US keyboard layout in order to turn on the right engine. The left engine works OK for some reason.

On Windows, it works fine with my european layout.

I have no idea how the keyboard is handled though. For TAW, I guess we want to know when the 2 physical buttons to the right of 'P' are pressed for engine start. On a US keyboard, these correspond to '[' and ']'. In Wine, if I use ']' to try to start the right engine (in this case Alt-Gr-9) it doesn't work either. So, neither the 'physical' or 'symbol' systems work in a logical way.

Very weird indeed.

What you call physical and symbol systems is actually called

  • scan codes – scan code 27 is always the key left of the return key; ] in US layout and + in my layout
  • virtual key codes – virtual key code 89 always corresponds to the key labelled Y, no matter the layout.

Like you suspected, TFXplorer uses scan codes almost exclusively because it would drive European users crazy having to find and press < and > for yawing.


I’ve just checked and both engine start keys are defined similarly – just differing in a +1 for the scan code actually:

Quote

toNextDiscrete->source.type                   = Type::rawKeyboard;
toNextDiscrete->source.asRawKeyboard.scanCode = IBM::ScanCode::leftBracket; // == 26
toNextDiscrete->source.asRawKeyboard.modeKey  = ModeKey::none;
toNextDiscrete->command                       = DiscreteGameCommand::player_toggleLeftEngine;
++toNextDiscrete;

 

toNextDiscrete->source.type                   = Type::rawKeyboard;
toNextDiscrete->source.asRawKeyboard.scanCode = IBM::ScanCode::rightBracket; // == 27
toNextDiscrete->source.asRawKeyboard.modeKey  = ModeKey::none;
toNextDiscrete->command                       = DiscreteGameCommand::player_toggleRightEngine;
++toNextDiscrete;

 

We should keep an eye on this. When I finally implement the control remapping page, you should be able to re-assign the command by pressing an arbitrary key. I’m very keen on finding out what it’ll show when you press that right angle bracket! :)

 

Edit: Again, thanks for testing with Wine. Although Wine may cause a few errors by itself, it still teaches me a lesson in striving for robustness and debuggability …

Link to post
Share on other sites

Thanks!

This isn't new behaviour by the way, just thought I'd mention it as I ran TFXplorer on LInux and Win10 within a few minutes of each other and was a bit curious to find out why it was different. 

Link to post
Share on other sites

Here’s a new build with an updated controllers settings screen: http://krishty.com/taw/tfxplorer/2020-08-02/TFXplorer.7z

 

Recording of how it should work:

2020-08-01%20controller%20settings.gif

 

Changelog:

  • now supporting TAB key for menu navigation
  • improved resizing performance
  • fixed some controls not displaying on small screens
  • fixed glitches scrolling Win32 dialogs
  • fixed vertical alignment of text labels
  • fixed flickering during resizing of menus
  • Controller settings page:
    • now scrollable
    • improved HID error messages
    • major performance improvements
    • now supporting 32 buttons instead of 12
    • now using arrows instead of axes for hat switches
    • now using larger text for button states
    • fixed invalid values on first visit
    • fixed memory leaks

I guess I’ll start with the mapping code soon, i.e. assigning arbitrary keys/axes/buttons to individual in-game functions.

Link to post
Share on other sites

Cool!

I've only tried it on Linux so far, so mine doesn't look like that.

It does show how chaotic it is on Wine, and there's even some crosstalk between channels. So, it's not just a case of swapping axes.

Link to post
Share on other sites
14 minutes ago, mikew said:

It does show how chaotic it is on Wine, and there's even some crosstalk between channels. So, it's not just a case of swapping axes.

 

Wow. Just something like gas and brake combining into one axis (pretty common for pedals I suppose)? Or actual unrelated axes moving together?

Link to post
Share on other sites

Some general problem related to data format between Wine and TFXplorer I think...or more likely between separate processes of Wine,

For instance, the throttle slider mainly registers as Y in your terminology but will change the value of Z slightly near the end of its travel. Even on Y, the values don't smoothly go from 0 to 1. It might start at 0 at one end, then give some indeterminate value where your indicator bar is jumping around as I move the slider before going back to zero at the middle of its travel. From the middle to the other end, Y goes from 0 to 1 in what looks like a 'normal' fashion.

 

Also, no movements of the mouse at detected at all in the area above the joystick info (I can't remember exactly what it says, and can't run it right now).

The mouse is working normally though.

 

None of this is a priority for me as it is enough that TFXplorer works with the keyboard on Linux.

Link to post
Share on other sites

:rant:

Thought I'd do a quick test on Windows, but instead of copying over the zip file, I stupidly let Windows connect to the internet to download it again.

Big mistake. Even though the connection is set to 'metered', within 5 minutes it was telling me that I needed to restart after updating something or other.

So, I thought I might as well let it do whatever it wants to do to get up to date...which took about 2 freaking hours.

After which I'm treated to an 'in your face' demo of the new Edge browser which really wants to be my default. :angry:

 

Anyway, TFXplorer works fine and that controller interface is looking very slick. :thumbsup:

Link to post
Share on other sites

  

51 minutes ago, mikew said:

:rant:

Thought I'd do a quick test on Windows, but instead of copying over the zip file, I stupidly let Windows connect to the internet to download it again.

Big mistake. Even though the connection is set to 'metered', within 5 minutes it was telling me that I needed to restart after updating something or other.

So, I thought I might as well let it do whatever it wants to do to get up to date...which took about 2 freaking hours.

After which I'm treated to an 'in your face' demo of the new Edge browser which really wants to be my default. :angry:

 

Anyway, TFXplorer works fine and that controller interface is looking very slick. :thumbsup:

 

I hear you. Took me weeks to disable all that nonsense, and just a few minutes ago I wrote a bug report to Visual Studio for spinning up every single hard disk drive in my computer to do a free-space analysis for a complicated rocket science operation known as “stop the debugger”.

 

Try saving this with .reg extension, then double-click to add to the registry. Stopped the forced updates for me, but I reserve the first Wednesday each month (the day after patch day) to trigger a manual install, so maybe it just stops them if you’re not too far behind:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]
"NoAutoUpdate"=dword:1
"AUOptions"=dword:2

; disable downloads from the local network
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config]
"DODownloadMode"=dword:0

 

Link to post
Share on other sites

Not much progress, just a few UI tweaks: http://krishty.com/taw/tfxplorer/2020-08-08/TFXplorer.7z

 

Changes:

  • more Windows 10 look (fewer margins, new background colors, nuances in text color, …)
  • error messages on controller settings page now support word wrapping
  • controller settings page now uses gray text for malfunctioning controllers
  • added version label to main page
  • fixed crash with no HIDs connected
  • fixed smooth scrolling depending on CPU speed
  • fixed scrolling speed system setting being ignored
  • fixed Windows 7 text glitches on splash screen
  • fixed memory leaks
Link to post
Share on other sites

Today’s version doesn’t bring any important changes: http://krishty.com/taw/tfxplorer/2020-08-16/TFXplorer.7z

  • vastly improved HID error messages
  • controller settings page can now be scrolled via keyboard
  • controller settings page preselects hardware tab on first visit
  • fixed crashes if HID without buttons were attached
  • major size optimization

That’s because I’m still busy with the control mapping, and it’s not yet far enough to show anything off.

 

The download has become quite a bit smaller. The reason is, I’ve replaced transcendental functions (sin, cos, log, exp) from the Visual C++ run-time library with those from musl libc.

 

I’ve had my own transcendental functions (which are better than the standard ones) for a long time. The F-22 flight control system, however, depend on the standard ones (and so does the computation of relative air density). The Visual C++ CRT happily provides those, but for no reason pulls in lots and lots of useless dependencies (thread-local storage and stuff). This annoyed me for years and only got worse with each Visual Studio update, so now I finally replaced the functions with their counterparts from musl libc (MIT license) and all binaries got about 20% smaller.

 

That’s 20% of garbage that I never wanted and never asked for, finally gone. Feels good.

 

However, if you notice some strange behavior with the F-22 flight controls or with temperature/humidity or other atmospheric attributes, please drop me a note.

Link to post
Share on other sites

I was always thinking about replacing my tire model because the tires submerge into the runway at high AoA …

 

But the new MS Flight Simulator does the same, so it’s probably good enough. (Can be clearly seen at 2:19 and even more so at 12:54)

 

At 6:00 you can see that the waves are realized via signed distance field. Pretty good idea, but they forgot to make them depend on direction.

Link to post
Share on other sites
9 hours ago, Krycztij said:

That’s 20% of garbage that I never wanted and never asked for, finally gone. Feels good.

But how are MS going to insert ads into transcendental functions if you've taken away all their hooks? :D

 

I had a run with the new version on Linux before going to work. Looks as good as ever! :thumbsup:

Control is another matter though. I'm not really seeing the benefit of the 'vastly improved HID error messages' as the joystick is deemed to be working normally.

 

FS2020 is looking gorgeous, but my eyes are always drawn to things which are out of place. The ground vehicle movements are absolutely farcical, so that's what I tend to look at.

Link to post
Share on other sites
1 hour ago, mikew said:

I'm not really seeing the benefit of the 'vastly improved HID error messages' as the joystick is deemed to be working normally.

Yep, that’s Wine telling TFXplorer that everything is just fine :D For stuff like hardware in exclusive use by other applications you will now get something actually useful like “Error: cannot open device path \\?\{pid=1234&vid=5678}\{sdfjdshf-fdjhsfkjs-sdfjhshf-sdfsdfsdf} (error 0x00000005)” instead of “This device doesn’t work. Try reconnecting it.”

 

1 hour ago, mikew said:

FS2020 is looking gorgeous, but my eyes are always drawn to things which are out of place. The ground vehicle movements are absolutely farcical, so that's what I tend to look at.

Yes. I couldn’t get my eyes off the intersection in the lower left at 13:35.

Since we want to make it better: I assume they handle roads as 2D graphs and project them onto the terrain to get a height coordinate. Since there is a bridge, the terrain is elevated at this point. So *all* roads will be projected onto the bridge, not just the one at the top.

Do you – by chance – know whether OpenStreetMap provides actual 3D coordinates (i.e. elevation) for roads and whether it’s accurate to at least 3 m so that we don’t fall for the same error?

Link to post
Share on other sites
24 minutes ago, Krycztij said:

Yes. I couldn’t get my eyes off the intersection in the lower left at 13:35.

:rofl:

 

25 minutes ago, Krycztij said:

Do you – by chance – know whether OpenStreetMap provides actual 3D coordinates (i.e. elevation) for roads and whether it’s accurate to at least 3 m so that we don’t fall for the same error?

I don't think you can just rely on height coordinates for traffic flow over bridges.

There are mechanisms like layering to help with this:

https://wiki.openstreetmap.org/wiki/Key:layer

Link to post
Share on other sites

I was wondering if it was possible to use the Openstreetmap ecosystem as a way of making the basis of a flightsim world, not necessarily the real one.

That's what these guys have done, but in a totally over the top way in terms of level of detail. :jawdrop:

https://opengeofiction.net/#map=3/22.11/85.25

 

Anyway, I couldn't resist getting FS2020, so I'll be enjoying more comedy ground movements soon. Well, not exactly soon, as there's another 91GB to go. :)

Link to post
Share on other sites

This is crazy!

 

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!

Link to post
Share on other sites

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

Link to post
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.


×
×
  • Create New...