-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add plugin for Final Fantasy XIV #2653
Conversation
Hi @EmperorArthur, I haven't yet reviewed the PR, but here's my WIP branch for wine plugin support, if you're interested: |
@@ -12,7 +12,7 @@ SUBDIRS = link | |||
DIST = plugins.pri | |||
|
|||
win32 { | |||
SUBDIRS += aoc arma2 bf1942 bf2 bf3 bf2142 bfbc2 bfheroes bf4_x86 blacklight borderlands borderlands2 breach cod2 cod4 cod5 codmw2 codmw2so cs css dods dys etqw tf2 gmod gtaiv gw hl2dm insurgency jc2 l4d l4d2 lol lotro ql rl sr sto ut2004 ut3 ut99 wolfet wow | |||
SUBDIRS += aoc arma2 bf1942 bf2 bf3 bf2142 bfbc2 bfheroes bf4_x86 blacklight borderlands borderlands2 breach cod2 cod4 cod5 codmw2 codmw2so cs css dods dys etqw tf2 gmod gtaiv gw hl2dm insurgency jc2 l4d l4d2 lol lotro ql rl sr sto ut2004 ut3 ut99 wolfet wow ffxiv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ffxiv should be after etqw, to keep the alphabetical order.
include(../plugins.pri) | ||
|
||
TARGET = ffxiv | ||
SOURCES = ffxiv.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a github issue. If you view the file directly, the problem disappears.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine.
avatar_front[2] = 0; | ||
|
||
if(camera_is_free) { | ||
camera_front[0] = -std::cos(camera_heading) ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after the bracket.
const procptr32_t identity_offset = 48; // Name | ||
const procptr32_t avatar_pos_offset = 160; // X, Z, Y | ||
const procptr32_t avatar_heading_offset = 176; // Heading (-pi to pi) | ||
//Camera struct offsets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should be "// Camera struct offsets".
peekProc(avatar_address + avatar_pos_offset, &avatar_pos_corrector, 12) && // Avatar Position values (X, Z and Y). | ||
peekProc(avatar_address + avatar_heading_offset, &avatar_heading, 4) && //Avatar heading float. | ||
// peekProc(pModule, servername) && // Server name. | ||
peekProc(pModule + map_id_address, &map_id,4) && // Map id. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after the comma.
const procptr32_t camera_ptr = 0x1045C40; | ||
const procptr32_t avatar_ptr = 0x10468EC; | ||
const procptr32_t state_address = 0x1048C60; | ||
//const procptr32_t servername_address = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the server name isn't available I would just remove it.
peekProc(camera_address + camera_is_free_offset, &camera_is_free, 1) && // Camera is in first person mode | ||
peekProc(avatar_address + avatar_pos_offset, &avatar_pos_corrector, 12) && // Avatar Position values (X, Z and Y). | ||
peekProc(avatar_address + avatar_heading_offset, &avatar_heading, 4) && //Avatar heading float. | ||
// peekProc(pModule, servername) && // Server name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the server name isn't available I would just remove it.
std::ostringstream ocontext; | ||
ocontext << "{"; | ||
|
||
// Server name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the server name isn't available I would just remove it.
std::wostringstream oidentity; | ||
oidentity << "{"; | ||
|
||
// Server name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the server name isn't available I would just remove it.
Hi @EmperorArthur, You're not obliged to setup a full environment to compile plugins, see the Wiki page for a small guide on how to do it. To test plugins we have a dedicated program called MumblePAHelper, you can download it from here or build it yourself if you want the latest version; we still have to setup a builder for it. 😉 |
avatar_front[1] = std::sin(avatar_heading); | ||
avatar_front[2] = 0; | ||
|
||
if(camera_is_free) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be if (camera_is_free) {
// that can be found in the LICENSE file at the root of the | ||
// Mumble source tree or at <https://www.mumble.info/LICENSE>. | ||
|
||
#ifdef WIN32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to ifdef. This plugin is only for Windows for now. Just replace this block with the Windows include.
We'll handle Wine inside mumble_plugin_win32_32bit.h/mumble_plugin_win32_64bit.h when it lands.
// X is East/West, West is increasing values | ||
// Heading is in radians, 0 faces south | ||
|
||
// Memory offsets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use tabs for indentation, but spaces for lining things up.
In this case, the whitespace between camera_ptr, avatar_ptr, etc. should be spaces, not tabs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i was worried about it after @davidebeatrici mentioned them being mixed. It's the same in the l4d2 plugin.
Will work on fixing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was referring to the peekProc and variables parts. 😉
// Create containers to stuff our raw data into, so we can convert it to Mumble's coordinate system | ||
float avatar_pos_corrector[3], camera_pos_corrector[3], avatar_heading, camera_heading; | ||
// Values for extra features | ||
// char servername[50]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete?
include(../plugins.pri) | ||
|
||
TARGET = ffxiv | ||
SOURCES = ffxiv.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine.
Good news, this compiles successfully on MSVC 2010, 2013, and 2015. I know because I installed all three of them yesterday. Bad news (for me), MumblePAHelper and Mumble snapshot don't recognize any compiled plugin. At this point I'm stuck. |
You must use the same compiler (and architecture) for Mumble/MumblePAHelper and the plugins. |
For Mumble 1.3.x, that's MSVC 2013, for Mumble 1.2.x, it's MSVC2010. |
Ok, the problem was everything, including MumblePAHelper, is compiled for X64, but the wiki didn't mention that. That should probably be fixed. One final question before this thing is ready. Does this sound correct?
South was chosen as the reference direction since heading (in radians) is 0 pointing South. |
Seems wrong that the coordinate system for avatar_front is different from avatar_pos.. (South is X is one, in the other?) Also, how is avatar_front's Z ever anything but 0 when it's set to 0 here? https://github.com/mumble-voip/mumble/pull/2653/files#diff-be1da379944da5c11f9a33c6658fcc3aR128 |
I was confused about the coordinate system. Looking at the code for the manual placement plugin helped straighten things out.
This code works, but I believe I can move things to North aligned instead of South aligned. Also, would you like me to squash all commits and rebase to master? side note: I really wish the manual placement plugin was an actual plugin. It would have made experimenting, and understanding the coordinate system so much easier. |
|
||
/* | ||
Mumble | Game (in L hand coordinate system) | ||
X | -X |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be able to swap this to X, -Y, Z and save all the negatives in the azimuth calculations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no opinion. As long as the coordinate system is mapped sensibly onto the Mumble coordinate system, I'm happy.
if (!camera_address) return false; | ||
|
||
// Peekproc and assign game addresses to our containers, so we can retrieve positional data | ||
ok = peekProc(pModule + state_offset, &state, 1) && // Magical state value: 0 or 255 when in main menu and 1 when in-game. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tabs or Spaces in aligning things here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tabs are OK here. It's once you start aligning things you should use spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'm aligning all the && //
so I'll use tabs for the indentation, and spaces to align those.
Sounds like a good idea to me. I'm not sure what other plugins do, though!
Yes, please!
It was, until very recently. We made it part of Mumble because of the Qt UI... Perhaps we can do something similar in MumblePAHelper, but use the link plugin? |
This only supports the DirectX 9 version of the game.
Here's, what should be, the final version. Ready to merge, hopefully. There is a 64 bit version of the game, but I will submit that as a separate pull request. |
Looks good to me. 😉 Does the DirectX 11 version of the game use a different executable? |
Landed. Thanks a bunch! :-) |
Thanks for all your help. I enjoy Mumble, and appreciate everything you all do. |
You're welcome! |
This is the first draft of a positional audio plugin for Final Fantasy XIV. It probably requires more work before being merge ready. I used the l4d2 plugin as a base, with a few patterns found in the wow plugin.
I'd appreciate some feedback, especially since I'm pretty sure I've messed up the coordinate system. I couldn't find any documentation on how to debug this thing aside from littering the code with
cout
statements.The plugin does compile on Linux, though it's not set to in this pull request. I'm in the process of setting up a Windows build environment, so I haven't had a chance to do any testing.
What do you all like about this code? What do you dislike, and what should I change?