MyWorld Meetup – 10/5/19
Announcements:
- The Plugin SDK is ready for release!
- MyWorld has a powerful plugin mechanism on both the server and the client. The SDK provides plugin developers with a toolkit for using industry standard languages, IDEs, and the Gradle build system for plugin development. The Groovy and Java languages are supported out of the box, but other JVM languages are trivial to integrate with the SDK’s Gradle build system.
- MyWorld has a powerful plugin mechanism on both the server and the client. The SDK provides plugin developers with a toolkit for using industry standard languages, IDEs, and the Gradle build system for plugin development. The Groovy and Java languages are supported out of the box, but other JVM languages are trivial to integrate with the SDK’s Gradle build system.
- A note about networking – until fairly recently, MyWorld used a message-oriented networking protocol. This was quite rigid and fairly fragile, as all messages must be pre-registered in the same order on both server and client. This meant that the network protocol was static, with no way for plugins to add network-level features or exchange network-level messages between plugins that coordinated between server and client. We recently switched to a lightweight RMI system (Remote Method Invocation) that allows both core code and plugins to “share” objects with a network connection. The other side of the connection can then remotely invoke methods on these shared objects, replacing the brittle and verbose messaging pattern with a powerful and flexible way to extend the network layer at runtime. This also allows graceful degradation of behavior when one side of a connection supports a feature that the other does not, since a missing shared object appears to the other side of the connection as a null value rather than as a missing message type (which will cause a serializer error). The new RMI system is highly efficient and imposes virtually no overhead over raw messaging, so adopting it required making no performance compromises.
Discussion:
- Zauberin – Will the SDK allow world operators to add script functions via plugins?
- Absolutely – MyWorld’s script engine, Chipmunk, uses a typical module system. Once the scripting is fully integrated, it will be trivially easy to add importable modules to the scripting engine.
- Absolutely – MyWorld’s script engine, Chipmunk, uses a typical module system. Once the scripting is fully integrated, it will be trivially easy to add importable modules to the scripting engine.
- Zauberin – Will it be possible to flag a module as being restricted? For example, some developers might want to add script functions for server or zone administration.
- Yes, there will be a security model for scripts. We have two options for doing that: preventing a script from loading a restricted module (as you’ve suggested), or requiring individual functions to do security checks as they are run. The latter option is much more flexible, and we’re leaning in that direction although we may do a combination of both (only allow a module to be imported by certain scripts, and then allow the functions in that module to impose additional security checks at runtime).
- Yes, there will be a security model for scripts. We have two options for doing that: preventing a script from loading a restricted module (as you’ve suggested), or requiring individual functions to do security checks as they are run. The latter option is much more flexible, and we’re leaning in that direction although we may do a combination of both (only allow a module to be imported by certain scripts, and then allow the functions in that module to impose additional security checks at runtime).
- Zauberin – Would it be possible to use C-like #ifdef statements for permissions at compile time?
- No – Chipmunk does not have a preprocessor so there is no mechanism for using #ifdef or other macro techniques. In addition, #ifdefs get out of hand very quickly if they’re not used sparingly, and the issues manifest themselves as confusing compiler errors. Permissions are complicated, which would make such a system highly prone to ifdef-related compilation errors.
- No – Chipmunk does not have a preprocessor so there is no mechanism for using #ifdef or other macro techniques. In addition, #ifdefs get out of hand very quickly if they’re not used sparingly, and the issues manifest themselves as confusing compiler errors. Permissions are complicated, which would make such a system highly prone to ifdef-related compilation errors.
- Zauberin – Does Chipmunk support assertions?
- There is currently no built in assert keyword like Java and other languages have, no. Assertions are easy to create with functions, but this has the downside that they can’t be disabled at runtime unless kept in test-only code. Early on, we’ll likely take the approach of assertion functions as part of a test framework, but if there’s demand for it we may add an assert keyword to the language and bytecode support to the VM.
- There is currently no built in assert keyword like Java and other languages have, no. Assertions are easy to create with functions, but this has the downside that they can’t be disabled at runtime unless kept in test-only code. Early on, we’ll likely take the approach of assertion functions as part of a test framework, but if there’s demand for it we may add an assert keyword to the language and bytecode support to the VM.
- Zauberin – Will it be possible to attach scripts to parcels, zones, avatars, etc. and not just objects? There are a few reasons that could be very handy.
- Yes, that’s the direction we’re looking into going. Note that on avatars, you already get to attach scripts “for free” since MyWorld has no special rules or treatment of avatars – avatars are entities just like every other object in the world, with the only exception that they are loaded and associated with a user when the user logs in. We do see a case for attaching scripts to things like zones and parcels, and we will probably take this route.
- Yes, that’s the direction we’re looking into going. Note that on avatars, you already get to attach scripts “for free” since MyWorld has no special rules or treatment of avatars – avatars are entities just like every other object in the world, with the only exception that they are loaded and associated with a user when the user logs in. We do see a case for attaching scripts to things like zones and parcels, and we will probably take this route.
- Zauberin – Will the renderer support edge maps (textures that preserve sharp edges on objects with low-resolution normal maps)?
- Currently no – we will investigate this option, however. As long as it works well with PBR, it could be a powerful feature.
- Currently no – we will investigate this option, however. As long as it works well with PBR, it could be a powerful feature.
- Zauberin – Will there be support for JSON in scripts? What about JSON Patch (a format for defining patches that override sections of an existing JSON object)?
- Yes, we will have a JSON library for serializing/deserializing script data. We will look into JSON Patch and consider support if we see a usecase in MyWorld.