1. Overview - momoadept/FleetCommand GitHub Wiki
Why use it?
I started AdeptOS when it appeared to me that vanilla C# is not enough to code the things I want in Space Engineers. I was very used to powerful frameworks that I could choose from for my other software projects, but for SE we don't really have that. As soon as I got into SE scripting, I decided to implement the features I want on my own. AdeptOS is a hell of an overengineered and undertested result of this endeavor. If you write scripts for SE, and, like me, want to reap the benefits of modularity, asynchronous runtime, extensibility, and serialization, please be my guest.
What it does?
The initial inspiration was Angular framework for JavaScript, but it is a very indirect comparison since most features are dictated by what I wanted to have specifically for SE scripting. We have
Modularity
Your code will come in modules. Modules are reusable, focused, easy to debug. You can mix and match modules to build your scripts. You can run multiple modules on the same Programmable Block. You can even run them on different PBs, but still let them talk to each other seamlessly. This way you can bypass the limits of the PBs code size because you can now split your source code. We have basic dependency injection and promote inversion of control here.
Asynchronous runtime
You want to spread out a complex problem into multiple ticks? You want to return control, but continue when a specific condition is met, without callback hell and redoing the whole structure of your script? You want to create a fire-and-forget background task that checks the integrity of your grid periodically? You miss Promises from JS with all that cool chaining and exception handling? You can now do that. We now have jobs and promises.
Serialization
It's cool that we have a Storage prop to save the state and survive world reloading. Let's turn everything into strings! We don't have JSON in scripting API, so I made my own JSON. You can use it to have a persistent state for your modules, it is also used in the background to allow PBs to pass object arguments to each other, and you can also use it from in-game to directly call a specific function on a specific module.
And more
We have more cool stuff here, and I keep adding small things here and there. Those are the main pillars that AdeptOS originated from.
What's the catch?
You'll need to write boilerplate code
Unfortunately, we can't use Reflections in SE, so you would have to write some boilerplate code here and there, specifically to access more advanced stuff like serialization. There is little way around it to keep it type-safe and C# friendly, but I did my best to make the syntax manageable, and your IDE autocompletion is your best friend. Tips on how to structure your code to avoid getting lost are included.
Advanced C# warning
There would be a lot of generics and lambdas. You would need to code classes and embrace the OOP way. A lot of abstract stuff in there. A lot of things will seem overcomplicated until you get used. And though you don't need to dig into the AdeptOS source code and understand all the details, you need to be confident in your own code. I can assure you that it gets better, especially for bigger and more complex codebases. I also work on guides to help you figure out thing on your way there.