-
Notifications
You must be signed in to change notification settings - Fork 13
DSL ~ Intro to the DSL Feature
The DSL feature parses the Domain Specific Language of chiventure into the WDL that can be processed by chiventure. This feature is written in Python, which means that there are no header files that function as user-facing interfaces. However, we still separated our code into modules that serve distinct purposes.
The chiventure/src/dsl/
directory is currently organized as such:
├── README.md
├── conda_environment.yml
├── src (.py files)
├── grammars (.lark files)
├── examples
│ ├── dsl (.dsl files)
│ └── wdl (.wdl files)
The README
introduces the DSL and the example .dsl
files. It also provides directions on how to install Lark and how to run the parser.
conda_environment.yml
is a conda environment file that helps install Lark
via a conda environment with the appropriate dependencies.
There are 3 directories: src
, grammars
, and examples
:
-
grammars
contains.lark
files that define the grammar of the DSL for the Lark parser. -
src
contains Python files that parse the DSL into WDL. -
examples
contains two sub-directories,dsl
andwdl
, that respectively contain sample.dsl
and.wdl
files for testing and demonstration. Descriptions for the specific examples can be found in theREADME
.
The grammars
directory currently contains 3 .lark
files: dsl_grammar.lark
, util.lark
, and vars.lark
.
-
dsl_grammar.lark
defines the DSL grammar in the acceptable format for Lark. Reference for this format can be found here. -
util.lark
defines "utility" grammars, like escaped strings and comments, that might be used in multiple different files. It also imports a few useful pre-defined definitions from Lark's common library. -
vars.lark
defines rules for usingvariables
in the DSL. This provides Lark with instructions on how to recognize, match and replacevariables
when parsing the DSL.
The src
directory contains 4 Python files: dsl_parser.py
, parse.py
, to_wdl.py
, and vars.py
. Each of the files acts as a module in the code design.
-
parse.py
is the main user-facing module that contains the themain()
function that handles the entire process of translating the DSL to WDL. It calls on functions defined in the other three modules. It also handles opening the DSL file and outputting the generated WDL file, and includes support for command line flags that can be specified when using the parser. -
vars.py
uses Lark to evaluate the variables, if any, in the given DSL file and replace the variables with their assigned values. The main outward-facing function isevalVars()
, which returns the DSL, as astring
, with variables replaced by their respective values. -
dsl_parser.py
parses the DSL according to the grammar defined ingrammars/dsl_grammar.lark
. The main outward-facing function isexport_dict()
, which outputs a transformed syntax tree that acts as an intermediate stage between DSL and WDL. In the intermediate stage, the information in the DSL is extracted and loaded into Python data structures, which can then be easily manipulated into WDL. -
to_wdl.py
takes the intermediate stage output from thedsl_parser.py
module and manipulates it into the final JSON/WDL format. The main outward-facing function isparsed_dict_to_json()
, which returns the WDL in its JSON format.
-
Action Management
-
Battles
- Design Document
- Text Based Combat in Other Games
- User Stories
- Wishlist
- Battle Planning 2022
- Battle User Stories Review 2022
- Structs in Other Modules Related to Battles 2022
- Stat Changes Design Document
- Run Function Design Document
- CLI Integration Design Document
- Move Changes Design Document
- Unstubbing Stubs Design Document
- Battle Items and Equipment Design Document
- Battle Item Stats
- Battles Demo Design Document
- Battles Testing Moves, Items, and Equipment Design Document
- Sound integration with battle (design document)
-
Custom Actions
-
Custom Scripts
-
DSL
-
CLI
-
Enhanced CLI
-
Game-State
-
Graphics
- Design Plan
- Design document for integrating split screen graphics with chiventure
- GDL (Graphical Description Language)
- Graphics Sandbox
- Design Document for NPC Graphics and Dialogue
- Feature Wishlist (Spring 2021)
- Installing and Building raylib on a VM
- LibSDL Research
- Module Interactions
- Working with Raylib and SSH
- raylib
- GDL
-
Linking the Libzip and Json C to chiventure on CSIL machines
-
Lua
-
NPC
- Dependencies: Player class, Open world, Battle
- Action Documentation
- Design Document for NPC Generation in Openworld
- Design and Planning
- Establishing Dependencies
- Implementation of Custom Scripts
- Independent Feature: NPC Movement Design Document
- Player Interaction Design and Planning
- Dialogue
- Design Document for NPC Dialogue and Action Implementation
- Loading NPCs from WDL Files
- NPC Battle Integration Design Document
- NPC Battle Integration Changes Design Document
-
Open World
- Autogeneration and Game State
- Deciding an integration approach
- Designing approach for static integration into chiventure
- Feature Wishlist
- Generation Module Design layout
- Potential connections to the rest of chiventure
- Single Room Generation Module Design
- Source Document
- User Stories
- World Generation Algorithm Plan
- Loading OpenWorld Attribute from WDL
-
Player Class
-
Player
-
Quests
-
Rooms
-
Skill Trees
- Avoiding soft locks in skill tree integration
- Components of Exemplary Skill Trees
- Design Document and Interface Guide
- Environment interactions based on skill characteristics
- Integrating complex skill (combined, random, sequential, etc.) implementation
- Integration of a Leveling System
- Potential Integration with existing WDL
- Research on game balancing in regards to skill trees
- Research on skill tree support in modern day game engines
- SkillTree Wiki Summary
- Skilltree "effect" implementation and roadmap
- Summary of md doc file for skilltrees
- Design ideas in connection to other features
- Summary of Skill Tree Integration 2022
- The Difficulty of the Reading the World
- Complex Skills Summary
-
Sound
-
Stats
-
WDL