Author Topic: scient replied  (Read 33389 times)

0 Members and 2 Guests are viewing this topic.

Offline Yitzi

Re: scient replied
« Reply #45 on: December 08, 2014, 05:01:38 AM »
Writing is probably the only thing I could contribute to a project like this, but I'd love to have a hand in it.

I don't think we'll need much writing for the "modding SMAC/X" project, but when/if we get to an unofficial sequel we'll need top quality  writers (i.e. better than most professional video game writers).  So if that's the only thing you can contribute but you can do it well enough, that'd be a great help when the unofficial sequel gets going.

Offline PlotinusRedux

Re: scient replied
« Reply #46 on: December 08, 2014, 05:40:50 AM »
Scient, that Mac file is incredible--ever function name and prototype.  That's going to help a lot with collaboration as well, because we can all use the actual names for classes and functions instead of everyone making up their own.  My instinct is to immediately go through and correct every name I've got, but I know a couple of people were waiting on my patch, so I'm going to resist and finish it porting it from SMAC to SMAX first....

I wasn't doing too bad, though, here's my menu class names on the left and theirs on the right:


Offline scient

Re: scient replied
« Reply #47 on: December 08, 2014, 05:50:25 AM »
Yeah, I ended up doing the same thing. I was pretty close with my naming of different functions but it's nice to have the original. They're not all there for every class, but there is a LOT of information. I've spent a lot of time porting over function names into the windows binary.

You might as well wait until I send you the map file. It will save you some time.

I haven't done prototypes yet except in a few cases. Mainly because some of the custom data types I don't have structure mapped out yet. Although, this makes it a lot easier to see patterns and start reconstructing them.

Offline Lord Avalon

Re: scient replied
« Reply #48 on: December 08, 2014, 06:32:46 AM »
...
I highly recommend using NSIS to create a single click installer. I have included the NSI script along with all the comments. This allows for managing all the related files besides just the exes such as the various languages for text files and ability to update registry among other things. I tried to make clear comments for each section, but more than happy to explain anything....

What does the installer do if there's no registry entry? I have SMAX folders that were copied from the original installation, which was done under a previous OS, so there's no current registry entry for it either.
Your agonizer, please.

Offline scient

Re: scient replied
« Reply #49 on: December 08, 2014, 06:51:39 AM »
The installer lets you set the path to whatever you want. However, the script I've coded has auto detection for the original registry entries of SMAC, SMACX, SMACX Planetary Pack and GOG versions to obtain the path. If that fails, it defaults to program files. However, you are given the choice to browse and select the destination you want to install it to.

Once it has been installed, it makes it's own registry entry inside default SMAC registry key (creating it if necessary) with the path that was last used. This was to allow for subsequent patches to check this entry first. I also added to installer script to create an unofficial version key.

Offline Mart

Re: scient replied
« Reply #50 on: December 08, 2014, 07:31:06 AM »
This is true.

Speaking of resources, I'm not sure if I ever mentioned this before my hiatus. I noticed that the linux edition port includes all the video files as MPG as opposed to the proprietary WVE format. With a few minor changes, you can get the windows game to play these if I remember correctly. It also solved the issue where with directx WVE code would mess up and not allowing you to alt-tab after a movie was played.

I've got that issue fixed already, but a mainstream format is always better than proprietary.  Are the mpg's decent quality?  I tried converting myself but couldn't get decent quality without a massive increase in file size.
At present time both terran.exe and terranx.exe (on windows) can play AVI files. What I checked is:
- using camstudio I "screen recorded" opening movie.
- cropped it to resolution 426x240, using xvid codec. with some seconds before and after, I got 54 mb size, compared to 38 mb on linux (as on screenie above) and 29 mb WVE on windows.
- placed opening.avi in "movies" folder and renamed opening.wve to some other name (so the game finds 'opening.avi').
It plays ok, with one issue, while I can escape playing wve file in the game, I could not escape avi file.
In movies folder, there is a player application "playuv15.exe". Game uses it in scenario editor?

As for the avi I made, camstudio had actual frame rate 14, when recording 1280x750. It probably could get better with decreasing resolution to about 400x192. Also removing extra time and decreasing video size from 426x240 to smth 400x192 would make file smaller than 54 mb.

Offline Sigma

Re: scient replied
« Reply #51 on: December 08, 2014, 01:08:25 PM »
Writing is probably the only thing I could contribute to a project like this, but I'd love to have a hand in it.

I don't think we'll need much writing for the "modding SMAC/X" project, but when/if we get to an unofficial sequel we'll need top quality  writers (i.e. better than most professional video game writers).  So if that's the only thing you can contribute but you can do it well enough, that'd be a great help when the unofficial sequel gets going.
Oh, of course. I wasn't injecting myself into this conversation saying that I could contribute herein, as I'm waaaay out of my depth. Merely that I'll offer whatever I can if and when a sequel project is started.

Meantime I'll be following this thread like everyone else, since it's incredibly exciting to follow even if I don't understand any of the technical specifications.

Offline DrazharLn

Re: scient replied
« Reply #52 on: December 08, 2014, 06:19:41 PM »
...
For the movie fix, I was looking at using the open source ffmpeg library which can actually read the format directly, when I hit on a an absurdly simple solution:

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

strcpy(szCmd, ".\\movies\\playuv15.exe -software ");
strcat(szCmd, pszFileName);

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);
}

To the user, the effect is indistinguishable from the video being played by the app itself--and since playuv15.exe uses it's own window handle, it doesn't screw up the game's window.

I'm glad to see this, I was trying to intercept SMAC's directdraw calls with an injected dll and was having problems with the movies. I got part way into implementing basically the same code as you have above (calling an external binary to play movies), but it was such a pain doing it in ASM that I gave up.

Bravo!

If you would release your patch I might even be able to make some more progress on the original upscaling I was working on.

@scient,

Hello! Glad to see you around again.

@scient and PlotinusRedux

Can either of you estimate how much of the codebase still needs to be decompiled? How much of the codebase can be skipped?

Offline 551262

Re: scient replied
« Reply #53 on: December 08, 2014, 10:13:25 PM »
I play SMAC and SMAC-X on a iMac G4 800MHz.

The Carbon version plays okay with Rosetta emulation on Intel processors, but it's still just about as slow as playing it on a PPC G4.

Offline scient

Re: scient replied
« Reply #54 on: December 08, 2014, 10:48:23 PM »
Hey DrazharLn! Good to see you!

As for what can be skipped, there is a lot of net code for multiplayer that I think should be redone. Anything relating to directplay needs an overhaul. It would probably be easier just to do it from scratch. Honestly, I think live multiplayer should be the last thing to add. There is a global boolean about whether the current game is multiplayer or singleplayer/PBEM. So those branches would be easy to skip.

There is also some code relating to movies that is redundant. Going through the code, there are numerous unused functions and code that the compiler added in. Most of the c++ ctor/dtor code can be ignored since compiler creates these based on globals.

Offline scient

Re: scient replied
« Reply #55 on: December 08, 2014, 11:11:21 PM »
I play SMAC and SMAC-X on a iMac G4 800MHz.

The Carbon version plays okay with Rosetta emulation on Intel processors, but it's still just about as slow as playing it on a PPC G4.

Well, as of 10.7 rosetta was removed. So the only option on newer iterations of OSX is to use something like wine. I think it would be nice to have a native intel compiled version that would run more smoothly.

Offline 551262

Re: scient replied
« Reply #56 on: December 08, 2014, 11:37:33 PM »
I concur, I thought about that after I made my post. It'd be nice to have a native PPC version that doesn't drag so bad. OTOH ... I dunno. I can't speak for the PPC G5, as I regard it as a waste of time, since it doesn't do anything an Intel CPU can't do better and faster.

Offline scient

Re: scient replied
« Reply #57 on: December 09, 2014, 12:11:03 AM »
Apple has made supporting PPC a chore by removing the ability to compile for PPC in Xcode. However, it should be possible if you set up some legacy version of Xcode.

Offline Yitzi

Re: scient replied
« Reply #58 on: December 09, 2014, 12:43:08 AM »
Writing is probably the only thing I could contribute to a project like this, but I'd love to have a hand in it.

I don't think we'll need much writing for the "modding SMAC/X" project, but when/if we get to an unofficial sequel we'll need top quality  writers (i.e. better than most professional video game writers).  So if that's the only thing you can contribute but you can do it well enough, that'd be a great help when the unofficial sequel gets going.

Oh, of course. I wasn't injecting myself into this conversation saying that I could contribute herein, as I'm waaaay out of my depth. Merely that I'll offer whatever I can if and when a sequel project is started.

Meanwhile, you might want to see if you can do some Planet Tales/AARs and learn to capture the feel of SMAC, as you'll need that ability if you're going to write for a proper sequel.
« Last Edit: December 09, 2014, 01:10:31 AM by Yitzi »

Offline Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49270
  • €438
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: scient replied
« Reply #59 on: December 09, 2014, 12:49:36 AM »
The Owners would like to endorse this (badly-formatted ;)) suggestion - we can always use more entertaining stuff in Planet Tales, and everyone loves a good AAR.  It's good writing experience, and everybody wins.

AC2 takes the official position of being in favor of Everybody Wins situations.

 

* User

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


Login with username, password and session length

Select language:

* Community poll

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

* Random quote

The Mind Worms are the natural defenses of the living Planet?the white blood cells, if you will. In a world in which unassimilated thought represents danger, the Mind Worm seeks out concentrations of sentient mental energy and destroys them, ruthlessly and efficiently.
~Commissioner Pravin Lal 'Mind Worm, Mind Worm'

* Select your theme

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

[Show Queries]