Author Topic: PRACX v1.10 Release  (Read 240607 times)

0 Members and 5 Guests are viewing this topic.

Offline DrazharLn

Re: PRACX v1.07 Release
« Reply #195 on: May 06, 2016, 11:40:53 AM »
Unpatched SMAC not working in windows 10 is a problem particular to the non-GOG versions of the game. I don't have access to the old CD version of the game at the moment, so I can't easily compare to find out what they've done differenty.

The video problem could be related, but I'm not sure.

I'm assuming you've installed Yitzi 3.4 and then installed PRACX 1.07 over the top. If you haven't, maybe do that.

Firstly, if you're using PRACX, you don't need to and shouldn't use DirectDraw=0. Both terran and terranx need to run as an administrator unless your user has write access to the folder they're in. Otherwise, they shouldn't.

Secondly, check the SMAC folder and tell me if dplayerx.dll is present

Thirdly, PRACX actually plays the videos in the game by calling playuv15.exe directly, so if it works outside the game, it should work in the game. Please give me the exact command line or process you're using to play the videos fine outside the game.

Thanks,
Draz

Offline Harpalus

Re: PRACX v1.07 Release
« Reply #196 on: May 06, 2016, 01:52:36 PM »
Yes, I installed Yitzi 3.4, followed by 3.4b, and finally 1.0.7 on top of it.  Running terranx.exe as an administrator doesn't help (it's outside of Program Files), and dplayerx.dll is present in the SMAX folder.

I've just been dragging and dropping wve files onto playuv15.exe, which would be (playuv15.exe asceticVirtues.wve), but I just tested the -nodoublebuffer and -16 switches, and the video played just fine in both of them.

Thank you for the response.

Offline DrazharLn

Re: PRACX v1.07 Release
« Reply #197 on: May 06, 2016, 02:09:56 PM »
Could you try running this in a command prompt in the movies directory?

You can open a command prompt in a directory by navigating to the directory in explorer, then holding shift and right clicking some free space and selecting open command prompt from the menu that appears.

Commands to try:

playuv15 -software opening.wve
playuv15 opening.wve

Could you tell me which if any of these commands successfully plays the film?

Offline Harpalus

Re: PRACX v1.07 Release
« Reply #198 on: May 06, 2016, 02:13:07 PM »
That's the issue! I should have clarified: I've already been testing in the command line. Videos play perfectly with all of the commands below.

playuv15.exe merchantExchange.wve
playuv15.exe -16 merchantExchange.wve
playuv15.exe -nodoublebuffer merchantExchange.wve

As you suggested, adding this flag reproduces the issue.

playuv15.exe -software merchantExchange.wve

It seems that this isn't a PRACX bug at all, it just triggers it by calling playuv15.exe with different parameters.

Offline DrazharLn

Re: PRACX v1.07 Release
« Reply #199 on: May 06, 2016, 02:36:10 PM »
So, to be clear running
playuv15.exe -software merchantExchange.wve

Fails to show a film?

I'll change PRACX to let you specify the arguments to playuv15.exe, if that's the case.

In the slightly longer term, I'm trying to get hold of the linux version of the game. Apparently that has the videos encoded with a more traditional codec, rather than EA's TQI codec. If I can get that, I'll provide a mod that uses ffmpeg or similar to play the films, which will remove the dependency on playuv and let people add new videos easier.

Offline Harpalus

Re: PRACX v1.07 Release
« Reply #200 on: May 06, 2016, 02:41:56 PM »
So, to be clear running
playuv15.exe -software merchantExchange.wve

Fails to show a film?


Correct. More specifically, it plays with visual corruption and stuttering.

In the slightly longer term, I'm trying to get hold of the linux version of the game. Apparently that has the videos encoded with a more traditional codec, rather than EA's TQI codec. If I can get that, I'll provide a mod that uses ffmpeg or similar to play the films, which will remove the dependency on playuv and let people add new videos easier.


There's a download here (http://alphacentauri2.info/index.php?action=downloads;sa=view;down=90) to convert the movies to AVI: unfortunately, it claims that doing so increases the size 10 to 20 times. ffmpeg could then be used to compress the videos: all this could be done in a batch file called by the installer, with a warning that it needs a fair amount of space.

Offline DrazharLn

Re: PRACX v1.07 Release
« Reply #201 on: May 06, 2016, 02:54:49 PM »
Alright, I'll release a patched version of PRACX after Lunch.

Thanks for the link to wcmp. I'd forgotten about it. ffmpeg is able to convert the wves as well, but you lose a lot of quality - I think that's because the eatqi codec in ffmpeg isn't very good, but I suppose I could also just be picking bad output options. Maybe this converter is better.

Offline Harpalus

Re: PRACX v1.07 Release
« Reply #202 on: May 06, 2016, 03:08:34 PM »
Alright, I'll release a patched version of PRACX after Lunch.

Thank you!

Thanks for the link to wcmp. I'd forgotten about it. ffmpeg is able to convert the wves as well, but you lose a lot of quality - I think that's because the eatqi codec in ffmpeg isn't very good, but I suppose I could also just be picking bad output options. Maybe this converter is better.

Unfortunately, it's not. I should have tested it first. Quality noticeably declines, and the audio suffers. The newest ffmpeg builds that I could find on Windows produce a similar result.

On the positive side, the final result was even smaller than the original video as shipped with the game.

maritimeControl.wve - 7,000 KB
wcmp_rip.avi - 122,547 KB
converted_wcmp_rip_to_h624.mp4 - 2,056 KB
converted_maritimeControlwve_to_h624_directly.mp4 - 3,953 KB

Quality of the last three videos is all comparably bad.

Offline DrazharLn

Re: PRACX v1.07 Release
« Reply #203 on: May 06, 2016, 06:15:22 PM »
Try this.

Go to your .ini file and add the line

Code: [Select]
MoviePlayerCommand=.\movies\playuv15.exe

The default is .\moves\playuv15.exe -software

Replacing the command with something other than playuv15 is likely not to work.

Patch took longer than expected due to this weird bug:
Code: [Select]
        std::string command = m_ST.m_szMoviePlayerCommand;

        // Would be nice to use ffplay or similar, but the videos are encoded with EA's proprietary TQI codec, and as of April 2016, there's no codec available for ffmpeg.
        // Could reverse engineer playuv15, or the implementation baked into SMAC, I suppose.
        i = strlen(filename) - 4;


        if (i > -1 && filename[i] != '.')
                strcat(filename, ".wve");

        command += " .\\movies\\";
        command += filename;

        // Due to some quantum mechanics weirdness, if I don't write command out to a file, it won't have the right value.
        std::ofstream logfile;
        logfile.open("pracx.tmp");
        logfile << command;
        logfile.close();
        std::remove("pracx.tmp");

Offline Harpalus

Re: PRACX v1.07 Release
« Reply #204 on: May 06, 2016, 06:43:13 PM »
Try this.

Go to your .ini file and add the line

Code: [Select]
MoviePlayerCommand=.\movies\playuv15.exe

The default is .\moves\playuv15.exe -software

Replacing the command with something other than playuv15 is likely not to work.

Unfortunately, this results in movies not playing at all: I tested with MoviePlayerCommand=<DEFAULT>, MoviePlayerCommand=.\movies\playuv15.exe, MoviePlayerCommand=".\movies\playuv15.exe", MoviePlayerCommand="C:\Games\Alpha Centauri\movies\playuv15.exe", and with the MoviePlayerCommand left out entirely.

Also, that is a weird bug.

Offline DrazharLn

Re: PRACX v1.07 Release
« Reply #205 on: May 06, 2016, 07:10:57 PM »
How peculiar. I'll try and make a version that logs the output of the program it calls. Might get round to it late this evening.

Offline Harpalus

Re: PRACX v1.07 Release
« Reply #206 on: May 06, 2016, 07:15:18 PM »
How peculiar. I'll try and make a version that logs the output of the program it calls. Might get round to it late this evening.

Figured it out. It's looking for the movie files in the current directory (with terranx.exe), not in the movies directory. The command itself is called successfully with MoviePlayerCommand=movies\playuv15.exe.

Offline DrazharLn

Re: PRACX v1.07 Release
« Reply #207 on: May 06, 2016, 09:21:34 PM »
That's really odd.

./movies and movies should resolve to the same address.

Glad you sorted it, though.

Offline Harpalus

Re: PRACX v1.07 Release
« Reply #208 on: May 06, 2016, 09:40:15 PM »
That's really odd.

./movies and movies should resolve to the same address.

Glad you sorted it, though.

To clarify, it's not really sorted: invoking the command wasn't the problem, and both ./movies and movies work. It's that the command is looking in the wrong directory when it's called. I just phrased my response poorly.
 
The command run internally by PRACX is something like "movies/playuv15.exe open.wve", which fails because open.wve isn't in the local directory: it's in movies. It should be calling "movies/playuv15.exe movies/open.wve"

Things work perfectly fine at the moment, but only because I copied every video file from C:\Games\Alpha Centauri\movies into C:\Games\Alpha Centauri. This should probably be fixed or the new changes reverted, or PRACX won't play movies anymore.

Thank you for adding the MoviePlayerCommand flag. Hopefully it helps people in the future with the same issue, provided that this last issue is fixed.

Offline Harpalus

Re: PRACX v1.07 Release
« Reply #209 on: May 06, 2016, 09:57:14 PM »
To be even more precise, reviewing the original source code, it looks like the pszFileName character array (the argument for PRACXShowMovie) already contains "./movies" in PRACXShowMovie, because the code doesn't need to prepend the directory to it. I can't see the whole function in 1.08, but I'd guess that you either don't use pszFileName or that "./movies" is not being passed to the function anymore. Perhaps use strcat rather than +=, as the original source does?

In regards to writing the command out to a file, is the issue possibly that the character array input needs to be in quotations? IE, MoviePlayerCommand=.\movies\playuv15.exe wasn't working but MoviePlayerCommand=".\movies\playuv15.exe" would have, removing the need for your workaround. Just a thought. It could just be a result of moving to "+=" from strcat.

I don't have Visual C++ set up at the moment, so I can't be more helpful at the moment and just make the changes and compile it.

Code: [Select]
void __cdecl PRACXShowMovie(const char *pszFileName)
{
PROCESS_INFORMATION pi = { 0 };
STARTUPINFO si = { 0 };
char szCmd[512];
int i;

// Would be nice to use ffplay or similar, but the videos are encoded with EA's proprietary TQI codec, and as of April 2016, there's no codec available for ffmpeg.
// Could reverse engineer playuv15, or the implementation baked into SMAC, I suppose.
strcpy(szCmd, ".\\movies\\playuv15.exe -software -xres 2560 -yres 1440 ");


// ===== Harpalus: No ".\\movies\\ here, it's already in pszFileName.
strcat(szCmd, pszFileName);

// ===== Harpalus: Final szCmd is presumably ".\\movies\\playuv15.exe -software -xres 2560 -yres 1440 .\\movies\\open.wme
// ===== Harpalus:  1.08 szCmd is presumably ".\\movies\\playuv15.exe -software -xres 2560 -yres 1440 .\\open.wme


i = strlen(szCmd) - 4;

if (i > -1 && szCmd[i] != '.')
strcat(szCmd, ".wve");

m_fPlayingMovie = true;

if (CreateProcess(".\\movies\\playuv15.exe", szCmd, NULL, NULL, false, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
{
WaitForSingleObject(pi.hProcess, 2 * 60 * 1000);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}

PostMessage(*m_pAC->phWnd, WM_MOVIEOVER, 0, 0);
}

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

In one moment, Earth; in the next, Heaven.
~Academician Prokhor Zakharov 'For I Have Tasted the Fruit'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 38.

[Show Queries]