Author Topic: Analyzed Procedures and Flags  (Read 10843 times)

0 Members and 1 Guest are viewing this topic.

Offline Dio

Analyzed Procedures and Flags
« on: May 29, 2015, 03:43:58 PM »
I am currently looking into functions that play an important role in determining various aspects of the AI behavior. I plan to release a text file with most of the information I have gathered once I have sufficently compiled accurate material. Presently, this thread is for any .exe coders that want to share the known functions of procedures or memory addresses with flags they have analzyed. I will start with the procedure at 005B9580. I know part of this procedure interacts Unit AI Plans. In particular it is switch 2 of 13 (hexadecimal) that interacts with the AI Unit Plans. In addition, Switch 6  of 13 interacts with Unit special ability flags. Finally, the most frequently called switch in the procedure is switch 2.
« Last Edit: May 29, 2015, 05:23:06 PM by Dio »

Offline Dio

Re: Analyzed Procedures and Flags
« Reply #1 on: May 29, 2015, 03:49:57 PM »
Here are some additional flags I have discovered:

0090E8EC: Custome Game Rules Flags
Do or Die: Don't restart eliminated players: 1
Total War: Allow Victory by Conquest: 2
Mine, All Mine: Allow Economic Victory: 4
Peace in Our Time: Allow Diplomatic Victory: 8
Look First: Flexible starting locations: 10
Tech Stagnation: Slower rate of research discoveries: 20
Intense Rivalry: Opponents more aggressive: 40
Time Warp: Accelerated Start: 80
No Unity Survey: World Map not visible: xh, 1 or 100
Blind Research: Cannot set precise research goals: xh, 2 or 200
Iron Man: Save/Restore restricted to exit: xh, 4 or 400
Higher Goal: Allow Victory by Transcendence: xh, 8 or 800
One for All: Allow Cooperative Victory: xh, 10 or 1000
No Unity Scattering: Supply Pods only at landing sites: xh, 20 or 2000
Spoils of War: Steal tech when conquer base: xh, 40 or 4000
Bell Curve: No Random Events: xh, 80 or 8000

0090E8F0:
Randomize faction leader personalities: 80 00 00
Randomize faction leader social agendas: 1 00 00 00
« Last Edit: May 29, 2015, 04:11:02 PM by Dio »

Offline Dio

Re: Analyzed Procedures and Flags
« Reply #2 on: May 29, 2015, 04:06:21 PM »
Some more Flags for the interested:
0090EA68 <Current Base Governor Options>
Governor manages production: 1
Governor may HURRY production: 20
Governor manages citizens and specialists (including Drone Riots): 40
Governor sets new units to "fully automate": 80
Governor may produce land combat units/ Governor may produce units with Offensive AI Plan: xh, 2 or 2 00 at 004FD77E
Governor may produce naval combat units/ Governor may produce units Naval Superiority AI Plan: xh, 4 or 4 00 at 004FD7D8
Governor may produce air combat units/Governor may produce units with Planet Buster AI units: xh, 8
or 8 00 at 004FD7D1
Governor may produce land defense units/ Governor may produce units with Defensive AI Plan: xh, 10 or 10 00 at 004FD7B4
Governor may produce Combat AI Plan Units: 12 00 at 004FD78A
Governor may produce air defense units/ Governor may produce units with Air Superiority AI Plan: xh, 20 or 20 00 at 004FD7CA
Governor may produce terraformers/ Governor may produce units with Terraforming AI Unit Plans: 80 00/ edi
Governor may produce base facilities: 1 00 00/ esi
Governor may produce colony pods/ Governor may produce units with Colonization AI Unit Plan: 2 00 00
Governor may produce secret projects: 4 00 00
Governor may produce prototypes: 8 00 00
Governor may produce probe teams/ Governor may produce units with Info War AI Unit Plan: 10 00 00
Governor may use multiple priorities: 20 00 00
Governor may produce scout/exploration units/ Governor may produce Units with Reconnaissance AI Plan: 40 00 00
Governor may produce troop transports/Supply Convoys/ Governor may produce units with Naval Transport AI Plan and units with the Supply Convoy AI Plan: 80 00 00
Governor set base to EXPLORE: 1 00 00 00
Governor set base to DISCOVER: 2 00 00 00
Governor set base to BUILD: 4 00 00 00
Governor set base to CONQUER: 8 00 00 00
Governor is active: 80 00 00 00
Governor automatically manages Citizens and Drone Riots at Base (Including Nerve Stapling): 80 00 00 40
« Last Edit: May 29, 2015, 04:50:13 PM by Dio »

Offline Dio

Re: Analyzed Procedures and Flags
« Reply #3 on: May 29, 2015, 04:13:20 PM »
Flags related to Faction Bonuses/Penalites
00946F58: x= memory register (a,b,c,d)
TECHSTEAL: xl, 10
TECHSHARE: Xdx, 20
WORMPOLICE: xl, 40
ALIEN: xl, 80
AQUATIC: xh, 1 or 100
FREEPROTO: xh, 2 or 200
FANATIC: xh, 4 or 400
MINDCONTROL: xh, 8 or 800
COMMFREQ: xh, 10 or 1000
TERRAFORM: xh, 20 or 2000
INTEREST, 0:, xh, 40 or 4000
MORALE, 0: xh, 80 or 8000

00946F60:
TECH, [Short Name]: 0
UNIT: 1
FACILITY: 2
SOCIAL: 3
IMMUNITY: 4
IMPUNITY: 5
PENALTY: 6
FUNGNUTRIENT: 7
FUNGMINERALS: 8
FUNGENERGY: 9
ROBUST: 0A
VOTES: 0B
FREEFAC: 0C
REVOLT: 0D
NODRONE: 0E
FREEABIL: 0F
PROBECOST: 10
DEFENSE: 11
OFFENSE: 12


Offline Dio

Re: Analyzed Procedures and Flags
« Reply #4 on: May 29, 2015, 04:36:00 PM »
Known Flags related to AI Strategies and Personalities. I know of additional flags associated with these addresses that I have not confirmed currently:

 0096C9E0:
 Progenitor Victory: 10 00 00
 Strategy: Attack enemy HQ: 20 00 00
 Cooperate with human player: 40 00 00
 Team up against human player: 80 00 00
 Commit atrocities wantonly: 1 00 00 00
 Obliterate captured bases: 2 00 00 00
 Emphasize Land Power: 4 00 00 00
 Emphasize Sea Power: 8 00 00 00
 Emphasize Air Power: 10 00 00 00
 Strategy: Search Objectives: 20 00 00 00
 Strategy: Defend Objectives: 40 00 00 00
 Strategy: Attack Objectives: 80 00 00 00

0096EA70:
Strategy: Lots of colony pods: 1
Strategy: Lots of terraformers: 2
Strategy: Lots of sea bases: 4
Strategy: Lots of probe teams: 8
Strategy: Lots of missiles: 10
Shamelessly betray human player: 20
Strategy: Lots of artillery: 40

Offline Dio

Re: Analyzed Procedures and Flags
« Reply #5 on: May 29, 2015, 04:47:34 PM »
More memory addresses and their associated known flags. Their are more flags associated with these memory addresses that I am uncertain as to their function at this time.

009A649C:
Do or Die: Don't restart eliminated players: 1
Total War: Allow Victory by Conquest: 2
Mine, All Mine: Allow Economic Victory: 4
Peace in Our Time: Allow Diplomatic Victory: 8
Look First: Flexible starting locations: 10
Tech Stagnation: Slower rate of research discoveries: 20
Intense Rivalry: Opponents more aggressive: 40
Time Warp: Accelerated Start: 80
No Unity Survey: World Map not visible: xh, 1 or 100
Blind Research: Cannot set precise research goals: xh, 2 or 200
Iron Man: Save/Restore restricted to exit: xh, 4 or 400
Higher Goal: Allow Victory by Transcendence: xh, 8 or 800
One for All: Allow Cooperative Victory: xh, 10 or 1000
No Unity Scattering: Supply Pods only at landing sites: xh, 20 or 2000
Spoils of War: Steal tech when conquer base: xh, 40 or 4000
Bell Curve: No Random Events: xh, 80 or 8000
Unity Pods never produce resources: 1 00 00
Unity Pods never produce monoliths: 2 00 00
Unity Pods never produce artifacts: 4 00 00
Solo Mission: only human player victory/defeat: 8 00 00, esi
Force player to play current faction: 10 00 00
No native life--fungus, mind worms, Planet, etc.: 20 00 00
No colony pods can be built: 40 00 00
No terraforming (raising/lowering): 80 00 00
Force current difficulty level: 1 00 00 00
No technology trading: 2 00 00 00
No technological advances: 4 00 00 00
Objective Units must reach friendly objective base: 8 00 00 00
Objective Units must reach friendly HQ base: 10 00 00 00
All bases count as objectives: 20 00 00 00, edi
Secret Projects count as objectives: 40 00 00 00
No secret projects can be built: 80 00 00 00

009A64C0:
Each square of territory counts as objective: ch, 80 or 80 00
All artifacts are objective units: 4 00 00
Highest Alpha Centauri Score wins: 8 00 00
Diplomatic Victory Achieved: 20 00 00 at 0052C17B
Economic Victory Achieved: 40 00 00
All terrain enhancements count as objectives: 2 00 00 00
Base facilities as objectives: 4 00 00 00
Each population unit counts as objective: 20 00 00 00
Each technology counts as objective: 40 00 00 00
Each energy credit counts as objective: 80 00 00 00

009A681C:
Unity pods never produce vehicles: 1
Unity pods never produce tech: 2
No planetary council: 4
No social engineering: 8

Offline Dio

Re: Analyzed Procedures and Flags
« Reply #6 on: May 29, 2015, 05:12:34 PM »
Here are some procedures with their associated functions:
00559060: Shows the Faction Leader Name in strings for Diplomatic Interactions.
005590A0: Shows the Faction Leader's Title in strings for Diplomatic Interactions.
005590E0: Shows the Faction Leader Adjective in strings for Diplomatic Interactions.
00559100: Shows the Faction Leader Perjorative in strings for Diplomatic Interactions.
00559120: Shows the General Faction Adjective in strings for Diplomatic Interactions.
00559140: Shows the General Faction Perjorative in strings for Diplomatic Interactions.
00559160: Shows the Faction Leader Derarogatory Name in strings for Diplomatic Interactions.

Offline Dio

Re: Analyzed Procedures and Flags
« Reply #7 on: May 29, 2015, 05:25:50 PM »
005BF1F0: Is one of the procedures that controls the appearance of Special Ability Names in Scripts.
The associated value for each Special Ability is as follows:
   Super Former: 1
   Deep Radar: 2
   Cloaking Device: 4
   Amphibious Pods: 8
   Drop Pods: 10
   Air Superiority: 20
   Deep Pressure Hull: 40
   Carrier Deck: 80
   AAA Tracking/Tracking Lasers: 1 00
   Comm Jammer: 2 00
   Antigrav Struts: 4 00
   Empath Song: 8 00
   Polymorphic Encryption: 10 00
   Fungicide Tanks: 20 00
   High Morale: 40 00
   Heavy Artillery: 80 00
   Clean Reactor: 1 00 00
   Blink Displacer: 2 00 00
   Hypontic Trance: 4 00 00
   Heavy Transport: 8 00 00
   Nerve Gas Pods: 10 00 00
   Repair Bay: 20 00 00
   Non-Lethal Methods: 40 00 00
   Slow Unit: 80 00 00
   Soporific Gas Pods: 1 00 00 00
   Dissociative Wave: 2 00 00 00
   Marine Detachment: 4 00 00 00
   Fuel Nanocells: 8 00 00 00
   Algorithimic Enchancement: 10 00 00 00

Offline Yitzi

Re: Analyzed Procedures and Flags
« Reply #8 on: May 29, 2015, 05:52:48 PM »
I am currently looking into functions that play an important role in determining various aspects of the AI behavior. I plan to release a text file with most of the information I have gathered once I have sufficently compiled accurate material. Presently, this thread is for any .exe coders that want to share the known functions of procedures or memory addresses with flags they have analzyed. I will start with the procedure at 005B9580. I know part of this procedure interacts Unit AI Plans. In particular it is switch 2 of 13 (hexadecimal) that interacts with the AI Unit Plans. In addition, Switch 6  of 13 interacts with Unit special ability flags. Finally, the most frequently called switch in the procedure is switch 2.

5B9580 takes the unit whose number is passed in argument 1, and finds the number of units in that square fulfilling certain other properties (depending on the other arguments, one of which is the switch).  So not purely AI.

(Also, be aware that AI unit plans, despite the name, are not purely AI-relevant; many other properties, such as ability to convoy resources or carry units, also seem to depend on this value.)

Here are some additional flags I have discovered:

0090E8EC: Custome Game Rules Flags
Do or Die: Don't restart eliminated players: 1
Total War: Allow Victory by Conquest: 2
Mine, All Mine: Allow Economic Victory: 4
Peace in Our Time: Allow Diplomatic Victory: 8
Look First: Flexible starting locations: 10
Tech Stagnation: Slower rate of research discoveries: 20
Intense Rivalry: Opponents more aggressive: 40
Time Warp: Accelerated Start: 80
No Unity Survey: World Map not visible: xh, 1 or 100
Blind Research: Cannot set precise research goals: xh, 2 or 200
Iron Man: Save/Restore restricted to exit: xh, 4 or 400
Higher Goal: Allow Victory by Transcendence: xh, 8 or 800
One for All: Allow Cooperative Victory: xh, 10 or 1000
No Unity Scattering: Supply Pods only at landing sites: xh, 20 or 2000
Spoils of War: Steal tech when conquer base: xh, 40 or 4000
Bell Curve: No Random Events: xh, 80 or 8000

0090E8F0:
Randomize faction leader personalities: 80 00 00
Randomize faction leader social agendas: 1 00 00 00

This could be very useful.  Thanks.

005BF1F0: Is one of the procedures that controls the appearance of Special Ability Names in Scripts.
The associated value for each Special Ability is as follows:
   Super Former: 1
   Deep Radar: 2
   Cloaking Device: 4
   Amphibious Pods: 8
   Drop Pods: 10
   Air Superiority: 20
   Deep Pressure Hull: 40
   Carrier Deck: 80
   AAA Tracking/Tracking Lasers: 1 00
   Comm Jammer: 2 00
   Antigrav Struts: 4 00
   Empath Song: 8 00
   Polymorphic Encryption: 10 00
   Fungicide Tanks: 20 00
   High Morale: 40 00
   Heavy Artillery: 80 00
   Clean Reactor: 1 00 00
   Blink Displacer: 2 00 00
   Hypontic Trance: 4 00 00
   Heavy Transport: 8 00 00
   Nerve Gas Pods: 10 00 00
   Repair Bay: 20 00 00
   Non-Lethal Methods: 40 00 00
   Slow Unit: 80 00 00
   Soporific Gas Pods: 1 00 00 00
   Dissociative Wave: 2 00 00 00
   Marine Detachment: 4 00 00 00
   Fuel Nanocells: 8 00 00 00
   Algorithimic Enchancement: 10 00 00 00

In particular, 5BF1F0 tests if unit number arg1 has any of the abilities whose corresponding bits are set in Arg2.  (Usually, only one such bit is set so it only tests for that ability, but it could be used to test for multiple abilities simultaneously.)

The order is simply the order in which they appear in alphax.txt.

Offline Dio

Re: Analyzed Procedures and Flags
« Reply #9 on: May 29, 2015, 09:54:13 PM »
Some flags I know for certain that pertain to Diplomatic relationships.

0096C9F8:
Pact: 1
Treaty: 2
Truce: 4
Commfreq: 8
Vendetta: 10
I want revenge: 20
I shall betray: 4 00
I have infiltrator: 10 00/ edi
I want to talk: 20 00
I am atrocity victim: 4 00 00
I have surrendered: 2 00 00 00

Offline Geo

Re: Analyzed Procedures and Flags
« Reply #10 on: May 29, 2015, 11:25:11 PM »
Those sounds like the diplo flags in the scenario editor.

Offline Dio

Re: Analyzed Procedures and Flags
« Reply #11 on: May 30, 2015, 12:31:24 AM »
Those sounds like the diplo flags in the scenario editor.
Your observation is correct.

Offline Yitzi

Re: Analyzed Procedures and Flags
« Reply #12 on: May 31, 2015, 03:57:24 AM »
Some flags I know for certain that pertain to Diplomatic relationships.

0096C9F8:
Pact: 1
Treaty: 2
Truce: 4
Commfreq: 8
Vendetta: 10
I want revenge: 20
I shall betray: 4 00
I have infiltrator: 10 00/ edi
I want to talk: 20 00
I am atrocity victim: 4 00 00
I have surrendered: 2 00 00 00

Actually, for the relationship faction #x has with faction #y, these are at 96C9F8+20CC*x+4*y.

Offline Dio

Re: Analyzed Procedures and Flags
« Reply #13 on: August 05, 2015, 11:22:10 PM »
It appears as though the procedure at address 005B0E00 has some important impacts on the appearance on certain AI Editor traits.

Offline Dio

Re: Analyzed Procedures and Flags
« Reply #14 on: August 05, 2015, 11:32:21 PM »
It appears as though part of the controls for AI production of colony pods is at address 004FB69C. What I have read so far is this:
If the current base population is less than 2, and the nutrient surplus of the base exceeds the mineral surplus, and nutrient surplus is equal to or greater than 1; than produce a colony pod.
« Last Edit: August 06, 2015, 12:16:13 AM by Dio »

 

* User

Welcome, Guest. Please login or register.

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

Preliminary analysis indicates that our rivals have developed a safe and reliable method to simulate conditions existing on the interior of a stellar mass. The fabrication and transmutation of materials possible in such an environment guarantees significant industrial and military applications.
~Probe Team Operations Directorate, Top Secret Report

* 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: 38.

[Show Queries]