combomash / engine

TypeScript Algorithmic Media Engine
https://www.npmjs.com/package/@combomash/engine
ISC License
0 stars 0 forks source link

URL Params #16

Closed owmo-dev closed 2 months ago

owmo-dev commented 3 months ago

Configuration options (ex: InitParams) should be available as URL parameters which override anything defined in code. They need to be validated before applying.

Why?

I'm going to develop a workflow orchestrator for queueing rendering in a variety of configurations and rather than requiring each artwork / application / etc. to implement a set of URL Parameters defined by the orchestrator to pass into the engine, it would be far easier to just define an interface via URL Params that the Engine supports and implement those instead.

In practice - from an artwork generation perspective - you could run everything in a "fit to the window / low resolution" mode while developing and then send the art to the orchestrator to generating thousands of high quality outputs, without needing any extra work.

owmo-dev commented 2 months ago

Added InputsHandler to the Engine as well, as I'd prefer to use one on the canvas by default (optionally adding others to other objects if I require it).

owmo-dev commented 2 months ago

Important to note the JSON parse is pretty strict and ideally the URL should be in an encoded format (not necessary, but makes things easier). Ideally use double-quotes in the JSON URL config for better results.

https://codebeautify.org/json-url-encode#