Author Topic: The University cheats to get the Hunter-Seeker Algorithm  (Read 806 times)

0 Members and 1 Guest are viewing this topic.

Offline bvanevery

  • Emperor of the Tanks
  • Librarian
  • *
  • Posts: 4433
  • €701
  • 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.  
  • Planning for the next 20 years of SMACX.
  • AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: The University cheats to get the Hunter-Seeker Algorithm
« Reply #15 on: April 23, 2020, 01:13:41 AM »
Good grief, most of my tree would be a prereq for the Dream Twister.  Anything leading to Sentient Resonance.  Oh well, I guess that means I've rendered the problem mostly meaningless, even if a pull was triggered.

Offline scient

Re: The University cheats to get the Hunter-Seeker Algorithm
« Reply #16 on: May 18, 2020, 01:31:16 AM »
This was not fun to clean up and test. It comes in as the 89th largest function in the game, mostly because of inline function code from compiler optimizations. Let me know if you have any questions.  :)

https://github.com/b-casey/OpenSMACX/blob/master/src/technology.cpp#L302

Also, I left in some testing code if you wanted to see output for all factions / tech. Using a debugger, cause game execution to pause with a breakpoint. My recommendation is on stack_fix() at 0x005B8E10 that triggers when you click stack of units or a base. After that, redirect code flow to function below in DLL. It should be listed under exports. It will then iterate and dump output to logfile.txt.
https://github.com/b-casey/OpenSMACX/blob/master/src/temp.cpp#L438

I would be interested if it dumps any errors. It shouldn't, I ran this through rigorous testing and manual review. But I figured I would leave in check.

Offline bvanevery

  • Emperor of the Tanks
  • Librarian
  • *
  • Posts: 4433
  • €701
  • 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.  
  • Planning for the next 20 years of SMACX.
  • AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: The University cheats to get the Hunter-Seeker Algorithm
« Reply #17 on: May 18, 2020, 04:06:49 AM »
That function is far out!  It will take some time to contemplate.  'Fortunately' COVID-19 grants time.

Offline EmpathCrawler

Re: The University cheats to get the Hunter-Seeker Algorithm
« Reply #18 on: May 19, 2020, 03:36:26 AM »
Weird how they didn't bother to make the Dream Twister a priority for factions with positive PLANET scores but left in the unused Psy rule compulsion.


Am I reading it right where if a faction has a positive Population rule, they are actually more compelled to research Hab Complexes?

Offline scient

Re: The University cheats to get the Hunter-Seeker Algorithm
« Reply #19 on: May 19, 2020, 03:54:31 AM »
Weird how they didn't bother to make the Dream Twister a priority for factions with positive PLANET scores but left in the unused Psy rule compulsion.

I know. Line 425-427 is never reached with vanilla factions.

Am I reading it right where if a faction has a positive Population rule, they are actually more compelled to research Hab Complexes?
You are correct. The faction would be compelled to research Hab Complex/Dome. It looks like Morgan is the only vanilla faction that has POPULATION rule set.

Offline bvanevery

  • Emperor of the Tanks
  • Librarian
  • *
  • Posts: 4433
  • €701
  • 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.  
  • Planning for the next 20 years of SMACX.
  • AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: The University cheats to get the Hunter-Seeker Algorithm
« Reply #20 on: May 19, 2020, 10:05:19 AM »
It looks like Morgan is the only vanilla faction that has POPULATION rule set.

To be quite exact, the only vanilla faction with POPULATION > 0.  The Peacekeepers have it "set", to -2.  It definitely makes sense that if you're crippling a faction with a hab restriction, that they need a strong pull to get the Hab Complex.  Of course it was bad game design to begin with, something I got rid of in my mod.  I suspect there are going to be a number of cases where they put something in alphax.txt, it wasn't really a good idea, so they "fixed" it by hardwiring the binary.

Well at least now the Dream Twister mystery is solved.  I don't believe in giving Psi combat bonuses, so no issue for me.

I'm noticing special privileging for Explore PLANET factions, which would be all 3 of mine since I decided they needed to get their mindworm thing going on.  Centauri Meditation and Planetary Economics both get boosted.  Fortunately I don't consider that much of a problem, but I don't really see the rationale for the latter.  Hybrid Forest, why make it a super duper PLANET faction thing?  Just because Deirdre had some lines about it?

Why hardcode a boost for Environmental Economics as a Build tech?  It's got a Build tech weight in it already in alphax.txt.  Did this code get written before the generalized 4 field weighting mechanism was in place?  Or did it get written in a hurry, trying to fix problems at the binary level?  Did they decide alphax.txt wasn't something they could do revisions of after shipping the game, but they could change the binary around?  It doesn't make sense to have this going on in 2 different places.  This sort of thing is kind of a mess.

Well, at least such an implementation doesn't violate the basic theory of categorical weights actually mattering.

Offline EmpathCrawler

Re: The University cheats to get the Hunter-Seeker Algorithm
« Reply #21 on: May 19, 2020, 02:46:39 PM »
You are correct. The faction would be compelled to research Hab Complex/Dome. It looks like Morgan is the only vanilla faction that has POPULATION rule set.


Ah, I forgot POPULATION limits size with positive numbers.

Offline EmpathCrawler

Re: The University cheats to get the Hunter-Seeker Algorithm
« Reply #22 on: May 19, 2020, 03:22:15 PM »

Why hardcode a boost for Environmental Economics as a Build tech?  It's got a Build tech weight in it already in alphax.txt.  Did this code get written before the generalized 4 field weighting mechanism was in place?  Or did it get written in a hurry, trying to fix problems at the binary level?  Did they decide alphax.txt wasn't something they could do revisions of after shipping the game, but they could change the binary around?  It doesn't make sense to have this going on in 2 different places.  This sort of thing is kind of a mess.

Well, at least such an implementation doesn't violate the basic theory of categorical weights actually mattering.

Well it's not a boost to research the tech, but for the AI to research its prerequisites from the very bottom of the tree up if I'm reading it right. It looks like the alphax weights are directly used to make a decision when the AI selects the next tech to research, but any deeper thought is handled in the exe on a case by case basis. Maybe they wanted to nudge a Build AI to research the commerce-enabling techs? I don't understand the cloud cover condition.
« Last Edit: May 19, 2020, 04:41:34 PM by EmpathCrawler »

Offline bvanevery

  • Emperor of the Tanks
  • Librarian
  • *
  • Posts: 4433
  • €701
  • 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.  
  • Planning for the next 20 years of SMACX.
  • AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: The University cheats to get the Hunter-Seeker Algorithm
« Reply #23 on: May 19, 2020, 07:49:47 PM »
Well it's not a boost to research the tech,

It's what it accomplishes in practice.  It's beelining code.  Even a human player experiences the beelining phenomenon.  Meet the conditions, and your research will head straight for the Hunter-Seeker Algorithm.  I say they either didn't have time to test their weights in alphax.txt and so implemented "expedient hacks" to fix problems as they eventually noticed them.  Or they decided they couldn't ship alphax.txt for some reason but could ship binary patches.  Maybe they were worried about players modding alphax.txt and wanted to force certain behaviors.

Quote
I don't understand the cloud cover condition.

It would only make sense if at some point they had cloud cover as an empire wide problem.  Which maybe they toyed with at some point in their development, who knows.  Nothing about this code says it's good code.  We're clearly looking at a collection of hacks.

Offline EmpathCrawler

Re: The University cheats to get the Hunter-Seeker Algorithm
« Reply #24 on: May 19, 2020, 11:46:58 PM »
To be clear, it's not doing anything to the Build weight. It's doubling the fully calculated sum of weights only if the tech is a prerequisite to Environmental Economics. There is no way to accomplish that with alphax weights alone without completely restructuring the tech tree below Environmental Economics to accommodate something extremely specific to cater to a few factions. Maybe they factions with Build plus another interest (Yang? Roze? Marr?) were weakening themselves by not taking certain Build techs when their other interests suggested something else.


Regardless, the rationale is unknowable and not really worth deducing.

 

* 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)
-=-
18 (6%)
XP Compatibility patch
-=-
9 (3%)
Gog version for Windows
-=-
77 (29%)
Scient (unofficial) patch
-=-
28 (10%)
Kyrub's latest patch
-=-
14 (5%)
Yitzi's latest patch
-=-
85 (32%)
AC for Mac
-=-
2 (0%)
AC for Linux
-=-
5 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
12 (4%)
Total Members Voted: 260
AC2 Wiki Logo

* Random quote

And here we tinker with metal, to try to give it a kind of life, and suffer those who would scoff at our efforts. But who's to say that, if intelligence had evolved in some other form in past millennia, the ancestors of these beings would not now scoff at the idea of intelligence residing within meat?
~Prime Function Aki Zeta-5 'The Fallacies of Self-Awareness'

* Select your theme

*