Accurate Play Solo

Summary

Currently, Play Solo executes both client and server code in a single data model.

With Accurate Play Solo (APS), we simulate using two separate data models (one client and one server) communicating over http.

This provides our developers with a much more accurate picture of how their game will execute in production: “Non-Experimental Mode” can be enforced, RunService::IsServer and RunService::IsClient will return the correct values, etc.

While emulating, you will see a control to toggle your view between the two data models.

We use a blue/green border on the main tabbed view to indicate current data model, and messages to the output window are also a tagged blue/green depending on source.

For the short term, APS is opt-in: go to File->Settings->Studio->Advanced, check “Use Accurate Play Solo”, and restart Studio. This will ultimately become the default and the existing Play Solo will be removed.

Caveats:

Each “view” (Edit, Play Solo Client, Play Solo Server) has its own state regarding which scripts or plugins are opened. When switching from one view to the other, we will close all plugins/scripts associated with outgoing view and attempt to re-open/restore any plugins or scripts associated with the incoming view.

The debugger will only work on the Server data model.

Diabolical mode doesn’t do anything in APS.

Flavor Text

Gather ‘round young’uns: sit down by the fire, take a nice molasses biscuit and hear the tale of how Grandpa added support for accurate play solo (APS).

Now you young whippersnappers grew up with APS, but let me tell you there was a day when developers running play solo had to run everything in a single data model! A SINGLE DATA MODEL I SAY!! Client and server functionality all shoehorned into a single data model, violating the laws of nature and good sense and all that is holy. A script that should run on the client could create objects! A script that should run on the server could affect the GUI! Oh, it was terrible times.

Then Grandpa hitched up his breeches and got to work! He worked for days, weeks, months even, wrasslin’ that code into shape. He also had to wrassle a bear, but that’s another story…

When he was done, and purt near tuckered out, there she was: Accurate Play Solo!

Keep in mind, of course, that APS was an option: they had to open up Settings/Studio/Advanced and turn it on!

But once they did, hoo-ee!!

Play Solo now used two data models, one for server and one for client.

While emulating, they could use a toggle to switch their view from client to server and back.

The main tab control had a colored border indicating whether they were in client or server.

Messages written to output widget also had a colored stripe indicating whether they came from client or server.

Emulation now properly reflected a real distributed environment: Client scripts ran on Client DM, Server scripts on Server DM, and limitations on who could write what were properly enforced.

Whoops, Micah, don’t knock Cessy into the fire like that….

Of course, there were some changes and setbacks too. The debugger only worked on the server, there was no Diabolical Mode, and each “view” (Edit, Client, Server) maintained its own separate notion of which scripts and plugins were opened.

And what happened next, you ask? Did the developers take to APS like a kitten to a bag of plums, or did they get mad as pig on a merry-go-round?

THAT IS A TALE FOR ANOTHER DAY!!