Source Code Project Mantis - FSSCP
View Issue Details
0003102FSSCPSEXPspublic2014-09-02 20:472014-10-06 21:55
Assigned ToParias 
PlatformOSOS Version
Product Version3.7.1 
Target Version3.7.2Fixed in Version3.7.2 
Summary0003102: Fix to make show-subtitle-text positioning consistent on MP clients (code included)
DescriptionRight now, show-subtitle-text has a bit of a quirk where it will send the raw x_pos and y_pos (and width) values *AFTER* the host has already calculated them (based on x_pct and y_pct, which are passed as SEXP arguments from the mission). This leads to issues if:

1) The host is running a different screen resolution than client systems (text will appear offset / misaligned from what the host sees)

2) The host is a dedicated / standalone server (text will just get all jumbled up in a corner because the values used for screen resolution percentage processing will come up null, or zero or something)

In either case, it's a bit problematic if you're expecting the text to line up in a certain way for all players. The attached .patch is a code fix to resolve this.
Additional InformationAs always, I'm pretty new to modifying the code and so I'm not sure if there's a better way to do this - treat this change with all due skepticism.

But anyways, the logic is that instead of having sexp_show_subtitle_text do all of the grunt work and then send the results (work out x_pos, y_pos, and width and send those), it'll instead send the original x_pct, y_pct, and width_pct values as received from the SEXP via the multiplayer SEXP packet system; the multi_sexp_show_subtitle_text void will then receive the percent values and do it's own calculation on the client end based on the client's own screen resolution.

Tested this with a few configs just this last weekend and this appears to lead to much better results.
TagsNo tags attached.
Attached Filespatch sexp.cpp-subtitleclientposition.patch (1,913) 2014-09-02 20:47
patch sexp.cpp-subtitleclientposition-new.patch (1,947) 2014-10-05 20:42

2014-09-02 21:00   
Doh - I just realized the .patch also has the change for char text[TOKEN_LENGTH] in multi_sexp_show_subtitle_text() rolled in (changed from TOKEN_LENGTH to 256 as per 0003077) so just an FYI as I think that just got committed to trunk. I'll upload a fresh .patch without it if desired.
2014-09-24 22:10   
The patch looks good, but it gets rejected on current trunk. Could you upload a patch against the most recent revision?
2014-10-05 20:43   
Sorry for the delay Goob - I've fired over an updated .patch (and re-tested against the latest base trunk revision to ensure it goes in). Let me know if there are any more problems.
2014-10-06 21:55   
Patch committed. Marking as fixed.

Issue History
2014-09-02 20:47PariasNew Issue
2014-09-02 20:47PariasFile Added: sexp.cpp-subtitleclientposition.patch
2014-09-02 21:00PariasNote Added: 0016267
2014-09-16 17:22Echelon9Statusnew => code review
2014-09-24 22:10Goober5000Note Added: 0016298
2014-10-05 20:42PariasFile Added: sexp.cpp-subtitleclientposition-new.patch
2014-10-05 20:43PariasNote Added: 0016327
2014-10-06 21:54Goober5000Changeset attached => fs2open trunk r11108
2014-10-06 21:55Goober5000Note Added: 0016328
2014-10-06 21:55Goober5000Assigned To => Parias
2014-10-06 21:55Goober5000Resolutionopen => fixed
2014-10-06 21:55Goober5000Fixed in Version => 3.7.2
2014-10-06 21:55Goober5000Target Version => 3.7.2
2014-10-06 21:55Goober5000Statuscode review => resolved