Outerra forum

Outerra Engine => Technology => Topic started by: foobie42 on October 09, 2013, 03:59:16 pm

Title: NaturalFail TrackIR 4/5 support in Outerra!
Post by: foobie42 on October 09, 2013, 03:59:16 pm
Here's the support for our favorite greedy anti-competitive, no-good corporation's flagship product.

Basically, you can now use Outerra with TrackIR 4 and 5 (with clip, hat, or whatever)!

Follow the link to download the binary-only file. No rights reserved. No warranty expressed or implied. Please DO indemnify Outerra/Anterworld at all costs, or don't view, store, download, transmit, copy or use in any other way.

http://ts3.cosaofficial.pl/opentrack/misc/outerra-tir-plugin-20131028.7z (http://ts3.cosaofficial.pl/opentrack/misc/outerra-tir-plugin-20131028.7z)

-foob.
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: foobie42 on October 09, 2013, 04:06:18 pm
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: DivineSense on October 28, 2013, 09:58:53 am
thanx a bunch foobie, I will try this as soon as i get home from the usability-grind :)
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: DivineSense on October 28, 2013, 04:35:29 pm
Darnit, I'm just getting crashes.
Outerra loads up like it should, shows the scenery for one second and then crashes.
TrackiIR4, Trackir5 software running. dll in plugins directory.

Can you give me any instructions on installing, if i should run other software and so on besides copying the dll?
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: cameni on October 28, 2013, 05:02:55 pm
It's been tested with an earlier version of OT and an earlier version of the plugin (the older plugin version is here (http://outerraworld.com/appdata/Anteworld/tir-trackir-plugin.dll), you may want to test it with that). I don't see where it's crashing - seems when calling the plugin.
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: foobie42 on October 28, 2013, 05:19:24 pm
Does the SDK need to be updated? Were there any ABI changes? Where can the SDK be found?
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: James on October 28, 2013, 05:33:47 pm
Does the SDK need to be updated? Were there any ABI changes? Where can the SDK be found?

There is no SDK yet.
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: cameni on October 28, 2013, 05:35:07 pm
Hmm, there might have been a change in the ABI, that wasn't included in the version hash check (the API gen is not yet final), so the plugin may need recompiling.
Here's the plugin API: http://outerraworld.com/appdata/Anteworld/ot-api.zip (http://outerraworld.com/appdata/Anteworld/ot-api.zip)
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: James on October 28, 2013, 05:40:09 pm
Hmm, there might have been a change in the ABI, that wasn't included in the version hash check (the API gen is not yet final), so the plugin may need recompiling.
Here's the plugin API: http://outerraworld.com/appdata/Anteworld/ot-api.zip (http://outerraworld.com/appdata/Anteworld/ot-api.zip)

Can that be used to customize Outerra?
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: cameni on October 28, 2013, 05:47:56 pm
It's an alpha SDK for IGC (image generator control, for using OT as a visualizer with a different simulator) and tracker plugins.
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: foobie42 on October 28, 2013, 06:06:26 pm
http://ananke.laggy.pk/outerra/outerra-tir-plugin-20131028.7z (http://ananke.laggy.pk/outerra/outerra-tir-plugin-20131028.7z)

Can someone verify it doesn't crash? Even without a FailIR, for now.

edit:

in init(), there's a dubious block, paraphrasing C syntax:

Code: [Select]
if _failed: return _failed
Is this as expected?
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: cameni on October 29, 2013, 02:31:02 am
Returning immediately if init failed once?
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: foobie42 on October 29, 2013, 02:32:57 am
Yeah, but returns true value.
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: foobie42 on October 29, 2013, 02:52:19 am
cameni, can you test the new plugin and see if the damn thing crashes?

I don't have non-VM windows installed :(
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: cameni on October 29, 2013, 03:06:33 am
It doesn't crash, but the old version didn't crash me either.

Yeah that condition should be
Code: [Select]
if _failed: return false
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: DivineSense on October 29, 2013, 06:48:54 am
I can confirm the new build works for me! Outerra starts up fine, the shakyness is gone and the translation values for the axis works!
I get a crash when i exit outerra now, but at least that's not as big of a problem :) The crash causes resolution changes to not be saved.

Thank you thank you thank you!  :) :) :D You guys are awesome

I'm using: TrackIR4 Camera, vector hat clip (the 3 point thing), Freetrack 2.2 on Windows 32-bit with a gtx660 running latest nvidia drivers.
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: DivineSense on October 29, 2013, 07:29:21 am
Okay, next issue I did not immediately realize.

The head position xyz seems to be affected by pitch tilt and yaw.

When I look to the sides, my head position moves forward, when i look down my head position moves back. (for example back and out trough the roof of the cessna ;), when i look up my head position seems to move down and forward.

In freetrack I can see that the head is still in the same postition, but in outerra it is not.

I tested both Freetrack 2.2 and Trackir5 software. Same issue.
The X-axis is also inverted (can be selected as inverted in freetrack as a workaround)

I made a video of this behavior. Centering the view in freetrack did not help. Moving the mouse around to different positions and then centering again seems to affect the issue as well but I have not managed to figure out how.

www.youtube.com/watch?v=hXNRuqkpgYw (http://www.youtube.com/watch?v=hXNRuqkpgYw#)

Please let me know if i can help you troubleshoot further
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: DivineSense on October 29, 2013, 08:11:17 am
In freetrack I can mimic the behavior by selecting "Relative Translation", which raises the head position when i look down provided I'm behind the origin.

Some further troubleshooting and some of this seems to have to do with the model position in freetrack and trackir software being exaggerated in Outerra.

Default values in freetrack seems to be Hor 0mm Vert 160mm and depth -70mm. I have to set all these values close to zero to balance out the effect.

(http://img812.imageshack.us/img812/146/hfaw.png)

Overall it seems the axis movement and head position is really exaggerated in Outerra, compared to how other programs translate them. I have to set the sensitivity really low for the tracker to be useable. Translated values are in a few mm, but i get large movements in Outerra.


I hope this tells you something, unfortunately I'm not good at programming this stuff so I'm a bit clueless as to how it works.
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: cameni on October 29, 2013, 08:51:12 am
I have no idea what the position units from TIR mean, and I found no docs or common usage patterns, so I just multiplied them with a constant, and expected people to pop up :)

Additionally, the head movement is simulated in OT as well, so it probably fights with the one from FT. Can't be turned off at the moment.
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: DivineSense on October 29, 2013, 09:34:45 am
Okay :) In that case the constant is a bit too large at the moment then, could explain why position changes are so huge.

The head movement is simulated? 

Bottom line, the TrackIR plugin needs some further tweaking before it works as well as 3782 did without any plugin :)
I can help testing new versions, perhaps foobie has some ideas as to what is wrong here.
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: cameni on October 29, 2013, 10:09:25 am
Bottom line, the TrackIR plugin needs some further tweaking before it works as well as 3782 did without any plugin :)
Now when you say 3782 worked better in this regard, that's odd, as the constant didn't change. OT tracker API expects the positions to be in meters, so basically it's all on the plugin - how it translates TIR protocol values into physical distances.

The built-in freetrack tracker uses K=0.001 multiplier for the positional data, I don't know if foobie changed it or if the tracker is providing different data than freetrack. I guess there's a separate scaling there somewhere.
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: foobie42 on October 29, 2013, 10:34:34 am
cameni,

Crash on exit is not known to me. There's no destructor at all.

Here's code for translation compensation. Can you test, please? It might solve aforementioned pitch-down-translate-down problem:

Code: [Select]
            if (compensate)
            {
                const auto H = output_camera.axes[Yaw] * M_PI / 180;
                const auto P = output_camera.axes[Pitch] * M_PI / 180;
                const auto B = output_camera.axes[Roll] * M_PI / 180;

                const auto cosH = cos(H);
                const auto sinH = sin(H);
                const auto cosP = cos(P);
                const auto sinP = sin(P);
                const auto cosB = cos(B);
                const auto sinB = sin(B);

                double foo[] = {
                    cosH * cosB - sinH * sinP * sinB,
                    - sinB * cosP,
                    sinH * cosB + cosH * sinP * sinB,
                    cosH * sinB + sinH * sinP * cosB,
                    cosB * cosP,
                    sinB * sinH - cosH * sinP * cosB,
                    - sinH * cosP,
                    - sinP,
                    cosH * cosP,
                };

---------------

Didn't change any constants. I don't know, sorry. Need to test somehow...

---------------

Additionally we may want to try changing the game id to something else.
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: cameni on October 30, 2013, 03:35:15 am
I think we just need to turn off the head simulation in OT for trackers that provide positional data. It's there for the Rift, to deduce the head movement from angles for more natural behavior, but it should not be needed when there's a positional info.
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: DivineSense on October 30, 2013, 11:25:27 am
That sounds like a good plan. Please let me know if i can help by testing something here on my end.
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: Memphis291 on February 02, 2014, 05:26:14 pm
sorry for a stupid question, but where do I have to put the tir-trackir-plugin.dll? I can not find any describtion/readme that is telling me where to put it into
Title: Re: NaturalFail TrackIR 4/5 support in Outerra!
Post by: cameni on February 03, 2014, 02:56:13 am
Create a "plugins" directory in the OT install directory and put it there.