I have the key to One Eyed Willy

Allegiance discussion not belonging in another forum.
Post Reply
Wasp
Posts: 1084
Joined: Sun Aug 17, 2003 7:00 am

Post by Wasp »

I believe it's a time step problem which is way beyond my scope of understanding. I've read up a little about it and see that it is an obstacle for every game coder to overcome with their projects. Unfortunately, the guys who attempted that Dx9 effort, didn't get it working.

My workaround here is simply having the joystick do an update where it is already designed to do an update if you are zooming. That update appears to be after, or less affected by, the input delay problem so that your controller inputs occur closer to the rendering.

The additional steps I've been experimenting with, are to disable features that make time consuming calls with the belief that I am reducing the time between controller input and rendering. I know this is working for the better which might explain why BT's Dx7 version was even less laggy.

Conclusion, the less of that Dx9 code in your game, the better.
Papsmear wrote:QUOTE (Papsmear @ Feb 25 2017, 09:46 AM) If you can actually fix the problem I'm sure some of us would be happy to download it and use it.
I know I would. With that in mind, please continue with what you are doing if you want. I would love to be able to aim better with either a mouse or joystick.
Presenting a very small slice of code that gives a workaround solution is something that FAO can review and easily see whether there is any negative impact however, when stripping out code or making large changes, those changes have to be well documented and thoroughly reviewed by someone who has a deep understanding of the game code.

There is no way FAO is gonna allow this controller update tweak, much less any large changes.
Last edited by Wasp on Sat Feb 25, 2017 6:39 pm, edited 1 time in total.
Wasp
Posts: 1084
Joined: Sun Aug 17, 2003 7:00 am

Post by Wasp »





Would this affect more than just inputs?...I'm hinting at network issues perhaps, because we now see ships stuttering (not just good ole warping) & shots not registering.

Since BT's version was using a Dx7 engine, shouldn't that have negated the timing issue that Dx9 suffers? I should note that BT's version used Dx7 however, it did not remove all of the Dx9 code but instead, co-existed in the same .exe


Is the Dx9 version fixable?
Wasp
Posts: 1084
Joined: Sun Aug 17, 2003 7:00 am

Post by Wasp »

It's me again...

I've been experimenting with borderless window mode and it appears to be working.

It won't work if you fly a mouse but seems to do the trick for joysticks. I'll try to catch someone online to drive a bomber while I turret and then I can confirm. It actually makes some sense too. If you want your joystick to behave, don't let R7 control it! :ninja:

I had a lot of trouble with others but this one seems to work

It's easy to use once you know what you're doing. A head scratcher at first. I had to tweak my Nvidia settings to get rid of some stutter. I'll post all the steps if it really fixes the problem.
Wasp
Posts: 1084
Joined: Sun Aug 17, 2003 7:00 am

Post by Wasp »

...continued...


The software I linked to above turned out to be problematic. On the plus side, I've found the workaround using two other software tweaks however, I've only got it working in 800 x 600 resolution so far. Another plus is that it is now working for mice as well as joysticks...

I hope to have this working in higher resolutions by this weekend.

Stay tuned...
Papsmear
Posts: 4810
Joined: Sun Jul 06, 2003 7:00 am
Location: Toronto, Canada

Post by Papsmear »

Keep up the good work!
Image
Image
Wasp
Posts: 1084
Joined: Sun Aug 17, 2003 7:00 am

Post by Wasp »

This is so frustrating...

R5+ versions, when run in windowed mode, reset the window into the upper left portion of the monitor when the game changes from the main screen to flight mode and back. Even switching to the loadout screen does this so it breaks the "window in full screen mode".

I can make it work however, it forces me to toggle (via mapped key) to switch back to full screen.

I found another software that will do this automatically however, it loses it's ability to function properly after a few minutes which I think is related to the graphics driver changing from 3d to 2d modes. Frustrating as hell but I'm getting closer every day.
Wasp
Posts: 1084
Joined: Sun Aug 17, 2003 7:00 am

Post by Wasp »

It appears to be working now. Changing screens such as going into loadout or when launching a ship, causes an instant window change from full screen to window back to full screen again. This is because the R5+ versions cause a windowed game to go from a changed position on your screen back to the upper left corner when changing from certain screens such as when going from main menu to loadout or from loadout to launch... :o

Because the launch animation takes a second (or two), there is enough time for the switch back to full screen before you are in cockpit view again. It's just a nuisance imo but well worth the trade of having a JS working again.

Took forever to find the combination of software to make this work "properly". I'll bet I've launched allegiance more than 100 times to get this workaround. For all of the Alleg testing I've done over the years, I'll bet I've launched more than Babel has! :iluv:

Using this workaround means that you have to launch in windowed mode so you mice users can't use it. I'll test it this Sunday, or sooner if I can, in a turret. If it works as I think it will, I'll post the fix.
Wasp
Posts: 1084
Joined: Sun Aug 17, 2003 7:00 am

Post by Wasp »

Nope, didn't work.

It did eliminate a lot of input lag however, it still did not provide the precision that an input device should have. It is as if the different axis' are experiencing a variable rate that can't be compensated for by adjusting frame rates or window sizes. I'm assuming that the addition of the mouse speed feature allowed users to somewhat compensate for this bug. Unfortunately, it didn't quite fix it for mice users either as the input / rendering issue is still noticeable no matter how you adjust it.

I think Imago has a better handle on this problem than I ever could. I can test it and tell if it's working or not, but I've got no clue whatsoever on how to correct it using the bastardized version that is in place.

Going back to test the Pre-Doofus version I can tell that there is very little input lag with vsync on and even forced to off via the GPU drivers as compared to the Post-Doofus commit. Turn on vsync and move your controller and you'll see that it is like someone added 3ms to every frame rendered.

I'm guessing that the only way to fix Allegiance is to go back to the point where Dx9 was introduced and bypass that mess entirely bringing the game forward with the other features leaving this problem where it belongs...in the crapper. :ninja:
BackTrak
Posts: 2079
Joined: Thu Mar 08, 2007 4:52 am
Location: Chicago, IL
Contact:

Post by BackTrak »

Hi Wasp,

I'm super sorry, I lost track of this thread. This last year has been incredibly busy for me.

I'd like to try to sum up your findings:

1. You have located a build in the code base that does not exhibit the issue under Dx7.
2. Kage has a commit history in github that we can roll verisons forward with.
3. You have chopped out a some code from the current Dx9 version and improved the lag, but have not been able to completely remove it.

Option 1: I take your current slew code, and update the current R7 version with it.

Option 2: I take the build that you have identified that doesn't have the issue, and roll each changeset forward into it, excluding any Dx9 changes, leaving us with a Dx7 based Allegiance. We lose shader capibilty. Total number of Shaders used in the current version of Allegiance: 0. (Not a loss right now, but will prevent someone from using that later, should that mythical beast ever appear).


Are there any other options? Rolling forward a few hundred changes that span 8 years of Allegiance development is not appealing, but I am willing to do that. At this juncture, there is some risk with that. It is possible that I spend weeks doing this, and we end up with a great playing game that won't run for more than five minutes due to all of the bugs I inadvertently add. I would like to focus on Steam integration, but I understand that this issue may take priority.

The fact that you have located the start build makes me optimistic that this issue can be fixed with Option 2 above.
ImageImage
Wasp
Posts: 1084
Joined: Sun Aug 17, 2003 7:00 am

Post by Wasp »

BackTrak wrote:QUOTE (BackTrak @ Jul 30 2017, 10:58 AM) ...Option 2: I take the build that you have identified that doesn't have the issue, and roll each changeset forward into it, excluding any Dx9 changes, leaving us with a Dx7 based Allegiance. We lose shader capibilty. Total number of Shaders used in the current version of Allegiance: 0. (Not a loss right now, but will prevent someone from using that later, should that mythical beast ever appear).


Are there any other options? Rolling forward a few hundred changes that span 8 years of Allegiance development is not appealing, but I am willing to do that. At this juncture, there is some risk with that. It is possible that I spend weeks doing this, and we end up with a great playing game that won't run for more than five minutes due to all of the bugs I inadvertently add. I would like to focus on Steam integration, but I understand that this issue may take priority.

The fact that you have located the start build makes me optimistic that this issue can be fixed with Option 2 above.
BT, you are a savior

The slew code allowed me to hard code ship turn rates (eliminating the fetching of that data) and also allowed me to update the inputs at that point in the code (wintrek.cpp) even if the ship's turn rate wasn't being slewed. This, forced update of the joystick, eliminated some of the input lag indicating that this problem is timing related. I went further on and started ripping out all sorts of code thinking that it might just be that there is too much in the loop. While I was able to get better response from the inputs, it was still completely out of whack.

I've tried delay timers and hundreds of variations of forced frame rates with monitor frequency changes and custom monitor sizes,...you name it, I've tried it, but nothing works. It's like flying with rubber bands instead of cables managing your control surfaces (airplane talk).

Anyhoo, I took this to Imago who revealed that immediate mode was not available in Dx9 and was likely the cause of this. I did a little research and boy did that make a lot of sense (even to me). That explained why, no matter how stripped down and filled with hard coded values, I could not get the Dx9's inputs to be correct.

Back when Dx9 was being released to the community, the server hosted both the Dx9 and Dx7 versions of the game. This allowed for testing and what not. I tried the Dx9 version back then but it was just as it is now, frustrating as hell to fly, so I continued to use the Dx7 version (as many others did).

Dx9 and Dx7 clients could be built from the same Project up until there was a merge where the Dx7 client was removed from the project. I was able to get contrib 205 to build both the Dx9 version (AllegianceR.exe) and the non dx9 version (Allegiance.exe). FAZR5Contrib@249 8c327b6c-a73e-8745-8738-111f1e176ae1 is where the Merge happend and the Dx7 build was removed from the Project.

If you can crank out builds, I can test the livin' $hit out of them in real time, on multiple platforms, so you won't have to. I already know of a couple issues with the Dx7 compatibility, but they are minor...also the slew formula that is currently in place, is flawed. efimage.cpp has a sensitivity factor that needs changed and a cursor position change (which is why your cursor isn't middle screen when you toggle mouse control on/off)....

I can assist with porting as well but it would have to be minor stuff and would need reviewed.

Thanks again, you made my day/week/year!
Post Reply