Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => Modding => Bug/Patch Discussion => Topic started by: PlotinusRedux on December 09, 2014, 11:22:10 PM

Title: PRACX v1.10 Release
Post by: PlotinusRedux on December 09, 2014, 11:22:10 PM
It can be installed over Yitzi's patch--the installation will just change a few bytes of terran.exe and terranx.exe to load my dll's.

For better formatted and more up to date information on the project, go to the github project page (https://github.com/DrazharLn/pracx).

Source code: https://github.com/DrazharLn/pracx (https://github.com/DrazharLn/pracx)
Downloads/Binaries: https://github.com/DrazharLn/pracx/releases (https://github.com/DrazharLn/pracx/releases)

PRACX Change Log
================

v1.0 (12/9/2014)
================
No big bug fixes or new features, just some minor UI tweaks for things that annoyed me.  The patch is fully compatible with SMAC, SMAX, and Yitzi's patches (last tested against v3.3B).

Windowed/Full Screen
--------------------
*Toggles between Full Screen and Windowed mode;
*Window is resizable;
*Configurable Full Screen resolution (any resolution can be used);
*Automatically switches system back to native resolution when windowed;
*<TAB> key toggles for systems that don't like <ALT-TAB> (like mine for some reason);
*DirectDraw .ini setting obsolete--DirectDraw is used only for movies;
*Opening and in game movies are fully compatible and no longer block <ALT-TAB>.

Scrolling
---------
*Pixel-level scrolling (previously had to scroll at least a tile at a time);
*Right-Click and drag scrolling added;
*Edge scroll zones scroll faster the closer to the edge the mouse is;
*Configurable zone sizes and scroll speed. "Min Scroll Speed" setting is the speed of scrolling when the mouse just enters the zone, and "Max" is the speed with the mouse fully against the edge of the screen/window.

Zooming
-------
*Pixel-level re-centering--no more screen zigzag when scrolling in and out;
*Automatically sets reasonable min, max, and increment values for the current resolution;
*Mouse wheel zooms in and out;
*Configurable # of increments between min and max zoom;
*Resolves black areas after zooming defect;
*Details (units, cities, improvements, etc.) are now shown even when fully zoomed out--can be turned off in Prefs if that causes anyone performance issues.

Resource Modes
--------------
*<ALT-R> cycles between displaying:
  --Normal Mode;
  --Current Yield: Displays what each tile would produce with its current improvements (if any);
  --Potential Yield: Displays each tile's food as if it had a farm, production as if it had a mine, and energy as if it had solar panels;
*Yields are displayed as though for a faction with no current max resource per tile limits--its main purpose is to make it easier to see where to place a city.

Terrain Modes
-------------
*<ALT-T> cycles between displaying:
  --Normal Mode;
  --Faction Ownership Mode: Displays tiles colored by who owns them, if anyone;
  --Elevation Mode: Displays highest elevations as dark red and lowest as white;
  --Rainfall Mode: Displays wettest areas as dark green and driest as while;
  --Rockiness Mode: Displays rockiest areas as dark gray and flattest as white;

Miscellaneous
-------------
*In view mode (key <V>), mouse over for unit and terrain info (don't have to Shift-Right Click);
*In city mode, unworked tiles show their potential yields in grey.  Can be turned off temporarily by holding <SHIFT>, or permanently in Prefs--in which case hold <SHIFT> will display the yields rather than hiding them;
*New in-game menu and prefs window to manage the new features.
*1st mode of existing <T> cycle now hides forests and fungus so you can see what's under them.
*Mouse wheel controls zooming when the map is shown, but controls list scrolling when a list window is shown.

PRACX Hotkey Reference
======================
<TAB>      Toggle fullscreen/windowed
<ALT-R>    Cycle resource display mode
<ALT-T>    Cycle terrain display mode
<SHIFT>    On city screen, show or hide unworked resources depending on the default setting

Disabling/Uninstalling
======================
The entire patch may be temporarily disabled by setting "Disabled=1" in the [PRACX] section of Alpha Centauri.Ini in the application's directory.  It may be permanently disabled by deleting prac.dll and prax.dll in the application's directory or by uninstalling.

Acknowledgements
===============
Thanks to everyone at http://alphacentauri2.info (http://alphacentauri2.info) for their comments and suggestions, and specially to Yitzi and Scient for sharing research from their patches.

Legal
====
Everyone is free to use, distribute, and modify this patch with no limitations, including bundling it in other patches and modifying the source code.

=============================================================
v1.01 (12/10/2014)
=================
Minor fixes to the v1.0 release:

*Fixed "WindowsFileBox=1" .ini setting causing full screen to switch to windowed mode on load/save;
*Fixed <V>iew mode not displaying tile info on mouse-over in SMAX;
*Fixed scaling issue with resource icons in Resource Mode for wide aspect ratios;
*Fixed "Please don't leave" dialog showing up after switching between windowed and full screen mode;
*Improved Zoom Increment calculation so that 0 zoom always lies exactly in the middle.  A side effect is the number of
Zoom Increments must now always be odd.  Even values will be rounded up to the nearest odd number;
*Added this note that <ESC> is the key to use to skip movies now;
*Window close box now acts as though the <ESC> key was pressed instead of minimizing the window.

v1.02 (12/17/2014)
==================
*Fixed incorrect resource calculation in Release build;
*Added removal of GOG <ALT-TAB> blocking to installation.
*Fixed crash when Disabled=1.

v1.03 (12/18/2014)
==================
*Re-enabled scroll wheel zoom (accidentally disabled in 1.02).

v1.04 (12/14/2014)
=============
*Significantly improved zoom level calculation.

v1.05 (01/16/2025)
==================
*Fixed lockup when zooming very large maps.
*Fixed incorrect computation of lower vertical scroll bound.
*Statically linked RTL to remove dependency on RTL DLL.

v1.06 (01/18/2015)
=================
*Compiled for XP compatibility
*Install script now actually creates the backup directory
*PRACX Preferences screen now shows the correct PRACX version

v1.07 (04/21/2016)
==================
* Change: No longer becomes windowed when window loses focus.
* Change: TAB no longer toggles windowed/full-screen.
* Change: ALT+ENTER now toggles windowed/full-screen mode.
* Fix: May fix colour calibration problems.
--DrazharLn

v1.08 (05/06/2016)
==================
* Feature: Can now set MoviePlayerCommand in .ini.
--DrazharLn

v1.09 (05/07/2017)
==================
* Fix: Video window would lose focus after two minutes
* Fix: Yitzi's patch 3.5 includes an 'Alpha Centauri.Ini' that sets bad PRACX options. I now look for them at installation time and change them to the defaults. There will be false positives, but it's better than the status quo.
--Daemonjax and DrazharLn

v1.10 (10/18/2017)
==================
* Fix: use current rather than registry display settings
* Fix: alt-tab works better
* Feature: package BUncle's Icons.pcx
* Feature: optional logging
--DrazharLn

Troubleshooting:

* Some versions of the Alpha Centauri.Ini packaged with yitzi's patch disable PRACX. If you can't open the PRACX menu, check the Ini file. v1.09 and up of the PRACX installer try to fix this for you.
* PRACX will not work with the official version of the game. You need to install the unofficial patches first.
* Windows 8 and later disable DirectPlay. Try re-enabling it ("Turn windows features on and off").
Title: Re: PRACX v1.0 Release
Post by: PlotinusRedux on December 09, 2014, 11:25:08 PM
NOTES:

I used NSIS for the installer because that's what Scient was using, but I saw some reports of it giving a false positive to some antivirus software--if anyone runs into that, please let me know and I'll switch to a different installer.

I'll post the source code in a few days--I want to clean it up a bit and make sure no one finds a bug first.

Yitzi--just installing it will add it to your .exe that you can then distribute--the .exe itself isn't including in this install, it just modifies a few bytes in the SELFMOD segment and adds itself to the class initialization table.

Title: Re: PRACX v1.0 Release
Post by: Flux on December 09, 2014, 11:30:29 PM
Yes! ;nod
Title: Re: PRACX v1.0 Release
Post by: Mart on December 10, 2014, 12:01:08 AM
Ok, having Win 8.1, I run the installer, but it seems the exe files are not patched.
I then tried to manually start pracxpatch.exe, but I got:
"... can't start because MSVCR120D.dll is missing..."
I placed the  MSVCR120D.dll file in Windows\system32 but no luck...

In details, there was also smth about not copied ( _backup ...)
Patch exe was started as administrator
or maybe the problem is antivirus?
Title: Re: PRACX v1.0 Release
Post by: PlotinusRedux on December 10, 2014, 12:21:30 AM
Mart, go to http://www.microsoft.com/en-us/download/details.aspx?id=40784 (http://www.microsoft.com/en-us/download/details.aspx?id=40784) and download and run vcredist_x86.exe, then re-install my patch, that should fix it.
Title: Re: PRACX v1.0 Release
Post by: Mart on December 10, 2014, 12:55:20 AM
Still some problem exists.
Running pracxpatch.exe gives a message window "program has stopped working..."
any idea? antivirus?

one more thing, I have 64-bit system. Maybe this is the problem?
Title: Re: PRACX v1.0 Release
Post by: Yitzi on December 10, 2014, 01:03:02 AM
Still some problem exists.
Running pracxpatch.exe gives a message window "program has stopped working..."
any idea? antivirus?

one more thing, I have 64-bit system. Maybe this is the problem?

I think virtually all systems now are 64-bit.
Title: Re: PRACX v1.0 Release
Post by: PlotinusRedux on December 10, 2014, 01:14:48 AM
Anti-virus is possible, Mart, since it's trying to modify a .exe file--but I'd hope your AV would tell you if it was doing that, not just hang the application....

I'm attaching the zipped .exe file, you can try just running it--if it's AV, that should fix it, if it's a problem with the Visual C roundtimes it will probably crash as well.

Has anyone else installed it yet?
Title: Re: PRACX v1.0 Release
Post by: scient on December 10, 2014, 01:16:13 AM
Tested and working on my win7 x64 vmware install I use to debug the game. Nice work!  :)

note:
I only tested the full screen / window mode and resize features. However, it installed ok and no problems there.
Title: Re: PRACX v1.0 Release
Post by: Mart on December 10, 2014, 01:22:48 AM
...
I'm attaching the zipped .exe file, you can try just running it--if it's AV, that should fix it, if it's a problem with the Visual C roundtimes it will probably crash as well.
...
Yes, the attached terran.exe also gives msvcr120d.dll problem
Title: Re: PRACX v1.0 Release
Post by: PlotinusRedux on December 10, 2014, 01:27:13 AM
It's still complaining about the dll?  Had you manually copied msvcr120d.dll to your system directory from somewhere?  It has to be registered, not just copied--if you manually put it there, delete it and retry the msvc install.  You might also install the x86 version of the redistrib from that site.  I've got to go pick up my son, but I'll look at this more when I get back.
Title: Re: PRACX v1.0 Release
Post by: Mart on December 10, 2014, 01:32:28 AM
I did some online search.
http://msdn.microsoft.com/en-us/library/windows/hardware/dn448963%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/windows/hardware/dn448963%28v=vs.85%29.aspx)

Msvcr120.dll - C runtime.
Msvcr120d.dll - Debug version of C runtime. No redistribution allowed.

Can it be, that pracxpatch.exe could refer to Msvcr120.dll, and this would solve the problem?

[edit]
I reinstalled vcredist_x86.exe, but Msvcr120d.dll is not in system32, Msvcr120.dll is though.
Title: Re: PRACX v1.0 Release
Post by: PlotinusRedux on December 10, 2014, 01:42:26 AM
Ah, yeah, I did compile the debug version.  I'll recorecompand repost when I get home, about 30 minutes.  I miss Borland, I hate all these MS dlls.
Title: Re: PRACX v1.0 Release
Post by: PlotinusRedux on December 10, 2014, 02:30:55 AM
Ok, I replaced the attachment at the top with the release compile, that should fix your issue, Mart.
Title: Re: PRACX v1.0 Release
Post by: Mart on December 10, 2014, 03:22:53 AM
Incredible! :)  Such UI was really unexpected... :)
Yes, it works very well now.

I checked much of the new functionality. Options screen - very nicely done, works excellent.
A question about V key. "v" is in the game for something like - find a unit to move, isn't that in conflict? This feature does not work for me.
Title: Re: PRACX v1.0 Release
Post by: ete on December 10, 2014, 03:25:37 AM
Awesome, just missed my most recent turn of fftf, but this is going to help a whole lot with the map collection for wiki and improve the playing experience greatly :)
Title: Re: PRACX v1.0 Release
Post by: PlotinusRedux on December 10, 2014, 03:33:39 AM
Hmm, it looks like the V key thing only works in AC, not AX for now.  I only wanted it to do the mouse-over thing when you didn't have a unit or tile selected, which is what happens when you hit V in AC, but in AX it's selecting the tile beneath the unit instead of having no selection.

I might look at fixing that for AX in the next day or two, though really the mouse over feature wasn't as useful as I had hoped, because it was hard to look both at where you were moving the mouse and that little window at the bottom.  That's part of what motivated the Terrain modes, to give a way of seeing the same information actually on the tiles themselves--as well as it being a feature I use heavily in Civ.

I'm glad your enjoying it, and thanks for reporting that--let me know if you find anything else.
Title: Re: PRACX v1.0 Release
Post by: Mart on December 10, 2014, 04:03:42 AM
...
I might look at fixing that for AX in the next day or two, though really the mouse over feature wasn't as useful as I had hoped, because it was hard to look both at where you were moving the mouse and that little window at the bottom.  That's part of what motivated the Terrain modes, to give a way of seeing the same information actually on the tiles themselves--as well as it being a feature I use heavily in Civ.
...
Maybe such text info could be in tool tip near mouse pointer?
Title: Re: PRACX v1.0 Release
Post by: TarMinyatur on December 10, 2014, 06:26:37 AM
When zooming the view, this is what I got. Things look good at default zoom, however.
Title: Re: PRACX v1.0 Release
Post by: PlotinusRedux on December 10, 2014, 01:18:30 PM
TarMinyatur--that won't do.  Could you give me the following information so I can reproduce it?

Screen size setting (or you desktop screen size if you had the screen size set to default);
Map size (i.e., huge, small, etc.);
# of Zoom incs if not set to Default.
Does it happen every time you Zoom to that level?

Thanks.
Title: Re: PRACX v1.0 Release
Post by: PlotinusRedux on December 10, 2014, 01:30:16 PM
TarMinyatur--Never mind on the questions, just realized I was tell your resolution from the image size since it's a screen shot of your desktop, and I was able to reproduce it.  Looks like the 1.77 screen aspect is throwing off the scale routines.  I'll get a fix out by this weekend at latest.

Thanks for letting me know.
Title: Re: PRACX v1.0 Release
Post by: ete on December 10, 2014, 02:52:55 PM
Few bug reports/suggestions:

I'm not seeing a way to return to exactly default zoom. Going up one level then down is fine, but going up to the top or down to the bottom then attempting to return to mid level means that everything is subtly resized, which reduces the clarity of some things if you look closely to to resizing, and there's no way as far as I see to undo it other than starting a new game/going to an older save.

Potential Resource Yield is off for ocean for nutrients on squares without kelp farms (should be 3, is 1 in deep ocean and 2 in shallow), and current resource yield is off for squares with mining platforms (claims 1/1/3, should be 1/1/0) and empty ocean squares (claims 1/1/3, should be 1/0/0). I think the issue is to do with the mining platform/kelp farms calculating differently from a mine or farm? The display from the base screen is correct, just the overlay is incorrect.

Resource overlays use whether a faction has explored an area to decide whether to show. This works perfectly, except in the scenario editor's omniscient mode where you can see all squares, but you only get the overlay on explored ones. It's fairly unimportant though.

I can't skip the opening video. Previously I used enter to skip, now enter does nothing and spacebar resets to start of movie rather than actually skipping. Edit: esc works still. Worth including this in a note somewhere for other people used to using other keys to skip.

Closing the window in windowed mode minimizes rather than closes the program. May be intentional.

Elevation mode is brilliant and raininess mode seems pretty handy too. Being able to window it is AMAZING. I'd been relying on chrome in windows 8 app mode to be able to swap back and forth, but win 8 app mode is pretty annoying for a bunch of reasons. Smooth scrolling&unused resource display in base are lovely. Vast improvement, thank you.
Title: Re: PRACX v1.0 Release
Post by: Mart on December 10, 2014, 03:41:59 PM
...
I'm not seeing a way to return to exactly default zoom. Going up one level then down is fine, but going up to the top or down to the bottom then attempting to return to mid level means that everything is subtly resized, which reduces the clarity of some things if you look closely to to resizing, and there's no way as far as I see to undo it other than starting a new game/going to an older save.
There is still old functionality "z" and "x", that works in AX. I can get to default zoom with shift+z. ctrl+z and ctrl+x work, too.
Quote
Closing the window in windowed mode minimizes rather than closes the program. May be intentional.
...
And here is something I would have to report:

- when pressing ctrl+s for saving, AX minimizes before opening windows dialog box for saving. I have that set-up in AlphaCentauri.ini file to use windows box rather than the game dialog box.
- After watching a SP movie, I wanted to save the game, what I did, but now, from that automatically windowed mode I wanted to go to full screen again with <TAB>, but it was opening the dialog box for save instead, and repeatedly. "Maximize" button at the top worked ok, though.
Title: Re: PRACX v1.0 Release
Post by: ete on December 10, 2014, 03:55:48 PM
...
I'm not seeing a way to return to exactly default zoom. Going up one level then down is fine, but going up to the top or down to the bottom then attempting to return to mid level means that everything is subtly resized, which reduces the clarity of some things if you look closely to to resizing, and there's no way as far as I see to undo it other than starting a new game/going to an older save.
There is still old functionality "z" and "x", that works in AX. I can get to default zoom with shift+z. ctrl+z and ctrl+x work, too.

hmm.. Those allow me to zoom in and out, and I think it gets to the right zoom if I go down or up to max then return to near mid with them. It'd be nice if the scroll wheel did this automatically since most players won't discover this and will be stuck with slightly distorted graphics, but less of a priority if there's some way to fix.
Title: Re: PRACX v1.0 Release
Post by: PlotinusRedux on December 10, 2014, 05:03:21 PM
Ete--

Thanks for the feedback.

I'm not sure why the resource overlay would be off--I'm actually calling the same routines the Terrain Info box at the bottom uses.  I'll look into this.

I know what the issue with not being able to get back to exactly 0 Zoom is--I'll fix that in my next update.

The movies are actually being played by the playuv15.exe application now, so it's controlling what keys skip it.  I'll add a note about using ESC--that's what I had always used myself, so I didn't notice a change.

The Close box minimizing was intentional--I did the windowed mode first, so I didn't know the entry point into the graceful exiting routines at the time.  I know it now, though, so I'll change it to call them instead of minimizing.

Mart--

I hadn't even noticed there was a setting to use the windows dialog boxes.  I'll look into what's going on there.
Title: Re: PRACX v1.0 Release
Post by: DrazharLn on December 10, 2014, 11:05:23 PM
This is really great!

I would be very interested in modifying the source to try to add sensible upscaling. Is that something you want to do yourself or do you want to let others try?
Title: Re: PRACX v1.0 Release
Post by: ete on December 10, 2014, 11:16:05 PM
Being able to window SMAX is helping /so much/ with checking and writing up bug reports. 21 up so far :), one of which you may be interested in: https://github.com/OpenSMACX/OpenSMACX/issues/13

Also, is activating the please don't go menu sometimes you switch to windowed mode intentional? It was doing it reliably, now seems to have stopped.. I'll let you know if I figure out the trigger.

Edit: Got it. If you esc, cancel, then switch to or from windowed you'll get another attempt to quit, which is cancelled by switching back.

Edit2: "*Mouse wheel controls zooming when the map is shown, but controls list scrolling when a list window is shown." - does not seem to be working for me on any of the scrolling lists.
Title: Re: PRACX v1.0 Release
Post by: PlotinusRedux on December 11, 2014, 03:09:42 AM
What window did you try, ete?  I just re-tested on Help Index and Bases windows and it scrolls for me on both.
Title: Re: PRACX v1.0 Release
Post by: ete on December 11, 2014, 03:25:29 AM
The f4 screen (base ops, all three options), bottom left list of techs in laboratories status, a bunch of lists of things in datalinks, bottom left list of techs on faction profile, and command nexus list of units.

Perhaps it's something my end, but I've never had any trouble with this mouse's scroll.
Title: Re: PRACX v1.0 Release
Post by: Mart on December 11, 2014, 03:51:29 AM
There is an option in the new options window (left menu or ALT+P), where wheel scroll speed can be set up. There is also value of zero. Maybe this is why your wheel scroll does not work.
I have it working ok on F4 for all 3 bases lists.
What does not work, is these small windows left and right lower corners on F2 or F3.
Title: Re: PRACX v1.0 Release
Post by: ete on December 11, 2014, 04:01:39 AM
Yup, that's the answer.

I feel silly now.

Problem solved! Yay for scrolling!
Title: Re: PRACX v1.01 Release
Post by: PlotinusRedux on December 11, 2014, 04:22:48 AM
Lol, Mart, you're better at giving support for my patch than I am.
Title: Re: PRACX v1.01 Release
Post by: Buster's Uncle on December 11, 2014, 04:27:20 AM
Mart has many uses. ;nod
Title: Re: PRACX v1.0 Release
Post by: PlotinusRedux on December 11, 2014, 04:31:35 AM
This is really great!

I would be very interested in modifying the source to try to add sensible upscaling. Is that something you want to do yourself or do you want to let others try?

I'd be glad for you to try that, Draz, but understand this will just be the source code for my DLL's, not the full game.  I haven't pulled over enough functionality in that area from the .exe into the .dll to really do upscaling yet, but if you read assembly and want to pull that functionality in yourself, that'd be great.  If not, I plan to pull over more functionality over time.

I'm curious, though, upscaling could mean a couple of things in this context--do you mean upscaling in terms of the UI elements (larger font sizes and windows and such), or upscaling in terms of adding bilinear or better scaling routines to the map itself?
Title: Re: PRACX v1.01 Release
Post by: PlotinusRedux on December 11, 2014, 04:34:44 AM
I just updated the install program at the top to v1.01 to fix a few of the issues people have reported here.  It's great to get so much feed back--I've had to beg for defect feedback on other projects.

Change log:

v1.01 (12/10/2014)
=================
Minor fixes to the v1.0 release:

*Fixed "WindowsFileBox=1" .ini setting causing full screen to switch to windowed mode on load/save;
*Fixed <V>iew mode not displaying tile info on mouse-over in SMAX;
*Fixed scaling issue with resource icons in Resource Mode for wide aspect ratios;
*Fixed "Please don't leave" dialog showing up after switching between windowed and full screen mode;
*Improved Zoom Increment calculation so that 0 zoom always lies exactly in the middle.  A side effect is the number of
Zoom Increments must now always be odd.  Even values will be rounded up to the nearest odd number;
*Added this note that <ESC> is the key to use to skip movies now;
*Window close box now acts as though the <ESC> key was pressed instead of minimizing the window.

I think that's everything that has been reported--if I missed something, please remind me.
Title: Re: PRACX v1.0 Release
Post by: DrazharLn on December 11, 2014, 05:18:18 AM
This is really great!

I would be very interested in modifying the source to try to add sensible upscaling. Is that something you want to do yourself or do you want to let others try?

I'd be glad for you to try that, Draz, but understand this will just be the source code for my DLL's, not the full game.  I haven't pulled over enough functionality in that area from the .exe into the .dll to really do upscaling yet, but if you read assembly and want to pull that functionality in yourself, that'd be great.  If not, I plan to pull over more functionality over time.

I'm curious, though, upscaling could mean a couple of things in this context--do you mean upscaling in terms of the UI elements (larger font sizes and windows and such), or upscaling in terms of adding bilinear or better scaling routines to the map itself?

I'm looking for ways to apply suitable image scaling algorithms (https://en.wikipedia.org/wiki/Image_scaling#Pixel_art_scaling_algorithms) to the map and UI elements (or maybe just a whole framebuffer) dynamically. I previously tried to do this with a replacement directdraw library, but I don't think AC2 actually used the library a whole lot, and, as I mentioned before, videos completely broke it.

I understand that the source code would be just for your dll.

You seem to be messing with at least the map rendering calls quite a lot, so your code may well already contain the kind of thing I want to access.
Title: Re: PRACX v1.01 Release
Post by: PlotinusRedux on December 11, 2014, 05:48:47 AM
That's correct, most of the scaling and all of the shading was done directly in code--direct draw (apart from the videos) was really just used as a way to vsync the final update to the screen.  I just removed the last calls to it--they're pointless on today's hardware.

I was thinking of a few options in that regard. 

(1) A big part of the problem isn't the scaling or rendering code per se, but the fact that the source textures are limited to 256 colors.  Just getting rid of that limit alone would do wonders.  The source textures are actually pretty decent resolution in terms of width and height.  I really think this would do more than anything to improve the game's appearance.  Unfortunately, all the shading and rendering code is hard coded to 8 bit color, and reworking it all will take some work;

(2) Some of the scaling is done with calls to StretchBlt and StrechDIBBits, which are horrible.  I was thinking of maybe just replacing those with DirectX 9 calls to take advantage of bilinear or better scaling routines;

(3) The best result would come from doing a full DirectX 9 conversion, converting the Cavier 3d models to a standard format and replacing all the custom rendering and shading code with letting DirectX do it which would have the added benefit of breaking the 8 bit color limit without have to refactor all that custom code.

That's just where my thoughts were headed on it.  I'll be posting the source code sometime in the next week, take a look at it and then we can talk again.  If you come back with "I could do X if only the source code exposed Y from the .exe", maybe I can add Y to it and let you run with it from there.
Title: Re: PRACX v1.01 Release
Post by: DrazharLn on December 12, 2014, 12:23:39 AM
My original aim was just to try and get a frame buffer for SMAC's screen, rendering at SMAC's intended resolution of 1280x768 (or whatever) and then scale it up appropriately for modern screens (with black bars at the sides).

With the zoom in your patch, it's more clear that the underlying problem is the textures themselves, and I concur that upgrading the texture rendering and providing better textures is probably the best way to improve the appearance of the game.

As a quick fix, though, I think it would be sensible to render the game at a smaller resolution (so that UI elements and so on are appropriately sized), then scale this and render it for modern monitors. This would have the effect of hiding some of the bad textures with blurring, hopefully removing some aliasing, while also making the game playable at very large resolutions (like mine (2560x1440)).

(My current best solution is to reduce my desktop resolution to 1440x900 and then play the game, but that's not so great and definitely draws attention to aliasing on textures and the map grid.)

This seems easier than working out how to resize all the UI elements and interactions, but I don't know what you have access to.

As for replacing with DirectX calls, would it be worth using openGL instead? OpenGL is obviously available for more platforms and might make it easier to port your improvements.

Unrelated, GOG decided to prevent alt-tab with sdbinst. The GoGwiki has instructions on how to restore it (http://www.gogwiki.com/wiki/Sid_Meier%27s_Alpha_Centauri#Restoring_Alt.2BTab_support). I think just using that is a better solution than mapping tab to toggle window.
Title: Re: PRACX v1.01 Release
Post by: PlotinusRedux on December 12, 2014, 10:28:52 AM
Draz,

Yeah, I've definitely exposed enough to do that, as it's basically what I have to do to run it in windowed mode:

(1) Hooked GetSystemMetrics to report to the game we're running at whatever resolution we want it to scale to itself;
(2) Hooked GetCursorPos and the mouse messages in WinProc to scale them from screen to client coords before passing them on to the game;
(3) Hooked the final BitBlt the game uses to copy the backbuffer to the screen.  In my case I replace it with a StretchBlt in windowed mode.

That should be enough to accomplish what you propose, just replacing that StretchBlt with your scaling code and use the Windowed mode coordinate conversions even when running full screen.

BTW, on "My current best solution is to reduce my desktop resolution to 1440x900 and then play the game"--you can change the full screen resolution in the PRACX prefs and it will at least automatically switch your desktop in and out of 1440x900 as you switch in out of windows mode, or start and exit the game.

I'll be interested to see your results.
Title: Re: PRACX v1.01 Release
Post by: DrazharLn on December 12, 2014, 02:09:16 PM
That sounds great, Plotinus. I'll have a crack at it once you're ready to release the source.

I really appreciate you explaining here what your code does: it'll make my work a lot easier.

Ultimately, it would probably be sensible to split rendering for the map and UI up: the map should probably be rendered with scaling appropriate to zoom level and UI should be scaled appropriate to resolution (probably should be configurable too). (And then the two buffers should be composited together).

Does your code receive the map and UI calls independently?

Thanks for the advice about PRACX preferences.
Title: Re: PRACX v1.01 Release
Post by: PlotinusRedux on December 12, 2014, 04:27:45 PM
Does your code receive the map and UI calls independently?

Not currently, as I didn't have all the classes and functions identified at the time.  Once Scient releases his IDA database, I plan to go back and add all the classes and functions the to C++ header file so any of them can be called and/or overridden.
Title: Re: PRACX v1.01 Release
Post by: Lord Avalon on December 13, 2014, 10:01:27 AM
While I appreciate the work you put into this, I have to say I prefer the old way the scroll wheel worked in the city build screen, where it moved everything up or down.

Also I'm wondering if you might know how to keep the cursor within the game window when in fullscreen mode? Right now I'm using Primary Lock to keep it on my main monitor (rather than having it go offscreen to the side of my second monitor).
Title: Re: PRACX v1.01 Release
Post by: PlotinusRedux on December 14, 2014, 04:13:29 AM
Lord,

I hadn't noticed what the mouse scroll did on the city screen.  I can change it to pass the wheel through when that screen is up.

There is a windows call to set a bounding rectangle for the cursor.  I only have one monitor hooked up, though, I'd be leery of messing with that without being able to test it.
Title: Re: PRACX v1.01 Release
Post by: Yitzi on December 14, 2014, 08:57:25 PM
Your patch appears to cause a stretching of the menu screen and of the map on my laptop screen dimensions.
Title: Re: PRACX v1.01 Release
Post by: PlotinusRedux on December 14, 2014, 09:02:30 PM
That should depend on the screen resolution you pick on the preferences window, Yitzhak.
Title: Re: PRACX v1.01 Release
Post by: Yitzi on December 14, 2014, 10:05:21 PM
That should depend on the screen resolution you pick on the preferences window, Yitzhak.

Ah, ok.
Title: Re: PRACX v1.01 Release
Post by: Yitzi on December 14, 2014, 11:03:26 PM
When I disable it via Disabled=1, I get a segfault, and when I don't disable it and it crashes for another reason (e.g. bug-hunting with the next version of my patch) while running Ollydbg, it doesn't switch to Ollydbg (as the original did) or even let me minimize.  (If I reduce the size beforehand it's ok, but it's still annoying.)
Title: Re: PRACX v1.01 Release
Post by: Lord Avalon on December 15, 2014, 01:16:44 AM
Lord,

I hadn't noticed what the mouse scroll did on the city screen.  I can change it to pass the wheel through when that screen is up.

There is a windows call to set a bounding rectangle for the cursor.  I only have one monitor hooked up, though, I'd be leery of messing with that without being able to test it.


Edit: No scrolling in Design Workshop when you pick weapons etc? Map behind zooms in & out. This is when DW is accessed from base build screen. When DW is accessed directly, scroll to select is row-by-row, rather than everything moves at once.

Edit2: Ooh, this is bad - also in Design Workshop, cannot click on left arrow to move towards obsolete units - map scrolls instead. (Right arrow works.) N.B.: this happens when DW is accessed from base screen. If I go directly into DW, it's OK.
Title: Re: PRACX v1.01 Release
Post by: PlotinusRedux on December 16, 2014, 08:23:07 AM
Unrelated, GOG decided to prevent alt-tab with sdbinst. The GoGwiki has instructions on how to restore it (http://www.gogwiki.com/wiki/Sid_Meier%27s_Alpha_Centauri#Restoring_Alt.2BTab_support). I think just using that is a better solution than mapping tab to toggle window.


I didn't even know that bloody thing existed.  http://www.microsoft.com/en-us/download/confirmation.aspx?id=7352 (http://www.microsoft.com/en-us/download/confirmation.aspx?id=7352) is an app to create them and see all the ones installed.  It looks like the *only* thing in the db's they installed is disabling ALT-TAB.  I'll add an uninstall og them to my the install script of my next release.  I'll probably leave <TAB> alone as a toggle, though--I've gotten used to it now as a way to quickly go to windowed mode then back.
Title: Re: PRACX v1.01 Release
Post by: PlotinusRedux on December 16, 2014, 08:26:57 AM
When I disable it via Disabled=1, I get a segfault, and when I don't disable it and it crashes for another reason (e.g. bug-hunting with the next version of my patch) while running Ollydbg, it doesn't switch to Ollydbg (as the original did) or even let me minimize.  (If I reduce the size beforehand it's ok, but it's still annoying.)

Fixing the Disabled thing.  Your debug behavior is the exact opposite of mine, though--before my patch, I couldn't get IDA or Visual Studio's debuggers to show over it, after the patch they do.  Maybe fixing the ALT-TAB thing will give me the same behavior you're seeing.  If not, at least Disabled will work.

Did changing the screen resolution on the Pref's window fix the stretching issue you saw?
Title: Re: PRACX v1.01 Release
Post by: PlotinusRedux on December 16, 2014, 08:28:49 AM
Edit: No scrolling in Design Workshop when you pick weapons etc? Map behind zooms in & out. This is when DW is accessed from base build screen. When DW is accessed directly, scroll to select is row-by-row, rather than everything moves at once.

Edit2: Ooh, this is bad - also in Design Workshop, cannot click on left arrow to move towards obsolete units - map scrolls instead. (Right arrow works.) N.B.: this happens when DW is accessed from base screen. If I go directly into DW, it's OK.

I'm reaching out to Yitzi and Scient to see if one of them has a better method of detecting when a pop-up window is open.  I was using code the game itself used, but apparently it's missing some cases.
Title: Re: PRACX v1.01 Release
Post by: PlotinusRedux on December 16, 2014, 10:11:30 AM
Yitzi--I've got the Disabled fixed, but even fixing ALT-TAB on my box, all my debuggers pop up over full screen with the patch, where they didn't before the patch--still the exact opposite of what you're seeing with Ollydbg.  At least you'll be able to just disable my patch now when you're doing your work, and of course you can always window it if the patch is on.

I also fixed an issue with the Resource display mode I'd never seen because it only showed up with Optimization on during building, which was only the case for Release builds, whereas I'm always using the Debug builds--I just turned off Optimization for both.  No telling what else that might have affected.
Title: Re: PRACX v1.01 Release
Post by: Yitzi on December 16, 2014, 12:45:05 PM
When I disable it via Disabled=1, I get a segfault, and when I don't disable it and it crashes for another reason (e.g. bug-hunting with the next version of my patch) while running Ollydbg, it doesn't switch to Ollydbg (as the original did) or even let me minimize.  (If I reduce the size beforehand it's ok, but it's still annoying.)

Fixing the Disabled thing.  Your debug behavior is the exact opposite of mine, though--before my patch, I couldn't get IDA or Visual Studio's debuggers to show over it, after the patch they do.  Maybe fixing the ALT-TAB thing will give me the same behavior you're seeing.  If not, at least Disabled will work.

Did changing the screen resolution on the Pref's window fix the stretching issue you saw?

Yes, it did, though as it said I needed to restart the program.

Edit: No scrolling in Design Workshop when you pick weapons etc? Map behind zooms in & out. This is when DW is accessed from base build screen. When DW is accessed directly, scroll to select is row-by-row, rather than everything moves at once.

Edit2: Ooh, this is bad - also in Design Workshop, cannot click on left arrow to move towards obsolete units - map scrolls instead. (Right arrow works.) N.B.: this happens when DW is accessed from base screen. If I go directly into DW, it's OK.

I'm reaching out to Yitzi and Scient to see if one of them has a better method of detecting when a pop-up window is open.  I was using code the game itself used, but apparently it's missing some cases.

I would probably just put a dummy bit somewhere (I have a few available if you want, and simply enable it when the popup window is opened and disable it when it's closed).

Yitzi--I've got the Disabled fixed, but even fixing ALT-TAB on my box, all my debuggers pop up over full screen with the patch, where they didn't before the patch--still the exact opposite of what you're seeing with Ollydbg.

Did you try it with a crash-causing bug (e.g. segfault)?  When there's no crash, it works fine (but IIRC still doesn't pop up at a breakpoint), but when it hits a segfault it won't let me alt-tab.
Title: Re: PRACX v1.01 Release
Post by: ete on December 17, 2014, 02:15:19 AM
hmm, I'm getting a bug where while watching the AI play out long turns it jumps to windowed mode and displays a circle instead of mouse. If you click anywhere it gives an error about the program not responding, but you can see the turn going on in the background. My guess is windows things the program is unresponsive during the off-turn, and now has a way to un-fullscreen?

I've attached a save which demonstrates it for me, just hit end turn and wait. If your comp is so fast it does that one before unresponsive hit y for full vision, or I'll dig up a bigger save.

Also, mouse wheel scrolling is now working in a bunch of places! It's a HUGE improvement.

Resource yield displays are still buggy:
(http://i.imgur.com/humiKfe.png?2)
Current yield, showing 3 for energy where it should be one (and the bottom box is wrong about it's yield with 'Solar' aka Tidal Harness).

There's also a minor glitch with the zoom on the square below the one selected in scenario editor.

(http://i.imgur.com/phwVTZB.png?2)
Potential Yield, displaying as if adding a Kelp Farm would bring it to 2, with a kelp square next to it showing that it should give 3. Also wrong in bottom box.

(http://i.imgur.com/oPPl0c5.png?2)

Also this. On current yield rocky squares and altitude squares incorrectly display potential yield instead of current.
Title: Re: PRACX v1.01 Release
Post by: PlotinusRedux on December 17, 2014, 08:47:59 PM
v1.02 released, should fix the incorrect resource calculations and disable GOG's <ALT-TAB> block on install.  Also Disabled=1 should no longer crash.

I'm still deciding how best to handle falling through to the default mouse wheel handler for windows that have one, per Lord Avalon.

Yitzi--I've seen what you're talking about with the debugger not always popping up over full screen, though that happens to me with or without the patch.  I don't have an idea how to change that yet--I just debug it in windowed mode for the most part.

Title: Re: PRACX v1.02 Release
Post by: TarMinyatur on December 18, 2014, 06:16:18 PM
If I use the 1366x768 screen mode in PRACX, my terran.exe crashes when I press the left arrow key four times in a row to move the selected tile ('V', left, left, left, left, {crash}). This doesn't happen if I use 1024x768.

I've attached an Ollydbg capture of the access violation. 
Title: Re: PRACX v1.02 Release
Post by: ete on December 18, 2014, 08:22:33 PM
Scrolling with mouse wheel and zooming with mouse wheel seems to be disabled entirely? It was working with 1.01, but now I've updated it's not working anywhere. And even zooming with keys is not fully functional, it won't let me zoom out past default (though I can zoom in a long way). I don't think I've screwed up preferences again, tried changing a bunch and it's not started working again.
Title: Re: PRACX v1.03 Release
Post by: PlotinusRedux on December 18, 2014, 09:12:12 PM
Scrolling with mouse wheel and zooming with mouse wheel seems to be disabled entirely? It was working with 1.01, but now I've updated it's not working anywhere. And even zooming with keys is not fully functional, it won't let me zoom out past default (though I can zoom in a long way). I don't think I've screwed up preferences again, tried changing a bunch and it's not started working again.

D'oh, I forgot I disabled it to test some stuff, it's re-enabled now (v1.03).  I knew I was forgetting something.

I'll try to look at the left arrow crash at wide resolution you found in the next few days, Yitzi.
Title: Re: PRACX v1.03 Release
Post by: ete on December 18, 2014, 11:00:31 PM
The default number of zoom levels is 21 somehow, clicking increase lowers it to 20 which reenables zooming out (with 21 it's impossible to zoom out further than default, but you can still zoom in).
Title: Re: PRACX v1.03 Release
Post by: PlotinusRedux on December 19, 2014, 12:10:13 AM
The default number of zoom levels is 21 somehow, clicking increase lowers it to 20 which reenables zooming out (with 21 it's impossible to zoom out further than default, but you can still zoom in).

The default should still be 6 (which is really 7)--I just tested it here.  There's an issue with the way I implemented putting 0 zoom in the middle, though--since the game can only handle integer levels of zoom, if the (max_zoom_out/(zoom_levels/2)) < 1, rounding puts two adjacent zoom levels at the same value, which then confuses the code determining the current zoom level.

It generally just occurs with either very small maps (30x30, say) and/or very high # of zoom levels.

I'm going to completely redo that algorithm soon and think through the min/max cases a little better.
Title: Re: PRACX v1.02 Release
Post by: PlotinusRedux on December 19, 2014, 03:32:23 AM
If I use the 1366x768 screen mode in PRACX, my terran.exe crashes when I press the left arrow key four times in a row to move the selected tile ('V', left, left, left, left, {crash}). This doesn't happen if I use 1024x768.

I've attached an Ollydbg capture of the access violation.

Just a cursory look at this, it has to do with 1366 not being divisible by 4.  That makes the pitch of each line 1368 (#bytes per line has to be divisible by 4 in a DIB)--somewhere it's not accounting for that difference between width and pitch.

Until I track down the exact place (and hopefully it's only 1 place), you can use 1360x768 instead of 1366x768 without encountering the problem and get almost the same visual experience, just a bit of delay switching in and out of full screen mode as it changes your screen resolution (I'm assuming 1366x768 is your native resolution).  Sucks to have that delay just to change your resolution by 6 pixels, though...

Any resolution whose width isn't divisible by 4 is probably going to have this same issue.  My worry is there may be more places with the same bug--for most resolutions, pitch == width since most resolutions have a divisible by 4 width--that was certainly true of their target resolutions of 800x600 and 1024x768, so any code where they mixed the two wouldn't have shown up as a problem before.

EDIT: So out of every recognized resolution between 1024 width and 2560 width--1024, 1152, 1280, 1360, 1366, 1440, 1600, 1680, 1776, 1792, 1800, 1856, 1920, and 2560, exactly one, 1366, isn't divisible by 4 and thus has a pitch != width.  If finding their mix up of width and pitch takes more than a few hours, I'll probably just remove 1366x768 as an option--1360x768 is close enough (though the game really looks bad in very wide screen resolutions anyway IMO), and anyone with a native 1366x768 display can curse the manufacturer for not giving them 2 more or 2 fewer pixels every time they have a wait an extra couple of seconds switching in and out of full screen mode.

(Of course that just applies to 8-bit color.  If I get the 32-bit color mod done, pitch will just equal width * BytesPerPixel for every resolution (since BytesPerPixel will be 4), and 1366 can be re-enabled.)
Title: Re: PRACX v1.03 Release
Post by: TarMinyatur on December 19, 2014, 05:07:32 AM
I prefer to use 1024 x 768 anyway. Thanks for checking it out.
Title: Re: PRACX v1.03 Release
Post by: PlotinusRedux on December 19, 2014, 06:29:45 AM
 1024x768=1.333... is a pleasant aspect ratio.  Oddly my native resolution of 2560/1440 = 1.77.... appears to have the same aspect ratio, though of course it doesn't.  Yet 1360x768=1.77083..., which lies between the two, gives an unpleasant stretched appearance, and has vertical letter bars--but that may be because it treats it as 1366x768 = 1.7786458333... aspect ratio.

In general on my box, anything <= 1.777... aspect ratio (with the exception of 1360x768, which isn't a real resolution, just a fake one to make 1366 divisible by 4) looks good, and anything every slightly above that, even 1.778, looks stretched and horrible and gets letter boxed.

1366x768 is a violation of nature that never should have existed, and when my son becomes emperor of the world, you can be sure the criminals responsible for such a crime against mathematics will be properly punished.
Title: Re: PRACX v1.03 Release
Post by: Lord Avalon on December 19, 2014, 07:38:08 AM
Gee, that's funny. I thought 1024x768=786,432.  ;)
Title: Re: PRACX v1.03 Release
Post by: PlotinusRedux on December 19, 2014, 08:23:24 AM
Gee, that's funny. I thought 1024x768=786,432.  ;)

Dividing to get the aspect ratio, not multiplying to get the number of pixels....  Which you knew....  :P

v1.04 feature.  "if (0==strcmp("Lord Avalon", pszPlayerName) && fAboutToWin) MultiplyEnemyArmiesBy1000();"

Bad Spock.  You weren't even ever in this dimension.
Title: Re: PRACX v1.03 Release
Post by: ete on December 19, 2014, 01:37:09 PM
hmm, I'm getting a bug where while watching the AI play out long turns it jumps to windowed mode and displays a circle instead of mouse. If you click anywhere it gives an error about the program not responding, but you can see the turn going on in the background. My guess is windows thinks the program is unresponsive during the off-turn, and now has a way to un-fullscreen?

I've attached a save which demonstrates it for me, just hit end turn and wait. If your comp is so fast it does that one before unresponsive hit y for full vision, or I'll dig up a bigger save.


Were you able to reproduce this? I'm getting it moderately reliably at end of turn on larger games and it's definitely new with your patch. It triggers even without omniscient on if enough AI units are within your vision, as happens in mid-late game.

Screenshot of what happens:
(http://i.imgur.com/q2EQYkl.png)

Units continue to move in the background and it starts responding at start of your next turn, but sound is gone, it's harder to see what's going on, and you have to minimize/full screen again to get it back to fullscreen.


Also, the black areas bug seems to be back:

(http://i.imgur.com/8OtiY4S.png?1)
Title: Re: PRACX v1.03 Release
Post by: Lord Avalon on December 19, 2014, 04:07:35 PM

// if (0==strcmp("Lord Avalon", pszPlayerName) && fAboutToWin) MultiplyEnemyArmiesBy1000();
FTFY  :)
Title: Re: PRACX v1.03 Release
Post by: PlotinusRedux on December 20, 2014, 01:18:34 AM
Ete,

I haven't been able to reproduce it, even with "y", but I have a very fast system.

It happens when the message handler doesn't respond to a message for a few seconds.  It was actually probably happening before, but was just hidden behind the game window so you never saw it, and my changes are now allowing it to appear over the game window.  The window you're seeing there that appears to be the game window grayed out isn't actually the game window--it's a Windows generated copy of the game window called a "ghost window".

The proper fix would be to create a new thread devoted to handling the message queue so that even during long AI processing messages still get handled.  I might do something like that after Scient releases his IDA database--I'm kind of putting off any major changes until then, because it will be so much easier to do things afterwards.

However, there's a stop gap measure you can test for me--I don't know if it will work or not.

Save the attacked SMAX.sdb file to your Alien Xfire directory.

Start a command prompt and change directories to your Alien Xfire directory.

Run: "sdbinst SMAX.sdb -q"

If you don't know how to do the command prompt stuff, just let me know and I'll put it in a script you can just click to run.

Let me know if it works--if it does, I'll add it to my patch's install script.  All it is doing is adding an entry to the compatibility database setting the "noghost" property for terranx.exe.  What I don't know is if that prevents the "Not Responding" dialog altogether, or if it only turns off the ghost window part of it.
Title: Re: PRACX v1.03 Release
Post by: ete on December 20, 2014, 05:51:30 PM
Yes, that seems to solve it, thank you!

Edit: Wait, no, it apparently just did not trigger on the tests I ran. It's still happening, popup and all.

(http://i.imgur.com/QgWu2Iq.png)
Title: Re: PRACX v1.03 Release
Post by: Yitzi on December 25, 2014, 11:24:45 PM
Question: Which files should I include in my patch in order to have it include yours?
Title: Re: PRACX v1.03 Release
Post by: Yitzi on December 25, 2014, 11:31:46 PM
Problem: I switched to a new computer, and transferred over all the files that looked like they were relevant to PRACX version 1.01 (which I'd had).  No PRACX.  I then installed version 1.03, still no PRACX.  I then uninstalled and reinstalled 1.03, still no PRACX.  Disabled is set to <Default>, so it shouldn't be that...
Title: Re: PRACX v1.03 Release
Post by: PlotinusRedux on December 25, 2014, 11:45:02 PM
Question: Which files should I include in my patch in order to have it include yours?
It depends on how much or how little of my patch you want to include.

To just be compatible (i.e., not overwrite the patch), you just need to have run pracxpatch.exe on the terranx.exe file you distribute.

To just include the Alien XFire part of the patch, you need the above, plus prax.dll, and the PracxChangeLog.txt file wouldn't hurt.

To include the full patch (i.e., for Alpha Centauri as well), you need the above, plus prac.dll and pracxpatch.exe, and run pracxpatch.exe on install to update the terran.exe file (or distribute a terran.exe file it's already been run on).
Title: Re: PRACX v1.03 Release
Post by: PlotinusRedux on December 25, 2014, 11:57:41 PM
Problem: I switched to a new computer, and transferred over all the files that looked like they were relevant to PRACX version 1.01 (which I'd had).  No PRACX.  I then installed version 1.03, still no PRACX.  I then uninstalled and reinstalled 1.03, still no PRACX.  Disabled is set to <Default>, so it shouldn't be that...


Hmm.  Check in Ollydbg to make sure terranx.exe has the patch code:

@0x00668160:
    call jmp_over
    _emit 'p'
    _emit 'r'
    _emit 'a'
    _emit 'x'
    _emit '\0'
jmp_over:
    call ds : _SMAXLoadLibraryA
    test eax, eax
    jnz  loaded
    ret
loaded:
    push eax
    push 1
    push eax
    call ds : _SMAXGetProcAddress
    test eax, eax
    jnz  callit
    pop  eax
    ret
callit:
    call eax
    ret

And
@0x00682000    dd 0x00668160

If that's there and prax.dll is in the same directory, you might try:

*http://www.microsoft.com/en-us/download/details.aspx?id=40784 and download and install vcredist_x86.exe

*run pracxpatch.exe at the command line and see if it gives an error message.

*put a break point 0x00668160 and make sure it gets to the "call eax"

*make sure the directory with prax.dll in it is the working directory when running terranx.exe

Let me know if you're able to resolve it with any of that or not.
Title: Re: PRACX v1.03 Release
Post by: Yitzi on December 26, 2014, 12:52:42 AM
Hmm...looks like it's not there.

I think what happened was I just ran the downloaded file, and not the pracxpatch.exe file it created.

Now I tried running pracxpatch.exe, and (after downloading the file to get rid of the missing dll message) it crashed...looks like for some reason it can't write to the image of terran/terranx on my computer...

And I just realized I forgot to re-install PRACX after downloading the file for the missing dll message...
Title: Re: PRACX v1.03 Release
Post by: PlotinusRedux on December 26, 2014, 01:05:43 AM
The install script runs it, but if you didn't have the VC files, it would have failed.

If you want, you can email me your latest terranx.exe and I'll run the patch on it and email it back.
Title: Re: PRACX v1.03 Release
Post by: Lord Avalon on December 26, 2014, 01:07:45 AM
I built the Supercollider, and the video had no sound. (I don't know about other videos, as I usually close them right away.) Back to the game, and it has sounds.
Title: Re: PRACX v1.03 Release
Post by: Yitzi on December 26, 2014, 01:08:24 AM
Ok, here it is.
Title: Re: PRACX v1.03 Release
Post by: PlotinusRedux on December 26, 2014, 01:17:10 AM
Here's the patched version.  Hopefully whatever was making pracxpatch.exe crash doesn't also crash prax.dll.  I hate MS compilers with all the hidden dll links--I might switch to GNU C to avoid them.
Title: Re: PRACX v1.03 Release
Post by: Yitzi on December 26, 2014, 02:04:25 AM
It seems to be working.
Title: Re: PRACX v1.03 Release
Post by: Lord Avalon on December 26, 2014, 04:12:58 AM
I built the Supercollider, and the video had no sound. (I don't know about other videos, as I usually close them right away.) Back to the game, and it has sounds.
OK, maybe never mind. I built Pholus Mutagen, started a new game and built Human Genome Project - no sounds. But then I restarted my PC. Got HGP sound. Just one of those things?
Title: Re: PRACX v1.03 Release
Post by: PlotinusRedux on December 26, 2014, 04:20:55 AM
Yitzi--antivirus maybe?  Or not running pracxpatch with admin rights?  What antivirus are you running, if any?

Lord Avalon--could be, my sound gets corrupt playing this old games from time to time--it doesn't go away completely, but gets very distorted.  If you want to test more and know how to use the command shell, you can go to the "movies" directory under your SMACX directory and run:

playuv15 -software supercollider.wve

That's what I have it shelling to to play in game movies now to avoid the movies+alt tab issues.

Title: Re: PRACX v1.03 Release
Post by: Yitzi on December 26, 2014, 04:24:50 AM
Yitzi--antivirus maybe?  Or not running pracxpatch with admin rights?  What antivirus are you running, if any?

I ran with admin rights, antivirus was both Windows Defender (which I had been running on the old computer where it worked properly) and AVG (which IIRC I had not).
Title: Re: PRACX v1.03 Release
Post by: PlotinusRedux on December 26, 2014, 04:38:36 AM
Yitzi--if you get time sometime, you might try running the patch program with AVG off to see if that's the issue.

If AVG is the issue, the solution would be to just distribute patched versions of terranx.exe and terran.exe.  I don't want to distribute terranx.exe at least myself, though, because I don't want someone installing my patch to overwrite yours.

So, we could either have you do the distribution of both patches together, with me only releasing test versions with a renamed terranx.exe in the interims, and/or we could add a version resource to terranx.exe--when they installed mine, I'd check the terranx.exe version, and if it was above--well, anything, since it doesn't exist now--I would assume they had your patch and not overwrite it.

Fortunately, I don't expect my patch to terranx.exe to ever need to be changed--all I need from it is to load prax.dll if it exists, and the dll can do everything from there.  So as long as your terranx.exe contains the changes I sent tonight, it should always be enough to work with anything I do in the future.

Well, unless, of course, I am able to make a fully re-compilable version of terranx using Scient's IDA database--in which case we can all start modifying that source code in git and any compilation from it will have all our changes.
Title: Re: PRACX v1.03 Release
Post by: PlotinusRedux on December 26, 2014, 05:05:17 AM
Actually, adding a version resource to terranx.exe wouldn't be a bad idea in general, so people could easily verify they have the right version of your patch, etc.

http://stackoverflow.com/questions/284258/how-do-i-set-the-version-information-for-an-existing-exe-dll (http://stackoverflow.com/questions/284258/how-do-i-set-the-version-information-for-an-existing-exe-dll) lists a few free ways to add a version resource if you don't have a version of Visual Studio that will do it (the free Express version I'm using won't, I've been adding them to my dll's manually).
Title: Re: PRACX v1.03 Release
Post by: Yitzi on December 26, 2014, 05:14:23 AM
I've just been editing the hardcoded text referenced by "show version number".
Title: Re: PRACX v1.04 Release
Post by: PlotinusRedux on December 26, 2014, 05:31:08 AM
I've been sitting on 1.04 for a while--the only significant change is the zoom level calculations, but it is a pretty big improvement.

This is probably the last version of a while--I'm going to switch focus to more foundational work for a month or two (especially when Scient releases his IDA work) that will greatly increase the ease of making changes, so I wanted to go ahead and release this.
Title: Re: PRACX v1.04 Release
Post by: Mart on December 26, 2014, 05:35:30 AM
I will have more detailed reports on PRACX working soon, but one thing, that seem to be connected to the patch is, that sometimes left-click generates like 2 events, both left-clicks subsequent. So for example:
I select a "button/window"? in unit workshop for some field (armour, engine, etc.) then instead of the usual window with options, one of these options gets selected, armour type, engine type, etc. And the window with options appears to blink in a fraction of a second. It looks like my left click generated two the same events (left-click).
Any idea, why this happens?
Title: Re: PRACX v1.04 Release
Post by: Lord Avalon on December 26, 2014, 07:19:00 AM
... Lord Avalon--could be, my sound gets corrupt playing this old games from time to time--it doesn't go away completely, but gets very distorted.  If you want to test more and know how to use the command shell, you can go to the "movies" directory under your SMACX directory and run:

playuv15 -software supercollider.wve

That's what I have it shelling to to play in game movies now to avoid the movies+alt tab issues.

It works now. I don't remember having any sound problems before your patch (but of course, I could be wrong).
Title: Re: PRACX v1.04 Release
Post by: PlotinusRedux on December 26, 2014, 07:55:26 AM
Mart--I'm not able to reproduce that, and offhand I can't think of anything I changed that might cause that.  If you find a pattern that seems to make it happen or can think of anything that might help me reproduce it, please let me know--that's the kind of thing I have to be able to reproduce to track down.

Lord Avalon--it's possible one of my "if (0==strcmp(player_name, EVIL_SPOCK))UseBadLuckRandomNumberGenerator();" might be interfering with the sound system.  (It's the internet, so I have to explicitly state that was a joke--you wouldn't believe some of the things I've had people take seriously.  If it is related to patch, the only thing I can think of is maybe since SMAX is already using DirectSound, sometimes that interferes with playuv15.exe accessing DirectSound?  That's just a wild guess, though.)

Title: Re: PRACX v1.04 Release
Post by: Lord Avalon on December 26, 2014, 08:40:09 AM
You are mistaken. I am Good Spock, aka Cool Spock. ^_^
Title: Re: PRACX v1.04 Release
Post by: PlotinusRedux on December 26, 2014, 11:03:30 AM
You are mistaken. I am Good Spock, aka Cool Spock. ^_^

Sorry, it's a universal law of alternate dimensions and twins that goatee = evil.  Not to mention the whole asking for my "agonizer" thing...
Title: Re: PRACX v1.04 Release
Post by: Lord Avalon on December 26, 2014, 02:34:21 PM
Isn't that a Punishment Sphere you're building over there? It seems similar to our agony booth.
Title: Re: PRACX v1.04 Release
Post by: Mart on December 28, 2014, 01:39:39 AM
Mart--I'm not able to reproduce that, and offhand I can't think of anything I changed that might cause that.  If you find a pattern that seems to make it happen or can think of anything that might help me reproduce it, please let me know--that's the kind of thing I have to be able to reproduce to track down.

It may be my mouse driver issue. It is, that it just happened around this time I started using one of the patch versions. I will have to check the driver and stuff around it.
I have Mad Catz RAT-5 at the moment (for fast text editing, which I had to do on some exam... software engineering is more demanding than a shooter game :) I played some such games occasionally, but never needed a mouse like that...). Sadly, having MSI machine does not help. Their support for Win 8.1 is lacking a bit. Yet still, this is my favourite type of hardware, having the second one from them and maybe another in the future. They just do these few little things so well, it's difficult to find anything better for medium price.

I installed 1.04 and map works smoother - this is my impression. The default zoom was below 20 (not 21) and it was 19, cause I set it so before, I think.
And wheel scrolling was 0? I do not remember now.
Title: Re: PRACX v1.04 Release
Post by: PlotinusRedux on December 28, 2014, 02:12:40 AM
Mart--I use the RAT 7 myself--it's the most adjustable (to fit my hand) mouse I've seen.  So I don't think it would be the RAT driver, though I'm using Windows 7, not 8.
Title: Re: PRACX v1.04 Release
Post by: Mart on December 28, 2014, 02:59:42 AM
Mart--I use the RAT 7 myself--it's the most adjustable (to fit my hand) mouse I've seen.  So I don't think it would be the RAT driver, though I'm using Windows 7, not 8.
There must be something in my hardware/software combination, cause I also noticed now such strange behaviour in firefox. So I am going to look for the problem over there.
... or is it nasty adware?
Title: Re: PRACX v1.04 Release
Post by: Yitzi on December 29, 2014, 08:54:32 PM
I noticed that the scroll wheel for zooming is not properly disabled/transferred to the menu when there is a scenario editor menu (e.g. create unit or modify techs) open.
Title: Re: PRACX v1.04 Release
Post by: Mart on January 08, 2015, 08:47:52 PM
I tried to play on map 180x360, but zooming by the wheel crashes the game.
Maps up to 256 size seem to work ok.
Is it expected?

There are large maps in download area:
Link (http://alphacentauri2.info/index.php?action=downloads;cat=8)
Title: Re: PRACX v1.04 Release
Post by: PlotinusRedux on January 09, 2015, 04:08:55 AM
Mart--what screen resolution?
Title: Re: PRACX v1.04 Release
Post by: Mart on January 09, 2015, 06:32:28 AM
I tried some more settings, it crashes at resolutions:
1600x900
1360x768
1024x768

and it is not the zooming by wheel, buttons "z" and "x" crash the game the same.
I could, however, flatten the view by <shift>+<ctrl>+<z>, also <TAB> worked, I could get a windowed game, play some unit moves, then return to full screen and play further.
And the game works, it seems, as long as zooming is not attempted.

I have also zoom levels set to 19, let me check other levels...
===
I tried also zoom levels: 7 and 3,
and turned off "details when zoomed out"
they crash when zooming the same.

Can it be, that some of the variables have problem with values above 256? Some 1-byte?
===
Maybe not... game works with such large maps.
I checked map dragging with right mouse button, and it works ok.

=========
I have more finds:

These work:
199x256
200x256

these does not work:
201x256
202x256

Then thinking, that it is connected to number of tiles, I tried other map ratios, that all do not work:
48x512
49x512
50x512
51x512
100x512
101x512

and there is a catch - to make such maps, they must be declared in alphax.txt, what I did, cause otherwise in "custom size" when you enter a value larger than 256, game defaults to 256.
Title: Re: PRACX v1.05 Release
Post by: PlotinusRedux on January 17, 2015, 03:49:41 AM
v1.05 released, fixes zooming with very large maps (the issue Mart found above) and a minor issue with calculating the lower scroll bound of the map.

If you're curious, Mart, I hadn't considered that maps could be large enough to not fit completely on the screen at any zoom level given rounding the game does when zooming.  In such cases, the attempt to find a zoom level at which the entire map map fit led to a zoom level so low that the pixel size of each tile rounded down to 0, leading to a division by 0 fault.  To fix, I just honored the game's existing clamp at 1/8th zoom.  If you're trying to get screen shots of a very large map, note that the higher your resolution, the larger the map you can completely fit on the screen even with the 1/8th zoom clamp.
Title: Re: PRACX v1.05 Release
Post by: new2ac on January 17, 2015, 12:21:40 PM
I can not apply this patch with 32 bit Windows XP.  I know it is a somewhat older unsupported OS, but it is still in use by many.  I have 64 bit OSs on the same PC, but I installed this on 32 bit Windows XP because this is a Win98 game and have many old apps I use with 32 bit Windows XP.  I would prefer not to have to reinstall this on 64 bit XP or 64 bit Win7.

I had to go into 64 bit Win7 just to manually apply this patch using pracxpatch.exe at the cmd command line prompt, as pracxpatch.exe is not a valid Win32 application.  However, this patch's DLLs are also 64 bit, as I get an exception about not being able to use GetTickCount64 with Kernel32.dll when starting SMACX and loading this patch's DLLs.  I verifed that the DLLs are the problem with WinDbg.

Therefore, I need 32 bit versions of the EXEs and DLLs in this patch.  Worst case I could compile the source for 32 bit, but I found source code for version 1.04 of this patch, not this 1.05 one.
Title: Re: PRACX v1.05 Release
Post by: PlotinusRedux on January 17, 2015, 12:30:25 PM
This was all  compiled as 32-bit, new2ac.  I've been up all night, I'll look into this more once I've slept.  In the meantime, if you would, turn off your anti-virus, re-download the install, and run it, and tell me if that solves your issue or not.  If you're not comfortable doing that, I understand.

GetTickCount64 refers to the return value, not the library--it is supposed to exist in Kernel32.dll.
Title: Re: PRACX v1.05 Release
Post by: new2ac on January 17, 2015, 01:05:56 PM
No automatic anti-virus scanning was enabled, and this patch I downloaded does not seem corrupt.  MD5sum of what I downloaded from this post is:

06680cd830c0d6b4a575197535ef4b7d  PRACXv105.exe

Also, there would not be a GetTickCount64 message from a 32 bit DLL.  I remember a posting by Microsoft that recent Visual Studio compilers can not create code for XP, or if that is not the problem, then you may have just mistakenly configured your compiler for 64 bit when you thought is was otherwise, then posted that 64 bit patch.  Remember, pracxpatch.exe only worked in 64 bit OS for me.
Title: Re: PRACX v1.05 Release
Post by: PlotinusRedux on January 17, 2015, 02:18:14 PM
Also, there would not be a GetTickCount64 message from a 32 bit DLL.

Like I said, the 64 refers to the return value, not the library, it's a function in kernel32.dll.  If I compiled it as 64 bit it wouldn't work at all as it is merged with the 32-bit SMAX code without a processor mode switch.

Googling GetTickCount64 shows the problem though--the function only exists on Windows Vista and later.  I'll switch it to run time loading with an OS version check later today--that should fix it.  I must sleep now.
Title: Re: PRACX v1.05 Release
Post by: DrazharLn on January 18, 2015, 12:45:41 PM
@new2ac,

Function reference for GetTickCount64: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724411%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/ms724411%28v=vs.85%29.aspx)

Definitely in kernel32.
Title: Re: PRACX v1.05 Release
Post by: PlotinusRedux on January 18, 2015, 06:12:21 PM
new2AC,

Try the 1.06 install attached here (not at the start of the thread) and let me know if it works with XP.  Once you confirm I'll move it to the top of the thread (or try something else if it doesn't work).

(File removed as new2AC has tested it)
Title: Re: PRACX v1.06 Release
Post by: PlotinusRedux on January 19, 2015, 07:49:45 AM
v1.06 released, compiled for XP compatibility.  For anyone curious, in VS 2013 you have to go to Project Properties\Configuration Properties\Platform Toolset and change it from "v120" to "v120_xp" or the startup code for .exe's will give the "Not a valid program" thing.  Then to insure you don't use any additions to the Windows API itself since XP (such as GetTickCount64()), add:

WINVER=0x0501
_WIN32_WINNT=0x0501

to the preprocessor defines (or at least somewhere before you hit the #include for the windows API headers).  0x0501 is the constant for Windows XP.

v1.06 (01/18/2015
=================
*Compiled for XP compatibility
*Install script now actually creates the backup directory
*PRACX Preferences screen now shows the correct PRACX version
Title: Re: PRACX v1.06 Release
Post by: fleenots on January 23, 2015, 11:59:55 PM
Hi
I have a question: Is PRACX version 1.06 compatible with the SMAC 444 AI patch version p?
Thanks
Title: Re: PRACX v1.06 Release
Post by: PlotinusRedux on January 24, 2015, 12:32:17 AM
Probably, but you'd just have to test it to be sure.  I've only tested with Yitzi's patch myself, and it works with it.
Title: Re: PRACX v1.06 Release
Post by: fleenots on January 24, 2015, 12:36:27 AM
Ok, but according with what I understood the last Yitzi's patch 3.3b is build on top of the kyrub SMAC 444 p. Isn't that right? So it should work.
Title: Re: PRACX v1.06 Release
Post by: PlotinusRedux on January 24, 2015, 12:38:49 AM
Yeah, if it's something that's included in Yitzi's patch, it's definitely compatible.
Title: Re: PRACX v1.06 Release
Post by: Geo on February 14, 2015, 12:27:21 AM
Just installed PRACX on my desktop. Nice work! ;b;
Title: Re: PRACX v1.06 Release
Post by: Tiddalick on March 01, 2015, 11:36:31 PM
Fantastic work,  ;b; It was perfect timing for me, as I have been meaning to replay the game for a while.

I have done some basic testing after installing Yitzi's latest 3.4 patch which includes PRACX 1.06 and everything seems to work except for mouse scrolling.
I am using the "Razor Abyssus" mouse, that runs a software suite for extra control options , though the mouse itself is plug and play.

Just thought I would mention it, in case others are also having issues with the scrolling.
I can post more details if you wish.

EDIT: I have managed to get it working after changing the compatability flags on the terranx.exe.
Turning off "Run this program as an administrator" did the trick. All the Pracx functions now work fine!
Title: Re: PRACX v1.06 Release
Post by: Nexii on March 02, 2015, 04:31:24 PM
Nice, windowed mode.  However I've found that occasionally after certain game actions, the entire window will resize and the graphics glitch a bit and the game gets laggy graphically, and I can't scroll normally.  Remaximizing the game seems to fix but this happens a lot to me.  Sorry if this is vague
Title: Re: PRACX v1.06 Release
Post by: PlotinusRedux on March 03, 2015, 06:19:30 AM
Geo--glad you like it.

Tiddalick--I'm trying to think of any plausible explanation why running outside of admin mode would fix issues, and I'm having trouble coming up with one.  But what works is what works.  The only thing half-way plausible I can think of is maybe your anti-virus software is more aggressive with programs run in admin mode--the method PRACX uses to change SMACX, DLL injection, is the same kind of method some viruses use, so an anti-virus might see it as suspicious.  But, if it was that, I'd have expected the anti-virus to give you a message, and to prevent PRACX from working at all, not just prevent mouse scrolling....  Thanks for the report about what fixed it for you--hopefully that will help anyone that runs into the same issue.

Nexii--what game actions specifically?  Is it the cut-scene movies?  And could you give me more details about your system--OS (i.e., Windows 7, 8, etc.), desktop resolution, are you running multiple monitors, etc.  Yours is the first report I've heard of something like that.  Really, I wouldn't recommend playing it in windowed mode at this point--I'm using windows scaling, which really blurs some of the text badly, and the edge scrolling is less than ideal, I really just use it for a turn or two while I respond to a text.  But, it shouldn't be changing window size like you describe--and eventually I'd like to convert the entire program to DX 9 and use its scaling, which would give a much better result in both full screen and windowed mode.  The game used direct draw once, but currently it uses windows API's for all the drawing, and custom code for scaling and effects that today are built into the hardware even without a graphics card.
Title: Re: PRACX v1.06 Release
Post by: Nexii on March 13, 2015, 06:04:51 PM
I've been getting less graphical glitches since just playing in full screen.  Sorry for being slow to get back, I did have some detailed things to report but I'd rather be specific than vague.
Title: Re: PRACX v1.06 Release
Post by: Geo on March 28, 2015, 02:14:51 PM
Don't know if this has been reported yet, but when the interludes pop up the text is shown with wider lines, but the background picture is still the 800x600 resolution one centered on the display,
obscuring the text on the right part of the picture (where the planet shows).
An obvious solution is to put hard returns in the interlude text paragraphs, but that's extra work... :P
Title: Re: PRACX v1.06 Release
Post by: Mart on March 28, 2015, 04:04:05 PM
...
An obvious solution is to put hard returns in the interlude text paragraphs, but that's extra work... :P
You can try also to substitute the graphics file with its widescreen version.
It would have to be done with adding some starfield part on the left, so that the planet doeasn't take so much % of the stretched screen.
Though it needs to be done with keeping pcx palette. I have it for SMAC, I think, not sure what I have for SMAX.
paint.net if I recall was keeping the pallette
Title: Re: PRACX v1.06 Release
Post by: Mart on March 28, 2015, 04:32:24 PM
Ok, I think, it is this one, the file attached.
When placing, make backup copy of the original in-game file.
The one I made has flaws, but I haven't prepared a better one yet...
It is 1366x768, and depending on your screen setting, can be stretched, like in case of full HD (1920x1080), or you may have it centered in original resolution.
However in my case when centered, the text does not go into the planet area.
Title: Re: PRACX v1.06 Release
Post by: Geo on March 28, 2015, 04:55:01 PM
Thanks. :)
Title: Re: PRACX v1.06 Release
Post by: vonbach on March 29, 2015, 03:02:21 PM
Not sure if this is the place for this but I installed your patch and it works great but when I try to mod a map
it wont save it. Maybe I'm making a mistake not sure its been awhile since i've played with the editor. I also cant exit out of the editor.
Title: Re: PRACX v1.06 Release
Post by: Mart on March 29, 2015, 03:11:25 PM
Yitzi patch 3.4 has PRACX 1.06 patch included. Maybe try it.
Title: Re: PRACX v1.06 Release
Post by: hyperdriveJ on April 02, 2015, 12:20:39 AM
[request]

I hope the next version includes a way to format the font size of text in windows such as the terrain yield info at the bottom of the screen or the base facilities list in the city screen (for laptop users, you can't see the "linked" beside the network node. You see, changing the value in "prefsformat" in Alpha.ini doesn't work.
Title: Re: Program locks up when saving a map in editor mode
Post by: Vidsek on May 23, 2015, 02:29:22 AM
  Probably the same issue mentioned by vonbach back in March.  Not sure if your PRACX patch is involved, just never had it occur before adding it. In any case, I'm in awe of your skills and hoped you'd look at the problem :) Edit: also occurs when PRACX is disabled (but not uninstalled).  Added some more info below.

  Only happens with map saving, not scenario or regular games.
  Opening up the 'save' window by clicking in the menu or by keystroke does -not- cause the problem, it usually occurs when I type in the save name (or click on a previous save to enter it), but sometimes allows typing/file name entry to occur and then crashes when I click the 'save' button or hit enter to save.
  Have now tried several screen resolutions, no change.  Also several different maps, small to huge, modified and random.
  The "lock" or "crash" is that Terranx.exe goes into a loop or whatever and starts using 98-99% of processor time.
  To get it shut down, I have to ctrl-alt-del to open taskmanager and 'end process' it there, since nothing else is getting enough cycles to work.
  To confuse the issue, the bug does not occur all the time, rarely everything works normally, and more rarely, an initial save works but subsequent attempts fail.  Mostly, tho, it's been happening.
  I'm trying to watch (and remember...) everything I'm doing and what else is running on my rig in hopes of seeing any patterns that might give a clue, but so far I'm, uh....clueless.  Will continue to look for one, tho.

  I remember reading about other bugs in SMAC/SMACX that caused an endless loop/100% processor time crash back when I was learning how to set up the game on a modern comp and OS a year or more ago.  Don't know if the same wrong calls or whatever might be involved here.

  Windows 7-64, patched to current.
  Yitzi's 3.4
  PRACX 1.06
  Any other pertinent system info can be provided if you think it might help


  I'm an avid modder at heart (with a pathetic skill set so far), so this save bug is horribly frustrating

                                                                        Vidsek Fayfisten
Title: Re: PRACX v1.06 Release
Post by: vonbach on May 26, 2015, 07:48:33 PM
You have to be in windowed mode to save a map. Thats the fix I found. The window comes up but you cant see it unless
your in windowed mode. So just go windowed mode save then go back.
Title: Re: PRACX v1.06 Release
Post by: Mart on May 26, 2015, 08:15:20 PM
Yes, that may be the same problem, as observed in other cases:
For some reason, already for several years, after a SP movie, the save game window does not "pop out" to the foreground. It stays in the background.
I was saving a game "blindly" e.g. hitting some key few times, and then enter. Then I quit the game and there was that save with name of the key-hits I made.
As I remember, I was not able to alt-tab to that save window.
Presently, with PRACX patch you can <TAB> to windowed mode. Then you can ALT-TAB to the save window.

So the game does not crash, it only opens a so-called modal window that needs to be dealt with before proceeding further.
Title: Re: PRACX v1.06 Release
Post by: Vidsek on May 27, 2015, 05:36:35 AM
    I ran across that same thing: pop-up window popping under.  Now I tab to windowed before opening the save window (since once that window opens under, I can't PRACX tab or alt-tab out of full screen).  Not a big problem once you know what's happening, just inconvenient.
   The first time it happened, I finally got to the desktop and discovered nine saves waiting for me.  Apparently I'm persistent, if not always very bright  :D

   Interestingly (to me at least) in the last year or so of playing SMAC/X, it never happened until just this last week...when I've had other pop-up window problems.

                                                                            Vidsek Fayfisten

 
Title: Re: PRACX v1.06 Release
Post by: Vidsek on May 27, 2015, 05:51:45 AM
[request]

I hope the next version includes a way to format the font size of text in windows such as the terrain yield info at the bottom of the screen or the base facilities list in the city screen (for laptop users, you can't see the "linked" beside the network node. You see, changing the value in "prefsformat" in Alpha.ini doesn't work.

   UI refinements are definitely something that would improve everyone's gameplay and being actually able to read what's there is top of my list (font size and the various windows' sizes as well).  Having more control over the UI in general would really help.
   I'm not sure where it should fall in the patch priorities, but I wonder: is the UI something that could be worked on by another person?  How integrated is it into Terranx.exe, and how much chance of messing up other parts of the game would changing it risk?

                                                                      Vidsek
Title: Re: PRACX v1.06 Release
Post by: Neuromanger on July 05, 2015, 10:20:40 PM
@PlotinusRedux

First of all, thanks very much for this great little mod!

I originally came here for Yitzi's patch but tried out yours too and I have to say I'm really impressed and find it very useful, especially the zoom scroll and <TAB> options.

I have a small suggestion though.

With respect to the <V> view mode / terrain info, there's a 'disconnect' when you actually want to view resource info rather than elevation and tile type or vice versa depending on what mode you were in originally.

What I mean is, yes, you can left click the terrain info to switch modes, but to do that you have to move your mouse from the square you were originally looking at, to the MFD screen! Hence the 'disconnect' if you see what I mean.

So, my suggestion is when you're in <V> mode could you have a toggle (or temporary enable)  to show elevation / resource info by using the very conveniently placed middle mouse button for example? Or <SHIFT> or whatever?

I think this would help a lot?
Title: Re: PRACX v1.06 Release
Post by: Nevill on August 11, 2015, 08:12:50 AM
Is PRACX compatible with kyrub's AI patch for SMAC?
Title: Re: PRACX v1.06 Release
Post by: Lxndr on August 14, 2015, 07:46:06 PM
I realize that I probably caused this issue by being an early adopter, but after upgrading to Windows 10, if PRACX is enabled, it crashed terranx (sometimes after the second turn I play). Any tips on how to troubleshoot this?
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on August 14, 2015, 11:12:24 PM
Hi Lxndr, welcome to the forum.

PlotinusRedux still checks into the forum fairly regularly, so hopefully he'll be along in a bit with some more specific instructions.

For now, you could help by confirming that you can play a few turns with PRACX off. Pracx is compiled to be compatible with winXP, but win10 should be backwards compatible. Just in case, you could try running pracx in winXP compatibility mode by right clicking on it and setting the appropriate option.

The only other useful diagnostic I can think of right now is to check windows event viewer for any interesting log messages at the time pracx crashes.

Cheers,
Title: Re: PRACX v1.06 Release
Post by: Lxndr on August 15, 2015, 01:22:11 AM
Thanks for the reply!

I can confirm that I am able play a full game when PRACX is disabled in AlphaCentauri.ini (Disabled = 1)

It crashes whenever PRACX isn't disabled.  I am running in Windows XP SP 3 compatiblity.
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on August 15, 2015, 11:21:21 AM
Thanks for confirming that. Could you have a look in Windows Event Log for anything interesting happening when SMAC crashes?
Title: Re: PRACX v1.06 Release
Post by: Lxndr on August 17, 2015, 05:08:22 PM
Thanks for confirming that. Could you have a look in Windows Event Log for anything interesting happening when SMAC crashes?

I'll admit I'm not up to the task of reading the Event Log.  I can't quite puzzle it out. But I found this:

Code: [Select]
Faulting application name: terranx.exe, version: 0.0.0.0, time stamp: 0x31313931
Faulting module name: terranx.exe, version: 0.0.0.0, time stamp: 0x31313931
Exception code: 0xc0000005
Fault offset: 0x001e076d
Faulting process id: 0x397c
Faulting application start time: 0x01d0d8ff39b5a244
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: 3cf15e3d-2e47-43bc-bc7b-34d68e8428ca
Faulting package full name:
Faulting package-relative application ID:
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on August 17, 2015, 05:27:46 PM
That report says that terranx.exe tried to access some memory it shouldn't at offset 0x001e076d, hopefully Plotinus will know what to do with that.
Title: Re: PRACX v1.06 Release
Post by: Vidsek on August 17, 2015, 09:27:42 PM
  As per your request:  Greetings Lxndr!!

  My solution for Win 10 disfunctions has been to wait to install it until at least the first round of bugfixes is issued.  Being an unpaid beta tester for a big, rich corporation ranks low on my priority list.
  I have done the free pre-release download, so when it's declared by users to actually be a step up from 7 I'll be good to go.
Title: Re: PRACX v1.06 Release
Post by: Lxndr on August 17, 2015, 09:33:16 PM
Other than this one quirk with PRACX, it's not been a bad OS. That said, I'm not sure there's a "Take it back" button for OS upgrades.
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on August 18, 2015, 04:19:03 PM
I realize that I probably caused this issue by being an early adopter, but after upgrading to Windows 10, if PRACX is enabled, it crashed terranx (sometimes after the second turn I play). Any tips on how to troubleshoot this?

I've PM'd PlotinusRedux.

Did you successfully use PRACX on the same physical machine and desktop resolution before upgrading to windows 10? If the machine was different, how was it different?
Title: Re: PRACX v1.06 Release
Post by: Lxndr on August 20, 2015, 09:42:54 PM
The hardware and resolution haven't changed (besides Windows 10). Though the installation of Windows 10 required me to update the BIOS of my mother board.
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on August 20, 2015, 11:22:37 PM
And just to confirm, you played Alpha Centauri with and without PRACX on that same machine before installing windows 10?

BIOS shouldn't have an effect.
Title: Re: PRACX v1.06 Release
Post by: PlotinusRedux on September 01, 2015, 06:07:18 AM
I'm absurdly busy IRL currently, probably will be until the end of Sept, but I'll try to squeeze in looking at the Windows 10 thing.  I have it installed myself so it shouldn't take long. 
Title: Re: PRACX v1.06 Release
Post by: Vidsek on September 01, 2015, 09:30:48 AM
  Thank you, and our hopes that things are going well for you.  But then the 3rd century CE was a busy time for you too, so you're probably used to that....
Title: Re: PRACX v1.06 Release
Post by: Nevill on September 01, 2015, 09:37:01 PM
Not sure whether to post it here or in Yitzi's patch thread.

Yitzi's patch is said to contain PRAX 1.06, but something got weird. Like, this weird:
(http://s20.postimg.org/8ztpg3o3h/2015_09_01_232241.jpg)
Thankfully, reinstalling PRAX over helped. If I had to guess, it's the icons.pcx file that is at fault.

Also, the white rectangle on the minimap showing the location of the current screen does not move/refresh during scrolling and vanishes if zooming in/out. It only redraws once you click on a tile. Is this a known issue?

I also hate to repeat myself, but is PRAX 1.06 compatible with kyrub's? I've launched it and it seemed to work fine, but I don't know what exactly it patches in terran.exe.
Title: Re: PRACX v1.06 Release
Post by: PlotinusRedux on September 04, 2015, 03:59:18 AM
Yes, icons.pcx definitely needs to be distributed for PRAC/X to work properly--it contains the new images I used.  Yitzi, could you include it in your install?

It looks like Yitzi's patch already includes Kyrub's patch.  Since they are both just the terran.exe file, installing Kyrub's would overwrite Yitzi's changes, whereas installing Yitzi's gets you both.  PRAC/X, on the other hand, modifies the existing terran.exe during installation, so you can install it over Yitzi's or just Kyrub's, as long as you install PRAC/X *last*.

I'm hating Windows 10.  The first thing it did was corrupt my RAID 1 array, both drives, I'm still recovering stuff from that.  I downloaded a Start button replacement that at least lets me pin things to the Start menu again.  I'm also still re-installing all my apps and dev kits, so I haven't had a chance to try PRAC/X on it yet.  It should be an easy fix--if it was something fundamental it would crash on start up.
Title: Re: PRACX v1.06 Release
Post by: Yitzi on September 04, 2015, 04:37:28 AM
Yes, icons.pcx definitely needs to be distributed for PRAC/X to work properly--it contains the new images I used.  Yitzi, could you include it in your install?

It looks like Yitzi's patch already includes Kyrub's patch.  Since they are both just the terran.exe file, installing Kyrub's would overwrite Yitzi's changes, whereas installing Yitzi's gets you both.

That's true if he meant Kyrub's terranx.exe, but mine is purely SMAX (although it can imitate SMAC), so installing Kyrub's terran.exe will have no effect on my terranx.exe.
Title: Re: PRACX v1.06 Release
Post by: PlotinusRedux on September 04, 2015, 04:57:03 AM
Ah, I didn't notice that, Yitzi.  Yes, PRAC should be compatible with Kyrub's SMAC patch, as long as you install PRAC last.

Both will need icons.pcx, Yitzi.

Vidsek, time is the moving image of eternity, so the more things change, the more they stay the same.  Except for this Windows 10 thing--and I thought Attila was bad....
Title: Re: PRACX v1.06 Release
Post by: Nevill on September 04, 2015, 08:15:13 AM

Quote
Yes, PRAC should be compatible with Kyrub's SMAC patch, as long as you install PRAC last.
Thanks!

Also, some in-game windows can't be scrolled up or down with a mousewheel, since those actions affect map zoom instead. The most noticeable is perhaps the unit list in the editor which is long enough that you would want to scroll it, often.

Would the minimap rentagle be hard to fix? For the moment it is probably the only issue that prevents me from switching to PRAX for good.
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on September 04, 2015, 12:28:09 PM
I've just checked and Icons.pcx is not redistributed with Yitzi 3.4, so that's probably the problem.
Title: Re: PRACX v1.06 Release
Post by: Lxndr on September 04, 2015, 07:24:40 PM
Upon reading the previous conversation, I went ahead and installed PRACX independently from Yitzi's, just in case it was icons.pcx causing my crashing problem.  Further testing gave me more of the same behaviour.
Title: Re: PRACX v1.06 Release
Post by: PlotinusRedux on September 09, 2015, 09:24:18 AM
I had the mini map problem before PRAX, I didn't know PRAX was causing it for some people.  I'd have to get it working properly without PRAX first to isolate what about PRAX is exasperating the issue.

A missing Icons.pcx update will cause all kinds of wrong looking things, like what Neville posted, but it wouldn't cause a crash like you're experiencing, Lxndr.  You're probably running into a Win 10 incompatibility that I really am going to get to at some point.
Title: Re: PRACX v1.06 Release
Post by: Buster's Uncle on September 24, 2015, 08:45:32 PM
Say, Mr. sequel-of-Plotinous,

Hey Yitzi - would fixing the no-tabout junk introduced in the GOG version so users of it don't have to find and implement the workaround be outside the scope of this project?  I'm guessing that would be a popular feature, so good for the community, good for the patch project and good for you...

Way outside.  It might be viable for PRACX, though.
?  The only reason I'm aware of for people needing to tab out is to take screenies, so I suppose he has a point that it's a graphics issue...  ISTR the reason's something about compatibility, so if you're working on W10 compatibility anyway...
Title: Re: PRACX v1.06 Release
Post by: Yitzi on September 24, 2015, 09:00:00 PM
Say, Mr. sequel-of-Plotinous,

Hey Yitzi - would fixing the no-tabout junk introduced in the GOG version so users of it don't have to find and implement the workaround be outside the scope of this project?  I'm guessing that would be a popular feature, so good for the community, good for the patch project and good for you...

Way outside.  It might be viable for PRACX, though.
?  The only reason I'm aware of for people needing to tab out is to take screenies, so I suppose he has a point that it's a graphics issue...  ISTR the reason's something about compatibility, so if you're working on W10 compatibility anyway...

It's not a graphics issue per se...but it deals with the program/system interaction, which is something I would guess PlotinusRedux probably knows how to handle, and I don't (at least not yet).

Also, PlotinusRedux, apparently changing the file name from terranx.exe to something else enables alt-tab, so that might help you figure out how to change it.
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on September 24, 2015, 10:58:29 PM
Plotinus and I found the fix for that a while ago. I think he included a little script in the installer to fix it (you just have to run a windows command with appropriate arguments).
Title: Re: PRACX v1.06 Release
Post by: Buster's Uncle on September 24, 2015, 11:18:46 PM
;b;  Is that in a changelog or instructions or anything?  I haven't had a look.
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on September 24, 2015, 11:59:50 PM
The PRACX installer should do it automatically. The GOGwiki also has instructions here: http://www.gogwiki.com/wiki/Sid_Meier's_Alpha_Centauri#Restoring_Alt.2BTab_support (http://www.gogwiki.com/wiki/Sid_Meier's_Alpha_Centauri#Restoring_Alt.2BTab_support)
Title: Re: PRACX v1.06 Release
Post by: Lxndr on October 03, 2015, 02:25:42 PM
A missing Icons.pcx update will cause all kinds of wrong looking things, like what Neville posted, but it wouldn't cause a crash like you're experiencing, Lxndr.  You're probably running into a Win 10 incompatibility that I really am going to get to at some point.

I had a feeling, but I figured I'd cover all my bases.
Title: Re: PRACX v1.06 Release
Post by: justinlee999 on October 23, 2015, 10:37:34 AM
Is there any way to disable the Tab button for windowing the game? I'd like to alt+tab without having it windowed every time I do it.
Title: Re: PRACX v1.06 Release
Post by: xerkon on October 28, 2015, 12:33:33 AM
Hey, PlotinusRedux!  Registered here just to say Thanks for such an awesome patch!  Makes playing SMAC easier than ever!   :D
Title: Re: PRACX v1.06 Release
Post by: Nevill on October 30, 2015, 09:57:57 AM
PlotinusRedux,

Is it possible to enable mouse wheel scrolling in the add unit/technology windows in map editor (the one that open by Ctrl+F1/F2 etc)? Currently it zooms the man in or out, but does not scroll the menu.
Title: Re: PRACX v1.06 Release
Post by: Doux2222 on November 02, 2015, 08:56:53 PM
Thanks for an AWESOME patch!

I have two issues, that might be known already but I just arrived here:

1) The mini-map rectangle does not move with my scrolling. I can, however, click anywhere on the map and the rectangle will re-center there. Sometimes the rectangle disappears altogether.
2) My movies don't play (f.i. intro movie at start of game).

I am using Yitzi's patch 3.4 w/ PRAX 1.06, and tested the above two problems by using the [PRAX] disable=1 line in the .ini.

Again, thanks for all the great work!
Title: Re: PRACX v1.06 Release
Post by: valmanwe on November 11, 2015, 02:13:52 AM
First of all thanks for making this great mod, I'm now spoiled with right-mouse map scrolling. I also noticed the minimap rectangle disappearing and behaving oddly but honestly it barely even registers for me while playing so the issue is easily ignored.

I wanted to share my experience with PRACX since problems with the movies seem to be common, and after much headache-inducing trial and error I found a solution that gets (got) them working for me (temporarily) on XP SP3.

At first I had no issues with movies, then one day for no discernible reason (no hardware changes or anything that should mess up an SMAC installation) I start to have issues; for some reason it started taking ~3 minutes just to load the intro movie, and even then it had no video most of the time, just sound. In the course of troubleshooting I switch back and forth between my native desktop resolution and 1600x1200 (I play in 4:3 so the movies aren't stretched); for some reason doing that a few times (changing res, load game, exit, change res again, repeat) jogs something loose and gets the movies working again, with no long load times. If you are unlucky enough to be having movie issues, try my trick and see if it does anything for you.

Scratch that, after a week or so of problem-free operation the problem is back, and my trick doesn't work now. The first time this happened it actually started working again after I loaded up vanilla SMAC (without PRACX); the next time I started SMAX+PRACX it worked flawlessly. That trick doesn't help now either. I even tried disabling DEP for the playuv15.exe; no help.

Incidentally the intro is fine (albeit still taking ~3 minutes to load instead of starting instantly as it normally would) if I go directly into windowed mode at the welcome screen, however in-game performance is very poor in windowed mode (everything is sloooow).

Guess I'll check back in if it starts working again! It is rather maddening.
Title: Re: PRACX v1.06 Release
Post by: alphabeta on February 16, 2016, 09:31:10 PM
This is very cool.

One small issue I noticed (using Yitzi's w/pracx 1.06).  When you start the game, it goes into full screen, no problem.  Then you press tab, it reinitializes the display and goes into window mode.  The problem:  it ignores/resets Windows 7's (dunno bout other versions) color calibration, setting it back to default.  This also happens if you start the game and just quit while still in full screen mode - the display re-inits and the calibration is lost.

This does not happen with the original non-pracx'ed game, or with pracx set to disabled via the ini (and DirectDraw=0).

I've tried various things, trying to use the video driver's color correction, some utilities to make it stick, etc, but none seem to work properly.  After running, it becomes necessary to load up the Control Panel applet and re-do the calibration or cycle it through Color Management.

Not a big deal, obviously.  Just a minor pain.  If you can't narrow down why the display cycling seems to grab ahold of Win's settings, maybe you could just put an ini option to start the game in windowed mode and not do the init/cycle at all?  I wouldn't mind that option anyways, hehe.

Thanks for the work, it's very cool to see new stuff like this!
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on February 17, 2016, 10:32:28 AM
Not a big deal, obviously.  Just a minor pain.  If you can't narrow down why the display cycling seems to grab ahold of Win's settings, maybe you could just put an ini option to start the game in windowed mode and not do the init/cycle at all?  I wouldn't mind that option anyways, hehe.

Are you sure that PRACX doesn't already have an option to start in windowed? It would be in PRACX's config file, not the standard .ini, if I recall correctly.

Unfortunately, PlotinusRedux isn't very active at the moment, so I wouldn't hold your breath for a new release. The source code is available to make any of these changes yourself, though.
Title: Re: PRACX v1.06 Release
Post by: alphabeta on February 17, 2016, 11:48:40 AM
Are you sure that PRACX doesn't already have an option to start in windowed? It would be in PRACX's config file, not the standard .ini, if I recall correctly.

Unfortunately, PlotinusRedux isn't very active at the moment, so I wouldn't hold your breath for a new release. The source code is available to make any of these changes yourself, though.

I gathered, but I thought I should at least report the issue.

I've read through this and other threads, and looked at the files included with the mod, I don't see any PRACX config file.  There's just the additional lines in the alpha centauri.ini file, and I see no option there for starting in windowed mode.

I'll have a look at the source code, found since you mentioned it being available.  Course, I havent updated my Visual Studio since 2005 lol... but we shall see!

Title: Re: PRACX v1.06 Release
Post by: DrazharLn on February 22, 2016, 04:58:19 PM
Thanks for reporting, for sure.

I could be wrong about the config file - not using windows at the moment so can't confirm.

Good luck with the source! It should build in the latest free version of VB.
Title: Re: PRACX v1.06 Release
Post by: thedarkestcolors on February 25, 2016, 02:06:34 PM
I find scrolling behaviour a bit strange. Without Pracx when I put the mouse on the borders it immediately scrolls continously that direction. Now with Pracx when I put the mouse towards the border nothing happens until I remove the mouse from the border, then suddenly it does one big jump into uncharted territories. If I change the max Scrolling distance, the jumps become more reasonable, but the long delay before anything happens remains. (Its like the game freezes, all animations are halted when the mouse hits the border until I remove the mouse again.
--> is this intended behaviour (to facilitate long distance scrolling?)
I'm running SMAC/X under WINE in Ubuntu, that could be the cause if this is not intended behaviour.

I tried to fiddle a bit with the settings, but the best I have come up with so far is disabling borderscrolling completely. (I have to restart the game for any changes in PRACX settings to take effect.)

Is there any way to get Vanilla Scrolling behaviour back?

Otherwise its an awesome addition to the game.

Title: Re: PRACX v1.06 Release
Post by: Lxndr on February 26, 2016, 01:04:54 AM
I'm still experiencing the issue I reported several months ago, last august.  Without PRACX disabled in the ini, terranx.exe crashes
Title: Re: PRACX v1.06 Release
Post by: Kurvivor on March 20, 2016, 02:54:54 PM
Due to some events i have to use my laptop again, and once again i experience crashes when i run patched executable
What should i attempt to get it running?
Here is a link to a srash dump file
https://drive.google.com/file/d/0BySU5-Guxi7QOUNqZUgwZXhCM1U/view?usp=sharing (https://drive.google.com/file/d/0BySU5-Guxi7QOUNqZUgwZXhCM1U/view?usp=sharing)

I have Windows 10 installed, by i have experienced the same problems with windows 7 on same hardware before.
Version i am running: GOG SMAX, with patch v1.06 over it

Consequently, i am unable to do my turns in timely manner
Title: Re: PRACX v1.06 Release
Post by: Lxndr on March 20, 2016, 03:07:55 PM
Kurvivor: That looks like the same thing I'm running into.  the only work-around I've discovered is to disable PRACX. 

Open up Alpha Centauri.ini in the same folder that you have terranx.exe installed. and insert "Disabled=1" into the [PRACX] section (or if there's already a Disabled, set it =1).
Title: Re: PRACX v1.06 Release
Post by: Kurvivor on March 20, 2016, 03:36:10 PM
Thanks you very much!
That helped
Title: Re: PRACX v1.06 Release
Post by: justinlee999 on April 20, 2016, 01:56:39 PM
Is there any way to disable the Tab button for windowing the game? I'd like to alt+tab without having it windowed every time I do it.
Anyone? Sorry if someone replied but I'm not finding anything about this.
Title: Re: PRACX v1.06 Release
Post by: Buster's Uncle on April 20, 2016, 02:04:34 PM
Does the renaming terranx.exe trick work with PRAX?
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on April 21, 2016, 01:56:32 PM
@justinlee,

I've built a new version of PRACX that doesn't window the game when you press tab. The installer is attached to this post.

Edit: See next post, issue wasn't quite fixed.

@lxndr,

I can reproduce the terranx.exe not starting when patched with PRACX bug. I'll try to work out how to fix it.

@BUncle,

Renaming terranx.exe is to get alt-tab to work in the gog version (because gog disabled it with sdb). The PRACX installer enables alt-tab for you anyway.
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on April 21, 2016, 04:31:18 PM
@lxndr, Kurvivor

Try installing Yitzi's patch 3.3, then re-installing PRACX. That works for me, whereas installing PRACX over vanilla terranx gives an access violation error.

That suggests that:
1) The error is not particular to Win10
2) At some point the unofficial patches changed some chunks of code from executable to data. Probably in scient's original patch.

@justinlee999,

The installer I gave earlier stops Tab from making the game windowed, but alt tab still puts the game into a windowed mode for me.

The version attached to this post fixes that issue and allows alt+enter to toggle windowed/full-screen modes.

Changelog:

Quote
v1.07 (04/21/2016)
==================
* No longer becomes windowed when window loses focus.
* TAB no longer toggles windowed/full-screen.
* ALT+ENTER now toggles windowed/full-screen mode.
--DrazharLn
Title: Re: PRACX v1.06 Release
Post by: alphabeta on April 21, 2016, 08:10:08 PM
Interesting!  As a bonus, doing Yitzi's 3.3 + your PRACX 1.07 also stopped my issue with windows 7 losing its colour calibrations.

So, thanks for that!  Plus its nice to have normal tab key behaviour.
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on April 21, 2016, 10:04:25 PM
Happy to help, alphabeta :)
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on April 22, 2016, 12:42:58 AM
I find scrolling behaviour a bit strange. Without Pracx when I put the mouse on the borders it immediately scrolls continously that direction. Now with Pracx when I put the mouse towards the border nothing happens until I remove the mouse from the border, then suddenly it does one big jump into uncharted territories. If I change the max Scrolling distance, the jumps become more reasonable, but the long delay before anything happens remains. (Its like the game freezes, all animations are halted when the mouse hits the border until I remove the mouse again.
--> is this intended behaviour (to facilitate long distance scrolling?)


This is not intended behaviour.

Quote
Is there any way to get Vanilla Scrolling behaviour back?


I don't understand the code well enough to do that for you. The source is available here, though: http://alphacentauri2.info/index.php?topic=14811.msg65877 (http://alphacentauri2.info/index.php?topic=14811.msg65877)
Title: Re: PRACX v1.06 Release
Post by: Buster's Uncle on April 22, 2016, 03:02:18 AM
...Why not Yitzi's 3.4 patch, BTW?
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on April 22, 2016, 11:07:15 AM
Yitzi included PRACX in his 3.4 patch, but he didn't do it quite right (didn't package Icons.pcx with it, maybe other things).

Probably PRACX will work over the top of 3.4, or Dio's patch or whatever as well, but I didn't bother testing last night.
Title: Re: PRACX v1.06 Release
Post by: thedarkestcolors on April 22, 2016, 06:44:26 PM
I don't understand the code well enough to do that for you. The source is available here, though: http://alphacentauri2.info/index.php?topic=14811.msg65877 (http://alphacentauri2.info/index.php?topic=14811.msg65877)


Yey, thanks!!! :)
I'll have a look at it soon.
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on April 22, 2016, 11:49:44 PM
I'm not sure if it's possible to build it on gcc, but it's easy enough with visual studio.

I'll post the source to my v1.07 in the source code thread too.
Title: Re: Pracx v1.06 Release
Post by: Buster's Uncle on April 22, 2016, 11:56:34 PM
Do post this to Downloads...
Title: Re: PRACX v1.06 Release
Post by: DrazharLn on April 23, 2016, 12:46:40 AM
@thedarkestcolors,

I was able to reproduce your freeze on scroll behaviour for the top and bottom bounds only with PRACXv1.06/7+yitzi3.3/4.

Looks like it's not a wine issue, so could well be easy to fix.

@BUncle,

Uploaded now.
Title: Re: PRACX v1.06 Release
Post by: Buster's Uncle on April 23, 2016, 12:53:26 AM
;b;

Add a description to the CNN thread?
Title: Re: PRACX v1.07 Release
Post by: DrazharLn on April 23, 2016, 12:13:32 PM
@BUncle,

Link? I don't know where that thread is. Also, this is a very small update. It doesn't need a big fuss made of it.
Title: Re: PRACX v1.07 Release
Post by: Buster's Uncle on April 23, 2016, 03:25:54 PM
http://alphacentauri2.info/index.php?topic=17837.msg92132#new (http://alphacentauri2.info/index.php?topic=17837.msg92132#new)

It needs to say what you've done, anyway.  I was sorta planning to make a big fuss of it, besides - gotta be always promoting the forum...
Title: Re: PRACX v1.07 Release
Post by: DrazharLn on April 26, 2016, 01:33:59 AM
Updated. Still a bit  ;santi;, though.
Title: Re: PRACX v1.07 Release
Post by: Buster's Uncle on April 26, 2016, 01:36:06 AM
 ;b; That'll do - I'm going to push this on Facebook, and people would ask...
Title: Re: PRACX v1.06 Release
Post by: justinlee999 on May 01, 2016, 11:51:57 AM
@lxndr, Kurvivor

Try installing Yitzi's patch 3.3, then re-installing PRACX. That works for me, whereas installing PRACX over vanilla terranx gives an access violation error.

That suggests that:
1) The error is not particular to Win10
2) At some point the unofficial patches changed some chunks of code from executable to data. Probably in scient's original patch.

@justinlee999,

The installer I gave earlier stops Tab from making the game windowed, but alt tab still puts the game into a windowed mode for me.

The version attached to this post fixes that issue and allows alt+enter to toggle windowed/full-screen modes.

Changelog:

Quote
v1.07 (04/21/2016)
==================
* No longer becomes windowed when window loses focus.
* TAB no longer toggles windowed/full-screen.
* ALT+ENTER now toggles windowed/full-screen mode.
--DrazharLn

This is awfully helpful of you, thanks a lot!
Title: Re: PRACX v1.07 Release
Post by: DrazharLn on May 01, 2016, 12:11:34 PM
You're welcome  :D
Title: Re: PRACX v1.07 Release
Post by: Lxndr on May 01, 2016, 04:42:24 PM
You're welcome  :D

I have/had Yitzi's patch installed since my previous complaint.  Just tried PRACX 1.07 (non-disabled) and I've managed to survive more than a few turns. Huzzah!

Now I just need to figure out how to disable that long video that plays upon startup.
Title: Re: PRACX v1.07 Release
Post by: Buster's Uncle on May 01, 2016, 05:05:42 PM
I don't remember how you do that, but it's a value in your alphax.txt and easy, IIRC.  Somebody will cough up details soon.
Title: Re: PRACX v1.07 Release
Post by: DrazharLn on May 01, 2016, 06:43:23 PM
Disable videos at startup:

Check "Alpha Centauri.ini". There's an option in the top section.

Glad to know it's working for you :)
Title: Re: PRACX v1.07 Release
Post by: Harpalus on May 06, 2016, 05:17:02 AM
I wasn't sure where to post this, but here seems like the best place to ask. Firstly, thank you kindly for the wonderful patches: it's appreciated.

I've been having a lot of trouble with movies. They play fine out of the game with playuv15.exe, but in-game they're rather "choppy": specifically, a small bottom portion of the video is shifted compared to the top part, and there's a small bit of visual stutter. The audio is fine. This is in Windows 10 x64. I installed from the original CDs, and I do have the expansion. I'm using Yitzi's newest patch and PRACX 1.07.

I've tried various Windows EXE "attributes": running it as administrator, with Windows XP compatibility, with a reduced color palette, and with "disabled DPI scaling". I added DirectDraw=0 to the ini file as per recommendations elsewhere (and the OP implies it still has an effect on the movies), but this didn't seem to do anything. Setting ForceOldVoxelAlgorithm to 1 didn't help. It also happens if I set my resolution to 640x480 in the PRACX section of alphax.txt. It doesn't happen with terran.exe, only terranx.exe. I'd test with a disabled PRACX by changing Disabled=<DEFAULT> to Disabled=1, but this prevents the game from loading.  I have an ATI card, if that's relevant. I installed to C:\Games, so Windows shouldn't be interfering at all.

Thank you kindly, again! Initially SMAC/X refused to run entirely on Windows 10 for me, but since installing Yitzi and PRACX it's been running perfectly smoothly with the exception of this one issue.
Title: Re: PRACX v1.07 Release
Post by: DrazharLn 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
Title: Re: PRACX v1.07 Release
Post by: Harpalus 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.
Title: Re: PRACX v1.07 Release
Post by: DrazharLn 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?
Title: Re: PRACX v1.07 Release
Post by: Harpalus 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.
Title: Re: PRACX v1.07 Release
Post by: DrazharLn 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.
Title: Re: PRACX v1.07 Release
Post by: Harpalus 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 (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.
Title: Re: PRACX v1.07 Release
Post by: DrazharLn 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.
Title: Re: PRACX v1.07 Release
Post by: Harpalus 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.
Title: Re: PRACX v1.07 Release
Post by: DrazharLn 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");
Title: Re: PRACX v1.07 Release
Post by: Harpalus 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.
Title: Re: PRACX v1.07 Release
Post by: DrazharLn 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.
Title: Re: PRACX v1.07 Release
Post by: Harpalus 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.
Title: Re: PRACX v1.07 Release
Post by: DrazharLn 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.
Title: Re: PRACX v1.07 Release
Post by: Harpalus 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.
Title: Re: PRACX v1.07 Release
Post by: Harpalus 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);
}
Title: Re: PRACX v1.07 Release
Post by: DrazharLn 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
Title: Re: PRACX v1.07 Release
Post by: Harpalus 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.
Title: Re: PRACX v1.07 Release
Post by: DrazharLn 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
Title: Re: PRACX v1.07 Release
Post by: Harpalus 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
Title: Re: PRACX v1.07 Release
Post by: DrazharLn 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.
Title: Re: PRACX v1.07 Release
Post by: Harpalus 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
Title: Re: PRACX v1.07 Release
Post by: DrazharLn 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.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn 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
Title: Re: PRACX v1.08 Release
Post by: treadstone 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.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle 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...
Title: Re: PRACX v1.08 Release
Post by: treadstone 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:
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 17, 2016, 01:53:26 AM
That sort of info is always the smart play for tech help...
Title: Re: PRACX v1.08 Release
Post by: treadstone 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.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 17, 2016, 02:47:11 AM
That sounds right, come to think of it.  Good job. ;b;
Title: Re: PRACX v1.08 Release
Post by: DrazharLn 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.
Title: Re: PRACX v1.08 Release
Post by: hilton on May 19, 2016, 04:19:58 AM
So I've decided to play SMAX again for a while, and figured I'd try some mods this time around. I've installed Yitzi's patch, but had to disable PRACX because it was causing crashes. I updated it to 1.08, but it made no difference. I have it disabled via the ini file, which has been sufficient to prevent the crashes.

I can play only a handful of turns before the game crashes. Reloading to continue has the same effect - usually (but not always) crashing at the same point. If it doesn't crash, then I can still only go a few turns.

I'd really like to enjoy playing with PRACX, but I obviously can't with the constant crashing. Any advice? Need any information?

PS. I also see quite a few graphical artifacts. Sometimes there are several-pixel-wide vertical lines in the middle of the map which appear to contain pieces of another part of the map. The white box on the mini-map does not seem to update as I move around; only if I center the map. And a few others I can't recall right now.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 19, 2016, 05:17:18 AM
I'll try and help.

Are you using the GOG version of the game?

What OS?
Title: Re: PRACX v1.08 Release
Post by: hilton on May 19, 2016, 08:10:31 AM
Yes, GOG version, Windows 7.
I could dig up my old install disks in the garage if GOG's version is the issue. They're buried somewhere, didn't want to go through the hassle. :P
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 19, 2016, 03:04:35 PM
Don't bother, GOG version is better. The graphics artifacts are interesting. Harpalus reported similar on an AMD card, do you know what your GPU is?

In case this is different from how you installed last time, you should clean install gog version, copy latest yitzi patch over then run the pracx installer.

If graphics artifacts are only in videos, that's fixable with a change to the ini file. If elsewhere, we'll have to do some more debugging.
Title: Re: PRACX v1.08 Release
Post by: hilton on May 19, 2016, 04:26:40 PM
Playing on a dual-video laptop. There is an nVidia GeForce GT520M on board, however it only kicks in when needed - SMAX runs on the Intel integrated video only. I did try forcing the GPU on when running SMAX, but it made no difference.

FYI, I downloaded a new copy (looks like I wasn't running the latest update - didn't know there was one). Just installed the full 2.0.2.23 version and added Yitzi 3.4 plus PRACX 1.08. Same results, unfortunately - a new game played a few turns but crashed in year 2111. It probably won't do any good, but I've attached the save file - game crashed consistently 5 times after moving the second scout that comes up. Doesn't matter which way I move them. Disable PRACX in the INI file and it continues fine from that point. I didn't notice any obvious artifacts during that run, but I wasn't really looking either.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 19, 2016, 05:15:16 PM
Save file was a good idea: I can reproduce the bug on my linux machine with Yitzi 3.4+pracx1.07. I'll try on windows and see about bug fixing in a bit.

Graphical glitches were probably caused by not using the latest gog patch.

Error from WINE:
Code: [Select]
wine: Unhandled page fault on read access to 0x02cbffff at address 0x5e076d (thread 004d), starting debugger...
Title: Re: PRACX v1.08 Release
Post by: hilton on May 20, 2016, 04:05:52 AM
I just ran it one more time to get you the following in case it helps you debug.
From Event Viewer -> Application:
Quote
Error / Application Error
Faulting application name: terranx.exe, version: 0.0.0.0, time stamp: 0x31313931
Faulting module name: terranx.exe, version: 0.0.0.0, time stamp: 0x31313931
Exception code: 0xc0000005
Fault offset: 0x001e0547
Faulting process id: 0x1164
Faulting application start time: 0x01d1b243a70102fe
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: f010f947-1e36-11e6-ae1c-02f022330901

Quote
Information / Windows Error Rerporting
Fault bucket 1997518084, type 1
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: terranx.exe
P2: 0.0.0.0
P3: 31313931
P4: terranx.exe
P5: 0.0.0.0
P6: 31313931
P7: c0000005
P8: 001e0547
P9:
P10:

Attached files:
C:\Users\acer\AppData\Local\Temp\WER6938.tmp.WERInternalMetadata.xml

These files may be available here:
C:\Users\acer\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_terranx.exe_46d7918f6c64bd967d65669ebef813a9e7296a_03f99fc2

Analysis symbol:
Rechecking for solution: 0
Report Id: f010f947-1e36-11e6-ae1c-02f022330901
Report Status: 0

I've attached the Report.wer file from the AppCrash_terranx.exe folder mentioned above as well, although it doesn't appear to have too much useful information in it.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 21, 2016, 11:05:33 PM
This doesn't cause a crash on my windows machine with pracx 1.07 or 8, strangely enough.

The report doesn't say anything useful to me.

Checking again on the linux machine, I get the crash moving the first scout, not the second. Maybe an unrelated bug, though they're both access violations.

Anyway, I can't run a debugger on SMAC in wine, and I'm not sure where the error is, so I'm not sure I can fix this. I'll PM Yitzi and ask him if he can help.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 22, 2016, 09:38:51 PM
v1.08 as a mod compatible with Ford's mod manager, or you can just extract it into your SMAC directory if you already have a PRACX compatible terranx.exe
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 23, 2016, 08:01:13 PM
I've collected some known issues with PRACX and some future features as guthub issues: https://github.com/DrazharLn/pracx/issues

If there's something you think's missing, comment here or open an issue there.

If you're experiencing some bug you can check it out there, too.
Title: Re: PRACX v1.08 Release
Post by: hilton on May 24, 2016, 05:54:06 AM
Sorry if these posts should have been in a separate thread. Maybe a mod can move them if need be.

After trying the game in safe mode and finding it DIDN'T crash, I spent some time trying different configurations to see if there is an external conflict. In the end, I narrowed down the crashing issue I've been having.

Believe it or not, it is resolution dependent.

With PRACX enabled, the game ONLY crashes at my laptop's native 16:9 resolution of 1366x768. It works fine at every other resolution from 1024x768 and up, including 1360x768.

(the above posted to github)

I have a short list of glitches and oddities I've noticed playing so far. Is the Github list complete, and do you want everything posted there, or should I post here first for you to review?
Title: Re: PRACX v1.08 Release
Post by: hilton on May 24, 2016, 08:07:30 AM
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 24, 2016, 10:08:58 AM
Thanks for the reports and suggestions.

Can confirm that on my laptop, the scout crash doesn't occur at 1280x1024.

City markers aren't significantly worse in PRACX than without, for me.

Confirm  view area marker, mouseover view bug

Can't confirm artifacts at 1280x1024. Maybe on another machine.

For unused tiles in city view: I agree transparency would be better, but the SMAC engine only supports drawing pcx files at the moment, and pcx only has a binary notion of transparency. I might get round to teaching SMAC to draw arbitrary pngs (mostly for the increased bit depth), but don't hold your breath :)
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 24, 2016, 10:42:11 AM
Added this stuff to the github issue tracker.

If I can confirm the resolution dependent hang bug on my windows machine, I'll do my best to debug it and try to push an update soon.

Some of the other issues shouldn't be too hard, either, so next time I feel like working on new features for PRACX I'll have a go at them.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 24, 2016, 10:45:43 AM
Occurred to me that I should test if SMAC crashes at 1366x768 with DirectDraw=0 (the older way of making SMAC play full screen), and it does.

So the bug is likely to be in the main SMAC code, not in PRACX. I'll still try to debug it.
Title: Re: PRACX v1.08 Release
Post by: hilton on May 24, 2016, 03:51:18 PM
Ah, that is unfortunate. Strange for it to screw up at that specific resolution, though - 1366x768 crashes while 1360x768 (just 6 pixels narrower) does not, nor does higher resolutions based on some of the screenshots I've seen.

It's mostly a non-issue for me now; I'm just leaving my laptop at 1360x768. My screen doesn't scale resolutions unless they're smaller than 720px high - all it does is lose me 3 pixels on each side of my screen and leave Windows complaining I'm not at my 'optimal resolution'. :)

What file has the nutrient/mineral/energy icons? I might try some experiments. Even making them darker might do it for me.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 24, 2016, 04:40:35 PM
It is pretty weird. Glad you found a work around, though :)

I'm fairly sure PRACX reads the grey icons from Icons.pcx. I think you have to stick to the baked in palette rather than 24bit RGB for everything to work, but I don't really know.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 24, 2016, 05:00:04 PM
Booting up to check for sure it's Icons.pcx.  -A lot of that kind of thing for SMACX ends up being in files I find not the obvious ones.

I modded that one for scient about a millilion years ago for a negative resources thing he's never gotten around to implementing, and don't recall ever doing anything else with since, but easy stuff if you know how to mod the game art.  Let me know if you run into problems, hil.



What you might want is in ter1.pcx, for the main game screen terrain resources  - Icons.pcx is just a few buttons, not the resources you see in base screen.  I'll keep looking and get back to you.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 24, 2016, 05:12:05 PM
Nah, not ter1.pcx. It's the income icons (1 apple, 2 apples, etc) we want, not the resource bonus icons.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 24, 2016, 05:24:34 PM
[ninja'd - Draz m'boy, you in my tech-house now.  Watch and learn.  ;) ;nod]

newicons.pcx for the base screen resources view.

Just in case you don't already know how to navigate the palette issues, you need to open it twice and do all the work in one copy you'll paste overtop the untouched one to save.  In GIMP, first thing with the working copy, Image>Mode>RGB, then Layer>Transparency>Add Alpha Channel, finally, Fuzzy Select Tool w/ Threshold: turned down to 0>click on the background pink>delete.  Now you can begin fiddling with the brightness of individually-selected parts (box-select the resource icons one row at a time or all together but you probably don't want to do that to everything in the entire file at once) and copy/paste the whole thing once you're finished into the untouched copy and save.

Some of those hoops aren't necessary to jump through in Photoshop, but I'd have to refresh my memory which - all are in GIMP.  Working with the indexed format of .pcx files and the limits of the SMACX palette is a bit of a pain, but no big deal for what you want -note that minor enough changes in shade and hue will default back when you paste into the original palette of the untouched copy, so you might have to do a bit of trial and error and playtesting. 

-If you decide to completely replace anything, it's a little more complicated, but I'll talk you through it, no problem.  The shade adjustment you propose ought to cover the originals fine without a glitch.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 24, 2016, 06:24:28 PM
It's not newicons.pcx for this case. Hilton's talking about the greyed out icons that Plotinus added to the base view.

Proof attached.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 24, 2016, 07:55:15 PM
I had a bit of a look at the assembly code that's causing the crash at 1366x768, but I can't see what's going wrong. One of the .exe modders might be able to help, so I'll post a new thread for that.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 24, 2016, 08:30:37 PM
Wow.

There's some room for improvement, there.  Give me the right file, PRAX version, so I don't have to root for it and let's see what we can come up with that's a little better-looking for future upgrades.  I'm serious, if those black outline things weren't shooped in when the red letters were added.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 24, 2016, 08:40:22 PM
Heh, the black outlines are just badly drawn Ds. Check out the Icons.pcx attached to the last post.

Clean PRACX version attached here.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 24, 2016, 08:52:00 PM
Why in the world did he make everything murky blue?  Suggestions about that?

I can make it absolutely anything that fits in the boxes and the palette allows...
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 24, 2016, 09:04:20 PM
You clearly haven't looked at my customised version yet. I leave these little jokes for you, and you just ignore them.

So rude.

I imagine Plotinus was going for the standard UX convention of greying out interface elements that are off/disabled. I think it works reasonably well.

I don't think we want anything fancy, just the same as newicons.pcx, but clearly and elegantly indicated as unused. I think monochrome and greyish is fine. Feel free to experiment with different solutions, though.

Hilton's suggestion of a darker "grey" isn't such a bad idea. Just has to be visible enough on all the different terrain types.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 24, 2016, 09:14:14 PM
I did, too - it was already open and I just didn't notice the joke, assuming you'd marked it up previously for something else.  I have bathed this month and put on a clean shirt yesterday - I just checked and think I smell fine.

Multitasking and going to have to go AFK to start supper soon, but I'll do something simple to make it more obvious -probably lighten them but add a thin(ish) black outline- and post before I go to bed.  I may try several things.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 24, 2016, 09:18:07 PM
;b;
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 25, 2016, 04:06:43 AM
[ninja'd - Draz m'boy, you in my tech-house now.  Watch and learn.  ;) ;nod]

newicons.pcx for the base screen resources view.

Just in case you don't already know how to navigate the palette issues, you need to open it twice and do all the work in one copy you'll paste overtop the untouched one to save.  In GIMP, first thing with the working copy, Image>Mode>RGB, then Layer>Transparency>Add Alpha Channel, finally, Fuzzy Select Tool w/ Threshold: turned down to 0>click on the background pink>delete.  Now you can begin fiddling with the brightness of individually-selected parts (box-select the resource icons one row at a time or all together but you probably don't want to do that to everything in the entire file at once) and copy/paste the whole thing once you're finished into the untouched copy and save.

Some of those hoops aren't necessary to jump through in Photoshop, but I'd have to refresh my memory which - all are in GIMP.  Working with the indexed format of .pcx files and the limits of the SMACX palette is a bit of a pain, but no big deal for what you want -note that minor enough changes in shade and hue will default back when you paste into the original palette of the untouched copy, so you might have to do a bit of trial and error and playtesting. 

-If you decide to completely replace anything, it's a little more complicated, but I'll talk you through it, no problem.  The shade adjustment you propose ought to cover the originals fine without a glitch.
Correction: for Fuzzy Select Tool, read Select by Color Tool.  I'm only just now starting work, but the first one I want to try is a pretty easy job.  Stay tuned.
Title: Re: PRACX v1.08 Release
Post by: hilton on May 25, 2016, 04:36:38 AM
I do think a little darker grey would suffice. Or perhaps just outlines of the icon (apple, sun, diamond) with black-outlined grey numbers in the middle. To me, at least, the current light grey icons seem brighter than the green/blue/orange icons. They should be darker or more clearly not in use.

Another solution might be to keep the unused icons in COLOR, but draw over them with the fog of war graphic, either masked to the icons or the full tile.

PS. If it's possible I have one other request - when in base view I am always looking at the city size. Unfortunately it sometimes gets covered by the resource icons. Is it possible to have the game draw the city size icon in another location, maybe at the top left corner of the base tile view and doubled in size? :)
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 25, 2016, 04:43:42 AM
I'm drawing outlines right now, which is what's taking so long - the color/shading took minutes.  Once I'm done, changing what's inside the outline will be easy.  Stay tuned for the first draft before I go to bed...
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 25, 2016, 04:52:46 AM
Somebody playtest and get back to me.  I'll be here all week.

-Turns out the palette doesn't do true greytones; it'll be exactly what's displayed below, but dunno how that'll look in-game.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 25, 2016, 08:52:42 AM
Thanks, BU. I think that's too bright, though. We want it to fade into the background and not attract the eye.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 25, 2016, 09:11:44 AM
Screenies.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 25, 2016, 12:37:28 PM
Okay - I totally misunderstood the point, them.  I wondered why y'all thought darkening the dull things would make them show up better.  I'll do something else and post.  Making them all brownish might be the thing.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 26, 2016, 11:52:41 PM
Sorry to have taken so long - things have been crazy.

First new version to playtest:
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 26, 2016, 11:56:45 PM
Screenie.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 26, 2016, 11:59:03 PM
Is that good?

Having technical problems saving a version run through Photoshop for testing.  Hold on...
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 27, 2016, 12:00:24 AM
Try this - same except I think I turned all the black back to semi-transparency.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 27, 2016, 12:00:32 AM
I'm afraid I probably still prefer Plotinus' originals. These are better than the first bright ones, though. They just still seem too bold somehow.

What do you think?
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 27, 2016, 12:02:46 AM
Beats me.  This version I made them a little brown.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 27, 2016, 12:03:10 AM
I can't see any difference between this and the last one  :-\
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 27, 2016, 12:05:20 AM
Brown version I like. Will look weird for sea bases, of course...
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 27, 2016, 12:06:54 AM
This time at sea. Actually looks alright. What do you think? Better than plotinus originals or not?
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 27, 2016, 12:14:18 AM
...Unmistakable that they're turned off, if you know what's going on.

I have something strange going on with my machine, and I think I better reset.  Track down the hacker and kill him if I don't come back...
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 27, 2016, 01:13:07 AM
Well, resetting seemed to fix.  Anything else to try?

I have one more idea...
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 27, 2016, 01:17:40 AM
See if this one works...

-Also?  It's 1:18 there, isn't it?  Go to bed.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 27, 2016, 01:33:49 AM
I thought about putting transparent lines on them, but this looks a lot better than I thought it would :)

Just needs to be a bit more visible on land tiles.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 27, 2016, 01:43:48 AM
Hmm.  I'll take the color back out...

Hold on.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 27, 2016, 01:50:00 AM
Try this.  I can't think of any color in particular that would show up everywhere, or I'd try that.  A bright enough green?
Title: Re: PRACX v1.08 Release
Post by: hilton on May 27, 2016, 05:17:34 AM
Have time to try my other suggestion? I don't have time to do it myself right now.

Rather than dark grey, make the icons black outlines only, with the number being dark grey w/ black outline.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 27, 2016, 09:51:53 AM
I think this one works well. A bright green or similar would be a terrible idea!

Hilton, I forgot or didn't read that idea. Might be a good one.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 27, 2016, 09:54:39 AM
Found out why the images from my laptop are turning out so horrible: SMF is automatically downscaling them and converting to jpg :(
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 27, 2016, 12:29:08 PM
Okay.  I like that one.

hil, I didn't understand outlines only; I'll try that later.
Title: Re: PRACX v1.08 Release
Post by: hilton on May 27, 2016, 04:02:42 PM
Yeah in earlier posts I suggested outlines only so you can see terrain behind, and later suggested a fog-of-war effect which is what you did with this last one. I like that one, going to try it.
Title: Re: PRACX v1.08 Release
Post by: hilton on May 27, 2016, 04:28:03 PM
Played a few turns with that last one (fog-of-war effect), it's definitely a huge improvement in my eyes! Might end up being the best option, I will definitely be keeping it on hand to use on future updates if DrazharLn chooses not to incorporate it. :)

Thank you BUncle and DrazharLn!
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 27, 2016, 05:24:29 PM
Thanks, BUncle. I'll add this to the next PRACX release.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 27, 2016, 05:36:38 PM
Let's try the outlines, first.  Booting up Photoshop because background transparency issues...
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 27, 2016, 06:28:42 PM
See how this one strikes you...

-It might be feasible to combine with every other row inside the outlinelines...
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on May 27, 2016, 09:36:06 PM
I don't like it as much, but thanks for the effort.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 27, 2016, 09:42:23 PM
I don't know - that looks about equal to the alternate-lined version, to me.

Well, PRAX users can call it; I think outlined combined with every other line inside would be too much, so I'm probably done, here.
Title: Re: PRACX v1.08 Release
Post by: hilton on May 28, 2016, 07:21:15 PM
BUncle,
After playing with both for a bit I think I prefer the fogged/scanlined version for play. Thank you very much for your efforts.

There may be slight room for improvement. I've noticed the following:
I actually wonder if keeping the scanlines on the icons as they are, but making the numbers solid again might work out well. Even the easy-to-identify numbers can be difficult to see on certain bright/colourful terrain types (over kelp, farms when there are 3 icons, solar collectors, tidal harnesses, etc.)
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 28, 2016, 08:22:50 PM
I'll have another look to see if one of the icon rows is out of synch; otherwise, there IS no practical fix for the scanlines lining up -I did all of them at a stroke; your problem may be the game's placement of the icons- unless you can talk an .exe modder into running down the placement code and adding the machine code equivalent of an IF/THEN statement to the vertical coordinates formula to do only even or odd.

Numbers, I can think of a couple things to try to make more visible.  -Maybe put the icon-type color back in the numbers for improved info on single-resource squares...
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 30, 2016, 07:44:10 PM
Embarrassed to not have gotten to this a lot sooner, but the mineral row was indeed rowed out of synch with the other two, so I started over with Plot's originals and scanlined the rows separately and made the numbers white.

See how this sucker works out in-game.
Title: Re: PRACX v1.08 Release
Post by: hilton on May 31, 2016, 06:46:25 AM
I like it. The white numbers are much better in my opinion - despite being scanlined, they are readable against every terrain. I ran through all my current game's cities and the only spot I couldn't 100% clearly see the number was the 3-mineral against a mine, but even it was really obvious. The top part of the '3' blended with the white parts of the mine, but the entire bottom half of the '3' was clearly visible so there was no mistaking it.
Title: Re: PRACX v1.08 Release
Post by: Buster's Uncle on May 31, 2016, 02:04:26 PM
:D  I thought white would work.  It was sort of squint-and-lean-in legible before - just needed a boost.
Title: Re: PRACX v1.08 Release
Post by: hilton on June 03, 2016, 06:53:22 AM
Can I make two feature requests for PRACX?

- Another zoom level between normal and the next zoom out. There are only two zoom out levels (on my system at least) versus 3 zoom in levels; each of the zoom out levels feels like too big of a jump, especially in comparison how little zoom in moves in. I'd like at least one more step added that isn't quite as zoomed out.
- Real time updates on minimap click-drag. Would like to be able to survey by click-dragging around the minimap and having the world map move with it.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on June 03, 2016, 08:56:29 AM
Number of zoom levels is already configurable. Open the PRACX menu in game.

Minimap thing sounds sensible. Feel free to add it to the github issue tracker and I'll try to get round to it sometime - unfortunately these conceptually easy things are often quite difficult.
Title: Re: PRACX v1.08 Release
Post by: hilton on June 03, 2016, 04:14:11 PM
It shouldn't be too difficult. SMAX already has a drag handler (used for issuing Goto commands by mouse); on the assumption that the handler is available on all the in game objects, it would theoretically be as simple as issuing a map re-center call on mouse move if button is being held down instead of just on click.
I'll add it to Github.

One more request: Show base grid when hovering over the city. The game already does this full time, of course, but it blends city outlines, making it difficult to see what tiles a city actually covers when there are many cities clumped together. I find myself constantly counting squares when terraforming. Should be a different colour than the red used now, i.e. pop up an orange outline. Should work on ALL cities, not just the player's.
Bonus points if you can make it shade squares that are unavailable to the city (being worked by a crawler or another city). Understandable if that part will not show up for opponent cities, but if that is the case, more bonus points if you can make it so it DOES work on Pact opponent cities. :)
Title: Re: PRACX v1.08 Release
Post by: Vox Imperatoris on October 31, 2016, 12:16:11 AM
It should be mentioned that this mod doesn't work unless you delete the Alpha Centauri.ini file.

At least, that's what I had to do. Before then, the PRACX menu would simply not show up, nor would any of the options work.

You might want to add this to the installation guide. It took me quite a while to troubleshoot this!

Edit: actually, it appears this had to do with Yitzi's mod: looks like it disables PRACX in the settings by default!
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on October 31, 2016, 12:49:50 AM
:(

Thanks for bringing this to my attention. I'll put a note in the OP.
Title: Re: PRACX v1.08 Release
Post by: Vox Imperatoris on October 31, 2016, 08:29:34 AM
Thanks.

Also, does this mod break the secret project videos? I haven't been getting them since I've installed it. (It could be Yitzi's patch, though.)

Is there any way to get this mod working with the videos? I do enjoy having them.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on October 31, 2016, 06:14:21 PM
The secret project videos should work fine, though they're displayed by an external program. Check that you can view the videos in /movies/ with /movies/playuv15.exe

'opening.wve' is the intro movie and is safe to watch without spoilers.

To play it, open a command prompt in the movies directory (Shift+rightclick), then run 'playuv15.exe -software opening.wve'
Title: Re: PRACX v1.08 Release
Post by: Vox Imperatoris on October 31, 2016, 07:21:49 PM
The secret project videos should work fine, though they're displayed by an external program. Check that you can view the videos in /movies/ with /movies/playuv15.exe

'opening.wve' is the intro movie and is safe to watch without spoilers.

To play it, open a command prompt in the movies directory (Shift+rightclick), then run 'playuv15.exe -software opening.wve'

Okay...so the player works fine when I try that.

But the movies don't play at all (except for the opening, oddly enough! never mind, the opening doesn't play, either) in version 1.08 in the actual game.

Even going to the scenario editor and directly selecting a project movie to play doesn't work. It doesn't even "try" to load anything.

The funny thing is: it works just fine in the version included with Yitzi's 3.4, which I believe is...PRACX 1.06? Have you made sure they work in the latest version? What OS are you using (I'm on Windows 10)?

I appreciate your help, and I'd like to troubleshoot this so it works properly in the latest version.
Title: Re: PRACX v1.08 Release
Post by: Vox Imperatoris on October 31, 2016, 07:37:36 PM
I fixed it!

Sorry to have taken up your time with this.

It seems to have been another mysterious incompatibility with the "Alpha Centauri.ini" file changing its format between versions. After I deleted it and allowed it to regenerate, the movies worked properly. (And no, they weren't simply disabled in the preferences menu!)
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on October 31, 2016, 09:31:02 PM
Thanks for reporting these issues. I'll try to get them fixed in Yitzi's releases.
Title: Re: PRACX v1.08 Release
Post by: Vox Imperatoris 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.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn 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.
Title: Re: PRACX v1.08 Release
Post by: Quinch 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?

Title: Re: PRACX v1.08 Release
Post by: DrazharLn 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
Title: Re: PRACX v1.08 Release
Post by: Quinch 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.
Title: Re: PRACX v1.08 Release
Post by: DrazharLn 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.
Title: Re: PRACX v1.08 Release
Post by: Daemonjax 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?
Title: Re: PRACX v1.08 Release
Post by: DrazharLn 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 :) )
Title: Re: PRACX v1.08 Release
Post by: Daemonjax 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.


Title: Re: PRACX v1.08 Release
Post by: deadgrunt 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?
Title: Re: PRACX v1.08 Release
Post by: dino 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.
Title: Re: PRACX v1.08 Release
Post by: deadgrunt 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
Title: Re: PRACX v1.08 Release
Post by: DrazharLn 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 :)
Title: Re: PRACX v1.08 Release
Post by: DrazharLn 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!
Title: Re: PRACX v1.08 Release
Post by: DrazharLn on July 05, 2017, 05:08:00 AM
@Daemonjax,

New release: https://github.com/DrazharLn/pracx/releases/tag/1.09

Changes: https://github.com/DrazharLn/pracx/commit/35d76cb23e4c922ed6fb59fe113a23cd0c1f28d1#diff-2
Title: Re: PRACX v1.09 Release
Post by: DrazharLn on July 05, 2017, 05:14:06 AM
I had to change compiler for this build for boring reasons. I'd appreciate if someone checked that the patch still works on old systems.
Title: Re: PRACX v1.09 Release
Post by: Quinch on July 10, 2017, 01:50:21 AM
No idea about older systems, but this might be useful - on Windows 10 x64, running in W7 compatibility mode, the patch will let the game start, however, it is impossible to switch to the game window. I poked around the .ini file and turns out that setting the width and/or height values to something other than <default> fixes it. Not sure which one {or all} specifically, I stopped fiddling once it worked.

That said, thanks for the patch! Makes the game a lot easier to survey!
Title: Re: PRACX v1.09 Release
Post by: DrazharLn on July 10, 2017, 12:53:59 PM
Thanks for testing. Could you clarify what exactly you mean by "it is impossible to switch to the game window"?

Do you mean that you can't switch *from* the game window?

If I press alt+tab, I get the task switcher appearing, but SMAC keeps focus. Compatibility mode doesn't seem to matter.

alt+enter switches SMAC to windowed mode and it can be task switched in that state.
Title: Re: PRACX v1.09 Release
Post by: Quinch on July 10, 2017, 03:18:23 PM
Nope, into. It shows up on the taskbar, but clicking on it, or even trying to switch to it from the task manager doesn't do anything.

Edit: Oh, maybe it bears mentioning, I installed PracX on top of Yitzi's patch. Might need to test different combinations a bit.
Title: Re: PRACX v1.09 Release
Post by: Quinch on July 11, 2017, 02:42:08 AM
Did a bit of trial and error stuff - posted my findings thissaway;

http://alphacentauri2.info/index.php?topic=19602.msg106292#msg106292 (http://alphacentauri2.info/index.php?topic=19602.msg106292#msg106292)
Title: Re: PRACX v1.09 Release
Post by: Seeker8 on July 13, 2017, 08:19:38 PM
Hi, I'm having a really weird problem with PRACX. I hope someone can help because this is a great mod.

The game keeps pausing, like when the AI is moving after every unit moves by one tile the game stops until i press a key or move the mouse, this keeps happening after every one tile move of a unit. If i hold in a key or keep moving the mouse the computer takes it's turn normally, although sometimes the screen goes white and crashes also. When moving my own units more than one tile it also moves slowly.

I tried reinstalling the whole game a few times but same thing happens only after i install this mod.

It used to work fine but i think it started happening after windows 10 last update which i kept delaying but it forced me to make. :mad:

My laptop is quite powerful and can run the game easily so i'm quite sure it's not performance issue.

Anyone ever came across this or have any idea what's causing it?
Title: Re: PRACX v1.09 Release
Post by: Buster's Uncle on July 13, 2017, 09:40:25 PM
I've been getting that sporadically, lately - in completely unpatched SMAX.
Title: Re: PRACX v1.09 Release
Post by: DrazharLn on July 13, 2017, 10:15:07 PM
Seeker8, BUncle,

What version of PRACX are you using and did you upgrade PRACX before the pausing started?

Is your cursor near the edge of the screen when the game is paused? There's a known issue where if the cursor is off the playable area or in a place that causes scrolling, the rest of the game is paused.

If you're not on the latest version of PRACX, please update to the latest version and check the issue still occurs.

Seeker8,

What other patches (and their versions) are you using? And is this occurring in SMAC or SMAX?
Title: Re: PRACX v1.09 Release
Post by: Buster's Uncle on July 13, 2017, 10:32:47 PM
No PRAX at all for me - seems to be just a SMAX thing - like he said, started about a month ago...  -Also, a general sluggishness about pathfinding in the middle of a turn unless you pump a button of move the cursor around.  It was worse at first.
Title: Re: PRACX v1.09 Release
Post by: DrazharLn on July 13, 2017, 11:10:57 PM
I see.

Seeker8, could you do the stuff in my post above and also try with PRACX disabled in the .ini and see if this keeps happening?

If it does, I'll write some logging code and give you a special debug build that you can run and I'll try to find the issue.
Title: Re: PRACX v1.09 Release
Post by: Seeker8 on July 14, 2017, 12:04:59 PM
I was using version 1.08 for ages and it worked fine, then it suddenly just started happening, i didn't change anything in SMAC.
i just noticed there is a 1.09, so i installed that but the same thing is happening.

No, cursor is not at edge of screen.

It's occurring in SMAC and SMAX. I have gog version which i think said version 5 when i checked the version with nothing else installed, i followed this advice from another web site:"In that case you want to install the SMAC 4.0 patch (you don't need the earlier patches),
the Windows 2000/XP update and scient's unofficial 1.0 patch (in that order)." I also installed Kyrub's patch.
But i've tried the game after every patch and it only happens after i install PRACX.

When i disable PRACX in the .ini file SMAC and SMAX are working fine again.
Title: Re: PRACX v1.09 Release
Post by: Seeker8 on July 14, 2017, 12:55:13 PM
Actually, after playing for about 30 minutes with PRACX disabled the problem is starting to happen more with each turn, at first it was fine, whereas with PRACX enabled it happened insantly. So it seems PRACX just makes the problem worse but still happens when it's disabled.
Title: Re: PRACX v1.09 Release
Post by: Seeker8 on July 14, 2017, 05:42:24 PM
Very confusing. I installed Yitzi's patch earlier and then played my game on SMAX for about an hour and it worked fine with PRACX disabled then as soon as i enabled PRACX it crashed.

I'll keep playing it with PRACX disabled and see if it keeps working fine.
Title: Re: PRACX v1.09 Release
Post by: gwillybj on July 15, 2017, 04:23:57 AM
That movement delay seems to me to have started with the Win10 Creators Update. I can't get rid of it in any configuration of SMAX, without and with patches. I have to move the mouse a smidge to get the unit to move.
I can't get the Move To line to show up, either. The cursor changes to the yellow arrow okay, so when I release to mouse button the unit acknowledge the order.
Title: Re: PRACX v1.09 Release
Post by: DrazharLn on July 15, 2017, 01:01:40 PM
What version of windows are you all on?

https://www.howtogeek.com/236195/how-to-find-out-which-build-and-version-of-windows-10-you-have/ (https://www.howtogeek.com/236195/how-to-find-out-which-build-and-version-of-windows-10-you-have/)

If you're on the creators update, why? Did windows install it automatically or did you deliberately install it?
Title: Re: PRACX v1.09 Release
Post by: Seeker8 on July 15, 2017, 01:19:56 PM
Creators update.

It kept telling me to install it and and i kept clicking "do it later". after a few weeks, i can't remember the exact words, but it told me i would have to install it now, and it just done it.

Think i'll try rolling back later, i didn't know you could do it:
http://www.thewindowsclub.com/rollback-uninstall-windows-10-creators-update (http://www.thewindowsclub.com/rollback-uninstall-windows-10-creators-update)
Title: Re: PRACX v1.09 Release
Post by: Buster's Uncle on July 15, 2017, 03:28:31 PM
Whatever's current.  There was a large update about a month ago...
Title: Re: PRACX v1.09 Release
Post by: Seeker8 on July 15, 2017, 05:29:34 PM
Rolled it back and seems to have fixed it. :)
Title: Re: PRACX v1.09 Release
Post by: DrazharLn on July 16, 2017, 08:25:53 PM
Thanks for the update :)
Title: Re: PRACX v1.09 Release
Post by: canvas on July 21, 2017, 05:22:39 PM
hi , is prack removing the sp movies ? i have smax gog with  Yitzi's Unofficial SMAX patch 3.5 +3.5d and  prack 1.09
Title: Re: PRACX v1.09 Release
Post by: DrazharLn on July 28, 2017, 10:46:31 AM
Pracx should not remove the movies.

Delete all the pracx stuff from your .ini and try again.

If that doesn't work, try playing the film's with playuv15.exe (in the movies folder). Try with and without the -software command line argument.

On holiday with practically zilch internet access, so that's all for now. Back in a week and a half or so.
Title: Re: PRACX v1.09 Release
Post by: valmanwe on September 13, 2017, 08:29:17 AM
Came back to SMAC and updated my unofficial patches, now I've got PRACX 1.09 installed over kyrub's for SMAC and Yitzi's 3.5d for SMAX. Instead of XP, this time around I'm playing on a Win7 laptop; after reading through this thread and educating myself about the problem with 1366x768 resolution I'm now crash free at 1360x768. The 6 pixels on either side won't be missed. I broke the movies by changing screen res from within the in-game options, but deleting the .ini for a fresh one and punching the new res in manually fixed me right up.

There is only the tiniest most unworthy speck of not-an-issue to report: When loading up SMAX with PRACX active, instead of playing the SMAX intro movie it plays SMAC's intro instead. In any event I much prefer the original intro over watching Progenitor scout ships slug it out for the millionth time, hence my concluding that this can only be the most deliberate and intentional of features, the inclusion of which would never under any circumstance be considered even remotely bug-like. Certainly, there can be no other explanation.  ;yang;

Almost forgot, when I used PRACX previously the movies would get stretched in widescreen resolutions, forcing me to choose between 4:3 or stretched FMV. That may have been down to a limitation of my desktop monitor and/or limitation of the nvidia driver under XP, but whatever the case it is no longer a concern for me on the laptop. In the event that PRACX actually had some tweaks under the hood to how it handles movies in widescreen, it is not unnoticed nor unappreciated! If not, still a win for me and PRACX is no less great (if not indispensable).
Title: Re: PRACX v1.09 Release
Post by: DrazharLn on September 14, 2017, 08:35:32 PM
I'm glad you're using PRACX, and thanks for posting feedback :)

Quote
...problem with 1366x768 resolution I'm now crash free at 1360x768. The 6 pixels on either side won't be missed. I broke the movies by changing screen res from within the in-game options, but deleting the .ini for a fresh one and punching the new res in manually fixed me right up.

Thanks for reporting this. I hadn't been able to reproduce this issue, so I didn't do anything about it. I'll have a think about how to improve the situation (just forcing PRACX to always use 1364x768 instead of 1366x768 may cause other issues).

Could you tell me a bit more about how the movies broke when you changed resolution with the in-game options?

Quote
When loading up SMAX with PRACX active, instead of playing the SMAX intro movie it plays SMAC's intro instead.

I think this bugfix is attributable to Yitzi as a result of the changes he made to support the SMAC in SMAX project :)

Quote
previously the movies would get stretched in widescreen resolutions

Can't take credit for this. I'm 90% sure this is due to your monitor (some (bad) monitors opt to stretch resolutions that don't fit, some (most?) show black bars).
Title: Re: PRACX v1.09 Release
Post by: JamesTofo on October 01, 2017, 07:00:12 PM
My problem is my game won't tab or alt-tab. I installed v1.09 and its says it was successful, both the unofficial patch and ur patch are installed now; and I'm a windows 10 user with the GOG version of the game. Anyone have an idea as what is wrong?
Title: Re: PRACX v1.09 Release
Post by: DrazharLn on October 18, 2017, 06:37:16 PM
Try release v1.10: https://github.com/DrazharLn/pracx/releases/tag/1.10
Title: Re: PRACX v1.10 Release
Post by: Chiu ChunLing on January 24, 2018, 12:41:32 AM
Hi ho, loving PRACX 1.08, wanting to try 1.10, but the installer won't run (Windows message to that effect was singularly unhelpful too, more than usual even).
Quote from: Windows
This app can't run on your PC.
To find a version for your PC, check with the software publisher.
Is it okay to just use the v1.10 .dll's without going through the install process, since the terran.exe is already patched to load them?
Title: Re: PRACX v1.10 Release
Post by: DrazharLn on January 29, 2018, 12:14:46 AM
Yep, copying the dlls will be fine.

You might want to get the nicer resource overlay images from the installer or github repo though. https://github.com/DrazharLn/pracx/tree/master/resources

Just paste the one you want into the SMAC dir renaming as Icons.pcx if necessary. Icons.pcx (same as Icons-outlines) is the one I decided is best.

The installer just backs up the existing terranx?.exe and copies the dlls and an image into the right places and then runs the patching script.

I don't know why the installer isn't working for you. Sorry.
Title: Re: PRACX v1.10 Release
Post by: Chiu ChunLing on February 02, 2018, 02:57:05 AM
Probably something to do with being an older PC.  Anyway, cool.
Title: Re: PRACX v1.10 Release
Post by: ultimo on June 03, 2018, 06:52:18 PM
Hey! Very nice patch! But for some reason world map square of current view don't change
Title: Re: PRACX v1.10 Release
Post by: fuzion2100 on June 27, 2018, 08:38:42 PM
im a bit lost i tried down loading the prax 1.10 exe but it wanted to start the game when i open it. how do i get it to go over the yitzi patch?
Title: Re: PRACX v1.10 Release
Post by: vygov on July 19, 2018, 06:08:14 PM
Hi!
1. The patch 1.10 shows the version 1.06 in the settings.
2. It is not installed under XP.
Title: Re: PRACX v1.10 Release
Post by: Dewbacca on August 15, 2018, 06:17:23 PM
Installed, can open SMAC but SMAX only tries, no black screen or anything, just swirling cursor, then nothing.

edit:
Seems SMAC did not change, no new graphics options, no option to window game.

Good news though, uninstaller worked perfectly!
Title: Re: PRACX v1.10 Release
Post by: Induktio on August 17, 2018, 02:36:25 PM
Installed, can open SMAC but SMAX only tries, no black screen or anything, just swirling cursor, then nothing.

Not sure if this software is being maintained. The last commit was almost a year ago. There's some troubleshooting tips on the first post, but other than that, can't comment on those issues.
Title: Re: PRACX v1.10 Release
Post by: Dewbacca on August 17, 2018, 03:03:46 PM
That would be a real shame, one of my biggest gripes about SMAC/SMAX is that it consumes the entire window and alt/tab still has it's screwed resolution.

I hate to think I missed the opportunity to enjoy the patch that corrected that, but thank you for the reply.
Title: Re: PRACX v1.10 Release
Post by: Induktio on August 17, 2018, 03:49:27 PM
This has probably been mentioned earlier here but it's useful to know.

You can play Alpha Centauri in the native desktop resolution without problems in alt-tabbing if you open Alpha Centauri.Ini and enter these lines there:

Code: [Select]
[Preferences]
ForceOldVoxelAlgorithm=1

[Alpha Centauri]
DirectDraw=0
Title: Re: PRACX v1.10 Release
Post by: Dewbacca on August 17, 2018, 08:42:46 PM
Playing back to back shows this weekend, will probably be Monday before I get around to test that, but

*says in a sinister voice*
Very Interesting...
Title: Re: PRACX v1.10 Release
Post by: Dewbacca on August 19, 2018, 12:43:38 PM
Added and no change. Alt/ tabbing to find 800 x 600 still rules the desktop.

wait... does that file govern SMAX as well? Because that is what I am testing it under.
Title: Re: PRACX v1.10 Release
Post by: Induktio on August 19, 2018, 10:07:35 PM
Edited to include the other line too. I think ForceOldVoxelAlgorithm is required for this to work. Works for me both in SMAC/SMACX with the GOG version.
Title: Re: PRACX v1.10 Release
Post by: DrazharLn on September 27, 2018, 12:32:44 AM
The code isn't maintained, but it works fine.

As explained earlier the installer just extracts the dll, image resources and a readme and runs pracxpatch.exe. If it does anything else that's a bug. In particular, the installer should not try to launch the game.

If there's some kind of issue with the code you can try extracting from the installer manually or using a previous release.
Title: Re: PRACX v1.10 Release
Post by: vygov on October 18, 2018, 05:59:12 AM
This has probably been mentioned earlier here but it's useful to know.
You can play Alpha Centauri in the native desktop resolution without problems in alt-tabbing if you open Alpha Centauri.Ini and enter these lines there:
Code: [Select]
[Preferences]
ForceOldVoxelAlgorithm=1
[Alpha Centauri]
DirectDraw=0
No, not right. There is a native permission, but for alt + tab it does not collapse.
Title: Re: PRACX v1.10 Release
Post by: vygov on October 18, 2018, 06:04:05 AM
It can be installed over Yitzi's patch--the installation will just change a few bytes of terran.exe and terranx.exe to load my dll's.
After patching with version 1.10 - terran.exe and terranx.exe remain unchanged (Yitzi). That is, they are similar to those in the _backup_v1.10 folder. So it should be?
Title: Re: PRACX v1.10 Release
Post by: DrazharLn on October 18, 2018, 10:07:08 AM
If you're using Yitzi's 3.5 patch then the .exes are already patched and the patcher doesn't need to do anything. So don't worry.

I forgot that the installer does re-enable alt-tab on windows. It's just a couple of commands to sdbinst. Have a look in the InstallScript nsi file on GitHub for the particular commands (link on first page of this thread).
Title: Re: PRACX v1.10 Release
Post by: vygov on October 18, 2018, 11:33:04 AM
In the Yitzi 3.5d version, prax.dll is 211 kb in weight, and in PRACX 1.10 it is prax.dll in 298 kb.  ???
Title: Re: PRACX v1.10 Release
Post by: DrazharLn on October 18, 2018, 12:04:05 PM
terran.exe and terranx.exe are already patched. The prac/prax DLLs are older versions. Probably Pracx 1.9 or something.
Title: Re: PRACX v1.10 Release
Post by: vygov on October 18, 2018, 12:25:55 PM
terran.exe and terranx.exe are already patched. The prac/prax DLLs are older versions. Probably Pracx 1.9 or something.
So, it is still better to patch over the new version of the DLL.
Title: Re: PRACX v1.10 Release
Post by: DrazharLn on October 18, 2018, 12:55:09 PM
We're using patch differently.

Yes, running the latest Pracx installer is best. Copying the latest DLLs is best. :)

You mentioned that the version is listed as 1.08. where?
Title: Re: PRACX v1.10 Release
Post by: vygov on October 18, 2018, 01:09:23 PM
In the Yitzi 3.5d patch, prax.dll is weighing 211 kb.

Title: Re: PRACX v1.10 Release
Post by: L to the P on December 11, 2019, 02:06:00 AM
I was struggling to find a way to play this game with windowed mode, and nothing was working.

One solution only that I found (windows 10, i think i am using thinker mod lol not sure exactly but NOTHING was working and I was looking for a long time.)

D3Dwindower.

If everyone already knows about this, sorry. If this is a wrong place to reply, sorry. But I wanted to share that with anyone that would like to be able to move between this and anything else without having to quit the game.
Running at native 1920 no problems once i got the settings right.

edit: still working on the perfect settings, since at this moment it insists on being "up" even if I can do other things, like bring firefox over it and type this. bottom is slightly cut off (you can still see hurry, barely and i can't see the energy credits but the year i can...) Maybe by adjusting the manual height and width, i can get it perfect. many options on this program.

Have a great day everyone.
Title: Re: PRACX v1.10 Release
Post by: Jagged_One on July 13, 2020, 03:26:40 AM
*** moved to a better place ***
Title: Re: PRACX v1.10 Release
Post by: notsureigetit1917 on August 08, 2020, 08:42:47 PM
hi -

so when i use the PRACX patch (which is an incredible god send, btw.), the font for the bottom info windows gets all jacked. like it has extra characters/letters/slashes and makes some of the text illegible.

is there any fix for this? thank you for any help

(https://i.imgur.com/1iSdp7H.png)

here's an example. happens at every resolution + windowed/fullscreen. Only happens in SMACX rather than the base SMAC.

i know with how slow this forum is, this is the internet equivalent of throwing a message in a bottle into the ocean but who knows!
Title: Re: PRACX v1.10 Release
Post by: jfarms on September 25, 2020, 03:20:11 PM
I have the same problem! 
Title: Re: PRACX v1.10 Release
Post by: Marty651 on October 21, 2020, 04:58:32 PM
Same here on two totally different computers. I wonder if anyone doesn't have that issue.
Title: Re: PRACX v1.10 Release
Post by: scient on October 22, 2020, 05:43:10 AM
That particular UI element is the handled by InfoWin class. While I don't know what's causing this, I would remember someone checking one of the following functions.

00456300 ; void __thiscall InfoWin::setup_text(InfoWin *__hidden this)
00458420 ; void __thiscall InfoWin::draw_text(InfoWin *this, int)
00458930 ; void __thiscall InfoWin::on_left_click(InfoWin *this, int, int)
004589C0 ; void __thiscall InfoWin::right_menu(InfoWin *this, int, int)
Title: Re: PRACX v1.10 Release
Post by: Marty651 on October 22, 2020, 05:56:10 PM
Thanks scient for showing the direction of a possible solution.

Just a further observation: This issue doesn't show up within a wine environment under Linux and also not under a Windows Vista installation (inside VirtualBox).
Title: Re: PRACX v1.10 Release
Post by: vygov on December 06, 2020, 05:11:52 PM
People, question. Is it possible to make a patch make the game load immediately in window mode?
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 31 - 840KB. (show)
Queries used: 15.

[Show Queries]