Other than these three there are a lot of different names for similar concepts and seemingly endless possibilities to name/design the details of the system.
The most common components are process, scheduler and kernel.
At some point your process will rise enough in priority to be run. You can prevent this "starvation" of the logic in OS very easily by increasing the priority of processes that have not run in a while.
#Screeps modules code#
The remedy for this is usually to work based on bucket levels and deactivate parts of your code base. The great thing about a working OS is that this is all there is to managing code execution order and CPU: The OS manages everything for you in the background.Ī quick example for CPU management: If you are at your CPU limit constantly and your ticks get cut off because your bucket is empty you might not ever run logic that you put at the end of your main loop. All game logic is usually contained or referenced in these processes, then the programmer assigns priorities to the processes and decides when to start them. Once a player is at that point they either stick to the concept or start abstracting the different modules more.Īn OS style bot is based on processes.
Usually at a certain point of logic complexity this gets out of hand though. For beginners, starting with a tutorial code style bot, it is very easy: They decide in what order things should run and then just write a chain of if-else/switches to accomplish this order. General philosophy Įvery Screeps player has to decide in what order the different modules of their code base will run.
#Screeps modules mods#
This allows for server administrators to execute commands and also the primary way to interact with mods if they have an intractable element.Įngine is the game core. It is where your servers game lives including map data, player data, etc.īackend contains an HTTP server accessed by clients and a CLI server for administration. The rest of the processes connect to storage to exchange data. Storage contains a LokiJS-based database, a key-value storage, and a Pub/Sub mechanism. It is also an optional modules as any user can write their own launcher or launch modules manually.ĭoing the latter gives far more control regarding the server operations. Launcher launches the rest of the processes, and it includes the server control GUI. And you can access their source codes at the bottom of this page. It consists of several segmented modules detailed below. The Screeps private server is a private server created by the devs and highly modifiable by the community. You can help Screeps Wiki by editing to add more information.