Archive:

August 19 – The day when all your mods died.

The new JSON patching system discussed way back on June 25 has landed. There might be a few edge cases that aren’t implemented correctly, but it’s passed all of the tests I threw at it. Let me know if you find an edge case I missed.

“__merge” style patches no longer work. You can override files fully, or you can use the patch system. To use a patch, name the file “whatever.config.patch” where “whatever.config” is the file you want to patch. It should support the entirety of RFC6902 and RFC6901.

Q: Can you give us an example?

A: Sure:

Here’s a short example.
Let’s say you have a file named… oh I don’t know, “player.config” And let’s say you want to change the hitbox of the player by changing around the standing poly.
You would create a file called “player.config.patch” and it could contain, for example, the following:


[
  { "op" : "replace", "path" : "/techControllerSettings/baseMovementParameters/standingPoly/2", "value" : [ 1.35, -2.5] },
  { "op" : "replace", "path" : "/techControllerSettings/baseMovementParameters/standingPoly/3", "value" : [ 1.75, -2.0] },
  { "op" : "replace", "path" : "/techControllerSettings/baseMovementParameters/standingPoly/4", "value" : [ 1.75, 0.65] },
  { "op" : "replace", "path" : "/techControllerSettings/baseMovementParameters/standingPoly/5", "value" : [ 1.35, 1.22] }
]

What that will do is change the values in the file from:


  "techControllerSettings" : {
    "baseMovementParameters" : {
       "standingPoly" : [ [-0.75, -2.0], [-0.35, -2.5], [0.35, -2.5], [0.75, -2.0], [0.75, 0.65], [0.35, 1.22], [-0.35, 1.22], [-0.75, 0.65] ],
       "crouchingPoly" : [ [-0.75, -2.0], [-0.35, -2.5], [0.35, -2.5], [0.75, -2.0], [0.75, -1], [0.35, -0.5], [-0.35, -0.5], [-0.75, -1] ],
       "airFriction" : 0.2,
       "mass" : 0.6,
       // should keep the player from teleporting through walls
       "maximumCorrection" : 1,
       "maxMovementPerStep" : 0.4
     }
   },

to


   "techControllerSettings" : {
     "baseMovementParameters" : {
       "standingPoly" : [ [-0.75, -2.0], [-0.35, -2.5], [1.35, -2.5], [1.75, -2.0], [1.75, 0.65], [1.35, 1.22], [-0.35, 1.22], [-0.75, 0.65] ],
       "crouchingPoly" : [ [-0.75, -2.0], [-0.35, -2.5], [0.35, -2.5], [0.75, -2.0], [0.75, -1], [0.35, -0.5], [-0.35, -0.5], [-0.75, -1] ],
       "airFriction" : 0.2,
       "mass" : 0.6,
       // should keep the player from teleporting through walls
       "maximumCorrection" : 1,
       "maxMovementPerStep" : 0.4
     }
   },

Possible values for “op” are: “test”, “add”, “remove”, “move”, “copy”, and “replace”. They do what it says on the tin. The only one potentially confusing is “test” which simply tests the path for some value, and if it’s not correct it aborts the patch.

“test”, “add”, and “replace” take “path” and “value”
“remove” just takes “path”
“move” and “copy” take “from” and “path”

There’s other stuff like “-” for end of list and using ~1 and ~0 to reference “/” and “~” respectively. But that’s pretty much it.

Comments »

August 11 – Documentation again

Remember the late time I mentioned documentation I said I’d eventually make it automated?

I did that today. It’s now tied to the steam upload so it should update every time Steam does (ie, nightly).

You can find the documentation here: http://doc.playstarbound.com/

You can navigate around by classes or by namespace, but the front page is mostly blank (because it’s the default doxygen setup).

The bits that you lua modders are most interested in are located here: http://doc.playstarbound.com/namespaceStar_1_1LuaBindings.html under the namespaces section (for instance: http://doc.playstarbound.com/namespaceStar_1_1LuaBindings_1_1WorldEnvironmentCallbacks.html )

Hope this helps!

Also did a few things with the Sky today. I’m currently separating the Sky from the Celestial Coordinate system so that we can give fully featured Skies to Outputs and Instances and the like. Nothing too exciting though.

Comments »

July 31st update – Programming retrospective

Hi there peeps.

Looks like no one has put out an update yet today. (Whoops, looks like Armagon put something up as I was typing this.) But I’m kind of mired in the goop of a huge change, so I don’t have much to report today other than mostly just going one by one through compile errors and handling them on a case by case basis. That’s not very entertaining!

So I figured I would take a short break and sort of give a retrospective on just what code has been changed in the background since our last stable update in late April. This is just the major new stuff. Things like bug fixes and minor features aren’t included. I figure it being the end of the month it’s more or less an appropriate time for it. And some of the stuff here, while not new, might not have crossed your awareness yet.

Ready? Go!

– Completely retooled the tile rendering system, platform behavior is now completely configurable and we have something what we call Neighbor Aware Tile Rendering which allows things like pipes automatically morphing based on neighbors. This can all be done in configuration, rather than hard coded like the old platforms. The configuration for platforms can be found in the assets under /tiles/platformtemplate.config and the configuration for pipes can be found in /tiles/pipetemplate.config.
– Changed around how ships work, they can now be upgraded, and everything else that goes with that (SAIL, short cinematics callable from world). Allowed certain features to be disabled, such as beaming down. Fixed the critical item hack and other such “just starting out” issues.
– Updated (and still in process of updating) the World Scan parameters which allowed changes to the UI. Weather is shown. Main and subbiomes are shown. Planet requirements are shown (such as low oxygen). Ability to lock the UI into certain screens based on ship capabilities.
– Completely changed around how the universe works. No more alpha/beta/etc sectors. Sectors are now areas on the map.
– All objects are now Wirable and Scriptable. Rejoice modders.
– Shields work completely differently. Melee weapons work completely differently. New weapon type: the staff. New options for weapons to make the player stand still while firing and all of the other various and related code accoutrements (like animated cursors).
– Items can now be scriptable. All FireableItems (materials, pickaxes and tools, weapons, etc.) are scriptable now. Item code organization overhaul. Internally changed to make things better
– Monster AI overhaul, new behaviors, new attacks, new most everything.
– Completely overhauled the monster spawning system. Can now accept much more data from the biomes and dungeons nearby and spawn much more intelligently.
– Added new Readers/Writers Lock to threading. Speeds up asset loading by a hell of a lot.
– Reworked our Networked Animator class. Gets rid of a bunch of redundant stuff on the lua side.
– Admin commands. Admin server logins. Show logged in clients. More! It’s almost like the server is becoming a “Real Thing.” Added stuff to go along with that, like unicode convertion and other off the wall random things.
– Refactoring a bunch of code in the Gui portion of the game. A lot of it was buggy, unfinished, and incomplete. Not a complete rewrite, but lots of stuff was changed.
– Minor changes to how lua callbacks are generated that allows them to be automatically documented by doxygen.
– Speaking of lua, lots of added functionality there, some covered in other points, some not.
– Quest changes and updates

And more, I’m sure I missed a few things because I just scrolled through a few thousand git commits.

Currently, I’m working on making player, npc and monster stats and statuseffects that operate open them completely configurable and scriptable. To that end today I removed the augment system entirely, so all 7 of those items will cease to function for the short term. I’ll eventually get them working again.

It must be Thursday. I could never get the hang of Thursdays.

Comments »