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

0 Members and 3 Guests are viewing this topic.

Offline DrazharLn

Re: PRACX v1.07 Release
« Reply #210 on: May 07, 2016, 01:34:06 AM »
It's an understandable assumption, but pszFileName does not contain the directory name: I've had the code print out the value to a logfile for me to inspect. playuv15.exe assumes that bare filenames given to it are in the same directory as itself. You can test this yourself with cmd.

I don't think any of the code I've released should ever access movies in the root smac directory. In version 1.07 and earlier, the command executed is "./movies/playuv15.exe -software opening.wve". In version 1.08, the command is "<MoviePlayerCommand> ./movies/opening.wve". If your hypothesis was correct, I'd be accessing films in SMAC/movies/movies, not in SMAC/ !

Now that I see it in your comment, I realise I left in my custom settings for playuv (the -xres and -yres bits) in the source code release, which is kinda funny. They're not in the public release (though of course they can now be set in the config file).

I switched to using std::string rather than null terminated strings + strcat, strcpy, etc. because I like having easy access to real string functions (replace, etc) and not having to care about the size of the string or safety, but I admit it could be a losing battle with this code base: the windows API and all of Plotinus' code uses char*.

Several people have shown interest in the code, and I manage it with git anyway, so I've just chucked it up on github: https://github.com/DrazharLn/pracx

Offline Harpalus

Re: PRACX v1.07 Release
« Reply #211 on: May 07, 2016, 03:31:56 AM »
Thank you for the clarification. I'm quite certain that it's looking in SMAC, even if I set MoviePlayerCommand to <DEFAULT>.

With my regular installation, no videos play: I start terranx.exe, start a new game as Morgan on easy, and rush/buy the Merchant Exchange project as soon as possible. Neither video plays. When I copy open.mte to SMAC from SMAC/movies, the opening video plays but not the Merchant Exchange project. If I copy the Merchant Exchange video after and repeat the test, both videos play. Is 1.08 working for you?

A thought:

Change
Code: [Select]
if (CreateProcess(".\\movies\\playuv15.exe", szCmd, NULL, NULL, false, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))to
Code: [Select]
if (CreateProcess(NULL, szCmd, NULL, NULL, false, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
In the spirit of "if it ain't broke". Here's 1.07 for comparison, which works:
Code: [Select]
if (CreateProcess(NULL, const_cast<char*>(command.c_str()), NULL, NULL, false, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
This seems to me as being the most likely source of this error. playuv15.exe is being given ".\movies\playuv15.exe" as its application name, and this is how it identifies what directory it is residing in. Being given a partial path, it believes its root directory to be the "current directory" (.), not the \movies\ portion. As per the API, the first argument is optional (https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx). Of course, the API then states that passing in NULL here will use the first portion of the second argument instead, which would be the same thing: so hell if I know. It's worth trying.

Thank you for putting the new source on GitHub.
« Last Edit: May 07, 2016, 04:12:24 AM by Harpalus »

Offline DrazharLn

Re: PRACX v1.07 Release
« Reply #212 on: May 07, 2016, 11:48:40 AM »
v1.08 Works for me on my win10 machine. Not tested on the linux one.

You've got slightly mixed up. In v1.07 and earlier, the createprocess call looks like this:
Code: [Select]
if (CreateProcess(".\\movies\\playuv15.exe", szCmd, NULL, NULL, false, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
In v1.08, I changed it to:
Code: [Select]
if (CreateProcess(NULL, const_cast<char*>(command.c_str()), NULL, NULL, false, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
In either case, szCmd and command (by default) both start with ".\\movies\\playuv15.exe", so setting the first argument to NULL should give the same result as setting it to ".\\movies\\playuv15.exe".

Quote
With my regular installation, no videos play: I start terranx.exe, start a new game as Morgan on easy, and rush/buy the Merchant Exchange project as soon as possible. Neither video plays. When I copy open.mte to SMAC from SMAC/movies, the opening video plays but not the Merchant Exchange project. If I copy the Merchant Exchange video after and repeat the test, both videos play.

This is definitely weird. For one, the opening movie is opening.wve or openingx.wve, not open.wve (I think open.wve is just a sound effect). I've built a copy of pracx that logs all the command strings to a logfile, maybe you could have a go with that? Test if opening a command window in the same dir as terranx.exe and running a command from the logfile gives you the right output, maybe? I've also attached a save that you can use to test video playback. Just press end turn and two bases will finish the Weather Paradigm and Merchant Exchange. Though video playback should be working or buggy for all videos, including the opening one.

Just replace the prax/prac.dlls in the smac dir with the ones I've attached.

Source for these changes: https://github.com/DrazharLn/pracx/tree/harpalus

Offline Harpalus

Re: PRACX v1.07 Release
« Reply #213 on: May 07, 2016, 03:05:35 PM »
v1.08 Works for me on my win10 machine. Not tested on the linux one.

You've got slightly mixed up. In v1.07 and earlier, the createprocess call looks like this:
Code: [Select]
if (CreateProcess(".\\movies\\playuv15.exe", szCmd, NULL, NULL, false, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
In v1.08, I changed it to:
Code: [Select]
if (CreateProcess(NULL, const_cast<char*>(command.c_str()), NULL, NULL, false, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
In either case, szCmd and command (by default) both start with ".\\movies\\playuv15.exe", so setting the first argument to NULL should give the same result as setting it to ".\\movies\\playuv15.exe".

Quote
With my regular installation, no videos play: I start terranx.exe, start a new game as Morgan on easy, and rush/buy the Merchant Exchange project as soon as possible. Neither video plays. When I copy open.mte to SMAC from SMAC/movies, the opening video plays but not the Merchant Exchange project. If I copy the Merchant Exchange video after and repeat the test, both videos play.

This is definitely weird. For one, the opening movie is opening.wve or openingx.wve, not open.wve (I think open.wve is just a sound effect). I've built a copy of pracx that logs all the command strings to a logfile, maybe you could have a go with that? Test if opening a command window in the same dir as terranx.exe and running a command from the logfile gives you the right output, maybe? I've also attached a save that you can use to test video playback. Just press end turn and two bases will finish the Weather Paradigm and Merchant Exchange. Though video playback should be working or buggy for all videos, including the opening one.

Just replace the prax/prac.dlls in the smac dir with the ones I've attached.

Source for these changes: https://github.com/DrazharLn/pracx/tree/harpalus

Sorry, I really should just improve my coding rather than making stupid guesses. I also meant opening.wve, not open.wve. At any rate, I think the log will shed some light on what's happening: there's garbage data after the movies directory. Oddly, this time the opening video started a few times, but didn't another time. Log should probably show why. It's possible that it coincidentally inserted random data when I was testing without videos in the top directory and coincidentally didn't when they were there, it's also possible that Windows is discarding the portion of the argument preceeding the garbage data.

Code: [Select]
.\movies\playuv15.exe .\movies\opening.wve
.\movies\playuv15.exe .\movies\Ìh$uweatherParadigm.wve
.\movies\playuv15.exe .\movies\Ìh$umerchantExchange.wve
.\movies\playuv15.exe .\movies\opening.wve
.\movies\playuv15.exe .\movies\”šwopening.wve

Offline DrazharLn

Re: PRACX v1.07 Release
« Reply #214 on: May 07, 2016, 04:16:53 PM »
This is the kind of low level programming bug that makes me use safer languages for my own projects :)

Looks like in your version of the game, but not mine, filename sometimes starts with garbage.

Could be that on my system filename is always or almost always empty and my strcat works as expected, but on yours it fails? I've changed it to a strcpy this time, which should overwrite anything that's in filename. It's for mistakes like these I try to use std::string :)

If that doesn't work, check your movlist file? I've attached mine for comparison. They should be identical.

Thanks very much for helping to debug this.

Offline Harpalus

Re: PRACX v1.07 Release
« Reply #215 on: May 07, 2016, 04:46:49 PM »
Everything seems to work as expected with this version. Thank you kindly. One of the last few boots had red graphical corruption all over the screen, but the movie was still playing. Unrelated to this issue, probably SMAC's fault. Not worth looking into, but it did give me pause because I was testing. The movlist.txt files are identical, as confirmed with WinMerge.

Code: [Select]
.\movies\playuv15.exe .\movies\opening.wve
.\movies\playuv15.exe .\movies\opening.wve
.\movies\playuv15.exe .\movies\weatherParadigm.wve
.\movies\playuv15.exe .\movies\merchantExchange.wve
.\movies\playuv15.exe .\movies\opening.wve
.\movies\playuv15.exe .\movies\weatherParadigm.wve
.\movies\playuv15.exe .\movies\merchantExchange.wve
.\movies\playuv15.exe .\movies\opening.wve
.\movies\playuv15.exe .\movies\weatherParadigm.wve
.\movies\playuv15.exe .\movies\merchantExchange.wve
.\movies\playuv15.exe .\movies\opening.wve
.\movies\playuv15.exe .\movies\opening.wve
.\movies\playuv15.exe .\movies\opening.wve (and red garbage across entire display while movie is playing)
.\movies\playuv15.exe .\movies\opening.wve
.\movies\playuv15.exe .\movies\opening.wve

Offline DrazharLn

Re: PRACX v1.07 Release
« Reply #216 on: May 07, 2016, 04:53:45 PM »
Never seen red garbage from SMAC before. Won't look into it unless it turns out to be common.

Releasing a real v1.08 after merging the bug fix.

Offline DrazharLn

Re: PRACX v1.08 Release
« Reply #217 on: May 07, 2016, 05:01:04 PM »
Release v1.08 attached to first post.

Source code: https://github.com/DrazharLn/pracx/tree/1.08

Offline treadstone

Re: PRACX v1.08 Release
« Reply #218 on: May 17, 2016, 01:11:50 AM »
Hi! I'm a pretty new Alpha Centauri player. While looking for graphics/UI mods for this venerable classic, I stumbled onto this site and downloaded PRACX.

I've installed and uninstalled and reinstalled several times, but I can only get the original Alpha Centauri to work with PRACX. I want to play Alien Crossfire, but it won't start with PRACX installed. I don't get an error message or anything, terranx.exe just won't start. When I remove PRACX, it begins functioning again. Any ideas? I have the GOG version and I'm running Windows 10. I've tried PRACX 1.08, 1.07, and 1.06. It's the same with each version - the vanilla game launches fine but Alien Crossfire won't start.

Offline Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49279
  • €532
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: PRACX v1.08 Release
« Reply #219 on: May 17, 2016, 01:36:20 AM »
Hi.  You wouldn't be the fellow I talked to on the Facebook page last night, would you?

Somebody better with tech will be by to help you soon...

Offline treadstone

Re: PRACX v1.08 Release
« Reply #220 on: May 17, 2016, 01:50:21 AM »
Yeah, that's me. Thanks for the welcome!

I dug up a couple of events from Windows Event Viewer that have to do with terranx.exe when it's patched with PRACX. Maybe they'll help?

---
Faulting application name: terranx.exe, version: 0.0.0.0, time stamp: 0x37e6a107
Faulting module name: terranx.exe, version: 0.0.0.0, time stamp: 0x37e6a107
Exception code: 0xc0000096
Fault offset: 0x001f0738
Faulting process id: 0x11a0
Faulting application start time: 0x01d1afd5eeaeabfd
Faulting application path: C:\GOG Games\Sid Meier's Alpha Centauri\terranx.exe
Faulting module path: C:\GOG Games\Sid Meier's Alpha Centauri\terranx.exe
Report Id: e9fd4229-f8f9-4727-a704-ae13d979e5ea
Faulting package full name:
Faulting package-relative application ID:
---
Windows cannot access the file  for one of the following reasons: there is a problem with the network connection, the disk that the file is stored on, or the storage drivers installed on this computer; or the disk is missing. Windows closed the program terranx.exe because of this error.

Program: terranx.exe
File:

The error value is listed in the Additional Data section.
User Action
1. Open the file again. This situation might be a temporary problem that corrects itself when the program runs again.
2. If the file still cannot be accessed and
   - It is on the network, your network administrator should verify that there is not a problem with the network and that the server can be contacted.
   - It is on a removable disk, for example, a floppy disk or CD-ROM, verify that the disk is fully inserted into the computer.
3. Check and repair the file system by running CHKDSK. To run CHKDSK, click Start, click Run, type CMD, and then click OK. At the command prompt, type CHKDSK /F, and then press ENTER.
4. If the problem persists, restore the file from a backup copy.
5. Determine whether other files on the same disk can be opened. If not, the disk might be damaged. If it is a hard disk, contact your administrator or computer hardware vendor for further assistance.

Additional Data
Error value: 00000000
Disk type: 0
---
Faulting application name: terranx.exe, version: 0.0.0.0, time stamp: 0x37e6a107
Faulting module name: terranx.exe, version: 0.0.0.0, time stamp: 0x37e6a107
Exception code: 0xc000041d
Fault offset: 0x001f0738
Faulting process id: 0x11a0
Faulting application start time: 0x01d1afd5eeaeabfd
Faulting application path: C:\GOG Games\Sid Meier's Alpha Centauri\terranx.exe
Faulting module path: C:\GOG Games\Sid Meier's Alpha Centauri\terranx.exe
Report Id: dfd3b362-0bdf-40a3-884a-9a93572bb186
Faulting package full name:
Faulting package-relative application ID:

Offline Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49279
  • €532
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: PRACX v1.08 Release
« Reply #221 on: May 17, 2016, 01:53:26 AM »
That sort of info is always the smart play for tech help...

Offline treadstone

Re: PRACX v1.08 Release
« Reply #222 on: May 17, 2016, 02:44:46 AM »
Ah, I figured it out. :D I don't know if it's the same for everyone, but for me it seems like the solution was to get Yitzi's patch and then install PRACX after that.

Offline Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49279
  • €532
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: PRACX v1.08 Release
« Reply #223 on: May 17, 2016, 02:47:11 AM »
That sounds right, come to think of it.  Good job. ;b;

Offline DrazharLn

Re: PRACX v1.08 Release
« Reply #224 on: May 17, 2016, 07:45:20 AM »
Glad you got it working, treadstone. That bug is known and discussed earlier in this thread, but I haven't got round to writing about it somewhere prominent. Sorry about that.

 

* 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

The sea... vast, mysterious... and full of wealth! And the nations of Planet send their trade across it without a thought. Well, the sea doesn't care about them, so it lets them pass. But we can give the sea a little hand in teaching the landlubbers a lesson in humility.
~Captain Ulrik Svensgaard 'The Ripple and the Wave'

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

[Show Queries]