Skip to content

标题:YAMI Editor Concluding Update & Open Source

作者:yami

发布时间:2025年03月15日 18时12分22秒

🚀 Rewrite JavaScript Game Scripts to TypeScript



  • TypeScript can detect syntax errors in advance, making it easier for AI to assist in writing plugin scripts.

  • Once a code error is detected, you can have the AI fix it until no errors remain.

  • After updating, you must wait for TypeScript compilation to complete before entering the game; otherwise, you’ll encounter a black screen.


🌐 Editor Localization Updates



  • Added a Russian language pack, translated and provided by Steam community members ZerosmO / SmoLife — huge thanks!

  • Used ChatGPT to translate English tooltips.


⚙️ Project Settings Adjustments


🎮 Virtual Axis Keys



  • Added 4 virtual axis keys (default bindings: W, S, A, D).

  • You can retrieve "Virtual Axis X/Y/Angle" via the "Set Number" command to simplify up, down, left, and right movement logic.


⚡ WebGL Low Latency Mode



  • Reduces rendering latency after user input, enhancing the operational experience.


🔄 Auto Compile



  • Option to enable the editor’s built-in TypeScript compilation feature.

  • Compilation info and error reports can be viewed in the bottom left corner.

  • If VS Code is installed, clicking the script path takes you directly to the error location.


💾 Save Location Options



  • User Data Directory: Saves are stored in the system application data directory, hidden from users.

  • User Documents Directory: Saves are stored in the "Documents" folder.

  • Application Local Directory: Saves are stored in the app’s local directory, which may be overwritten during updates.


⚠️ Removed Some Features



  • Removed "Initial Player Actor", "Initial Party Members", and "Party Inventory Mode".

  • These settings are no longer necessary; repair methods will be provided later.

  • Removed "Special Events" and automatically converted them to the following event types:

  • Startup

  • Load Save

  • Create Scene

  • Show Text

  • Show Choices


🛠 Editor Changes



  • Selected Object -> Right-Click Menu -> Find References: Search for where the target object is referenced.

  • Objects that can be checked: scene objects, elements, global variables, attributes enumerations, localized text, and any files.
  • Deleting a single file now automatically checks if it’s referenced and issues a warning.

  • Project Directory -> Right-Click Menu -> Find Invalid References: Lists all paths where referenced objects were accidentally deleted, boosting security for OCD users.

  • Project Directory -> Right-Click Menu -> Find Unused References: Lists unused objects outside of scene objects and UI elements, including global variables, attributes, enumerations, localized text, and any files.

  • Project Directory -> Right-Click Menu -> Create -> Script:

  • Added multiple script template files.
    Provided a simple combat state machine example.
    Recommended installing the VS Code Tabnine extension (an AI-powered code completion tool).
  • Expanded the "Search Box" to allow finding objects or files by GUID.

  • Added a left sidebar in the event editor to quickly locate all events related to the selected event.

  • In the event editor’s command list, the "Call Event" command line can now quickly open the called global event.

  • Command list item indentation in the event editor has been doubled.

  • Object events can be toggled individually (shortcut: /) for debugging.

  • Added a "Duplicate" option (shortcut: Ctrl+D) to the "Right-Click Menu" for scene objects and UI elements, enabling quick copying to the same level.

  • Added a "Reset Start Position" option to the scene menu to cancel the selected initial position marker.

  • Disabled objects in the scene are now displayed as semi-transparent.


🖥️ MacOS Related Optimizations



  • Added "MacOS Universal" deployment option: Supports both Intel x64 and Apple arm64 CPUs, with a slight increase in file size.

  • Adjusted the MacOS editor app icon size to 85%, which may require deleting and reinstalling the app.


📝 Auto-Generate Global Variable {Name->ID} Table



  • Automatically generates a {Name->ID} mapping table for global variables and saves it to the Script/yami.ts file.


🎭 Actor System Optimizations



  • Added an "Immovable" property to actors.

  • When enabled, the actor won’t be pushed by other actors during collisions.

  • Collision relationships must be configured in the "Team" window to trigger collision effects.


📜 Object Inheritance Feature



  • Supported inherited objects: actors, skills, triggers, states, items, and equipment.

  • After inheriting an object, repetitive settings can be skipped; child objects automatically inherit the parent’s attributes, events, and scripts.

  • If events of the same type exist, the child overrides the parent’s event and can call the overridden parent event via the "Call Event" command.

  • When inheriting the same script, it overrides the parent’s script.

  • When inheriting attributes with the same key name, the child overrides the parent’s attribute value.


📦 New Element Prefab



  • Added a "Reference" element, which can point to an existing element and replicate it.

  • Modifying the referenced element updates all reference elements synchronously, eliminating the need to edit multiple instances manually.

  • Element Menu -> Create -> Reference: Inserts an empty reference element.

  • Element Menu -> Create -> Shortcut: Inserts a reference element pointing to the currently selected element.

  • Element Menu -> Set as Prefab: Designates the selected element as a prefab.

  • Element Menu -> Create -> Prefab -> Your Added Element: Inserts the added prefab reference element.

  • Prefabs are ideal for storing commonly used elements and invoking them via references to improve efficiency.

  • Note: Reference elements are automatically replaced with the actual referenced elements during game runtime.


✨ Particle Sprite Display Optimization



  • Particle sprites can now use animation sequence frames for playback.

  • In older projects, particle sprites default to random sprite frames to maintain compatibility.


🎭 New Actor Animation Directions



  • Added "Bottom Right, Top Right" directions to actor animations, which can mirror "Bottom Left, Top Left".


🌍 Support Placing Global Actors in Scenes



  • Placing a global actor in a scene will attempt to create that actor.

  • If the global actor already exists, it will only be teleported to the specified position.

  • Events of global actors in a scene are unloaded when leaving the scene, and running events will stop.

  • When a global actor enters a new scene, it loads the scene’s events and immediately executes any "Autorun" events (if present).


🔄 Event Type Changes



  • Removed the following global event types:

  • Add Skill

  • Remove Skill

  • Add State

  • Remove State

  • Add Equipment

  • Remove Equipment

  • Added the following global event types:

  • Startup

  • Create Scene

  • Load Scene

  • Load Save

  • Show Text

  • Show Choices

  • Added multi-touch events: Touch Start, Touch Move, Touch End; related touch points can be retrieved via the "For Each" command.

  • Added "Destroy" event for all scene objects: Triggered before an object is deleted.

  • Added mouse-related events for actors: Mouse Down, Mouse Up, Mouse Enter, Mouse Move, Mouse Leave, Click, Double Click; suitable for actor (building) placement.

  • Optimized mouse event implementation: Now compatible with single-touch events on mobile devices.


🌐 Global Event Changes



  • Added property: Namespace — Ensures an independent local variable space when called, avoiding variable sharing with the caller.

  • Added property: Return Type — Supports boolean, number, string, object, actor, element, etc.

  • Added property: Description — If set, a tooltip appears in the command line calling this event.

  • Added property: Event Parameter List — Allows passing parameters when calling the event.

  • You can pass variables or data to global events via the "Call Event" command.

  • Global events automatically set these parameters as local variables at runtime.

  • You can output a return value to the caller event via the "Return" command and store it in a local variable.


🎭 Preset Event Optimizations



  • Slightly simplified preset events in new projects.


🛠 Event Command Changes


📌 Extended "Call Event" Command



  • Call Global Event — Supports passing parameters and receiving return values, simplifying event command encapsulation.

  • Call Inherited Event — Calls the overridden event of the same type in the inherited object, enabling extension of parent event functionality. For example:

  • When an actor equips or unequips equipment, first call the parent object’s event to adjust attributes.

  • Then add extra commands for unique functionality (e.g., adding/removing states).


🔙 Added "Return" Command



  • Stops the current event from running.

  • If it’s a global event, it can pass a return value to the parent event that called it.


⏹️ Extended "Stop Event" Command



  • Now allows stopping events of specified objects, e.g.:

  • Stop specific event types running for a designated actor.

  • Differences between "Return" and "Stop Event":

  • "Return" — Stops only the current event, leaving the calling parent event unaffected.

  • "Stop Event" — Stops all parent events in the call chain.


📝 Added "Register Event" Command



  • Register and Unregister Events: Register global, actor, or element events at runtime, simplifying management and local variable sharing.

  • Example: For drag functionality, register mouse down, move, and up events to share local variables and streamline interaction logic.

  • Note: Repeatedly triggering "Register Event" won’t re-register the same event.


🛠️ Added "Create Object" and "Delete Object" Commands



  • Replaced "Create Light" and "Delete Light" Commands: Scene objects can now be used as prefabs for easier management and dynamic creation.


🎬 Added "Set Object Animation" Command



  • Modify Visual Effect Properties: Adjust hue, opacity, offset, rotation, for specified actors, triggers, and scene animations.


🔲 Added "Render Outline" Command



  • Actor Outline: Add outlines to one or more actors to enhance interactive visual feedback.


📸 Added "Clamp Camera" and "Unclamp Camera" Commands



  • Restrict Camera View: Limits the camera position to show only part of an area (e.g., Roguelike rooms or dungeons in War3 custom maps) when an actor enters it.

  • Release View Restriction: Removes the restriction when no longer needed.


🔲 Added "Block" Command



  • Command Folding Management: Group multiple commands into a collapsible block for easier viewing and editing, improving readability and organization.


🎯 Added "Set Target" Command



  • Set Target Actor: Designate a specified actor as the target for subsequent operations.


⚡ Modified "Cast Skill" Command



  • Inherit Target Actor: When casting a skill, inherit the target actor from the current event’s actor accessor, enabling skill casting on the target.


🎯 Modified "Create Trigger" Command



  • Inherit Target Actor: The trigger event inherits the target actor from the current event’s accessor, supporting features like single-target tracking missiles.


📜 Modified "Load Scene" Command



  • Teleport Actor in Advance: When loading a scene, teleport the actor to the specified position before the "Create Scene" and "Autorun" events.


🖱️ Extended "If" Command



  • Added "Just Pressed" and "Just Released" Condition Judgments for Mouse/Keyboard/Controller: "Just Pressed"/"Just Released" now indicate instantaneous frame behavior.


👣 Extended "Follow Actor" Command



  • Added Buffer Distance: Set a buffer distance during actor following to reduce start-stop frequency and improve smoothness.


🔒 Added Plugin "Developer Tools Password"



  • Console Interface: After deployment, enter a password to open the console, aiding developers in viewing error messages.


🔮 Added Custom Command "Blurriness"



  • Blur Filter: Apply a blur effect to the scene, ideal for use when opening specific interfaces.


🛠 Feature Modifications and Optimizations


🎧 Attenuation Sound Effect Playback Behavior Optimization



  • Modified "Attenuation Sound Effects" playback to calculate distance changes in real-time and dynamically adjust volume.


⚙️ File Writing Logic Optimization



  • Moved file-writing logic from the window thread to the main thread, improving reliability of auto-saving global variables on game exit and preventing write failures from rapid window closure.


🔧 Enhanced Error Capture



  • Previously captured only synchronous errors; now asynchronous errors are also captured and reported, boosting development efficiency.


🐞 Fixed Known BUGs



  • Fixed multiple known bugs in the editor and game, including black screen issues on some Android systems.


❤️ Acknowledgments Update



  • Updated the acknowledgments list to include those who provided unpaid help for the editor. Sincere thanks for your selfless contributions! Apologies for any omissions, and thank you again!


💃 How to Utilize Actors?



  • Actors can now serve as general-purpose objects, applicable in these scenarios:

  • Buildings, plants, minerals, loot, chests, traps, etc.

  • The larger the scene, the better the optimization, enabling the placement of more actors.

  • If collision handling isn’t needed, set the actor’s weight to 0 for further performance gains.


🌱 Examples of Plants, Buildings, and Loot



  • Buildings as actors: Click to pop up a UI for producing soldiers or buying items.

  • Plants as actors: Start a timer from birth, changing animation and maturity at set intervals.

  • Loot as actors: Detect player proximity to acquire items from their inventory.

  • Chests as actors: Click to move the player over and acquire inventory items.


🔨 Examples of Traps and Minerals



  • Traps as actors: Periodically cast range skills and auto-execute behaviors.

  • Minerals as actors: Reduce resource attributes when mined by workers, disappearing when depleted.

  • Skills aren’t just for combat—they can also be used for building, resource gathering, etc.


⚠️ Breaking Changes Explanation


🔧 Modified Plugin/Custom Command Parameter Declaration



  • @variable-getter changed to @variable-setter.

  • This will cause errors in scripts using @variable-getter; replace it with @variable-setter to fix.

  • Now, @variable-getter directly returns the value read from the specified variable, aligning with other getters.


📁 Modified Script File Names



  • file.js → loader.ts

  • controller.js → input.ts

  • Added flow.ts (asynchronous script base class; see usage in script examples).

  • Added yami.ts (auto-generated global variable ID table).


🔤 Variable Naming Adjustments



  • Event → CurrentEvent

  • File → Loader

  • EasingMap.map() → get()

  • Easing.scale → EasingMap.scale

  • Animation → AnimationPlayer

  • Scene.parallaxes → Scene.parallax

  • Scene.actors → Scene.actor / Scene.actor.list

  • Scene.animations → Scene.animation / Scene.animation.list

  • Scene.triggers → Scene.trigger / Scene.trigger.list

  • Scene.regions → Scene.region / Scene.region.list

  • Scene.lights → Scene.light

  • Scene.emitters → Scene.emitter / Scene.emitter.list

  • Scene.idMap → Scene.entity.presetIdMap

  • Scene.terrains.get(x, y) → Scene.terrain.get(x, y, 0)

  • Scene.terrains.set() → Scene.terrain.set()

  • Scene.terrains → Scene.terrain.rawArray

  • Scene.terrainObstacles.get(x, y) → Scene.terrain.get(x, y)

  • Scene.terrainObstacles → Scene.terrain.compositeArray

  • Scene.obstacles.get() → Scene.obstacle.get()

  • Scene.actors.cells → Scene.actor.partition

  • scene.updateTerrainObstacle() → scene.updateTerrain()

  • scene.loadTerrainObstacles() → scene.loadTerrains()

  • Scene.paused → Game.pauseCount

  • Scene.pause() → Game.pause()

  • Scene.continue() → Game.continue()

  • actor.skillManager → actor.skill

  • actor.stateManager → actor.state

  • actor.equipmentManager → actor.equipment

  • actor.cooldownManager → actor.cooldown

  • actor.shortcutManager → actor.shortcut

  • actor.targetManager → actor.target

  • texture.fromImage() → texture.loadImage()

  • ......


💾 Local Save Path Changes After Deployment



  • After deployment, the resource folder has changed from the old version’s “Output Directory/” to “Output Directory/resources/app/”.

  • This causes a change in the local save path. Released games must update and test the (cloud) save path accordingly.


🎮 Removed Project Settings: Initial Player Actor, Initial Party Members



  • Old projects will lose their initial actors; it’s no longer auto-created.

  • Use these commands in the "Startup" event to create the initial actors:

  • "Create Global Actor"

  • "Set Player Actor"

  • "Set Party Member"


💼 Removed Project Settings: Party Inventory Mode



  • For traditional RPGs previously using "Share Player’s Inventory" in "Party Inventory Mode":

  • Call "Set Inventory" when an actor joins the party to share the player’s inventory.

  • Call "Set Inventory" when they leave to restore their independent inventory.


📝 Modified Element Accessor -> Definition of "Latest Element"



  • Now, "Latest Element" points to the element directly created via the "Create Element" command, excluding descendants.

  • Previously, it pointed to a descendant, making the option hard to use effectively.


❌ Removed: Add Skill, Remove Skill, Add State, Remove State, Add Equipment, Remove Equipment Events



  • Create common skills, states, and equipment, and let other objects inherit their add/remove events.


🔍 How to Find and Modify Embedded Scripts in Events



  • Use VS Code to globally search for "script": in the project folder to locate embedded scripts.

  • The "Event" variable name conflicted with the built-in "Event" variable in the TypeScript environment and has been renamed to "CurrentEvent".


🔍 "Create Light" Command Changed to "Create Object" Command



  • Use VS Code to globally search for "id": "createLight" and replace with "id": "createObject".


🔍 "Delete Light" Command Changed to "Delete Object" Command



  • Use VS Code to globally search for "id": "deleteLight", replace with "id": "deleteObject", and update "light" to "object" in the next line.


🗂️ In the Object Script List, Scripts from the Same File Are Now Overridden Instead of Stacked



  • Only the last script from the same file is retained; duplicate the file if you need multiple identical scripts.


🍏 Old MacOS Projects Missing Icon/icon.png, Causing Deployment Failure



  • Solution: Create a new project and copy icon.png over.


⚙️ Some Custom Commands in Old Projects Not Updated to Latest Version, May Require More Fixes



  • Create a new project, copy changed custom commands, and use "Find References" to modify them yourself.


Closing Remarks


The editor project is officially complete. I sincerely apologize for any disruption this breaking update may have caused.
To ensure stability, no major changes will be made moving forward, but I’ll continue fixing reported bugs. I rarely check Steam community comments, so please email me directly about bugs. Thank you for your support!
For feature extensions, refer to existing plugins and use AI to create your own.
Game development is a long, challenging journey:
Some aim to become professional developers, dedicating immense time and energy to their craft.
Others seek a simple, easy-to-use engine for specific needs without deep exploration.
Some try out of curiosity and quietly give up.
Few who attempt game-making finish their first project; fewer still profit from it. The ideal is for work to yield commercial returns, sparking motivation for the next creation.
The YAMI editor isn’t for everyone—it meets some developers’ needs but can’t serve all. I regret this limitation. It’s best for those with some experience, suited to small-to-medium projects, like a stepping stone to professional engines. Many great engines exist; if YAMI doesn’t fit, choose what suits you best.
Though not widely used or promoted, some have spent months crafting small games with it. Here are a few examples:

  • Da Kui: quickly done but somewhat rough —— Journey to the West Survivor 🤣

  • Yahzj: A mini hit in card-based tower defense —— Border Pioneer 👈

  • Panda: A promising newcomer, cheer them on —— To hell with work 💪


Game links are at the end—I believe everyone will keep improving!
Next, I’ll pursue my dream game—a long-term project that may take my lifetime. For a higher technical ceiling, I’m switching to a professional engine to build a more complex architecture.
After 8 years, YAMI enters a stable phase. New features can’t alter its core or solve "some can’t make games," and might add instability. I’m tired after so long on this editor. Now, I want to learn new tech, try fresh projects, and chase freedom and passion!
I’ve lowered the editor’s price to reduce trial costs. This may upset early supporters, but I’m doubly grateful for your backing XD!
Trying may not succeed, but if someone’s inspired or benefits, it’s worthwhile. I’ve open-sourced the editor, games created with the editor compiled from the source code grant their authors the same rights as those created with the Steam version, with no extra legal obligations.
🔗 Open Source Address:
https://github.com/yami-pro/yami-rpg-editor

Wishing everyone success in realizing their game dreams! 🎮✨




官方群:3992050