What I did the last days
→ Discussion on /r/Citybound
This post is brought to you by cats.
So far, I'm still busy with preparation for the scary invent-a-magical-algorithm part of economy.
I laid down the basic concepts of resources, places and activities in code
- I spent some time to come up with a good, compact data representation for activities, since the more activity-connections (of the activity network) I can fit into the CPU cache at once, any kind of search algorithm that I will write on top of them will run faster. Further optimization will probably make sense after I know the exact characteristics of the yet-to-be-fully-invented algorithm.
Instead of just defining my initial (rural-town) resource, place and activity types directly in the code, I built a small system to load them from configuration files at runtime
This will allow me to tweak individual values, or even introduce completely new resource, place and activity types without recompiling the game at all
This means that some "pioneer modders" could already do the same and they don't even need developer tools, just a text editor!
- I'm actually trying to set a precedent here and see how much even complex behaviour can be treated as data and thus "outsourced" into configuration files - the more consequently I do this, the more accesible even powerful modding will be!
My "data format" is actually just markdown with tables (specific column names and table cell formatting is expected from the code), which has the benefit of not only being easily editable, but looking extremely readable both in plaintext and when rendered on GitHub
- List of resources: plaintext, rendered
- Example of a place with activities: plaintext, rendered
- If you're wondering what the 'me', 'us', 'here' means: it refers to the transaction party being affected/referred to (me = current agent, us = current agent's family, here = household which offers this activity)
I'm almost done with that
My next steps will be:
- Implement roads as activities (with dynamic costs/benefits)
- In code, generate a large (abstract, invisible) road grid with a random mix of homes, farms and shops at grid points, each with their activities
- Start sketching some working algorithm ideas for finding reasonable daily schedules in this synthetic-rural-town-grid
Let me know what you think!