MBINCompiler icon indicating copy to clipboard operation
MBINCompiler copied to clipboard

Mapping and figuring out Sketch Nodes

Open monkeyman192 opened this issue 5 years ago • 0 comments

As of Desolation (2.6), HG has added in something called Sketch Nodes which appear to be some kind of shader node handling in the entity files. They may also be to do with abandoned freighter scripting. (Just spitballing ideas really...) These present a new challenge for a number of reasons:

  1. These "structs" do not seem to be mapped out in the same way as other ones are in the exe. They have some kind of mapping info, but I need to look into it more...
  2. Which struct is used to represent the data is dependent on the value of a string earlier on in the TkSketchNodeData struct (To be more precise, the byte data in the CustomData property of this struct is deserialised based on what the value of TypeName is)

Because of this, this data cannot be properly decompiled and recompiled (well, at least in a nice way we can modify) until the following structs have been mapped out.

  • [x] SnOnSpawned
  • [x] SnOnVariableChanged
  • [x] SnOnBroadcastReceived
  • [x] SnOnComponentEvent
  • [x] SnIfValueIs
  • [x] SnValueAsBool
  • [x] SnFixedValue
  • [x] SnGetVariableValue
  • [x] SnSetVariableValue
  • [x] SnSurveyVariableValue
  • [x] SnSequence2
  • [x] SnSequence3
  • [x] SnWaitSeconds
  • [x] SnWaitFrames
  • [x] SnRandomNumber
  • [x] SnBroadcastValueModel
  • [x] SnBroadcastValueDistance
  • [x] SnRaiseEvent
  • [x] SnOnNodeActivated
  • [x] SnOnTriggerVolume
  • [x] SnOnAnimFrame
  • [x] SnSetNodeActive
  • [x] SnDeleteModel
  • [x] SnPlayAnim
  • [x] SnIfAnimIsPlaying
  • [x] SnStopAnim
  • [x] SnPlaySound
  • [x] SnFadeModel
  • [x] SnTranslateNode
  • [x] SnRotateNode
  • [x] SnSetLightIntensity
  • [x] SnOnPlayerNear
  • [x] SnSpawnParticles
  • [x] SnStopParticles
  • [x] SnDestroyDestructables
  • [x] SnSetScannableComponentUsed
  • [x] SnSetHazard
  • [x] SnDamagePlayer
  • [x] SnCameraShake
  • [x] SnStopCameraShake
  • [x] SnFadeMaterials
  • [x] SnSetShaderValue
  • [x] SnGiveReward
  • [x] SnAddShootableHealth

I have prepended the prefix Sn as a shorthand for Sketch Node (similarly to how Gc is Game Component and Tk is Tool Kit (we think), so that they can be separated from the other structs. Whilst they do not have this Sn in the exe, and instead.. well they technically don't have any prefix, but I thought it better to give them one here to give them the pretence of being a proper struct)

Also, I am not 100% sure that the list above is comprehensive, extracted it from the exe so hopefully it is!

monkeyman192 avatar Jul 24 '20 13:07 monkeyman192