Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => Modding => Bug/Patch Discussion => Topic started by: ete on December 05, 2014, 02:34:12 PM

Title: scient replied
Post by: ete on December 05, 2014, 02:34:12 PM
Contact successful!

Quote
Hey!

I apologize for my absence from the community. You are correct, I have been extremely busy. Various things in life have kept me occupied. I still do have the patch stored with a large number of changes I never released. I forget if I ported all changes over to SMAC.

Even though I have been absent, I have be actively working on SMAC/X project. I have shifted from fixing bugs to complete decompilation of the game. There are just too many things I'd like to change and resolve that patching at the assembly level is no longer an option. This will take a number of years, at least if I work on it solo in my free time, however I have made a lot of progress. I have identified almost all the major functions inside the binary which makes stepping through the code and looking at logic a lot easier.  Also, I have decompiled a few of the base internal classes back into C++. I've been doing them in blocks and building upon each other with subclasses.

Perhaps in a couple weeks when I have some time off I will make a post on forums about my work along with the unreleased patch. If I don't have time, then I will email you everything and let Yitzi sort it out.

I hope all is well. If you don't hear back from me on boards or by email in a few weeks, feel free to remind me.

Brendan (scient)

Quote
I just had a quick look and it seems like I pretty much finished the patch entirely. I don't know why I never released it. The text files were being cleaned up for typos and mistakes by James Ó Nuanáin (Guv'ner). I'm not sure if he ever released his work, so I'll have to see if he posted a final version. I know I do have a few more revisions that I never included up until ~6/2013.

I took a few screenshots of everything. Since it looks like all the work is pretty much done, I will definitely post a public draft the installer for people to test in about two weeks. Then troubleshoot any problems.

Good news :).

I would *really* like to get the active decompilers sharing data with each other, since otherwise there's just massive duplication of effort which could instead be directed towards more improvements to AC. The initial work of merging discovered functions would be significant, but I suspect would be quickly payed back by having three times as many people working on the project.

Yitzi, PlotuxRedux, Dio, and scient when you get here:

Would you be willing to share your data if it was frictionless to sync?
What form is your decompiling work stored in, and what program do you use?
Are you willing to help merge everyone's information?

I want to see this happen because I like it when things get fixed and improved and think this would be a major step forward. I don't know exactly what I can do to help as a non-programmer, but if there's anything I can do to make it more likely I'm in (e.g. teaching people github, talking to people, organizing things).
Title: Re: scient replied
Post by: PlotinusRedux on December 05, 2014, 05:21:43 PM
I'm actually working along the same lines as Scient, reconstructing the original C++ class structure.  Unfortunately they severely abused multiple inheritance which makes detangling them particularly messy.

I'd love to swap notes with him, and I'm happy to share my research with anyone.  I use IDA Pro, but for people not using that I also have C header files, map files, etc.

My modifications are actually being done in C++ code directly referencing the decompiled classes, with assembly just used for hooks and thunks.
Title: Re: scient replied
Post by: BFG on December 05, 2014, 06:57:41 PM
I continue to be impressed by your dedication and passion on this.  I've actually programmed some video games but nothing anywhere close to the complexity of SMAC - I wouldn't even know where to begin with this.  And to think that some of it's in assembly...
Title: Re: scient replied
Post by: ete on December 07, 2014, 03:04:20 PM
I sent PlotuxRedux's post to him
Quote
That's awesome! I will have to touch base with PlotinusRedux. I too am decompiling the asm back into c++ source code more or less 1-1. I've been optimizing the code and updating it as I see fit. So far, I've mainly been working on start up code to parse the initial files. While I have identified all the major game logic, I wanted to have a working engine shell first.

As for code analysis, I first started identifying functions on my own about two years ago. Then I realized a nice trick. The mac binary, due to how gcc (I think that was compiler used) and macosx works, contains all the ORIGINAL function names. As in, what the SMAC/X devs used. This makes identifying the logic of what a function is suppose to do a lot easier. Granted, it has taken a lot of time and effort to match the PPC code up with the intel code (mac code base vs win code base). There are also a number functions not referenced directly which do not have this information. However, I have almost the entire binary mapped out in IDA. I still have much work to do, I've started going through and cleaning it up. This analysis has taken up the bulk of my time, countless hours have gone into my database. I would be happy to sync up work with whoever.

Overall, it would be great to set up a git (not necessarily on github) to help with working on this project. My goal is to have an open source version of SMAC/X in the end, similar to OpenXCom and Riven X.

I will see about getting myself on the boards sometime around 12/20 when I'll have some time off. I look forward to chatting with everyone, it's been too long!

This is looking very promising :)
Title: Re: scient replied
Post by: Dio on December 07, 2014, 07:06:18 PM
Contact successful!

Quote
Hey!

I apologize for my absence from the community. You are correct, I have been extremely busy. Various things in life have kept me occupied. I still do have the patch stored with a large number of changes I never released. I forget if I ported all changes over to SMAC.

Even though I have been absent, I have be actively working on SMAC/X project. I have shifted from fixing bugs to complete decompilation of the game. There are just too many things I'd like to change and resolve that patching at the assembly level is no longer an option. This will take a number of years, at least if I work on it solo in my free time, however I have made a lot of progress. I have identified almost all the major functions inside the binary which makes stepping through the code and looking at logic a lot easier.  Also, I have decompiled a few of the base internal classes back into C++. I've been doing them in blocks and building upon each other with subclasses.

Perhaps in a couple weeks when I have some time off I will make a post on forums about my work along with the unreleased patch. If I don't have time, then I will email you everything and let Yitzi sort it out.

I hope all is well. If you don't hear back from me on boards or by email in a few weeks, feel free to remind me.

Brendan (scient)

Quote
I just had a quick look and it seems like I pretty much finished the patch entirely. I don't know why I never released it. The text files were being cleaned up for typos and mistakes by James Ó Nuanáin (Guv'ner). I'm not sure if he ever released his work, so I'll have to see if he posted a final version. I know I do have a few more revisions that I never included up until ~6/2013.

I took a few screenshots of everything. Since it looks like all the work is pretty much done, I will definitely post a public draft the installer for people to test in about two weeks. Then troubleshoot any problems.

Good news :).

I would *really* like to get the active decompilers sharing data with each other, since otherwise there's just massive duplication of effort which could instead be directed towards more improvements to AC. The initial work of merging discovered functions would be significant, but I suspect would be quickly payed back by having three times as many people working on the project.

Yitzi, PlotuxRedux, Dio, and scient when you get here:

Would you be willing to share your data if it was frictionless to sync?
What form is your decompiling work stored in, and what program do you use?
Are you willing to help merge everyone's information?

I want to see this happen because I like it when things get fixed and improved and think this would be a major step forward. I don't know exactly what I can do to help as a non-programmer, but if there's anything I can do to make it more likely I'm in (e.g. teaching people github, talking to people, organizing things).
I have a whole slew of user comments on things that I have identified using the program Ollydebug. I also released a notepad file that listed all the addresses and names of the labels from labels.txt that are present in the assembly game code. I have never used C++ coding but woud be willing to look into it for this game.
I would be more than willing to share what I do know about the game code and the state of various sound effects, voices, scripts, and pcx's within the said code with those that are interested.
Title: Re: scient replied
Post by: Lord Avalon on December 07, 2014, 07:15:58 PM
 :danc:   ;woohoo :danc:
Title: Re: scient replied
Post by: ete on December 07, 2014, 07:58:52 PM
@PlotinusRedux & Dio: Okay, cool :). I think it'd be a good idea for you to both post the notes and decompilation progress you have here (http://alphacentauri2.info/index.php?topic=14229.new#new) if you're okay with that, that way all the interested people can just download rather than having to each send them out as requested.
Title: Re: scient replied
Post by: PlotinusRedux on December 07, 2014, 09:23:45 PM
...While I have identified all the major game logic, I wanted to have a working engine shell first.

Any idea where I could get a copy of that Mac executable?

To Scient: I've approached it as a hybrid project.  My C++ code compiles into a DLL that gets loaded into the same address space as the .exe.  In the C++ code I start by stubbing out the classes with the methods initially just being jmp's to the exe image in memory.  Then as I need to modify a method, I reverse engineer it and replace the jmp with actually C++ code and overwrite the exe image version with a jmp to my C++ code.

That way I don't have to wait until it's all converted for it to be useful, and over time more and more of the code will migrate over to the C++/dll side.  In the end, all of it could do so and replace the original .exe altogether.
Title: Re: scient replied
Post by: Buster's Uncle on December 08, 2014, 12:20:41 AM
Note that scient was just by...
Title: Re: scient replied
Post by: scient on December 08, 2014, 12:40:44 AM
I decided to pop on here sooner than I planned heh. The mac binary is from the mac port of the game by Aspyr, not the GOG version which is similar to a wine port (I believe).  The actual version I'm using is a beta patch by one of the port developers Brad Oliver. I've attached it below. However, I would wait for me to finish cleaning up my IDA database. I have spent a lot of time porting over the function information into the intel binary so it would be a wasted effort to do it all over again. They're not 1-1 but you can see patterns of function calls and once you start identifying things it becomes easier and easier. The mac binary is in PPC asm, which I personally cannot understand as well as intel. On a side note, one of my goals with SMAC/X decompilation projection would be to create a native mac version that runs without the need for wine or emulation.

Here is screenshot of function names for mac SMACX binary in IDA:
(http://i.imgur.com/QXLs7ZT.png)

Here is example of my copy of WinMain:
(http://i.imgur.com/JuB6PvG.png)

I haven't figured out how to get IDA to display the class double colon properly, so it changes it to "__" when displayed. However, as you can see it makes stepping through the code a lot easier.  :)

It also makes finding connections a lot easier, especially for the internal engine code with all the jumble of inheritance. I have started to create the internal structures and enums in IDA as well.

...

The hybrid method sounds interesting. I guess since I've been working on my own, I have been more working on just decompiling classes as I go. Most of my work has been going into analysis of binary for now, so I have finished a few basic classes. I need to split some of my code as I have a lot of functions in general.cpp related to parsing the technology and text files. I'm almost done with reading all text files and loading that information into the globals for example, like labels. Also, I've been trying to ditch some of their usage of globals where ever possible.

The ones in done are "complete" and have gone over a clean up with comments so they look like the next screenshots.
(http://i.imgur.com/GqTazxn.png)

In end, you get:
(https://i.imgur.com/vQZxZS4.png)
(https://i.imgur.com/5pee0DA.png)

The next two weeks are going to be quite busy but I will try and stop by from time to time. And I will see about putting out a beta patch with my v2.0 with a lot of fixes and changes I finished about a year ago but never released.
Title: Re: scient replied
Post by: scient on December 08, 2014, 12:45:42 AM
Also this was a reply to ete that I'll quote here as well.

Quote
I haven't used github much, pretty indifferent. I liked the idea of launchpad because it also included the ability to track bugs in a more robust way than github. Something I had wanted to have set up for SMAC/X project as well.

For example, see here: https://launchpad.net/rivenx

Riven X project doesn't have bug tracking but if you look into launchpad vs github there is some discussion about it.

From what I looked into, legally decompiling it isn't an issue. However, resources it might get hazy.

I agree, I will wait to make a test release until after they are merged.

I've attached the installer script. It's a very easy scripting language to create the installer.

Perhaps others have a better idea about which we should use. I thought having repository as well as bug tracking system would be a great way to index bugs as well as start decompiling the code. Actually, as I have been working on a few functions I have found a number of bugs in engine. They will happen under rare circumstances but still exist. For example, there is a set of functions designed to index the text files to speed up reading from them which it does. However, the code has bug that breaks the implementation completely so it never works. I have since corrected this.  :)

edit:
Hey BU, hope all is well. ^^
Title: Re: scient replied
Post by: Buster's Uncle on December 08, 2014, 12:57:24 AM
I've been better and been worse. 

Obviously, my big hobby -this community- is rolling along robustly, if not so much as I aspire to.   :) 

We've missed you.  Did you not see all my skypes this summer, or did I keep catching you at a bad time?
Title: Re: scient replied
Post by: scient on December 08, 2014, 01:18:17 AM
Likewise.

Yes, this community seems to be doing well!

One of my best friends past away suddenly at the start of the summer, so I didn't do much of anything.

I will see about popping on Skype more in the future. It would be great to chat.
Title: Re: scient replied
Post by: Buster's Uncle on December 08, 2014, 01:32:23 AM
;b;



And I just want to say to ete, publically:

 :unworthy: ;woohoo :adore:  ;woohoo ;worship

You've done a man's job, sir; and I'm not just talking about getting scient active - we've needed to get our patchers talking to each other for a long time.  Name your accomplishment badge; you've got one coming, for all your organizing activities lately.
Title: Re: scient replied
Post by: Dio on December 08, 2014, 01:35:28 AM
Wrong topic to post this in...
Title: Re: scient replied
Post by: ete on December 08, 2014, 01:51:32 AM
I'll just reply here, I think.

From what I looked into, legally decompiling it isn't an issue. However, resources it might get hazy.
It probably violates the EULA, but we'd be able to pass for fair use if we don't include a bunch of files we're not changing that are required for the game to run. And it's pretty unlikely they'd bother objecting, we're just stirring up business for the gog copy.

I haven't used github much, pretty indifferent. I liked the idea of launchpad because it also included the ability to track bugs in a more robust way than github. Something I had wanted to have set up for SMAC/X project as well.

For example, see here: https://launchpad.net/rivenx

Riven X project doesn't have bug tracking but if you look into launchpad vs github there is some discussion about it.

Perhaps others have a better idea about which we should use. I thought having repository as well as bug tracking system would be a great way to index bugs as well as start decompiling the code. Actually, as I have been working on a few functions I have found a number of bugs in engine. They will happen under rare circumstances but still exist. For example, there is a set of functions designed to index the text files to speed up reading from them which it does. However, the code has bug that breaks the implementation completely so it never works. I have since corrected this.  :)
Looking around the (https://github.com/jfroy/rivenx) two (https://bugs.launchpad.net/rivenx) riven x repositories, the github one feels monumentally more sleek and functional. Kinda like imgur verses the old image hosts. launchpad's bug tracker does look more advanced, but this project is not one that needs the kind of features it provides, and github's issue tracker is pretty neat in it's way. Minimalist, but in very a good way. Example (https://github.com/etesp/Alpha-Centauri-Ultimate/issues).

It's also massively more popular which means more people discovering it on github, less friction for getting new devs to post their first bug and join in, more active development of the system, more stability, and has awesome things like this (https://github.com/blog/1844-say-hello-to-github-for-windows-2-0).

If you're thinking an open repository with a site to coordinate, I think Github's the way to go, though of course if you guys prefer something else I'll still help out with bug organization and stuff wherever. If you've not used it much I suggest you have at least a brief play with it, see how it compares to other things you've used. You may be pleasantly surprised.

I've attached the installer script. It's a very easy scripting language to create the installer.
Cool, got it. I'll probably not do this just yet, but it's on my to do list (https://github.com/etesp/Alpha-Centauri-Ultimate/issues/18).


@BU: I'm just glad it seems to be working so well :D.

If there's some kind of organizer badge, perhaps that? Or downloads, I did make the factionpack, and am a good chunk of the way through ACU?
Title: Re: scient replied
Post by: Buster's Uncle on December 08, 2014, 01:56:11 AM
Me too  :D

I'll put a Downloads badge on you now - but you deserve a separate organizer badge, if we can think of an image...
Title: Re: scient replied
Post by: scient on December 08, 2014, 02:02:15 AM
As far as I know, you cannot copy right source code. So while it may violate the EULA, I don't think the actual source code will be an issue. However, resources such as icons, images and perhaps text files would fall under this. I did some cursory legal research so I could be wrong.

You've convinced me heh. Github looks like the way to go.

And yes, a big thank you should go to ete for reaching out to me. I had been meaning to rejoin the community and talk about work I've done but always seemed to put it off.
Title: Re: scient replied
Post by: Buster's Uncle on December 08, 2014, 02:06:48 AM
Well - the important thing is, we make no profit and do not distribute the game for free or anything like that.  Keep money out of it entirely, and they can still make us stop -they always could have, which is something all fans doing derivative work have to live with- but we can't get in any real trouble.
Title: Re: scient replied
Post by: scient on December 08, 2014, 02:12:40 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.
Title: Re: scient replied
Post by: Lord Avalon on December 08, 2014, 02:18:31 AM
...- but you deserve a separate organizer badge, if we can think of an image...
Morgan Industries Employee of the Month?
Title: Re: scient replied
Post by: Buster's Uncle on December 08, 2014, 02:21:52 AM
You know, there's occasional but persistent interest among some modders in being able to swap in new movies/ mod the ones in place.

Adding on to that about legality - Firaxis overtly encouraged at least some sorts of modding and didn't specifically exclude going on to fiddle with their code in process.  We're on firmer legal ground than if we were writing Star Trek fanfic.  And the bottom line is, there's no evidence that current rights owner EA cares - and even if they did, they'd be as likely to hire some of you as to step on your projects. ;nod


...- but you deserve a separate organizer badge, if we can think of an image...
Morgan Industries Employee of the Month?
What would that look like, besides a big M or Morgan's head?  Or would one of those do?
Title: Re: scient replied
Post by: ete on December 08, 2014, 02:22:42 AM
Me too  :D

I'll put a Downloads badge on you now - but you deserve a separate organizer badge, if we can think of an image...
Cool :).

As far as I know, you cannot copy right source code. So while it may violate the EULA, I don't think the actual source code will be an issue. However, resources such as icons, images and perhaps text files would fall under this. I did some cursory legal research so I could be wrong.
Right, I think that fits with my understanding. Let's keep all the text files and peripherals separately in the ACU and AC-Text files repositories, and the decompilation work/collections of addresses and functions and stuff in another.

You've convinced me heh. Github looks like the way to go.
Awesome. Now all we need is names. I created https://github.com/AlphaCentauri-Ultimate a while back, but ACU is more specifically the megapack and it's.. not my favorite name, seems a bit too self-confident, I've just not thought of anything better (except Alpha Centauri 1.5 which yitzi already has plans for). We could use that organization or start a new one. And then we'd want a repository name.

Alpha-Centauri-2? Alpha-Centauri-Open? Alpha-Centauri-Open?

Then I can set it all up, include everyone's publicly posted work, and import a few example bugs/set up the bug tracker for AC uses.

And yes, a big thank you should go to ete for reaching out to me. I had been meaning to rejoin the community and talk about work I've done but always seemed to put it off.
I know that feeling. Glad you're back :).


@BU: Either sounds good to me.
Title: Re: scient replied
Post by: Buster's Uncle on December 08, 2014, 02:27:31 AM
Lal would work as an organizer, too, maybe less confusingly - but a gold M would be easiest...  Need to think on this...
Title: Re: scient replied
Post by: scient on December 08, 2014, 02:31:30 AM
I think we should stay away from numerals like 2 in case hell freezes over and Firaxis/EA/Take Two come to terms and decide to put out an official sequel to SMAC/X heh.

As for name, perhaps a poll. I have been referencing it in my own code as: "Alpha Centauri Redux". However, something like "SMAC/X Open", "Open SMAC/X", "Open Alpha Centauri", or "Alpha Centauri Open" would work too.
Title: Re: scient replied
Post by: Yitzi on December 08, 2014, 02:35:47 AM
It probably violates the EULA

Actually, as far as I can tell there is no EULA for the original (non-GOG) version...we'd still need to make sure it fits fair use, though (so nothing that would cut into anyone's business).

I think we should stay away from numerals like 2 in case hell freezes over and Firaxis/EA/Take Two come to terms and decide to put out an official sequel to SMAC/X heh.

Although there's nothing to keep us from eventually coming out with an unofficial sequel to SMAC/X...provided, of course, that we can find the writing and graphics/movies talent to pull off a worthy successor.  (And the coding and game-design talent, but those will be somewhat easier since in those fields we're not trying to replicate one of the best games ever made, just a very good one, and I know that I have at least some capability in those fields, which I don't in movie-making/graphics.)

Also, scient, we will want to combine your fixes into my patch...
Title: Re: scient replied
Post by: Buster's Uncle on December 08, 2014, 02:36:51 AM
OpenSMACX -or something of the sort- IS catchy...
Title: Re: scient replied
Post by: PlotinusRedux on December 08, 2014, 02:52:01 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.
Title: Re: scient replied
Post by: scient on December 08, 2014, 02:59:51 AM
I'm curious what the issue was, I tracked it down to a function UV2Player::play that has calls to old direct x (4 or 5) functions starting at offset 0x4BF4B0 in SMACX exe. However, I never went further from there.

They're decent quality. They're about 100mb larger than WVE set.

And I agree, mainstream format is better. It looks like for the debug builds of SMAC/X they used uncompressed AVI based on the code.

(http://i.imgur.com/PwTt2gV.png)

Title: Re: scient replied
Post by: ete on December 08, 2014, 03:22:13 AM
Lal would work as an organizer, too, maybe less confusingly - but a gold M would be easiest...  Need to think on this...
I'm happy with that too.

I think we should stay away from numerals like 2 in case hell freezes over and Firaxis/EA/Take Two come to terms and decide to put out an official sequel to SMAC/X heh.

As for name, perhaps a poll. I have been referencing it in my own code as: "Alpha Centauri Redux". However, something like "SMAC/X Open", "Open SMAC/X", "Open Alpha Centauri", or "Alpha Centauri Open" would work too.
Good point, and right. I'll start a topic for naming.

It probably violates the EULA

Actually, as far as I can tell there is no EULA for the original (non-GOG) version...we'd still need to make sure it fits fair use, though (so nothing that would cut into anyone's business).
Huh, that's worth knowing. I guess it is a pretty old game.

I think we should stay away from numerals like 2 in case hell freezes over and Firaxis/EA/Take Two come to terms and decide to put out an official sequel to SMAC/X heh.

Although there's nothing to keep us from eventually coming out with an unofficial sequel to SMAC/X...provided, of course, that we can find the writing and graphics/movies talent to pull off a worthy successor.  (And the coding and game-design talent, but those will be somewhat easier since in those fields we're not trying to replicate one of the best games ever made, just a very good one, and I know that I have at least some capability in those fields, which I don't in movie-making/graphics.)
Indeed.. :). I'm up for playing project manager and filling in bits of any non-art non-programming jobs that need doing, testing, bug organization, writing, suggestions, etc...

Also, scient, we will want to combine your fixes into my patch...
I think scient's plan is to post what he has to test in a couple weeks when he'll have more free time, at which point the two will be merged and united with the set of updated text files I'm working on (https://github.com/etesp/Alpha-Centauri-Textfiles) and possibly ACU if it's ready for a release. I'm not sure the best way to handle merging your different works in a way that'll pave the way for future easy merges since each of you is working in a slightly different way, that's something you guys should all probably discuss.
Title: Re: scient replied
Post by: scient on December 08, 2014, 03:28:10 AM
Well, after this patch release I don't really plan on making another. If anything, I like PlotinusRedux idea of injecting dll. I want to focus solely on decompilation project since my time is pretty limited as is. I don't really feel like dealing with patching at ASM level anymore beyond some simple testing. Some of patches I did in my unreleased update were quite a pain to do. Especially the one getting the unused pcx for resource pops/disappears to display correctly.

However, I am happy to provide all info regarding my patches and the setup for NSIS installer so merging with Yitzi's patch is seamless.
Title: Re: scient replied
Post by: Buster's Uncle on December 08, 2014, 03:31:15 AM
Did anything ever get done with that negative resource graphic I did up for you five+ years and several forums ago?
Title: Re: scient replied
Post by: Yitzi on December 08, 2014, 03:38:47 AM
Indeed.. :). I'm up for playing project manager and filling in bits of any non-art non-programming jobs that need doing, testing, bug organization, writing, suggestions, etc...

If you're talking about the possibility of an unofficial sequel, writing is not going to be a "filled-in because it needs doing" job; that seems to be the approach BE took to writing, and that's why it's not a proper sequel to SMAC.
Title: Re: scient replied
Post by: scient on December 08, 2014, 03:40:55 AM
No, I still have it somewhere tho.  :)

The problem was a limited heap space (memory) inside the binary to store info after parsing pcx. This could be solved by redirecting offsets to injected dll. Patching it in binary itself would be complicated. Both methods would be a pain to implement. Another reason decompiling the exe is a good idea. There are many things hardcoded that are difficult to work around without extensive patching.
Title: Re: scient replied
Post by: Buster's Uncle on December 08, 2014, 03:43:54 AM
Okay.  [sniffles]

Indeed.. :). I'm up for playing project manager and filling in bits of any non-art non-programming jobs that need doing, testing, bug organization, writing, suggestions, etc...

If you're talking about the possibility of an unofficial sequel, writing is not going to be a "filled-in because it needs doing" job; that seems to be the approach BE took to writing, and that's why it's not a proper sequel to SMAC.
I think we can cover writing, though.  Rymdolov is scary good, and I've dashed off a few pieces of AC fanfic I'm not ashamed of...
Title: Re: scient replied
Post by: ete on December 08, 2014, 03:46:28 AM
Okay, so approximately this plan:
1. scient provides his patch and notes, Yitzi merges them (?)
2. scient and Plotinux post their IDA data then merge their current decompilations to a repository I'll set up and incorporate research by Yitzi and Dio to speed up decompilation, I try and get kyrub's data to add into the mix
3. Yitzi & Dio either join in the decompilation project and work with C++ for their modifications or continue to patch directly, leaving hooks for the .dll guys to work from?
4. As functions are drawn into the .dll more and more becomes easily moddable until finally the original exe is unnecessary
5. We make an awesome sequel complete with bells and whistles :D (may take another 15 years)

Indeed.. :). I'm up for playing project manager and filling in bits of any non-art non-programming jobs that need doing, testing, bug organization, writing, suggestions, etc...

If you're talking about the possibility of an unofficial sequel, writing is not going to be a "filled-in because it needs doing" job; that seems to be the approach BE took to writing, and that's why it's not a proper sequel to SMAC.
I can write fairly good stuff if I apply myself. It's not my favorite part of creating things, but it'd not be half-arsed. Of course I'd rather have others doing the bulk or the writing, organization is what I most enjoy.
Title: Re: scient replied
Post by: Sigma on December 08, 2014, 03:50:13 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.
Title: Re: scient replied
Post by: scient on December 08, 2014, 04:17:38 AM
Actually, rather than wait two weeks if Yitzi or whoever would like to merge my patch that would be great. Releasing a stand alone patch just splitters the patches even more and since Yitzi has been doing the majority of patch work merging the new patches into his sounds like the best solution. Especially since I don't plan to continue releasing patches.

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.

I have a mix of various text files by Guv. The ones I have packaged as part of my patch are not the latest. I believe the ones in "final_update_txt.zip" are the final set he sent me via email. I didn't merge them together so folks can see. However, some kind of unified text files would be a good call. He did a LOT of work updating and cleaning up the stock ones.

Also, inside my patch files I included my internal patches.txt I use to locate specific patch data to speed up applying them to binary. Actually, I don't think I ever applied Kyrub's patches to my binaries. However, everything else should be there. I tested all my patch code extensively.

My readme includes detailed explanations of all the patches and what they do.

Enjoy. I should of shared this sooner with the community.
Title: Re: scient replied
Post by: ete on December 08, 2014, 04:27:02 AM
Makes sense. Okay, I'll move checking and merging the text files to top priority (my copies have a handful of changes he'd not included, though his work is based on mine so he's got most of my changes already). I've also found a fair number of things changed that probably shouldn't be (e.g. removing a load of alien dialogue which should be edited instead), it needs a bit of review. I should have them ready to bundle in the next couple of days :).
Title: Re: scient replied
Post by: Buster's Uncle on December 08, 2014, 04:32:00 AM
Does anyone know what the deal with Guv is?

I miss Guv.
Title: Re: scient replied
Post by: scient on December 08, 2014, 04:34:32 AM
I have his email but haven't talked to him in over a year. The last email I got was with those text files and that was it.
Title: Re: scient replied
Post by: PlotinusRedux on December 08, 2014, 04:40:21 AM
I'm curious what the issue was, I tracked it down to a function UV2Player::play that has calls to old direct x (4 or 5) functions starting at offset 0x4BF4B0 in SMACX exe. However, I never went further from there.
(http://i.imgur.com/PwTt2gV.png)


For SMAC, basically DDraw always got initialized in the movie code with SetCooperativeLevel(DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE) and no fallback.  It got reinitialized in the later start up code with a fallback to DDSCL_NORMAL.  Out of exclusive mode, the code has to be able to handle no automatic back surfaces and no flip, which the main code did handle by manually creating back surfaces and using Blt() instead of Flip() in that case--or even not using DDraw at all if you had the .ini configuration.  The movie code, on the other hand, used DDraw regardless, and if you try to set DDSCL_NORMAL on it, it would crash the first time it tried to access the automatic backbuffer.

If the movie played, the main code inherited the DDSCL_EXCLUSIVE from the movie code even if the main code wasn't using DDraw because they used the same window handle.

I've got ALT-TAB working plus instead of minimizing it runs on a sizeable window outside of full screen.  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.


Title: Re: scient replied
Post by: ete on December 08, 2014, 04:42:35 AM
I can have a go at reviving Guv, I bet he'll love the switch to github.
Title: Re: scient replied
Post by: Buster's Uncle on December 08, 2014, 04:48:27 AM
I vote in favor.
Title: Re: scient replied
Post by: ete on December 08, 2014, 04:49:35 AM
On my to do list. Will probably happen tomorrow.
Title: Re: scient replied
Post by: Yitzi 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.
Title: Re: scient replied
Post by: PlotinusRedux 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:

Title: Re: scient replied
Post by: scient 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.
Title: Re: scient replied
Post by: Lord Avalon 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.
Title: Re: scient replied
Post by: scient 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.
Title: Re: scient replied
Post by: Mart 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.
Title: Re: scient replied
Post by: Sigma 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.
Title: Re: scient replied
Post by: DrazharLn 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?
Title: Re: scient replied
Post by: 551262 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.
Title: Re: scient replied
Post by: scient 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.
Title: Re: scient replied
Post by: scient 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.
Title: Re: scient replied
Post by: 551262 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.
Title: Re: scient replied
Post by: scient 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.
Title: Re: scient replied
Post by: Yitzi 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.
Title: Re: scient replied
Post by: Buster's Uncle 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.
Title: Re: scient replied
Post by: 551262 on December 09, 2014, 03:45:39 AM
I think I have XCode on a CD. Let me check...yeah it's XCode version 2.0, dated 2005. It's for 10.4 Tiger. It says that it has support for 10.1, 10.2 and 10.3. I have all of those versions on CD and a spare iMac G4 800MHz that I can devote to the job. Probably needs new heatsink compound on the ... little contact, aside from that it should be fine. Right now it has 9.2.2 and 10.4.11 on a 60GB HDD.

EDIT: I'm seeing gcc 3.3 and gcc 4.0 under the /Packages directory. *shrugs*
Title: Re: scient replied
Post by: Buster's Uncle on December 09, 2014, 04:09:12 AM
 :)
Title: Re: scient replied
Post by: scient on December 09, 2014, 04:27:28 AM
That gif! :D

@551262: I already have archived copy of XCode v4 that still compiles for 10.5/10.6 along with support for PPC. I believe that is the last version available. I'm pretty sure once Apple moved over to llvm, they dropped support for PPC. It is probably better to use whatever the latest version of Xcode possible.

Either way, having a full compilable version for windows, let alone mac, is many years off.
Title: Re: scient replied
Post by: vv221 on December 11, 2014, 03:01:43 AM
Is it just me dreaming, or am I looking at the making of an open-source re-implementation of SMAC/SMACX?

Dunno if I can help in any way at the moment, with my programming skills limited to some shell scripts…
Well, might be the time to learn a couple more languages!

Anyway, I’ve a Loki native Linux version of the game here that I used as a base to build .deb packages (for Debian, Ubuntu, Linux Mint, etc.), if you need some precisions on the file formats or whatever used there (including the .mpg movies).
Title: Re: scient replied
Post by: PlotinusRedux on January 14, 2015, 08:20:43 AM
How goes it, Scient?  I've suspended all my activity except for looking at the .cvr files with Ford until you release your IDA DB.  I'm eager to try my hand at turning the disassembly into a compile-able C++ app.  Your DB doesn't need to be perfect, or your final, complete work--an interim release will let me move forward writing and testing the IDA python scripts to do the conversion, which will probably take me up to a month to perfect anyway, then we can run them on your final product later.
Title: Re: scient replied
Post by: ete on January 16, 2015, 01:41:55 PM
pinged him by email with that message, since he's not logged into the forums for ~20 days.
Title: Re: scient replied
Post by: PlotinusRedux on January 24, 2015, 09:57:09 AM
Is it normal for him to be gone this long?  His profile still shows Dec 25th as his last log on.
Title: Re: scient replied
Post by: Buster's Uncle on January 24, 2015, 03:33:57 PM
It normal, alas.
Title: Re: scient replied
Post by: PlotinusRedux on February 02, 2015, 08:54:57 AM
Hmm.  On the one hand, I'm finding Pandora to be about 70% of what I hoped to achieve with a SMACX 2.  On the other hand, I was really looking forward to bringing SMACX into the new century.

I basically halted all my work for the past 2 months because it would have been duplicating what Scient has already done.  But he planned to release his work by the end of the year--which seemed a very optimistic time frame to me--and now over a month later he's still silent. 

If you're reading this, Scient, I completely understand you not being ready to release by the end of the year, I just need to hear something from you to know if you're still working on it, in which case I'm happy to continue to wait, or if you've just abandoned the whole project, in which case those of us left can move forward on our on.  Obviously I'd rather wait for you if you're still working on it, but with no contact at all, I don't even know if you're still alive.
Title: Re: scient replied
Post by: Buster's Uncle on February 02, 2015, 03:13:17 PM
scient disappears.  He just does; I'd advise trying to contact him directly, and if that hasn't worked pretty quickly, proceed without him.
Title: Re: scient replied
Post by: Yitzi on February 02, 2015, 03:56:18 PM
Hmm.  On the one hand, I'm finding Pandora to be about 70% of what I hoped to achieve with a SMACX 2.

Does it have the same sense of character and scale-of-storyline?
Title: Re: scient replied
Post by: PlotinusRedux on February 05, 2015, 06:56:16 AM
Yitzi,

The character, story, and atmosphere aren't as good as SMACX by a long shot, but they're light years better than BE.

The factions themselves are basically SMAC clones--scientist, religious, ecological, military, diplomat, etc.  And that is integrated fairly well into the diplomatic conversations--other factions will accuse the scientist of dangerous experiments whereas if you're the scientist you get to speak very condescendingly to the other factions.  The bit of flavor missing there is no character is given to 3rd parties in conversation--the religious leader will talk about sin and converting the world as well as what she specifically likes or doesn't like about your faction, but if she asks you to declare war on the ecology leader she just gives that leader's name rather than calling her a crazed tree huger dancing naked under the stars.

There's no grand unifying story like the world you're on achieving consciousness, but there are a couple of storied events that drastically affect play--a gradual eclipse that drives the native life mad, and a world wide invasion by the former inhabitants of the planet that tends to suspend all wars while everyone cooperates to survive.

It's clearly meant to be a SMAC clone--it's got the same unit workshop, fungus, etc.

It has an interesting mechanic that randomizes what techs are prerequisites for what (within limits), so you have to come up with a different tech strategy each game.

It's missing wonder and victory/defeat movies, which is a big negative for me as I find they add a lot of atmosphere to games.  But BE and Civ 5 don't have those either.

It's also missing the sense of climate.  You can raise and lower terrain, but you're just changing whether that hex is plains, hills, or mountains like the Civ games rather than pulling a 3D grid up or down, and I haven't noticed that doing so has any affect on rainfall.

I'd definitely recommend it, and it's the closest modern game to SMACX I've seen--it's about 70% of the way to what I'd want SMACX 2.0 to be, which is a lot closer than anything else has come.
Title: Re: scient replied
Post by: Yitzi on February 08, 2015, 01:10:12 AM
Yitzi,

The character, story, and atmosphere aren't as good as SMACX by a long shot, but they're light years better than BE.

The factions themselves are basically SMAC clones--scientist, religious, ecological, military, diplomat, etc.  And that is integrated fairly well into the diplomatic conversations--other factions will accuse the scientist of dangerous experiments whereas if you're the scientist you get to speak very condescendingly to the other factions.  The bit of flavor missing there is no character is given to 3rd parties in conversation--the religious leader will talk about sin and converting the world as well as what she specifically likes or doesn't like about your faction, but if she asks you to declare war on the ecology leader she just gives that leader's name rather than calling her a crazed tree huger dancing naked under the stars.

There's no grand unifying story like the world you're on achieving consciousness, but there are a couple of storied events that drastically affect play--a gradual eclipse that drives the native life mad, and a world wide invasion by the former inhabitants of the planet that tends to suspend all wars while everyone cooperates to survive.

It's clearly meant to be a SMAC clone--it's got the same unit workshop, fungus, etc.

It has an interesting mechanic that randomizes what techs are prerequisites for what (within limits), so you have to come up with a different tech strategy each game.

It's missing wonder and victory/defeat movies, which is a big negative for me as I find they add a lot of atmosphere to games.  But BE and Civ 5 don't have those either.

It's also missing the sense of climate.  You can raise and lower terrain, but you're just changing whether that hex is plains, hills, or mountains like the Civ games rather than pulling a 3D grid up or down, and I haven't noticed that doing so has any affect on rainfall.

I'd definitely recommend it, and it's the closest modern game to SMACX I've seen--it's about 70% of the way to what I'd want SMACX 2.0 to be, which is a lot closer than anything else has come.

Sounds to me more like 50%, with SMAC/X itself being 70% or 80%.  (Remember, a sequel should be better than the original).

Of course, that's still closer than anything else...
Title: Re: scient replied
Post by: PlotinusRedux on February 13, 2015, 07:46:35 AM
Yeah, I was taking SMAC unchanged except for a modern GUI and graphics as 100%.

I've actually really been enjoying playing it the more I understand it.

Currently it just has the original SMAC factions (I mean, literally identical down to the sex of each faction)--I hope they add the SMAX expansion factions soon.  Apparently players can make factions, but it's mod management is non-existent.

I don't like it's pollution system at all.  Pollution in SMACX is as it should be--it damages the planet, infuriates native life, and pisses off the ecology faction.  In Pandora, pollution does nothing but increase unhappiness--and fungus, native to the planet, causes pollution!  Pollution is more toxicity to humans than ecological damage.

I do really like the randomizing of tech for each game--it makes for very different strategies depending on what techs are earlier in the tree and what ends up as a prerequisite for what.  Techs are always in their tech era, and it has code that insures within an era improvements on the same tech come later than each other in the tree--so 50% bonus armor is always further in than 25% bonus armor, though 25% may or may not be a prerequisite for 50%.  And you can only see 3 steps down the line from the techs you've discovered.

To pull that back into SMACX would require turning on the option that lets you choose your tech and adding a display of the entire tech tree--probably too much to do.
Title: Re: scient replied
Post by: Yitzi on February 13, 2015, 05:14:32 PM
Yeah, I was taking SMAC unchanged except for a modern GUI and graphics as 100%.

I've actually really been enjoying playing it the more I understand it.

Currently it just has the original SMAC factions (I mean, literally identical down to the sex of each faction)--I hope they add the SMAX expansion factions soon.  Apparently players can make factions, but it's mod management is non-existent.

I don't like it's pollution system at all.  Pollution in SMACX is as it should be--it damages the planet, infuriates native life, and pisses off the ecology faction.  In Pandora, pollution does nothing but increase unhappiness--and fungus, native to the planet, causes pollution!  Pollution is more toxicity to humans than ecological damage.

I do really like the randomizing of tech for each game--it makes for very different strategies depending on what techs are earlier in the tree and what ends up as a prerequisite for what.  Techs are always in their tech era, and it has code that insures within an era improvements on the same tech come later than each other in the tree--so 50% bonus armor is always further in than 25% bonus armor, though 25% may or may not be a prerequisite for 50%.  And you can only see 3 steps down the line from the techs you've discovered.

To pull that back into SMACX would require turning on the option that lets you choose your tech and adding a display of the entire tech tree--probably too much to do.

Actually, while possibly somewhat much for SMAC/X, I have some ideas (largely inspired by Master of Orion) for how a sequel could use a semi-randomized tech tree/discovery rates to make things much more interesting (including a compromise between blind research and directed research that will let you focus on one area but sometimes get things you weren't trying for).
Title: Re: scient replied
Post by: PlotinusRedux on February 18, 2015, 04:03:33 PM
I thought you might find this interesting, Yitzi--apparently since the developer is pretty much done improving Pandora, they gave a player access to the source code to improve the AI--http://www.slitherine.com/forum/viewtopic.php?f=173&t=55054.  Too bad they don't that with all games, like SMAC/X.
Title: Re: scient replied
Post by: Yitzi on February 19, 2015, 04:19:09 AM
I thought you might find this interesting, Yitzi--apparently since the developer is pretty much done improving Pandora, they gave a player access to the source code to improve the AI--http://www.slitherine.com/forum/viewtopic.php?f=173&t=55054.  Too bad they don't that with all games, like SMAC/X.


Thanks, but I don't think I'll work on that; I've got enough with SMAC/X.

(I've also been thinking some more about some interesting game-mechanics ideas that might be usable if we ever make a SMAC 2; ultimately, though, I think that what will really make or break the game is if we can match the thematic strengths of the original.)
Title: Re: scient replied
Post by: PlotinusRedux on April 05, 2015, 06:36:26 AM
Still no word from Scient, I take it?
Title: Re: scient replied
Post by: Buster's Uncle on April 05, 2015, 05:57:08 PM
Not that I know of.
Title: Re: scient replied
Post by: Nevill on May 01, 2015, 11:34:04 AM
Was sighted commenting on rpgcodex forums earlier this week about the paid mods fiasco.

http://www.rpgcodex.net/forums/index.php?threads/steam-is-no-longer-charging-for-mods-now-lmao.98728/page-31#post-3884105 (http://www.rpgcodex.net/forums/index.php?threads/steam-is-no-longer-charging-for-mods-now-lmao.98728/page-31#post-3884105)

He is still around, but he tends to disappear for a long time once in a while.
Title: Re: scient replied
Post by: Buster's Uncle on July 31, 2015, 04:46:44 PM
Actually, rather than wait two weeks if Yitzi or whoever would like to merge my patch that would be great. Releasing a stand alone patch just splitters the patches even more and since Yitzi has been doing the majority of patch work merging the new patches into his sounds like the best solution. Especially since I don't plan to continue releasing patches.

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.

I have a mix of various text files by Guv. The ones I have packaged as part of my patch are not the latest. I believe the ones in "final_update_txt.zip" are the final set he sent me via email. I didn't merge them together so folks can see. However, some kind of unified text files would be a good call. He did a LOT of work updating and cleaning up the stock ones.

Also, inside my patch files I included my internal patches.txt I use to locate specific patch data to speed up applying them to binary. Actually, I don't think I ever applied Kyrub's patches to my binaries. However, everything else should be there. I tested all my patch code extensively.

My readme includes detailed explanations of all the patches and what they do.

Enjoy. I should of shared this sooner with the community.
Can anyone tell me why I shouldn't post scientIficPatch v.2 in Downloads?
Title: Re: scient replied
Post by: Dio on July 31, 2015, 05:17:24 PM
Was sighted commenting on rpgcodex forums earlier this week about the paid mods fiasco.

http://www.rpgcodex.net/forums/index.php?threads/steam-is-no-longer-charging-for-mods-now-lmao.98728/page-31#post-3884105 (http://www.rpgcodex.net/forums/index.php?threads/steam-is-no-longer-charging-for-mods-now-lmao.98728/page-31#post-3884105)

He is still around, but he tends to disappear for a long time once in a while.

This was the last confirmed sighting of the elusive scient  :hunter:.
Title: Re: scient replied
Post by: Buster's Uncle on July 31, 2015, 05:50:05 PM
He does that - it doesn't mean anything except he disappears for long spells.

I'm confident he wouldn't mind it being added to Downloads, so adding to my to-do list.
Title: Re: scient replied
Post by: LetteredLion on September 21, 2015, 10:26:09 PM
Hello. Sorry if this is the wrong play to post. I could find no tread just about the 2.0 patch so am posting in the tread it was released in. I cant open the rar attachment. The zip was no problem. I have a program that opens rar files, PeaZip but cant seem to open this one. Anyone have any ideas? No matter how obvious please give them, extracting rar files is something i do once a year, if that, so i could be completely blanking on something simple.

Thanks,
Lion

Actually, rather than wait two weeks if Yitzi or whoever would like to merge my patch that would be great. Releasing a stand alone patch just splitters the patches even more and since Yitzi has been doing the majority of patch work merging the new patches into his sounds like the best solution. Especially since I don't plan to continue releasing patches.

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.

I have a mix of various text files by Guv. The ones I have packaged as part of my patch are not the latest. I believe the ones in "final_update_txt.zip" are the final set he sent me via email. I didn't merge them together so folks can see. However, some kind of unified text files would be a good call. He did a LOT of work updating and cleaning up the stock ones.

Also, inside my patch files I included my internal patches.txt I use to locate specific patch data to speed up applying them to binary. Actually, I don't think I ever applied Kyrub's patches to my binaries. However, everything else should be there. I tested all my patch code extensively.

My readme includes detailed explanations of all the patches and what they do.

Enjoy. I should of shared this sooner with the community.
Title: Re: scient replied
Post by: Nevill on September 21, 2015, 10:32:27 PM
7zip is my go-to program to work with archives. It's free and open source.

http://www.7-zip.org/ (http://www.7-zip.org/)
Title: Re: scient replied
Post by: Buster's Uncle on September 21, 2015, 10:56:21 PM
I prefer ZipCentral - but I don't recall if it handles .rars; 7Zip definitely does..

I'll try to Skype scient, but don't hold your breath...
Title: Re: scient replied
Post by: LetteredLion on September 21, 2015, 11:09:37 PM
First. Thank you for the fast replies. 7-zip solved the issue of it no opening which means my program was failing.

I have however encountered a new error in this quest for getting the patch. When I load it into NSIS the following error appears

"Error in script "C:\Users\*\Documents\patch_2.0_files\##patcher\SMACX Patch.nsi" on line 150 -- aborting creation process"

I have downloaded the patch twice and downloaded both the release version and beta of NSIS. This is the error that appears every time. Any idea how on what the problem could be?

Lion
Title: Re: scient replied
Post by: LetteredLion on September 24, 2015, 07:16:19 PM
Hello, I realize it might be wise to add more data about the error i am encountering when using Scient's installer script. The full text of what NSIS is showing be it quoted at bottom.

It appears to me that the script is unable to find the CPU nn already linked.wav file. However, I can clearly see it in the "ALL" folder inside the "##current patch files" folder. To see what would happen I deleted that line of the NSIS script. This only lead to it returning the same error about the next line on the wpn missile launcher.wav file.

Any thoughts on how I might be able to fix this? Any idea no matter how simple it seems to you would be great. I only work with scripts very infrequently and can be considered a novice at many aspects of computers.

Lion

Quote
Processing config:
Processing plugin dlls: "C:\Program Files (x86)\NSIS\Plugins\*.dll"
 - AdvSplash::show
 - Banner::destroy
 - Banner::getWindow
 - Banner::show
 - BgImage::AddImage
 - BgImage::AddText
 - BgImage::Clear
 - BgImage::Destroy
 - BgImage::Redraw
 - BgImage::SetBg
 - BgImage::SetReturn
 - BgImage::Sound
 - Dialer::AttemptConnect
 - Dialer::AutodialHangup
 - Dialer::AutodialOnline
 - Dialer::AutodialUnattended
 - Dialer::GetConnectedState
 - InstallOptions::dialog
 - InstallOptions::initDialog
 - InstallOptions::show
 - LangDLL::LangDialog
 - Math::Script
 - NSISdl::download
 - NSISdl::download_quiet
 - Splash::show
 - StartMenu::Init
 - StartMenu::Select
 - StartMenu::Show
 - System::Alloc
 - System::Call
 - System::Copy
 - System::Free
 - System::Get
 - System::Int64Op
 - System::Store
 - TypeLib::GetLibVersion
 - TypeLib::Register
 - TypeLib::UnRegister
 - UserInfo::GetAccountType
 - UserInfo::GetName
 - UserInfo::GetOriginalAccountType
 - VPatch::GetFileCRC32
 - VPatch::GetFileMD5
 - VPatch::vpatchfile
 - nsDialogs::Create
 - nsDialogs::CreateControl
 - nsDialogs::CreateItem
 - nsDialogs::CreateTimer
 - nsDialogs::GetUserData
 - nsDialogs::KillTimer
 - nsDialogs::OnBack
 - nsDialogs::OnChange
 - nsDialogs::OnClick
 - nsDialogs::OnNotify
 - nsDialogs::SelectFileDialog
 - nsDialogs::SelectFolderDialog
 - nsDialogs::SetRTL
 - nsDialogs::SetUserData
 - nsDialogs::Show
 - nsExec::Exec
 - nsExec::ExecToLog
 - nsExec::ExecToStack

!define: "MUI_INSERT_NSISCONF"=""

Changing directory to: "C:\Users\*\Documents\patch_2.0_files\##patcher"

Processing script file: "C:\Users\*\Documents\patch_2.0_files\##patcher\SMACX Patch.nsi"
!include: "C:\Program Files (x86)\NSIS\Include\MUI2.nsh"
!include: "C:\Program Files (x86)\NSIS\Contrib\Modern UI 2\MUI2.nsh"
NSIS Modern User Interface version 2.0 - Copyright 2002-2009 Joost Verburg (C:\Program Files (x86)\NSIS\Contrib\Modern UI 2\MUI2.nsh:8 )
!define: "MUI_INCLUDED"=""
!define: "MUI_SYSVERSION"="2.0"
!define: "MUI_VERBOSE"="3"
!include: closed: "C:\Program Files (x86)\NSIS\Contrib\Modern UI 2\MUI2.nsh"
!include: closed: "C:\Program Files (x86)\NSIS\Include\MUI2.nsh"
!define: "APP_NAME"="SMAC/X Unofficial Patch"
!define: "VERSION"="02.00.00.00"
!define: "VERSION_SHRT"="2.00"
!define: "REG_ROOT"="HKLM"
!define: "REG_APP_PATH"="Software\Microsoft\DirectPlay\Applications"
!define: "PATCH_FILES_PATH"="K:\#AC-ACX Project\##current patch files"
VIAddVersionKey: "ProductName" "SMAC/X Unofficial Patch"
VIAddVersionKey: "CompanyName" "scient"
VIAddVersionKey: "LegalCopyright" "scient © 2013"
VIAddVersionKey: "FileDescription" "SMAC/X Unofficial Patch"
VIAddVersionKey: "FileVersion" "02.00.00.00"
CRCCheck: on
XPStyle: on
SetCompressor: /FINAL /SOLID LZMA
Name: "SMAC/X Unofficial Patch"
Caption: "SMAC/X Unofficial Patch v2.00 Installer"
OutFile: "SMACX_UP_v2.00_Installer.exe"
!define: "MUI_ABORTWARNING"=""
!define: "MUI_UNABORTWARNING"=""
!define: "MUI_LANGDLL_REGISTRY_VALUENAME"="Installer Language"
!insertmacro: MUI_PAGE_DIRECTORY
!insertmacro: end of MUI_PAGE_DIRECTORY
!insertmacro: MUI_PAGE_INSTFILES
!insertmacro: end of MUI_PAGE_INSTFILES
!insertmacro: MUI_UNPAGE_CONFIRM
!insertmacro: end of MUI_UNPAGE_CONFIRM
!insertmacro: MUI_UNPAGE_INSTFILES
!insertmacro: end of MUI_UNPAGE_INSTFILES
!insertmacro: MUI_LANGUAGE
!insertmacro: end of MUI_LANGUAGE
!insertmacro: MUI_RESERVEFILE_LANGDLL
!insertmacro: end of MUI_RESERVEFILE_LANGDLL
Function: ".onInit"
!insertmacro: MUI_LANGDLL_DISPLAY
!insertmacro: end of MUI_LANGDLL_DISPLAY
ReadRegStr $0 HKLM\Software\Microsoft\DirectPlay\Applications\Sid Meier's Alpha Centauri\UnofficialPath
StrCmp "$0" "" equal=0, nonequal=default_path
ReadRegStr $0 HKLM\Software\Microsoft\DirectPlay\Applications\Sid Meier's Planetary Pack\Path
StrCmp "$0" "" equal=0, nonequal=default_path
ReadRegStr $0 HKLM\Software\Microsoft\DirectPlay\Applications\Sid Meier's Alpha Centauri\Path
StrCmp "$0" "" equal=0, nonequal=default_path
ReadRegStr $0 HKLM\Software\Microsoft\DirectPlay\Applications\Sid Meier's Alien Crossfire\Path
StrCmp "$0" "" equal=0, nonequal=default_path
StrCpy $0 "$PROGRAMFILES\Sid Meier's Alpha Centauri" () ()
StrCpy $INSTDIR "$0" () ()
FunctionEnd
!define: "BCKPATH"="$INSTDIR\_backup_v2.00"
Section: "-MainProgram"
SetShellVarContext: current
Rename: $INSTDIR\fungalpayld_sm.pcx->$INSTDIR\fungpayld_sm.pcx
Rename: $INSTDIR\humref_sm.pcx->$INSTDIR\humanref_sm.pcx
Rename: $INSTDIR\sporelnch_sm.pcx->$INSTDIR\sporlnch_sm.pcx
WriteINIStr: [PREFERENCES] ForceOldVoxelAlgorithm=0 in $INSTDIR\Alpha Centauri.ini
IfFileExists: "$INSTDIR\fx" ? 0 : +2
WriteRegStr: HKLM\Software\Microsoft\DirectPlay\Applications\Sid Meier's Alpha Centauri\Complete=Yes
WriteRegStr: HKLM\Software\Microsoft\DirectPlay\Applications\Sid Meier's Alpha Centauri\UnofficialVer=2.00
WriteRegStr: HKLM\Software\Microsoft\DirectPlay\Applications\Sid Meier's Alpha Centauri\UnofficialPath=$INSTDIR
CreateDirectory: "$INSTDIR\_backup_v2.00\fx"
Delete: "$INSTDIR\*.016"
Delete: "$INSTDIR\*.256"
Delete: "$INSTDIR\*.icd"
Delete: "$INSTDIR\clcd*.dll"
Delete: "$INSTDIR\clokspl.exe"
Delete: "$INSTDIR\dplayerx.dll"
Delete: "$INSTDIR\drvmgt.dll"
Delete: "$INSTDIR\secdrv.sys"
Delete: "$INSTDIR\logfile.txt"
CopyFiles: (silent) "$INSTDIR\fx\CPU nn already linked.wav" -> "$INSTDIR\_backup_v2.00\fx", size=0KB
CopyFiles: (silent) "$INSTDIR\fx\wpn missile launcher.wav" -> "$INSTDIR\_backup_v2.00\fx", size=0KB
CopyFiles: (silent) "$INSTDIR\fx\wpn singularity laser.wav" -> "$INSTDIR\_backup_v2.00\fx", size=0KB
CopyFiles: (silent) "$INSTDIR\terran.exe" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\alpha.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\basename.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\believe.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\blurbs.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\concepts.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\credits.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\facedit.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\faction.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\flavor.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\gaians.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\help.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\hive.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\Holobook.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\interlude.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\jackal.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\labels.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\menu.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\monument.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\morgan.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\movlist.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\peace.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\scenario.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\script.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\spartans.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\system.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\techlongs.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\techshorts.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\tutor.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
CopyFiles: (silent) "$INSTDIR\univ.txt" -> "$INSTDIR\_backup_v2.00", size=0KB
SetOutPath: "$INSTDIR\fx"
File: "K:\#AC-ACX Project\##current patch files\ALL\CPU nn already linked.wav" -> no files found.
Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
   /oname=outfile one_file_only)
Error in script "C:\Users\*\Documents\patch_2.0_files\##patcher\SMACX Patch.nsi" on line 150 -- aborting creation process
Title: Re: scient replied
Post by: LetteredLion on September 28, 2015, 06:19:58 AM
Hi. I found the cause of the error i posted about earlier and this is how to fix it should anyone have it in the future after downloading the 2.0 patch.

First here are the first few lines of the NCIS script file Scient included in the patch.

Quote
# TODO
# custom image on launch -> AdvSplash
# banner image

!include "MUI2.nsh"

!define APP_NAME "SMAC/X Unofficial Patch"
#!define WEB_SITE "http://www.civgaming.net/forums/"
!define VERSION "02.00.00.00"
!define VERSION_SHRT "2.00"
!define REG_ROOT "HKLM"
!define REG_APP_PATH "Software\Microsoft\DirectPlay\Applications"
#!define REG_GOG_PATH "Software\GOG.com"
!define PATCH_FILES_PATH "K:\#AC-ACX Project\##current patch files"


The last line is the important one. If i was more computer savvy than I am, I expect it would have taken me less time to solve this mystery. The default file path "K:\#AC-ACX Project\##current patch files" wont work for you most likely. The way i solved it was to rename the folder with the patch in it which by default is "patch_2.0_files" to "#AC-ACX Project" then drop it into my C drive and change K to C in the file path in the script to keep the script changes to a minimum. However the path can just be rewritten to wherever you have the folder and whatever you have named it. I hope this is helpful to anyone not that good with tech like me who downloads the patch.

Lion
Title: Re: scient replied
Post by: scient on May 15, 2016, 12:35:40 AM
scient talked to ANYone five months ago and I'm only hearing about it now?


Like Rumpelstiltskin just say my name and I appear (maybe with a bit of delay haha). I'll do a more in-depth post in one of other threads related to my work on SMACX.

For learning RCE, I suggest writing small basic programs in C/C++ and then popping the compiled debug binary into IDA/debugger. OllyDbg is great debugger for beginners. For disassembly, IDA is industry standard. There are some others like Hopper for mac. IDA also had a great decompiler plugin that is quite helpful with SMACX code. This way you have your own original source code and can see what's going on under the hood.

Great books under Reverse Engineering section here:
http://dfir.org/?q=node/8 (http://dfir.org/?q=node/8)

The x86 binary (windows) was compiled with an older version of Microsoft Visual C++ (5 or 6).

So I've been talking with DrazharLn about sharing the database like a week ago. He reached out to me via email, my life has been hectic. I have a little bit of time before things get busy again so I'm currently working on cleaning a few things up and merging notes into the database. There is much do to with understanding data structures as well as what certain globals or enums do. I have tried to identify as much as I can as I work on it. Either way, it makes it a lot easier to say find specific combat, base or diplomacy code than blindly look around. Want to understand something related to global map? Just see all references to g_MAP in database. Things like this. It makes finding patterns and understanding code flow more manageable.

Once I finish a draft ready for public, I will host it on here as reference and maybe if people identify more stuff merge that info in future draft. If I run out of time and don't finish want I wanted to, will post it anyway. Either way, it will get posted by first week in June.
Glad you're not dead, sir. :D

Sooner is better than later - just sayin'.


So as not to hijack that other thread, moving over to here. Haha yeah, I'm not dead even though I feel like it sometimes. Don't worry, DrazharLn has a draft copy as of yesterday that he has full permission to post in the event I get struck by lightening or I doze off and disappear for another couple years. I'd just like to attempt a little work on it while I have some time over next two weeks.

There are a few things I left undone when I got burnt out the last time. Translating all the PPC mac binary functions over to x86 database is tedious. Right now I'm going through systematically and checking for ones I missed. There aren't many, maybe like 10-20 so far. I'm also making note of any functions that were in PPC binary but I couldn't find in x86. I'm starting to put some notes in IDB notes section. Most of them are small functions that got inlined by compiler, say like checking flag on certain faction inside another factions global diplomacy struct. Also, I am unifying everything. Since I was working on it off and on, a few of my naming conventions became piecemeal. So as I review over all functions, correcting some of those. And of course trying to identify globals and structs when possible.

There is something weird I came across related to map. So there is the large map of all tiles stored in memory that it allocates based on X bounds (2 x horizontal value) * Y bounds. However, it creates this "alternate" map that is compressed. A lot of missing functions were related to accessing it that either got inlined or I couldn't find. I haven't spent a lot of time trying to debug it but I wasn't sure if someone had any idea.

Also, here is a list so far of missing functions that I couldn't locate.

Quote
alt_at(int, int)
bad_reg(int) : 00575502
base_project(int)
bit_at(int, int)
by_zoom(int, int) : bases
byteflip_dogleader(DogLeader *)
byteflip_dogvehicle(DogVehicle *)
byteflip_leaders(Leader *)
byteflip_monument(Monuments *)
byteflip_offers(void)
byteflip_player(Player *)
byteflip_regions(Region *)
byteflip_snoopdogleader(SnoopDogLeader *)
byteflip_timecontrol(TimeControl *)
byteflip_vehicle(Vehicle *)
clear(char *) : null string
climate_at(int, int)
code_at(int, int)
crappy(int, int) : something to do with base_terraform()
expand(int) : expanding abstract map?, param * 5
friction_level(int, int) : get fac_struct_friction_level (0056CB82)
get_special(char *, int *) : 005DC85C
get_special_link(char *,int *) : 005DC817
has_agenda(int fac1, int fac2, int enum) : checks against fac_struct_diplo_agenda (00577AA9)
has_treaty(int,int,int) : checks against fac_struct_diplo_status (00560CBB)
help_spock(void): 0x0051F1EC
hof_load(void) : hall_of_fame()
hof_save(void) : hall_of_fame()
io_mapwin(MapWin *, std::_FILE *)
is_ocean(int, int)
map_loc(int, int)
on_abstract(int, int)
polygon(Buffer *, Vert *, int, int)
polygon_dest(Buffer *, Vert *, int, unsigned char *)
pop_close(void)
popp(char *, char *, int (*)(void))
population_limit(int) : base_growth() / base_doctors()
reactor_power(int) : 005799CD
recurse_zorder(Win *) : 005F4EC0
region_at(int, int)
rocky_at(int, int)
scan_out_line_poly(int, int)
scan_out_line_poly_dest(int, int)
sunny(int, int)
temp_at(int, int)
vector_dist(int, int)
vector_dist(int, int, int, int)
veh_down(int)
veh_who(int, int)
xrange_abstract(int) : similar to xrange but specifc to WORLD global?
Title: Re: scient replied
Post by: Buster's Uncle on May 30, 2016, 01:00:24 PM
I've put the word out a few places in the last two days about the code database being in the works - any progress to report while people are looking in?
Title: Re: scient replied
Post by: Buster's Uncle on May 30, 2016, 01:25:34 PM
Ah.  What he was typing while I asked:
I have made leaps and bounds working on the database over the past two weeks. I really am starting to get an idea of all the different classes for the game and how they work together. Well, at least in my head. I've been trying to mark up and identify as much as possible in the database, especially related to the interface code and how it interacts with logic and structures. I have merged 95% of what was in the PPC binary into my database related to function names and custom variable parameters. As of now, my database is more complete along with the huge amount that I have identified on my own. I have tried to keep the same naming conventions so everything stays fairly uniform.

I've decided on a cut off and release date, 6/15. I have done most of what I wanted to accomplish for a public release and should finish up the rest by then.
Title: Re: scient replied
Post by: scient on May 30, 2016, 01:42:59 PM
I'll make a new thread once I post it. Perhaps others can help identify structure components or unidentified functions that I overlooked. Or any mistakes. I am fairly through but things can slip through. A lot of work will need to go into figuring out what makes up the struct for each class. I'll continue to work on it after public release, perhaps make a 2nd release at end of summer.

My plans for the release package will be the compressed IDA database that will work with v6.8 or v6.9. I will include the unpatched SMACX v2.00 exe I originally used.  This might be useful to those that want to export a map file for ollydbg or debug with IDA.
Title: Re: scient replied
Post by: Buster's Uncle on May 30, 2016, 01:46:10 PM
You'll want to include an appeal for feedback and what-not in your OP, then.  I can get some eyes on it... ;nod
Title: Re: scient replied
Post by: Buster's Uncle on May 30, 2016, 04:43:05 PM
In case you have any interest in talking it up yourself:
http://www.civgaming.net/forums/showthread.php?p=164625#post164625 (http://www.civgaming.net/forums/showthread.php?p=164625#post164625)
http://www.weplayciv.com/forums/showthread.php?9169-SMACX-Code-Database&p=303165.0 (http://www.weplayciv.com/forums/showthread.php?9169-SMACX-Code-Database&p=303165.0)
http://apolyton.net/showthread.php/213256-SMACX-Code-Database (http://apolyton.net/showthread.php/213256-SMACX-Code-Database)
http://forums.civfanatics.com/showthread.php?t=568329 (http://forums.civfanatics.com/showthread.php?t=568329)
-And I can point you at a few spots on Facebook, too, where the real numbers are, if not as high a percentage hardcore tech d00dz...

I'll let you know if there's any substantive feedback/questions.  One of the Facebook postings got an almost-instant "Woah, haven't fooled around with SMAC/X for awhile but this is almost biblical :D" and a "What does this actually allow, in practical terms for non-coders?" that I don't feel qualified to answer more than "Nothing - but it makes mods you can use more likely..." which I haven't done - yet...
Title: Re: scient replied
Post by: scient on May 30, 2016, 05:29:28 PM
I'll pop into those threads when it gets closer to 6/15. Pretty sure I have accounts on all of those forums. And thank you! That would be appreciated.

You are correct. From the stand point of someone non-technical it probably means little. For modding? I hope it to be a cornucopia of information. You want to mess around with scroll bars? Easy. You want to see all the functions related to the infographic windows at bottom of main window? Done. You want to poke around all the diplomacy or battle code? Or perhaps the internal structure of a "unit" stored in memory and all the references to a unit's status? Done. Stuff like this and much more. The goal for me at least is to have a fully marked up database that could be used to start decompiling whole portions of the game.
Title: Re: scient replied
Post by: Buster's Uncle on May 30, 2016, 05:43:06 PM
I'll just quote that from you when I need to bump the thread in the FB Alpha Centauri Players' Group.  -And it will tend to do more good for you to comment later as far as bumping the forum threads -the others will probably stay topped, but the CFC one probably won't stay topped all day today, because someone's asking Petek install questions. 

You know, of course, the more actively we push, the more techies you'll get - which is a win for everyone involved...
Title: Re: scient replied
Post by: Buster's Uncle on May 31, 2016, 02:07:45 AM
Worth mentioning - if we get enough hard tech talk going, a Source Code Database subforum would take me longer to log in to the admin panel and scroll down to Boards and Topics than to make a sub w/ mod powers for you for ease of sorting if you like.  A Tech D00dz usergroup would also be doable, and that would make making the sub private possible - but I wouldn't much want that last, public discussion being good best for drawing more tech d00dz...

-Also, you're entitled to Staff Room access, but I never offered 'cause I figure you're not curious about seeing the staff yelling at me when I'm bad in Rec Commons and suchlike, and the nuts and blots of running the place - but you're in if you say different...
Title: Re: scient replied
Post by: scient on May 31, 2016, 03:01:58 AM
I'm all for open sharing of any decompiling info. Not sure if it's necessary to make a private sub. Let's see how much interest it garners. I won't be able to spend as much time on the project as I have past couple weeks. I'll still be working on improving the database and checking in. For now a thread is probably ok, but we could always move it into it's own sub. I just hope that it can be of use to the community, I've poured countless hours into it haha.

I know DrazharLn was interested in hooking functions into compilable dll. This might be a good step if we can redirect certain functions and inline any assembly (like globals) that haven't been broken down yet. I plan on asking friend of mine who is a brilliant coder for some advice on the best way to tackle this.
 
As for Staff Room, sure!
Title: Re: scient replied
Post by: Buster's Uncle on May 31, 2016, 03:18:42 AM
Okay - you're in.  Scroll down to the bottom of the page - one advantage is that I hate PMs, so something calling for discretion is relatively private, there, if you don't mind that darn Draz seeing.  Read/post opinions about anything else you feel like.  You are the Boss of Me -somewhat- in your domain here -Yitzi, too- so in there's a good place to yell at me when I'm bad in here.
Title: Re: scient replied
Post by: Solver on June 09, 2016, 09:09:57 PM
Just completely blown away by the disassembly effort and the IDA work.
Title: Re: scient replied
Post by: Buster's Uncle on June 17, 2016, 04:42:21 PM
SMACX v2.0 Analysis

Quote from: scient (Brendan Casey) - 6/15/2016
This is a work in progress of a complete analysis on the SMACX v2.0 binary.
There is much left to do regarding filling in missing functions as well as
details regarding internal structures. It is provided as is. There might be
mistakes as meticulous as I am. If you find somewhere that I did something
incorrectly, please post on the forums and let me know. I plan to continue
my analysis on the binary as time permits. However, I hope by releasing the
database in its current state that the community will benefit.

http://alphacentauri2.info/index.php?action=downloads;sa=view;down=341 (http://alphacentauri2.info/index.php?action=downloads;sa=view;down=341)
I spent an hour or two posting/linking this at the forums listed above and on Facebook.  Let's hope we can draw some tech input...
Title: Re: scient replied
Post by: DrazharLn on June 20, 2016, 10:15:17 PM
I've got a lot of work on at the moment, but I'm really appreciative of scient's work and I've already learnt stuff I hope to use in PRACX from looking through the database :)
Title: Re: scient replied
Post by: scient on June 22, 2016, 03:54:26 AM
Glad you got some use out of it. If anyone has any questions about the database I will be happy to try and answer them the best I can. I've already started working on next draft of it. I'll aim for a release either end of summer or sometime early in the fall. Since the majority of the functions have been identified, I plan on working trying to flush out details about internal structures used by the game and improve upon the ones I've identified. This will increase understanding of code flow and logic across multiple classes and functions.
Title: Re: scient replied
Post by: Bearu on July 20, 2016, 02:41:51 AM
The IDA database continues to tell me that I need a newer version of IDA Free to open the database file even though I have the most recent version of the free software from the website. What version and type of license was the database created under? I might have to employ a slightly creative measure to extract the information from the database.
Title: Re: scient replied
Post by: DrazharLn on July 20, 2016, 12:35:08 PM
I was wrong earlier. Looks like you actually need IDA 6.8 to open it. Scient says it's not possible to downgrade the database.
Title: Re: scient replied
Post by: scient on July 20, 2016, 01:47:58 PM
Yeah, unfortunately after going from one version to the next you can't downgrade. Also, there are a lot of features that 6 adds that improves the analysis which are not part of 5.
Title: Re: scient replied
Post by: Buster's Uncle on July 20, 2016, 03:48:43 PM
Is there nothing we can do to make the info more generally accessible?  -We very much want people looking and commenting and all that, and nobody much being able w/o some Svensgaard action is obviously a barrier to participation we could really do without...
Title: Re: scient replied
Post by: scient on July 21, 2016, 03:15:48 AM
I know IDA supports exporting a lot of the disassembly information into a MAP file (File>Produce File>Create MAP file).  You can then import this into OllyDbg. I forget if Olly needs a plugin or if it supports this natively. You won't get some information and it won't be as nicely presented to go through statically, however it would be better than nothing.  It should make the debugging information more readable. That's the only solution I can think of since there is no going back from 6.x to 5.x. My old 5.x database is really out of date and wouldn't be useful at all.
Title: Re: scient replied
Post by: Buster's Uncle on July 21, 2016, 03:28:40 AM
Please?
Title: Re: scient replied
Post by: scient on July 22, 2016, 04:45:48 AM
Tomorrow evening or this weekend I'll play around with it and get some instructions on how to get the map file (along with file itself) working with OllyDbg. I have only done it a few times before since I do most of my debugging straight in IDA now.
Title: Re: scient replied
Post by: scient on July 27, 2016, 02:56:46 AM
Sorry for delay, I got caught up finishing a training presentation for work.

So the plugin I have used in the past to load sigs and map files from IDA into OllyDbg is GODUP. There are plenty of others that do the same thing so take your pick. You can then load in the labels and any comments. I haven't done much commenting so that won't be as useful however it can't hurt. Most of my work has been more to make the disassembly readable in IDA so you don't need comments. The labels you would at least get the function and class names mostly in. It is not as pretty as IDA but better than nothing. Anyone wanting to do a deep analysis on SMACX binary I strongly encourage to use IDA so you benefit from all the analysis information I have gathered such as structures and enums which are key.


Title: Re: scient replied
Post by: Bearu on July 27, 2016, 02:18:06 PM
Okay. I took a gander through the new file and added the comments for the areas in my file that did not match the values in the file. A significant amount of the new information appeared in the Path finder algorithm section.
Title: Re: scient replied
Post by: ariete on October 29, 2022, 08:45:08 PM
hi im playing a game with Hive using Scient last patch on a Smac vanilla improved with what required, xp patch and official v2 patch for smac. Is it normal in social engeneeeing efficency value dont go under 0 whatever negative change i go to make ?

edit : hive is immune in efficency, didnt remember
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: 33 - 892KB. (show)
Queries used: 20.

[Show Queries]