Code architecture

Continuing from a discussion on Discord: How can I architect my code to satisfy two conditions:

  1. Easy to yank out parts of the code for open source distribution
  2. Supports free-form, reactive gameplay

By “free-form, reactive gameplay,” I mean that our experiences have no scripted gameplay until somebody interacts with an object – be it a blackboard, a boat, a conveyor tube. Although this isn’t strictly true since we also have environment objects like trees that operate independently of players.

I have little experience designing large systems, so I’m not sure I understand what I mean by code architecture. I think there are at least two interpretations:

  1. Physical: What types of BaseScript objects you use, how you organize them in the tree, how they communicate.
    Ex. Single-script architecture, bindables, a custom require function
  2. Philosophical: How you think about things in the world, their state, and their actions
    Ex. ECS, OOP, microservices, Rodux

Whatever your interpretation, I’m keen to hear how you architect your own code and how I might architect mine to achieve the conditions above.

1 Like