game:source_diving
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| game:source_diving [2012/06/27 00:16] – AIStates star_weaver | game:source_diving [2014/12/27 04:40] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== 1.08b source code .... stuff ... ====== | ||
| + | ===== Random Data Obtained from the C++ Source Code ===== | ||
| + | I just need a place to plonk this stuff for the moment, it really needs to go somewhere else later. -Weaver | ||
| + | |||
| + | |||
| + | ==== AI States 1.08b ==== | ||
| + | |||
| + | This might be useful for debuggery? Also a full list of hardcoded controllers because the states vary per controller. From TSE/ | ||
| + | |||
| + | < | ||
| + | class CStandardShipAI : public CBaseShipAI | ||
| + | enum StateTypes | ||
| + | { | ||
| + | 0 | ||
| + | |||
| + | 1 | ||
| + | 2 | ||
| + | 3 | ||
| + | 4 | ||
| + | 5 | ||
| + | 6 | ||
| + | 7 | ||
| + | 8 | ||
| + | 9 | ||
| + | 10 stateMaintainBearing, | ||
| + | // until we run into enemies. | ||
| + | 11 stateNone, | ||
| + | 12 stateOnCourseForDocking, | ||
| + | 13 stateOnCourseForStargate, | ||
| + | 14 stateOnPatrolOrbit, | ||
| + | 15 stateReturningFromThreat, | ||
| + | 16 stateWaiting, | ||
| + | 17 stateWaitingForThreat, | ||
| + | 18 stateWaitingUnarmed, | ||
| + | 19 stateWaitForPlayerAtGate, | ||
| + | 20 stateFollowing, | ||
| + | |||
| + | 21 stateOnCourseForLootDocking, | ||
| + | 22 stateDeterTargetWhileLootDocking, | ||
| + | 23 stateFollowNavPath, | ||
| + | 24 stateReturningViaNavPath, | ||
| + | 25 stateOnCourseForDockingViaNavPath, | ||
| + | 26 stateOnCourseForPatrolViaNavPath, | ||
| + | 27 stateOnCourseForPoint, | ||
| + | 28 stateWaitingForTarget, | ||
| + | 29 stateWaitingForEnemy, | ||
| + | 30 stateAttackingTargetAndAvoiding, | ||
| + | | ||
| + | 31 stateAvoidingEnemyStation, | ||
| + | 32 stateOnCourseForPointViaNavPath, | ||
| + | 33 stateBombarding, | ||
| + | 34 stateApproaching, | ||
| + | 35 stateAimingAtTarget, | ||
| + | 36 stateOnCourseForOrbitViaNavPath, | ||
| + | 37 stateOrbit, | ||
| + | 38 stateReturningToEscort, | ||
| + | 39 stateHoldingCourse, | ||
| + | 40 stateAttackingPrincipalThreat, | ||
| + | |||
| + | 41 stateTurningTo, | ||
| + | 42 stateAttackingTargetAndHolding, | ||
| + | }; | ||
| + | |||
| + | |||
| + | class CAutonAI : public CBaseShipAI | ||
| + | enum StateTypes | ||
| + | { | ||
| + | 0 | ||
| + | 1 | ||
| + | 2 | ||
| + | 3 | ||
| + | 4 | ||
| + | 5 | ||
| + | }; | ||
| + | |||
| + | class CFerianShipAI : public CBaseShipAI | ||
| + | enum StateTypes | ||
| + | { | ||
| + | 0 | ||
| + | 1 | ||
| + | 2 | ||
| + | 3 | ||
| + | 4 | ||
| + | 5 | ||
| + | 6 | ||
| + | 7 | ||
| + | }; | ||
| + | |||
| + | class CFleetCommandAI : public CBaseShipAI | ||
| + | enum StateTypes | ||
| + | { | ||
| + | 0 | ||
| + | 1 | ||
| + | 2 | ||
| + | 3 | ||
| + | 4 | ||
| + | 5 | ||
| + | 6 | ||
| + | 7 | ||
| + | }; | ||
| + | |||
| + | class CFleetShipAI : public CBaseShipAI | ||
| + | enum StateTypes | ||
| + | { | ||
| + | 0 | ||
| + | 1 | ||
| + | 2 | ||
| + | 3 | ||
| + | 4 | ||
| + | 5 | ||
| + | 6 | ||
| + | 7 | ||
| + | 8 | ||
| + | 9 | ||
| + | 10 stateWaiting, | ||
| + | }; | ||
| + | |||
| + | class CGaianProcessorAI : public CBaseShipAI | ||
| + | enum StateTypes | ||
| + | { | ||
| + | 0 | ||
| + | 1 | ||
| + | 2 | ||
| + | 3 | ||
| + | }; | ||
| + | |||
| + | class CGladiatorAI : public CBaseShipAI | ||
| + | enum StateTypes | ||
| + | { | ||
| + | 0 | ||
| + | 1 | ||
| + | 2 | ||
| + | 3 | ||
| + | }; | ||
| + | |||
| + | |||
| + | |||
| + | class CZoanthropeAI : public CBaseShipAI | ||
| + | enum StateTypes | ||
| + | { | ||
| + | 0 | ||
| + | 1 | ||
| + | 2 | ||
| + | 3 | ||
| + | 4 | ||
| + | 5 | ||
| + | 6 | ||
| + | 7 | ||
| + | 8 | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Distance ==== | ||
| + | |||
| + | Having nothing to do with scale, but with positioning and travel distance. | ||
| + | |||
| + | From TSE/ | ||
| + | |||
| + | * Light_Speed = Light_Second = 299792.5 km | ||
| + | * Klicks_Per_Pixel = 12500.0 | ||
| + | * Therefore 1 light_second = 23.9834 pixels (how did I get 18.3something last time?) | ||
| + | |||
| + | ==== Devices ==== | ||
| + | |||
| + | From TSE/ | ||
| + | |||
| + | * Drive devices do replace both maxspeed and thrust, nothing is additive | ||
| + | |||
| + | ==== Encounters ==== | ||
| + | |||
| + | From TSE/ | ||
| + | |||
| + | * A system spawns an encounter every 6000 to 9000 ticks | ||
| + | |||
| + | * There is a 10% chance of just reading from a level-based random encounter list | ||
| + | |||
| + | * Otherwise a list of all the encounter tables and events attached to objests in the system is collated based on raritys given, and one is picked from that list. | ||
| + | |||
| + | |||
| + | ==== Rarity ==== | ||
| + | |||
| + | From TSE/ | ||
| + | |||
| + | I think george may have said this already, but I looked it up in relation to the last exploration anyway | ||
| + | |||
| + | < | ||
| + | enum FrequencyTypes | ||
| + | { | ||
| + | ftCommon | ||
| + | ftUncommon | ||
| + | ftRare | ||
| + | ftVeryRare | ||
| + | ftNotRandom | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | I believe this is generally used by the game by creating a list with [rarity] copies of each item, and then rolling against that list. | ||
| + | |||
| + | |||
| + | ==== System Map Grid ==== | ||
| + | |||
| + | The map grid is 100 ls per square: | ||
| + | |||
| + | < | ||
| + | TSE/ | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Shield Regen Rates ==== | ||
| + | |||
| + | Shield regen in the xml seems to be based on hp per 6 seconds, but is broken down into different actual periods of no more than 3 seconds via a rather complicated wad of math in CShieldClas.cpp: | ||
| + | |||
| + | < | ||
| + | // Load regen value | ||
| + | |||
| + | int iRegen; | ||
| + | if (pDesc-> | ||
| + | { | ||
| + | // Regen specified in hp per 180 ticks. We need to convert that to RegenHP and RegenRate | ||
| + | |||
| + | if ((iRegen % 12) == 0) | ||
| + | pShield-> | ||
| + | else if ((iRegen % 10) == 0) | ||
| + | pShield-> | ||
| + | else if ((iRegen % 9) == 0) | ||
| + | pShield-> | ||
| + | else if ((iRegen % 6) == 0) | ||
| + | pShield-> | ||
| + | else if ((iRegen % 5) == 0) | ||
| + | pShield-> | ||
| + | else if ((iRegen % 4) == 0) | ||
| + | pShield-> | ||
| + | else if ((iRegen % 3) == 0) | ||
| + | pShield-> | ||
| + | else | ||
| + | pShield-> | ||
| + | |||
| + | pShield-> | ||
| + | |||
| + | int iDepletion; | ||
| + | if (pDesc-> | ||
| + | pShield-> | ||
| + | else | ||
| + | pShield-> | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | pShield-> | ||
| + | pShield-> | ||
| + | pShield-> | ||
| + | |||
| + | if (pShield-> | ||
| + | { | ||
| + | pShield-> | ||
| + | pShield-> | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Enhancment ==== | ||
| + | |||
| + | From TSE/ | ||
| + | |||
| + | < | ||
| + | enum ItemEnhancementTypes | ||
| + | { | ||
| + | etNone = 0x0000, | ||
| + | etBinaryEnhancement = | ||
| + | etLoseEnhancement = | ||
| + | |||
| + | etStrengthen = 0x0100, // +hp, data1 = %increase (10% increments) | ||
| + | etRegenerate = 0x0200, // data1 = rate | ||
| + | etReflect = | ||
| + | etRepairOnHit = | ||
| + | etResist = 0x0500, // -damage, data1 = %damage adj | ||
| + | etResistEnergy = 0x0600, // -energy damage, data1 = %damage adj (90%, 80%, etc) | ||
| + | etResistMatter = 0x0700, // -matter damage, data1 = %damage adj (90%, 80%, etc) | ||
| + | etResistByLevel = | ||
| + | etResistByDamage = 0x0900, // -damage, data1 = %damage adj, data2 = damage type | ||
| + | etResistByDamage2 = | ||
| + | etSpecialDamage = | ||
| + | // data2 = 0: immune to radiation | ||
| + | // data2 = 1: immune to blinding | ||
| + | // ... see SpecialDamageTypes | ||
| + | etImmunityIonEffects = 0x0c00, // Immunity to ion effects (blinding, EMP, etc.) | ||
| + | // (if disadvantage, | ||
| + | etPhotoRegenerate = | ||
| + | etPhotoRecharge = | ||
| + | etPowerEfficiency = | ||
| + | etSpeed = | ||
| + | etTurret = 0x1100, // weapon turret, data1 is angle | ||
| + | etMultiShot = | ||
| + | |||
| + | etData1Mask = | ||
| + | etData2Mask = | ||
| + | etTypeMask = 0x7f00, // Type | ||
| + | etDisadvantage = 0x8000, // If set, this is a disadvantage | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== DamageTypes ==== | ||
| + | They' | ||
| + | |||
| + | < | ||
| + | |||
| + | enum DamageTypes | ||
| + | { | ||
| + | damageError | ||
| + | damageGeneric | ||
| + | |||
| + | damageLaser | ||
| + | damageKinetic | ||
| + | damageParticle | ||
| + | damageBlast | ||
| + | damageIonRadiation | ||
| + | damageThermonuclear = 5, // hydrogen bomb | ||
| + | damagePositron | ||
| + | damagePlasma | ||
| + | damageAntiMatter | ||
| + | damageNano | ||
| + | damageGravitonBeam | ||
| + | damageSingularity | ||
| + | damageDarkAcid | ||
| + | damageDarkSteel | ||
| + | damageDarkLightning = 14, // | ||
| + | damageDarkFire | ||
| + | |||
| + | damageCount | ||
| + | }; | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== SpecialDamageTypes ==== | ||
| + | |||
| + | Wormhole? TSE/ | ||
| + | < | ||
| + | enum SpecialDamageTypes | ||
| + | { | ||
| + | specialRadiation | ||
| + | specialBlinding | ||
| + | specialEMP | ||
| + | specialDeviceDamage = 3, | ||
| + | specialDisintegration = 4, | ||
| + | specialMomentum | ||
| + | specialShieldDisrupt = 6, | ||
| + | specialWMD | ||
| + | specialMining | ||
| + | |||
| + | specialDeviceDisrupt= 9, | ||
| + | specialWormhole | ||
| + | specialFuel | ||
| + | specialShatter | ||
| + | // max 15 (because it is used in CItemEnhancement) | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | ==== Sovereigns and Alignment ==== | ||
| + | Oh, RPC must have added this for me, cool. | ||
| + | This is from TSE/ | ||
| + | |||
| + | < | ||
| + | enum DispositionClasses | ||
| + | { | ||
| + | alignNone = -1, | ||
| + | |||
| + | alignConstructiveChaos = 0, | ||
| + | alignConstructiveOrder = 1, | ||
| + | alignNeutral = 2, | ||
| + | alignDestructiveOrder = 3, | ||
| + | alignDestructiveChaos = 4, | ||
| + | }; | ||
| + | |||
| + | class CSovereign : public CDesignType | ||
| + | { | ||
| + | public: | ||
| + | enum Alignments | ||
| + | { | ||
| + | alignUnknown = -1, | ||
| + | |||
| + | alignRepublic = | ||
| + | alignFederation = | ||
| + | alignUplifter = | ||
| + | alignFoundation = | ||
| + | alignCompetitor = | ||
| + | alignArchivist = 5, // constructive | ||
| + | alignSeeker = | ||
| + | alignHermit = | ||
| + | |||
| + | alignCollective = | ||
| + | alignEmpire = | ||
| + | alignSterelizer = 10, // destructive | ||
| + | alignCorrector = 11, // destructive | ||
| + | alignMegalomaniac = 12, // destructive | ||
| + | alignCryptologue = 13, // destructive | ||
| + | alignPerversion = 14, // destructive | ||
| + | alignSolipsist = 15, // destructive | ||
| + | |||
| + | alignUnorganized = 16, // unorganized group of beings | ||
| + | alignSubsapient = 17, // animals, zoanthropes, | ||
| + | |||
| + | alignCount = 18, | ||
| + | }; | ||
| + | |||
| + | enum Disposition | ||
| + | { | ||
| + | dispEnemy = 0, | ||
| + | dispNeutral = 1, | ||
| + | dispFriend = 2, | ||
| + | }; | ||
| + | |||
| + | CSovereign (void); | ||
| + | ~CSovereign (void); | ||
| + | |||
| + | void DeleteRelationships (void); | ||
| + | inline void FlushEnemyObjectCache (void) { m_pEnemyObjectsSystem = NULL; } | ||
| + | Disposition GetDispositionTowards (CSovereign *pSovereign); | ||
| + | inline const CSpaceObjectList & | ||
| + | CString GetText (MessageTypes iMsg); | ||
| + | inline bool IsEnemy (CSovereign *pSovereign) { return (m_bSelfRel || (pSovereign != this)) && (GetDispositionTowards(pSovereign) == dispEnemy); } | ||
| + | inline bool IsFriend (CSovereign *pSovereign) { return (!m_bSelfRel && (pSovereign == this)) || (GetDispositionTowards(pSovereign) == dispFriend); | ||
| + | static Alignments ParseAlignment (const CString & | ||
| + | void SetDispositionTowards (CSovereign *pSovereign, | ||
| + | |||
| + | // CDesignType overrides | ||
| + | static CSovereign *AsType (CDesignType *pType) { return ((pType && pType-> | ||
| + | virtual bool FindDataField (const CString & | ||
| + | virtual DesignTypes GetType (void) { return designSovereign; | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | CSovereign:: | ||
| + | { | ||
| + | // WE are constructive chaos... | ||
| + | { | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | }, | ||
| + | |||
| + | // WE are constructive order... | ||
| + | { | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | }, | ||
| + | |||
| + | // WE are neutral... | ||
| + | { | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | }, | ||
| + | |||
| + | // WE are destructive order... | ||
| + | { | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | }, | ||
| + | |||
| + | // WE are destructive chaos... | ||
| + | { | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | CSovereign:: | ||
| + | }, | ||
| + | }; | ||
| + | |||
| + | const DWORD ALIGN_FLAG_CONSTRUCTIVE = | ||
| + | const DWORD ALIGN_FLAG_DESTRUCTIVE = 0x00000002; | ||
| + | const DWORD ALIGN_FLAG_COMMUNITY = 0x00000004; | ||
| + | const DWORD ALIGN_FLAG_INDEPENDENCE = | ||
| + | const DWORD ALIGN_FLAG_KNOWLEDGE = 0x00000010; | ||
| + | const DWORD ALIGN_FLAG_SPIRITUALITY = | ||
| + | const DWORD ALIGN_FLAG_EVOLUTION = 0x00000040; | ||
| + | const DWORD ALIGN_FLAG_TRADITION = 0x00000080; | ||
| + | |||
| + | struct SAlignData | ||
| + | { | ||
| + | int iNameLen; | ||
| + | char pszName[32]; | ||
| + | DispositionClasses iDispClass; | ||
| + | DWORD dwFlags; | ||
| + | }; | ||
| + | |||
| + | static SAlignData ALIGN_DATA[CSovereign:: | ||
| + | { | ||
| + | { | ||
| + | { | ||
| + | { | ||
| + | { | ||
| + | { | ||
| + | { | ||
| + | { | ||
| + | { | ||
| + | |||
| + | { | ||
| + | { | ||
| + | { | ||
| + | { | ||
| + | { | ||
| + | { | ||
| + | { | ||
| + | { | ||
| + | |||
| + | { | ||
| + | { | ||
| + | }; | ||
| + | </ | ||
