Author Topic: Mods to allow player to address their bases using SQL?  (Read 703 times)

0 Members and 1 Guest are viewing this topic.

Offline JWS0711

Mods to allow player to address their bases using SQL?
« 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!

Offline bvanevery

  • Emperor of the Tanks
  • Thinker
  • *
  • Posts: 6370
  • €659
  • View Inventory
  • Send /Gift
  • Allows access to AC2's quiz & chess sections for 144 hours from time of use.  You can't do without Leadship  Must. have. caffeine. -Ahhhhh; good.  Premium environmentally-responsible coffee, grown with love and care by Gaian experts.  
  • Planning for the next 20 years of SMACX.
  • AC2 Hall Of Fame AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: Mods to allow player to address their bases using SQL?
« Reply #1 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.

Offline JWS0711

Re: Mods to allow player to address their bases using SQL?
« Reply #2 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.

Offline bvanevery

  • Emperor of the Tanks
  • Thinker
  • *
  • Posts: 6370
  • €659
  • View Inventory
  • Send /Gift
  • Allows access to AC2's quiz & chess sections for 144 hours from time of use.  You can't do without Leadship  Must. have. caffeine. -Ahhhhh; good.  Premium environmentally-responsible coffee, grown with love and care by Gaian experts.  
  • Planning for the next 20 years of SMACX.
  • AC2 Hall Of Fame AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: Mods to allow player to address their bases using SQL?
« Reply #3 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++.

Offline EmpathCrawler

Re: Mods to allow player to address their bases using SQL?
« Reply #4 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...

 

* User

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


Login with username, password and session length

Select language:

* Community poll

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

* Random quote

Of all the employments, working in the the brood pit was at once the most horrific and the most desirable. Horrific for what we saw occur day after day, and because of the very nature of the sessile native lifeforms. Desirable, because having been chosen to work in the pit, you were highly unlikely to be one of its victims.
~Captain Ulrik Svensgaard 'The Shadow Resonance'

* Select your theme

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

[Show Queries]