-
Previously, due to the large scale of my current projects, updating to version 2.0 was slightly delayed. As a result, I overlooked observing the feature updates in this new version. Today, reminded by a fellow developer, I discovered that VS scripts can now control multithreading using sub-layers.
-
I immediately tested this and consolidated actions that were previously generated as separate sub-objects to avoid multithreading conflicts—such as the auto-healing mechanism and bullet shooting mechanics for hero objects—into a single VS sub-layer.
-
This feature thrilled me! I immediately started praising and promoting it in our domestic AGM group chat. I even clinked glasses with excited AGM colleagues across the network to celebrate! I said we shouldn’t just celebrate secretly; we need to share this joy with the hardworking AGM official team! So, I wrote this tribute post.
(These are three sets of actions I have already integrated, controlling player movement, auto-healing, and bullet firing respectively. Later, I plan to write many developed hero skills and future buffs into this sub-layer.)
-
While working on the third layer, I encountered a crash bug, crashing four times in a row. The crash process:
(1) I copied all VS actions from an instantiated sub-object into the hero object’s VS script.
(2) When I tried to adjust this sub-layer, moving any condition caused AGM to crash and close unexpectedly.
I eventually identified the action causing the crash:
In the sub-object for instantiating hero bullets, I created a variable for “fire rate” and set a condition where time > fire_rateto switch actions directly. Since the hero object itself didn’t have this variable, AGM likely couldn’t recognize it, leading to the crash.
I tried to reproduce the crash minimally, but unfortunately, even with the same operations in a completely new project and VS actions, it wouldn’t crash. I suspect the crash was caused by a conflict between old version VS actions and the new version. (After all, this batch of actions was completed almost when AGM was born. Now, after a year and multiple major updates to AGM, they are likely incompatible with the current version.)
I added the missing variables to the hero object, deleted these conditions, rewrote them, and then AGM stopped crashing and ran perfectly during testing.
-
Despite this flaw, I am still excited to thank the AGM official team. This feature is incredibly powerful with many advantages:
(1) You can abandon the previous method of controlling parallel functions using sub-objects. This saves the tedious steps of creating sub-objects and new VS scripts. It also reduces resource consumption from sub-objects and sub-scripts.
(2) It makes implementing various complex skills, buff effects, and parallel actions easy. Another huge advantage of multi-layer VS scripts is the ability to directly access various variables and switches of the parent object, eliminating the need to manually select corresponding object attributes one by one in sub-objects.
(3) It makes the node structure within the overall object more concise and lightweight. -
Words cannot express my excitement. This time, I truly feel proud of AGM-G’s evolution. Once again, I pay respect to the AGM official team. Thank you very much!



