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

0 Members and 3 Guests are viewing this topic.

Offline DrazharLn

Re: PRACX v1.08 Release
« Reply #300 on: October 31, 2016, 09:31:02 PM »
Thanks for reporting these issues. I'll try to get them fixed in Yitzi's releases.

Offline Vox Imperatoris

Re: PRACX v1.08 Release
« Reply #301 on: November 06, 2016, 05:41:17 PM »
DrazharLn, I figured out what exactly it was that was causing the movies not to play.

It's the line MoviePlayerCommand=<DEFAULT>

When I remove that (as happens when I delete the "Alpha Centauri.ini" file entirely), the movies work. Until I adjust some setting in the PRACX menu, which then causes the line to be recreated. Then the movies stop playing. I'll try to figure out what to type in (in place of <DEFAULT>) to get it working correctly. But you should know that the default option is not working, at least for some people.

Edit: replacing the line with

MoviePlayerCommand=.\movies\playuv15.exe -software

Solves the problem. Which is odd, as that ought to be what the <DEFAULT> is, no? But anyway, whatever the default was putting in there, it wasn't working. Note that I'm still using Yitzi's 3.4b—that might be related to the problem, I don't know.
« Last Edit: November 06, 2016, 05:57:42 PM by Vox Imperatoris »

Offline DrazharLn

Re: PRACX v1.08 Release
« Reply #302 on: November 06, 2016, 07:40:58 PM »
That is odd, and definitely my fault. Also definitely the kind of thing I should be able to detect with proper testing. I haven't looked into testing frameworks for interactive programs like smac, though.

I'll sort it tonight or tomorrow.

Offline Quinch

Re: PRACX v1.08 Release
« Reply #303 on: January 25, 2017, 12:24:54 AM »
Heyo, love the mod, especially the resolution options. I do have a question, though - I can't seem to get the terrain color coding to work. All terrain overlays just seem to show brown tiles. Any ideas what might be causing it?


Offline DrazharLn

Re: PRACX v1.08 Release
« Reply #304 on: January 25, 2017, 02:42:56 PM »
All credit to the hypnotoad, er, PlotinusRedux.

That does sound odd, though.

Could you attach a screenshot, a save file and the following info for me?

Info:

PRACX version
Yitzi patch version
Keys you're pressing to enable terrain overlay

Offline Quinch

Re: PRACX v1.08 Release
« Reply #305 on: January 25, 2017, 06:44:58 PM »
Huh, interesting - right now I'm using Yitzi's patch 3.5b, and it was happening earlier {way earlier, like possibly months ago}. On a whim, I decided to install the latest PRACX patch, 1.07 and that seems to have fixed it. It was both for Alt+T and manual switching.

Screenshot and savefile are attached.

Offline DrazharLn

Re: PRACX v1.08 Release
« Reply #306 on: January 25, 2017, 11:42:33 PM »
Cool. If the same issue recurs in a future I'll have a look at the save, but I'll leave it for now.

Offline Daemonjax

Re: PRACX v1.08 Release
« Reply #307 on: April 29, 2017, 03:45:21 AM »
I'm encountering a weird bug that's 100% reproducible for me:

Using:

PRACX version: 1.08
Yitzi patch version: 3.5d
win7x64 ultimate edition, intel i5 3570k, amd 7970
using 1024x768 resolution (higher res just makes the menus smaller to my eyes)
Enabling pracx in the ini file, of course.

When videos play ingame, after a certain amount of time (in the longer videos, like the intro: opening.wve), I lose focus of the playing video and it switches focus back to the game... so I can't see the end of the longer videos ingame.

It takes the exact same amount of time no matter what. 

I was curious if it was happening due to reaching a certain length within a video, or whether it was just a timer... so I tested it by overriding uvplayer15.exe with mplayer instead (since it can play wve files, too), and the same thing happened... even if I pause the video using the space bar... it's about the same amount of time until it loses focus (no I didn't actually time it).

This doesn't happen when pracx isn't enabled.

I haven't tried pracx without the 3.5d unofficial patch, or older versions of the patch, or older versions of pracx.

TLDR: after x seconds, videos seem to end prematurely.



Thoughts?  Is the source code for the prax.dll available?
« Last Edit: April 29, 2017, 04:00:44 AM by Daemonjax »

Offline DrazharLn

Re: PRACX v1.08 Release
« Reply #308 on: April 29, 2017, 11:30:19 AM »
Source is available: https://github.com/DrazharLn/pracx/

I haven't encountered this issue, but, if I get time in the next week I'll have a look at it.

If you have any questions about the source, please open an issue on github, email me or post here (in that order of preference :) )

Offline Daemonjax

Re: PRACX v1.08 Release
« Reply #309 on: April 29, 2017, 09:51:42 PM »
Thanks.

I spent about 5 minutes (not long) looking at the source for pracx.dll, and I suspect it has to do with the global timer wrappers -- where the timer wouldn't normally be started when movies are playing ingame, but the wrapper sets the global timer anyways whenever that call is made...

But if that's the case, then you should be able to reproduce the problem.  If not, then that would be weird.

I wouldn't know where to start to hook something to check if a movie was playing ingame.  I might be able to get around the issue with an autohotkey script that forces the uvplay15.exe (or whatever) process to have window focus if it exists, but that might trigger bugs associating with alt-tabbing while the game is running (I usually end up with an unplayable screen if I alt-tab).

I'll probably test the theory by disabling the timer hooks and recompiling pracx.dll it to see what happens as the intro plays.  It really does behave as if it's on a timer.  It would be interesting to get the exact number of milliseconds until it forces the window focus change.   

EDIT:

Looking closer...

Code: [Select]
LRESULT __stdcall PRACXWinProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static int iDeltaAccum = 0;
int iRet = 0;
bool fHasFocus = (GetFocus() == *m_pAC->phWnd);

if (msg == WM_MOVIEOVER)
{
                .
                .
                .


EDIT2:

I think I found the issue (btw, your coding style makes it very easy to read -- it's not the nightmare I've come to expect when reading other peoples' code):

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

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 [nonsense], 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");

m_fPlayingMovie = true;

if (CreateProcess(NULL, const_cast<char*>(command.c_str()), NULL, NULL, false, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
{
LOOK HERE! WaitForSingleObject(pi.hProcess, 2 * 60 * 1000);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}

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

WaitForSingleObject(pi.hProcess, 2 * 60 * 1000);

It waits for 2 minutes, which sounds right about around where videos cut off.  I'll time it.

EDIT3: Yeah, that's it.  Change it to 5 minutes (or 5 hours, does it really matter?), and we're good. :D

//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.

BTW, mplayer can play wve files, and it can play them in fullscreen with postprocessing filters.  I've been using that instead of uvplay15.exe.  In the ini I have it point to the following batch file:
Code: [Select]
@echo off
"c:\mplayer"\mplayer.exe "E:\Sid Meier's Alpha Centauri\movies"\%~n1.wve -vf-add hqdn3d -fs

Since it's actually easier to just hexedit in an increased wait time (rather than fire up a c++ compiler), here it is incase anyone else wants to make the change before the next pracx version:

in pracx.dll search for the hex values (using a hexeditor of course): C0 D4 01 00
in 1.08 it starts at hex offset: 51FD

Change that to: 80 A9 03 00
That will make it a 4 minute wait, which should be plenty of time for all the ingame videos to finish playing.

"It would be interesting to get the exact number of milliseconds until it forces the window focus change." -- Daemonjax

It's funny I said that, because if I had timed it, even without the source, I would have blindly searched for a 120000 integer value in the pracx.dll, made the change, and had gotten the fix anyways.  It's more fun with the source, though. ;)  I would have written an autohotkey script to measure the time in milliseconds between focus changes, because I wouldn't have known what value I was looking for... but I ended up using the clock on my cable tv box when checking if it was exactly 2 minutes, so that saved me some time which could be better spent playing SMAX.


« Last Edit: April 30, 2017, 12:02:21 AM by Daemonjax »

Offline deadgrunt

Re: PRACX v1.08 Release
« Reply #310 on: June 06, 2017, 11:08:39 AM »
So I have Alpha Centauri Alien Crossfire from GOG, installed 3.5 Yitzi, then 3.5d Yitzi on top, then PRACX 1.08 on top.
When I run game, PRACX is not enabled. Game file "Alpha Centauri.Ini" has no mention of PRACX.
Any ideas how to enable PRACX?

Offline dino

Re: PRACX v1.08 Release
« Reply #311 on: June 06, 2017, 02:19:48 PM »
Add this on top of your Alpha Centauri.ini

[PRACX]
Disabled=0
ScreenWidth=<DEFAULT>
ScreenHeight=<DEFAULT>
WindowWidth=<DEFAULT>
WindowHeight=<DEFAULT>
ZoomLevels=8
ScrollMin=<DEFAULT>
ScrollMax=30
ScrollArea=80
MouseOverTileInfo=<DEFAULT>
ShowUnworkedCityResources=1
ListScrollLines=<DEFAULT>
ZoomedOutShowDetails=<DEFAULT>
MoviePlayerCommand=<DEFAULT>

Or delete Alpha Centauri.ini, then launch the game, it'll generate a new one with PRACX config variables included.

Offline deadgrunt

Re: PRACX v1.08 Release
« Reply #312 on: June 06, 2017, 06:35:20 PM »
Alien factions can scan all the map using ALT+T, since it overrides fog of war for them. For example one can learn about positions of all factions and empty lots on the first turn. Is it a known bug? By the way, resource map works properly for alien factions

Offline DrazharLn

Re: PRACX v1.08 Release
« Reply #313 on: July 04, 2017, 03:20:44 PM »
I think I found the issue (btw, your coding style makes it very easy to read -- it's not the nightmare I've come to expect when reading other peoples' code):

Code: [Select]
void __cdecl PRACXShowMovie(const char *pszFileName)
{
      <snip>
if (CreateProcess(NULL, const_cast<char*>(command.c_str()), NULL, NULL, false, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
{
LOOK HERE! WaitForSingleObject(pi.hProcess, 2 * 60 * 1000);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}

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

WaitForSingleObject(pi.hProcess, 2 * 60 * 1000);

It waits for 2 minutes, which sounds right about around where videos cut off.  I'll time it.

EDIT3: Yeah, that's it.  Change it to 5 minutes (or 5 hours, does it really matter?), and we're good. :D


Thanks for looking into this, Daemonjax, really sorry I didn't see your reply earlier!

I don't think I wrote the section with the delay, so I've no idea why it's so short, but I'll have a look at it today and publish a new version with your fix shortly :)

Thank you for the compliments on the coding style. Almost all the code is by PlotinusRedux, I wrote all the comments (and maybe reformatted and re-ordered the code, I forget) and just fixed a couple of bugs and added a feature.

Quote
//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.

BTW, mplayer can play wve files, and it can play them in fullscreen with postprocessing filters.  I've been using that instead of uvplay15.exe.  In the ini I have it point to the following batch file:
Code: [Select]
@echo off
"c:\mplayer"\mplayer.exe "E:\Sid Meier's Alpha Centauri\movies"\%~n1.wve -vf-add hqdn3d -fs

I'll look into this. Interesting that mplayer is better at decoding the files than ffplay was. I'm fairly sure mplayer uses ffmpeg. While we're on the topic, mpv has more or less superseded mplayer, IMHO. It can certainly do fancier post-processing and is a more active project.

Quote
"It would be interesting to get the exact number of milliseconds until it forces the window focus change." -- Daemonjax

It's funny I said that, because if I had timed it, even without the source, I would have blindly searched for a 120000 integer value in the pracx.dll, made the change, and had gotten the fix anyways.  It's more fun with the source, though. ;)  I would have written an autohotkey script to measure the time in milliseconds between focus changes, because I wouldn't have known what value I was looking for... but I ended up using the clock on my cable tv box when checking if it was exactly 2 minutes, so that saved me some time which could be better spent playing SMAX.

Neat :)

Offline DrazharLn

Re: PRACX v1.08 Release
« Reply #314 on: July 04, 2017, 03:23:17 PM »
Alien factions can scan all the map using ALT+T, since it overrides fog of war for them. For example one can learn about positions of all factions and empty lots on the first turn. Is it a known bug? By the way, resource map works properly for alien factions

Thanks for reporting! This is not a known bug. I'll put it on the bugtracker. No promises for when or if it will get fixed, though!

 

* 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

Having now established a secure perimeter, we've made ourselves relatively safe from enemy incursions. But against the seemingly random attacks by Planet's native life, only our array warning sensors can help us, for the mind worms infiltrate through every crevice and chew through anything softer than plasma-steel.
~Lady Deirdre Skye 'The Early Years'

* 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: 41.

[Show Queries]