More Expression Parsing...


This will be yet another short quick update. I'm almost done with expression parsing but there are still a few cases that I need to cover... This weekend I added both function parsing and entity attribute parsing. I also was able to parse a few complex multi-parameter nested expressions. So far, everything seems to be working fine. The only thing missing is implementing entity attribute functions, which is a combination of both things I worked on the past few days. Just to give an example, this would be a an entity attribute function:

"group.cell.biome_trait_presence(wood) > 0.3"

In this statement, I'm comparing a group cell's wood trait presence against the value 0.3, which represents a required minimum percentage of 30%, and validating if is this is greater than such value. To perform this operation I have to first extract the cell attribute from a particular group (a cell is the place on the map where a human group is located) and then call the attribute function biome_trait_presence with the parameter value 'wood' to extract the percentage of biomes present on the cell that have the wood attribute (jungles, forests, taigas, etc). 

I hope I won't take too much effort to implement these type of functions. Likely, it will take just an afternoon, but anything that involves using regular expressions (shudders) can get surprisingly complicated sometimes. Regardless, if everything goes well, I hope to get to work right away on the new event conditions and and then start implementing the example decision I defined a couple weeks back. I don't think I'll manage to complete that task in a single weekend though. Nevertheless, with some luck, I'll have a working prototype a week later.

Get Worlds - History Simulator

Comments

Log in with itch.io to leave a comment.

Good , Good .