To Drag or not To Drop
How Sanatorium—A Mental Asylum Simulator is basically a Drag-n-Drop Adventure
So, our Drag-n-Drop and Mouse Detection System will be at the forefront of the player experience. There were many trials and tribulations with the current Drag-n-Drop system in the games demo we used at many conventions and events.
As you already know, Sanatorium is #MadeWithUnity. Looking at 2D games, Unity is a very popular, but also not an optimal choice. It provides many features specifically for 2D games, but it will always be a 3D space in the editor, and in some cases you’ll need to move something in respect to that.
The current Drag-n-Drop System did not consider these specialties of unity, and it was based around the card, as the demo was very card focused. The detection of draggable objects was based on the specific object itself, isolated from its context.
For a better mouse detection and input system, this needed to change. So, the whole Drag-n-Drop movement was moved to a cross-section DragNDropSystem, that would detect and move cards, files and other objects.
With that goes a further decoupling, the separation of systems to reduce dependencies. With the new system, we also adapted a special “Command” pattern. It would burst the frame of this diary and is very technical, but maybe I’ll make a special tech blog post about it.
The TL;DR of that: With the new system, we will also be ready to port sanatorium to a controller-based environment such as consoles and mobile devices much easier. The release on PC/Mac/Linux will still be at the center of the development. The next big item on the list is how we handle, edit and generate the data needed for Sanatorium, but that’s a story for another time.