Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => Modding => Topic started by: JWS0711 on February 01, 2022, 11:10:15 PM

Title: Mods to allow player to address their bases using SQL?
Post by: JWS0711 on February 01, 2022, 11:10:15 PM
Hi All,

I have been using SQL for work for the last 8 years and through playing this game again in the last year I have found that the end game play is fairly time consuming.
It could be much more easily handled if I could address the live database of the bases, units etc and modify their current state via query and do group changes without going through the game upkeep interface or after simply doing all my modifications to the build queue one base at a time.
Is the database while the game is running addressable during debugging?
Has someone made such a mod?
Or perhaps, a governor mod that allows for much more fine grain control?

Thanks!
Title: Re: Mods to allow player to address their bases using SQL?
Post by: bvanevery on February 02, 2022, 05:48:29 AM
Is the database while the game is running addressable during debugging?

"Database?"  Why would you assume that the internal implementation of the game's state, is a database?  I don't know how they actually did it, but I find that idea highly unlikely.  The most glaring reasons would be, in the era this game was made, that would be a piggish use of scarce computing resources.  And there's no transactional reason or value to implement things in terms of a database.  Saving stuff to hard disk, computing things from secondary storage, just isn't what you do in an efficient game that an AI needs to analyze.  At least, not back then, and I can't even imagine it's a good idea now.  For the resources expended... YMMV if you do a game "small enough on modern HW".  There was no such thing back in the day, really.

Quote
Has someone made such a mod?

Exceedingly unlikely.  Somebody would have to have been both an assembly code hacker and a database wonker.  That's a very strange combo.  Considering that efficiency "close to the metal" pulls a programmer towards ASM, and databases pull people towards hard drive, secondary storage, and network considerations.

Quote
Or perhaps, a governor mod that allows for much more fine grain control?

That could mean a lot of things.  I haven't heard of any such thing though.  The 2 binary hack mods that have done a lot of stuff, are Thinker and The Will To Power.  The latter is based on the code of the former, i.e. "downstream".

I'm not sure what you can accomplish with Scient's OpenSMACX.  I don't think it already has any "major modding" features implemented, like a more advanced governor or something.  Scient's area of focus tends to be making things work, fixing bugs, and reverse engineering original features.
Title: Re: Mods to allow player to address their bases using SQL?
Post by: JWS0711 on February 02, 2022, 06:20:16 AM
I guess the reason that I would assume the game is running with a database somewhere in the back is that it is what I am most familiar with and humans tend to reason based on those things with which they are familiar. Also, you mention that the use of a database would be a rather inefficient use of computing resources, but I do remember that my machine would chug when I originally played this when it first came out. Part of the joy of playing it now is that is no longer an issue.

Also, there is data retention that allows the objects in the game to retain values over time and based on their relative position to other objects (tile surface, zones of control) that modify other aspects of the object during combat and movement (unit lands on pod, event occurs). In order for the AI (comp players) to operate, you suggest it is easier to simply do it all in memory? I thought that would have been a more scarce resource than compute or disk back in the day but this is not an area that I excel in.

Also, the nature of the upkeep phase of each turn operates like a For Each/While loop that leads me to think that the game is at least treating bases/units/terrain like objects so I guess the game is written in an object oriented language. These languages are often able to address databases, though I guess that is probably a rather newly feasible technology compared to this game.

At any rate, thanks for the reply and the info on the Thinker and Will to Power mods, I'll check them out.
Title: Re: Mods to allow player to address their bases using SQL?
Post by: bvanevery on February 02, 2022, 06:38:16 AM
you suggest it is easier to simply do it all in memory?

Clearly.

Quote
I thought that would have been a more scarce resource than compute or disk back in the day

Games were made to fit within their memory limitations.  Including how much AI analysis you could do.

Quote
Also, the nature of the upkeep phase of each turn operates like a For Each/While loop that leads me to think that the game is at least treating bases/units/terrain like objects so I guess the game is written in an object oriented language.

I don't think that's sound reasoning.  Nevertheless, I really don't know if it was implemented in C or C++.
Title: Re: Mods to allow player to address their bases using SQL?
Post by: EmpathCrawler on February 04, 2022, 10:29:12 PM
Hi All,

I have been using SQL for work for the last 8 years and through playing this game again in the last year I have found that the end game play is fairly time consuming.
It could be much more easily handled if I could address the live database of the bases, units etc and modify their current state via query and do group changes without going through the game upkeep interface or after simply doing all my modifications to the build queue one base at a time.
Is the database while the game is running addressable during debugging?
Has someone made such a mod?
Or perhaps, a governor mod that allows for much more fine grain control?

Thanks!

Somebody was decompiling the game here but he appears to be dormant. Might give you some clues on if it's possible or not: https://github.com/b-casey/OpenSMACX

I hacked together an AutoHotkey script that adds shortcuts for the build queue menu which can alleviate the pain somewhat. If you're interested I can share it with you. I made an attempt to make it "universal" no matter what screen size, but so far I've only tested it on one PC in one resolution so there are no guarantees...
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 31 - 840KB. (show)
Queries used: 14.

[Show Queries]