Editing ActorSerializeParameter and AI
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 11: | Line 11: | ||
"AI": { | "AI": { | ||
"Static": [], | "Static": [], | ||
− | + | "Dynamic": []; | |
}, | }, | ||
"Hash": { ... }, | "Hash": { ... }, | ||
Line 41: | Line 41: | ||
</source> | </source> | ||
− | For the majority of actors in the game, most of the fields within <code>ActorSerializeParameter</code> are the same for each type of enemy - that is, all Kochappys in the game have the same Life, ActorParameter, CheckComp, etc. A data scrape of each unique value that each type of enemy can have can be found [https://github.com/Chagrilled/P4-DandoriDesktop/blob/master/src/api/entityData.json/ here]. This can be used for sourcing the non-changing values, or for various examples of each byte array for every creature and object. (Generating code is [https://github.com/Chagrilled/P4-DandoriDesktop/blob/master/scrape.js/ here]). | + | For the majority of actors in the game, most of the fields within <code>ActorSerializeParameter</code> are the same for each type of enemy - that is, all Kochappys in the game have the same Life, ActorParameter, CheckComp, etc. A data scrape of each unique value that each type of enemy can have can be found [https://github.com/Chagrilled/P4-DandoriDesktop/blob/master/src/api/entityData.json/ here] (note, does not include night enemies). This can be used for sourcing the non-changing values, or for various examples of each byte array for every creature and object. (Generating code is [https://github.com/Chagrilled/P4-DandoriDesktop/blob/master/scrape.js/ here]). |
== AI == | == AI == | ||
Line 63: | Line 63: | ||
== Charts == | == Charts == | ||
− | Attempts have been made to chart the bytes of various AI parameters to uncover patterns and the locations of values in order to manipulate them. | + | Attempts have been made to chart the bytes of various AI parameters to uncover patterns and the locations of values in order to manipulate them. The current diagrams mostly illustrate the inventory system. |
− | There are many bytes AFTER the end of the inventory which ends in 4 bytes of <code>255, 255, 255, 255</code> (<code>-1</code>), but I have no idea what they do yet. I believe they're probably the overrides for | + | There are many bytes AFTER the end of the inventory which ends in 4 bytes of <code>255, 255, 255, 255</code> (<code>-1</code>), but I have no idea what they do yet. I believe they're probably the overrides for <code>TekiAIParameter</code>, territory, and each enemy's custom AI arguments. |
=== Creature AI === | === Creature AI === | ||
− | Details the drop system for a regular enemy (and eggs). The inventory system | + | Details the drop system for a regular enemy (and eggs). The inventory system used here is the same as in GroupDropManager's, so it helps to understand creatures first. |
[[File:P4-creature-ai-inventory-bytes.png|500px|thumb|center|]] | [[File:P4-creature-ai-inventory-bytes.png|500px|thumb|center|]] | ||
Line 91: | Line 91: | ||
[[File:p4-portaltrigger-ai.png |500px|thumb|center|]] | [[File:p4-portaltrigger-ai.png |500px|thumb|center|]] | ||
− | === | + | === AreaBaseAI Gen Variable === |
This chart is for the base camps. | This chart is for the base camps. | ||
Line 98: | Line 98: | ||
− | === | + | === SprinklerAI and ObjectAIParameter === |
Objects mostly seem composed of two objects - <code>ObjectAIParameter</code> and an entity-specific object, like <code>SprinklerAIParameter</code>. The former contains inventories (<code>DropParameter</code>) and some stuff to do with edge collision it seems, while the latter controls everything specific to the entity. The chart below illustrates it for sprinklers. | Objects mostly seem composed of two objects - <code>ObjectAIParameter</code> and an entity-specific object, like <code>SprinklerAIParameter</code>. The former contains inventories (<code>DropParameter</code>) and some stuff to do with edge collision it seems, while the latter controls everything specific to the entity. The chart below illustrates it for sprinklers. | ||
− | |||
− | |||
− | |||
− | |||
[[File:p4-sprinkler-objectAI.png |500px|thumb|center|]] | [[File:p4-sprinkler-objectAI.png |500px|thumb|center|]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Researching === | === Researching === | ||
Line 130: | Line 108: | ||
The best way of breaking down the AI parameter (I have found) is to combine the blueprint JSONs from the <code>Sublevels/</code> folder, with the <code>ActorPlacementInfo</code> file of the same type. The Sublevels files contain the gen_variables that seem to be encoded into the byte arrays of ActorSerializeParameter. | The best way of breaking down the AI parameter (I have found) is to combine the blueprint JSONs from the <code>Sublevels/</code> folder, with the <code>ActorPlacementInfo</code> file of the same type. The Sublevels files contain the gen_variables that seem to be encoded into the byte arrays of ActorSerializeParameter. | ||
− | AI parameters can be found by searching for <code>{entity}AI_GEN_VARIABLE</code>, for example <code>ElecMushiAI_GEN_VARIABLE</code> for Anode Beetles. Most of the contents of that object's <code>Properties</code> will be encoded in that actor's <code>ActorSerializeParameter.AI.Static</code> in the <code>ActorPlacementInfo</code> file, so you can compare things like the drop numbers, asset path and other such floats for occurrences of those values in the AI array. Strings are often the easiest to find/locate with due to their easy to spot nature (look for the big sequence of non-0 numbers and decode it to see if it matches what you need). | + | AI parameters can be found by searching for <code>{entity}AI_GEN_VARIABLE</code>, for example <code>ElecMushiAI_GEN_VARIABLE</code> for Anode Beetles. Most of the contents of that object's <code>Properties</code> will be encoded in that actor's <code>ActorSerializeParameter.AI.Static</code> in the <code>ActorPlacementInfo</code> file, so you can compare things like the drop numbers, asset path and other such floats for occurrences of those values in the AI array. Strings are often the easiest to find/locate with due to their easy to spot nature (look for the big sequence of non-0 numbers and decode it to see if it matches what you need). |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | A scrape of all of the sublevel files (Day/Hero/Cave) can be found in [https://github.com/Chagrilled/P4-DandoriDesktop/blob/master/src/api/sublevels.json Dandori Desktop's repo] which collects every parameter that each entity ever defines - so every drop, and config param ever given to any Kochappy, for example. This is very useful for finding all the potential values of random things like <code>GameRulePermissionFlag</code> or <code>CustomParameter</code>, and is a great starting point for piecing parts of the AI puzzles together, as params like <code>ObjectAIParameter</code> and <code>TekiAIParameter</code> are shared frequently, with individual properties being set on certain entities. | |
− | |||
− | |||
[[Category:Pikmin 4]] | [[Category:Pikmin 4]] | ||
[[Category:Parameters]] | [[Category:Parameters]] |