jamiebrynes7 / spatialos-sdk-rs

Rust integration of the SpatialOS C API bindings
Apache License 2.0
21 stars 6 forks source link

Developer workflow for cargo-spatial #70

Open randomPoison opened 5 years ago

randomPoison commented 5 years ago

Now that cargo-spatial is (about to be) on the master branch, we should start to discuss what sort of workflows should be supported, and what a good default workflow/setup would be.

To start off, the initial functionality I added was the cargo spatial local launch command, which performs the following steps:

The idea here was to automate all the manual steps that I was having to do in order to launch a local deployment to test my workers.

While this workflow has been all I've needed so far for a super simple test game, @jamiebrynes7 has pointed out that his normal workflow is to launch a local deployment and then manually connect workers to it. If I'm understanding it correctly, this is a similar workflow to what the Unity GDK uses, i.e. Ctrl + L launches a local deployment, and then hitting the play button in the Unity editor launches all your workers and connects them to the local deployment.

Would it make sense to support a similar workflow for the Rust SDK? I have very limited experience working with SpatialOS, so I'm not personally familiar with what a "normal" development workflow looks like. What other workflows should we support? Does it even make sense for the Rust SDK to emulate the workflow of the Unity GDK, or should that be left to engine-specific integrations to do?

jamiebrynes7 commented 5 years ago

I think the ideal scenario is one where its configurable to your own workflow with some sort of reasonable defaults.

For the GDK for Unity, there's a huge advantage to connecting workers manually due to the quick compile & hot reloading capabilities of Unity. This advantage is unlikely to yield similar benefits in Rust.

My preference is generally still to manually connect my workers, mostly because you get more control over them when working locally. That's definitely not to say that this is the correct workflow.

I think the only way to find a good default workflow is to use it and find what workflows are commonly used. Which takes time! :wink:

The trap I really don't want to fall into is reimplementing the old Spatial CLI inside cargo spatial :joy:

randomPoison commented 5 years ago

The trap I really don't want to fall into is reimplementing the old Spatial CLI inside cargo spatial

Agreed! I've been thinking that it might be better to more closely mirror Cargo's CLI and workflow, since that's going to provide a more familiar experience for Rust developers. So e.g. cargo spatial run might do what the current cargo spatial local launch command does, i.e. provide a basic build-and-run workflow. The simplicity of having cargo run automatically build my project before running it is what I was looking to emulate when I setup cargo spatial local launch, I'd hope we can continue to provide a reasonable "default" workflow like that even as we add the less opinionated alternatives that you're requesting 🙂