The Modding Requests

Hi,

Thanks for pulling these together! These are really great questions! Looking forward to the next batch. Feel free to elaborate on any of the points below. The idea is to start a discussion with the modding community on the most important topics for them, not for this to be a dissertation of the “One Source of Truth” or anything like that.

Proposals

@RepeatPan: File API

A general purpose File API would be really powerful, but is also a double edged sword. It would enable a whole class of very powerful mods which would be impossible otherwise, but we don’t want to do anything would could compromise the end user.

For example, if we provide a general purpose write file API, an unscrupulous modder could easily write a virus to your system and try to trick you into clicking on it via their UI. Even if we only let you write well-known file types with well known extensions, modders can exploit bugs in the underlying operating system to still wreak havoc (e.g. the recently revealed .png metadata overflow attack).

Could you elaborate on what types of things you’d like to do with a File API? Maybe we can enable them with a specific and impossible to exploit API instead. For example, World of Warcraft has a combat log feature which is used by World of Logs and others to give really awesome combat summaries. Since Wow’s determining the content of the file, there’s no way to exploit the combat log to break out of the sandbox.

@RepeatPan: render_info:set_scale

I’m working on a fix and hope to have it in the next release. Note that render_info:set_scale only affects the appearance of the entity, not any of the other actual entity state. For example, trees define a region where someone must be standing to harvest a tree (the ‘destination’ component’s adjacent region). Changing the scale of the tree in render_info won’t resize that region, so things are probably going to look a little silly if you don’t also change that region. The same thing is true for collisions. Eventually, we hope to have a system where you can easily scale the entire entity, including the destination and region_collision_shape components.

@RepeatPan: modify rendering behavior inside mods materials, textures, shaders (?)

You can change the material of a model using render_info:set_material(). For an example, see “horde/materials/default_material.xml”. In the near future, we want to move the entire horde directory into the Stonehearth mod. After that happens, you should be able to do things like render_info:set_material(‘mymod:materials:translucent_shiny_glass’) to point to your own material files and shaders. This probably won’t make the next release, but I’ll see if we can get it done soon. In the meantime you manually copy stuff into the horde directory.

@RepeatPan, @Asterai: access to qb matrices and model_variants

We have the framework for implementing this, but it would need a lot of work to apply it generally. It’s currently used by the construction sub-system to make walls of arbitrary size out of qubicle templates. Check out the voxel_brush stuff in the disassembled code if you’d like to see what it looks like now. I’d like to see this, but it probably won’t come along until we have a game-system or class that desperately needs it. It’s a lot of work, and doing it now would come at the expense of working on more gameplay features (like save/load… need… save… load…!)

@RepeatPan: disabled mods and mod list

We definitely want more sophisticated mod loading, including the ability to pick what’s enabled/disabled for your game. It’s probably something that will get tackled on the way to save/load, which means sooner rather than later.

Questions

@RepeatPan: How is stonehearth:entity_created accessed? It’s called on the created entity - is there some way to listen to all entity_created events?

I’ll add the same trigger to radiant.events. It should be in the next build we release.

@RepeatPan: Is there a way to enable the micro map you use to test things?

Not easily, but I’ll add it my list of things to try to expose soon. If you add this to your user_settings.json file, you can create a small (though not as tiny as ours) world, which should dramatically speed up the game start time:

"mods" : {
	"stonehearth" : {
		"world_generation" : {
			"method" : "tiny"
		}
	}
},

@RepeatPan: Can we access the Javascript debugger/refresh UI stuff on the fly already?

It works in the shipping build, but you need the devtools package from Chromium Embedded to enable it:

  1. Download the latest CEF3 build
  2. Open the archive and copy cef.pak and devtools_resources.pak in the resources directory to your Stonehearth folder (right next to the locale’s folder).
  3. Run the game and point Chrome at http://localhost:1338

You can hit F5 in Chrome to reload the UI in Stonehearth.

**@RepeatPan: What’s the difference between radiant.resources.load_json and radiant.resources.load_manifest? **

There’s no real difference.

**@RepeatPan: Is the JSON parser non-strict on purpose? **

We use libjson to read/write JSON. I’m guessing it’s a bug in their implementation or we’re not catching an error somewhere. At any rate, it’s not-intentional.

Looking forward to the next batch!

7 Likes