WebGAL Documentation
repository·main·Indexed 26 days ago
https://github.com/openwebgal/webgalA modern, web-based visual novel engine featuring a no-code graphical editor and a scripting interface. It supports Pixi.js customization and provides tools for animation systems, Z-index hierarchy management, and scene parsing via the @webgal/base package (v4.6.2). The engine includes a server for project detection and a parser for converting scene scripts into structured data.
What's inside WebGAL
- WebGAL is a web-based visual novel engine designed to make the development of visual novel games easy and accessible. It supports a wide range of features found in mainstream visual novel engines, including animations and special effects for game customization. Games created with WebGAL can be published to websites for play on PCs and smartphones, or exported as executable files for Windows.
Understand the Animation and Transformation System
mainIn WebGAL, animations are implemented as
PIXI.Tickercallback functions.Key concepts include:
- Transformations: A special type of animation with a duration of 0ms that sets a stage object to its final state immediately on the first frame.
- Internal Transformations: A record of effects applied to specific stage object keys. These are applied whenever an animation ends or a stage object changes to ensure the object maintains its intended position or effect.
- Locking Mechanism: To prevent conflicts, the WebGAL stage controller locks stage object keys while an animation is in progress. These keys are unlocked only after the animation completes. Upon completion, the animation's 'final state' is updated to the object's 'internal transformation' record.
Get started with WebGAL
mainWebGAL is a web-based visual novel engine designed for ease of use and powerful customization. You can create games using a graphical editor, direct scripting, or specialized developer tools.
Ways to create games:
- Graphical Editor: Use the WebGAL Graphical Editor for a no-code experience.
- Scripting: Write WebGAL scripts directly. For an enhanced experience, use the WebGAL Script VS Code extension for syntax highlighting.
- Developer Tools: Use the WebGAL Debugging Tools for advanced development workflows.
Flowchart feature overview
mainThe flowchart feature allows players to view unlocked story nodes via the menu or the bottom control panel and jump back to previously unlocked scenes.
Key capabilities:
- Supports multiple routes.
- Tracks node unlock progress.
- Provides visibility controls for locked nodes.
- Note: Resetting game data will also clear all flowchart progress.
Implement a GameScript command
mainA GameScript command implementation is a function that receives an
ISentenceand returns anIPerform.Core Principle: Separate the logic of advancing recoverable state from the logic of runtime performance.
- Command Function: Responsible for parsing arguments and modifying
calculationStageState(the authoritative state for subsequent commands, conditions, and fast previews). - IPerform: Responsible for the runtime performance (visuals, audio, etc.) after the state has been committed.
If a command has no runtime performance (e.g., it only modifies state), it should return
createNonePerform().Command registration is handled in
Core/parser/sceneParser.ts.- Command Function: Responsible for parsing arguments and modifying
Run WebGAL-Server in Auto-Detection Mode
mainWebGAL-Server can automatically detect a WebGAL project root directory in two scenarios:
- The current working directory is the WebGAL project root.
- The current working directory contains a folder named
WebGAL(case-insensitive), which is treated as the project root.
Use this mode when you are already inside the project folder or its parent directory.
Develop for the WebGAL engine
mainIf you are a developer interested in contributing to the engine itself, please refer to the official developer guide for instructions on how to participate in the project.
Developer Guide: https://docs.openwebgal.com/developers/
Join the WebGAL developer community
mainDevelopers interested in contributing to the engine or seeking information can join the official Discord server.
https://discord.gg/kPrQkJttJyUse the WebGAL Graphic Editor
mainFor users who prefer a visual approach over manual scripting, you can use the WebGAL Graphic Editor (WebGAL Terre) to create visual novels without deep programming knowledge.
Download the Graphic Editor: WebGAL Terre Releases
Create games with the WebGAL Graphical Editor
mainFor users who want to create visual novels without programming, WebGAL provides a graphical editor called WebGAL Terre. You can download the WebGAL Web Editor from its releases page to start building your game visually.
https://github.com/OpenWebGAL/WebGAL_Terre/releasesHandle animations and state updates
mainWhen implementing animation commands (like
setAnimation,setTransform), distinguish between Calculation End State and Runtime Animation.- Calculation End State: The state that subsequent commands, saves, and previews read. This should be written to
calculationStageState.effectsduring the command function stage (e.g., viaapplyAnimationEndState()). - Runtime Animation: The frame-by-frame visual effect. This should be registered in the
startFunctionof the returnedIPerform.
Best Practices:
- Parallel Animations (
-parallel): Only write the specific fields the animation controls. For example, if an animation only changesscale, do not resetpositionto default values; use local field merging instead of full object replacement. - State Update Principle: Only write recoverable, saveable, and dependency-critical content to the stage state. Do not write temporary DOM, Pixi tickers, timers, or audio instances to the stage state.
- Resource Management: Use
assetSetter()for resource paths instead of manual string concatenation. Use provided tools likegetStringArgByKey,getNumberArgByKey, etc., for argument parsing.
- Calculation End State: The state that subsequent commands, saves, and previews read. This should be written to
Create games with WebGAL
mainTo start creating visual novels with WebGAL, you can use the following resources:
- Development Documentation: For detailed technical guides, visit the WebGAL development documentation.
- Visual Editor: If you prefer a graphical interface over coding, you can download the WebGAL graphical editor.
- Online Demos: Experience the engine via a short demo or browse official WebGAL games.