Author Topic: Antipodes 9 - SDL Everywhere  (Read 11531 times)

0 Members and 1 Guest are viewing this topic.

Offline The E

  • He's Ebeneezer Goode
  • Global Moderator
  • 213
  • Nothing personal, just tech support.
    • Skype
    • Steam
    • Twitter
Antipodes 9 - SDL Everywhere
And once more, it is Antipodes time.

For those who are not used to this, Antipodes is a special development branch we are maintaining to test features and additions that are either too big or too fundamental to just be stuffed into trunk.

This time around, the topic is "SDL Everywhere". What does this mean?
Well, here's the issue: On Linux and MacOS (and FreeBSD), we are using the SDL middleware library to manage the hairy bits of setting up windows, getting an OpenGL context, and handling control input. This has worked pretty well for us, but had one big drawback: SDL 1.2 did not have any support for force feedback effects.

Now, after several years of development, SDL2 has been released. This allows us to do force feedback on all platforms, and this means that it is about time we started using SDL on Windows too, cutting down on the amount of platform-specific  code we have to write and maintain.

Given that this changes the behaviour of one of the biggest things in any game engine, namely player input handling, we need this tested thoroughly. Keyboard/Mouse/KB+Mouse/Joystick/Joypad input all has to be checked, because we want the engine to behave very much the same for obvious reasons.

Here then are the builds for Windows (Built in Visual Studio 2013)

fs2_open_Ant9_20150716_2777459.7z
fs2_open_Ant9_20150716_2777459_SSE.7z
fs2_open_Ant9_20150716_2777459_SSE2.7z
fs2_open_Ant9_20150716_2777459_AVX.7z

All builds are based on git hash 2777459.

You must have SDL2.dll present for the builds to run.  You can get it from libsdl.org.  Make sure the SDL2.dll is in your FS2 folder alongside the downloaded executables.

And here are the builds for other supported platforms (late to the party)

OS X: FS2_Open_Ant9_20150716_2777459.zip  Built on OS X 10.10.4, Xcode 6.4
FreeBSD x64: fs2_open_ant9_20150716_2777459.tar.bz2  Built on PC-BSD 10.1, clang 3.4.1
Ubuntu x86: fs2_open_ant9_20150716_2777459.tar.bz2  Built on Ubuntu Server 14.04.2 LTS, GCC 4.8.4

Big thanks go to taylor, for providing the force feedback code, and m|m and Echelon9 for various fixes and enhancements.

EDIT:

Update posted on 15/12/2013

Changelog:
-Updated to trunk revision 10223
-Made a few housekeeping changes (A few defines removed)
-Fixed bug involving crash when Force Feedback is activated.

Updates posted 18 July 2015

-All new builds for every platform based on latest Git hash
-Many new SDL-only optimizations have been merged including dialog cleanup, dead code removal, etc.
« Last Edit: June 17, 2016, 06:11:32 pm by chief1983 »
**** every cause that ends in murder and children crying. ― Iain Banks
Join the fun at the HLP IRC channel. Get the latest spam and gossip as long as it's fresh!

 

Offline Macfie

  • 210
  • If somebody made a campaign I've probably got it
Re: Antipodes 9 - SDL Everywhere
The AVX build does not have  an "sdl2.dll" file.  Is it not required?
Normal people believe that if it isn't broke, don't fix it. Engineers believe that if it isn't broke, it doesn't have enough features yet.
The difference between Mechanical Engineers and Civil Engineers is:
Mechanical Engineers build weapons.  Civil Engineers build targets
An optimist sees the glass half full; the pessimist sees it half empty. An engineer sees that the glass is twice as big as it needs to be.

 

Offline The E

  • He's Ebeneezer Goode
  • Global Moderator
  • 213
  • Nothing personal, just tech support.
    • Skype
    • Steam
    • Twitter
Re: Antipodes 9 - SDL Everywhere
Yes, you do need it. I have reuploaded the AVX archive.
**** every cause that ends in murder and children crying. ― Iain Banks
Join the fun at the HLP IRC channel. Get the latest spam and gossip as long as it's fresh!

 

Offline Macfie

  • 210
  • If somebody made a campaign I've probably got it
Re: Antipodes 9 - SDL Everywhere
It would be nice to base the antipodes build off a more recent nightly so you don't get the error message when using the Media VP beta release.
One thing I noticed was the build reversed my throttle and bank on the joystick (Logitech Extreme 3D Pro).  The other thing I noticed was if you disconnected the joystick during the game and then re-plugged it in it would not redetect the joystick.  I sometimes reset the joystick by doing this if it isn't exactly centered.
Normal people believe that if it isn't broke, don't fix it. Engineers believe that if it isn't broke, it doesn't have enough features yet.
The difference between Mechanical Engineers and Civil Engineers is:
Mechanical Engineers build weapons.  Civil Engineers build targets
An optimist sees the glass half full; the pessimist sees it half empty. An engineer sees that the glass is twice as big as it needs to be.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Antipodes 9 - SDL Everywhere
Yes I meant to mention the axis swap too, it seems they map differently in game than from DirectInput.  It seems to say Rx and Z are different between the two.  Also, enabling Force Feedback on Windows leads to an immediate crash on load because of how we're using SDL_LoadObject (we pass in NULL).  Supposedly this works for Linux, as taylor said it was working for him, but on Windows it blows up.  Hard-coding it to "SDL2.dll" actually seems to let it work on Windows.  Not sure if we just need an ifdef _WIN32 there or what, I haven't been able to verify what happens on Linux/OS X yet with the Force Feedback code as it is now.

Other than those issues, my previous testing of the Antipodes branch has been very successful.  Played a couple entire missions with no hiccups.

Edit:  Also added an Antipodes 9 version to Mantis.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 
Re: Antipodes 9 - SDL Everywhere
sse2 build seems to work ok in the input department with keyboard and mouse, however there seems to be a major graphical glitch in that the black behind the stars background does not appear (only nebula, planets ect...) Causes some pretty freaky problems

[attachment deleted by an evil time traveler]

 

Offline Kiloku

  • 27
  • I like to code. Code doesn't like me.
    • Minecraft
Re: Antipodes 9 - SDL Everywhere
I tested the SSE2 build using a joypad (Xbox 360 Gamepad - wired), the triggers are treated as two separate axes (Ry for Left Trigger, Rz for Right Trigger)  which are on 0% when released. When you hold them down, they go to 100%.

The main control stick (left) is mapped correctly as Joystick X and Joystick Y.
The secondary control stick (right) is mapped as Joystick Z Axis (for its horizontal axis) and Joystick RX Axis (for its vertical axis)

The buttons go as:

D-Pad up: Button 1
D-Pad down: Button 2
D-Pad left: Button 3
D-Pad right: Button 4

Start: Button 5
Back: Button 6

Left Stick Click: Button 7
Right Stick Click: Button 8

LB: Button 9
RB: Button 10

A: Button 11
B: Button 12
X: Button 13
Y: Button 14

It seems to recognize everything well, the only thing that is an annoyance in my opinion is the way it handles the triggers.

I assume the other 2 builds are going to handle the same way as far as XBox Pad input goes, but I can test it if you guys want.

EDIT: I forgot to mention, in non-SDL builds, the triggers are recognized as a single axis, and it seems to go from -100% (Left trigger fully pressed) to 0 (both fully pressed or both released) to +100% (Right trigger fully pressed). The horizontal axis of the right stick was simply not recognized at all and might as well not exist.
« Last Edit: December 02, 2013, 08:51:09 am by Kiloku »

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Antipodes 9 - SDL Everywhere
Yes I meant to mention the axis swap too, it seems they map differently in game than from DirectInput.  It seems to say Rx and Z are different between the two.

Might be related to the axes confusion I reported on Mantis, here.

EveningTea: Time to go Freeman on this cultist..
* EveningTea pulls crowbar off his shoulderstrap and charges screaming incoherently across the marsh *

z64555: bro. do you even salad

 
Re: Antipodes 9 - SDL Everywhere
I've had a bit more time to test the sse2 build (for some reason the graphical glitch fixed itself) and the mouse only moves as if the axis is tied to desktop position. if your cursor is all the way to the left then you can't turn anymore in that direction.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Antipodes 9 - SDL Everywhere
It would be nice to base the antipodes build off a more recent nightly so you don't get the error message when using the Media VP beta release.
One thing I noticed was the build reversed my throttle and bank on the joystick (Logitech Extreme 3D Pro).  The other thing I noticed was if you disconnected the joystick during the game and then re-plugged it in it would not redetect the joystick.  I sometimes reset the joystick by doing this if it isn't exactly centered.

the first issue comes from the fact that fs2 dates back to the days of yore when gameports were still the standard interface. and back then completely different axis designations were used (x,y,throttle/z,rudder/r). there were really named after whatever the driver decided to name them. usb sticks are usually based of an hid class from the usb specifications, and they used different axis names. d3d had its own names and so does sdl. none of them are anywhere near compatible. when it comes right down to it, its a binding issue, i dont see it being too much trouble to tweak your control profiles.

for the second issue, you just need to have the game re-scan the system for joysticks. this is probibly only being done once at start up, you just need to have this done either at a regular interval (every few seconds), or perhaps when you enter the control config screen. if you needed to unplug or replug a joystick while in game, you would just have to go into options and back out and the stick would be found and remapped. bind by guid instead of stick number to make sure you dont get your sticks mixed up.

It seems to recognize everything well, the only thing that is an annoyance in my opinion is the way it handles the triggers.

thats just M$ being a dick. sdl is probibly bypassing the thing in the ms driver that combines those triggers into a single axis (this was done because ms thought that all axes should be center rested). i actually combine my ch toe breaks into a single rudder axis, because my actual rudder axis is so clogged with dirt it makes this annoying grating sound when used. this might be solved with a 3rd party utility (ppjoy, anything based on vJoy, etc) in a similar way. the other way to fix this is by letting you combine axes in the game, its not really hard to do but would be somewhat hard to mesh that into the existing interface. perhaps use half axis binds as an alternative to full axis binds (like bank left axis, bank right axis). assuming the axis are mapped out to a -1.0f to 1.0f range, axis merging should looks something like this:

Code: [Select]
float bankAxis =  (bankLeftAxisValue*0.5f) - (bankRightAxisValue*0.5f);

there arent really a whole lot of cases where you would need this though.
« Last Edit: December 02, 2013, 05:26:01 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Kiloku

  • 27
  • I like to code. Code doesn't like me.
    • Minecraft
Re: Antipodes 9 - SDL Everywhere
Before SDL, I used that for roll, left trigger was left roll, right trigger was right roll. I admit I don't see many more uses beyond that, though. At the same time, I like it that SDL allows me to use the secondary stick correctly instead of being forced to ignore its horizontal axis.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Antipodes 9 - SDL Everywhere
the reason that the 360 controller meshes so poorly with direct input is because it was natively an xinput device. it was never designed to be a direct input controller, and so its direct input mode was utter crap. sounds like sdl is just bypassing a lot of that crap, exposing raw, unfiltered data. its probibly talking xinput on the controller side. sdl is ultimately just a wrapper for whatever native apis are running on the platform. on windows sdl goes through direct input (possibly xinput as well, as this behavior would seem to suggest) for controller support. i like it because its easy to use and i dont have to download gigabytes of microsoft sdks to compile stuff that uses it.
« Last Edit: December 03, 2013, 01:14:01 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Kiloku

  • 27
  • I like to code. Code doesn't like me.
    • Minecraft
Re: Antipodes 9 - SDL Everywhere
Now re-replaying the default FS2 campaign on SSE2 SDL Build. Any specific kind of stuff I should look out for, while testing?

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Antipodes 9 - SDL Everywhere
Managed to get my freelook patch update, and operable in the cockpit, have yet to tried the other view modes.

Now re-replaying the default FS2 campaign on SSE2 SDL Build. Any specific kind of stuff I should look out for, while testing?

Letsee, the SDL changes should affect the control input and graphics, the goal should be that there shouldn't be any apparent changes in either department vs. trunk (other than the desired performance boost, of course).

EveningTea: Time to go Freeman on this cultist..
* EveningTea pulls crowbar off his shoulderstrap and charges screaming incoherently across the marsh *

z64555: bro. do you even salad

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Antipodes 9 - SDL Everywhere
Not sure if there's any real performance boost here, the idea is that SDL will allow us to do more cool things going forward, and simplify the code base by removing DirectInput specific code.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Antipodes 9 - SDL Everywhere
Yeah, there probably isn't, but it isn't a negative if there is indeed some sort of performance gained. :D

EveningTea: Time to go Freeman on this cultist..
* EveningTea pulls crowbar off his shoulderstrap and charges screaming incoherently across the marsh *

z64555: bro. do you even salad

 

Offline The E

  • He's Ebeneezer Goode
  • Global Moderator
  • 213
  • Nothing personal, just tech support.
    • Skype
    • Steam
    • Twitter
Re: Antipodes 9 - SDL Everywhere
New builds have been posted. Please see the first post for details.
**** every cause that ends in murder and children crying. ― Iain Banks
Join the fun at the HLP IRC channel. Get the latest spam and gossip as long as it's fresh!

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Antipodes 9 - SDL Everywhere
Tried out my Force Feedback Pro joystick with the new adapter I got.  FF works in IL-2, and FSO 3.7.0, but not with these SDL builds.  I did some extra debugging and it doesn't want to initialize FF on the sdljoy joystick resource.  I tried switching it to use Cur_joystick directly with SDL_HapticOpen instead of SDL_HapticOpenFromJoystick and just got an error when loading the first effect to the joystick.  So not sure why this is being so cantankerous on Windows when Taylor had this working on Linux just fine.

Also, I was working with a more recent build with latest trunk merged in locally, and some of the command line code tweaks seem to be breaking flag parsing by the launcher.  When trying to load the flags, it is instead running the game.  Also, this sometimes leads to a freeze where it gets stuck before the video even plays.  Not sure if that's related to the flag parsing or if that's just a separate bug altogether.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: Antipodes 9 - SDL Everywhere
Same here, FF is not working with this build. Plus I'm constantly rolling to the left, as if the rudder (rX axis) is always on the minimum.
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Antipodes 9 - SDL Everywhere
My rudder axis was different between my pecision 2 and ff pro, probably because the usb adapter returns so many axis.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays