New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make our own DMI alternative? #256

Closed
PJB3005 opened this Issue Jul 2, 2017 · 14 comments

Comments

Projects
None yet
6 participants
@PJB3005
Member

PJB3005 commented Jul 2, 2017

Right now sprites in game are direct references to a PNG on disk. To have multiple states available to things like door icons changing on open, the render able component needs to load these before hand in the component definition.

Its kinda clunky, especially with animated states.

Personally I think we should keep the idea behind the DMI format. I already have a spec for a DMI-like format that isn't stupid, GitHub and VCS friendly and more easily workable. The spec can be seen here. There's Python and Rust tooling for it already and writing a C# library can't be hard.

@Silvertorch5 you're the rendering man, opinions?

We should however consider how this'll fit into the current rendering system, including abstractions.

@theOperand

This comment has been minimized.

Contributor

theOperand commented Jul 2, 2017

Is there an existing format that could serve here? If there is something, it seems better than making our own spec.

@PJB3005

This comment has been minimized.

Member

PJB3005 commented Jul 2, 2017

I've tried looking but could find absolutely nothing.

@Silvertorch5

This comment has been minimized.

Member

Silvertorch5 commented Jul 2, 2017

we can make our own texture atlas format

@PJB3005

This comment has been minimized.

Member

PJB3005 commented Jul 2, 2017

@Iamgoofball absolutely proprietary.

@Silvertorch5 Silvertorch5 self-assigned this Jul 2, 2017

@Quantomicus

This comment has been minimized.

Contributor

Quantomicus commented Jul 2, 2017

We don't need you Goofball, step aside.

@ghost

This comment has been minimized.

@RemieRichards

This comment has been minimized.

Contributor

RemieRichards commented Jul 2, 2017

If RSI is what's used in the end, here's a Json Schema to validate it:
(or atleast a 'version 1')

{
	"$schema": "http://json-schema.org/draft-04/schema#",
        "title": "RSI Image Format Validation Schema V1",
	"description": "Robust Station Image",
	"type": "object",
	"definitions": {
		"size": {
			"type": "object",
			"properties": {
				"x": {"type": "integer", "minimum": 0},
				"y": {"type": "integer", "minimum": 0}
			},
			"required": ["x","y"]
		},
		"directions": {
			"type": "integer",
			"enum": [1,4] //a 1 or a 4
		},
		"state": {
			"type": "object",
			"properties": {
				"name": {"type": "string"},
				"select": {
					"type": "array",
					"items": {"type": "string"}
				},
				"flags": {"type": "object"}, //To be de-serialized as a Dictionary
				"directions": {"$ref": "#/definitions/directions"},
				"delays": {
					"type": "array",
					"items": {
						"type": "array",
						"items": {"type": "number", "minimum": 0} //number == float
					}
				}
			},
			"required": ["name","select","flags","directions"] //'delays' is marked as optional in the spec
		}
	},
	"properties": {
		"version": {"type": "integer", "minimum": 0},
		"size": {"$ref": "#/definitions/size"},
		"states": {
			"type": "array",
			"items": {"$ref": "#/definitions/state"},
			"minItems": 1
		}
	},
        "required": ["version","size","states"]
}

Which was used to validate this example (only modifications from the main RSI example is an example flag, couldn't think of an example selector)

{
    "version": 1,
    "size": {
        "x": 32,
        "y": 32
    },
    "states": [
        {
            "name": "hello",
            "select": [],
            "flags": {
              "isMovement": "true"
            },
            "directions": 4,
            "delays": [
                [1, 1, 1],
                [2, 3, 4],
                [3, 4, 5],
                [4, 5, 6]
            ]
        }
    ]
}

You can play with the above here: http://www.jsonschemavalidator.net/

Json.NET is free to use commercially as MIT and the most popular .NET library on nuget.
Json.NET Schema isn't free (except AGPL3 with 1000 validations per hour, which if content gets large could cause issues) but licenses are $99 for Indie Companies (less than 10 employees, nobody's getting paid so maybe that one would work?) or $149 for a business plan (10+ employees)

Edit:
Fear not! the Schema spec Json.NET implements is an open specifcation, that has an MIT implementation: https://github.com/RSuter/NJsonSchema so both Json.NET and NJsonSchema can be used for json serialising/deserialising and validation.

@Silvertorch5

This comment has been minimized.

Member

Silvertorch5 commented Jul 6, 2017

This is going to be a part of RobustEngine™ so we can remove kebab msspriterenderer

@PJB3005

This comment has been minimized.

Member

PJB3005 commented Jan 26, 2018

Just an FYI. I have a quick dirty RSI loader coded in C# on my fork, but haven't integrated it yet.

@Acruid

This comment has been minimized.

Contributor

Acruid commented Feb 12, 2018

We will deal with merging the @PJB3005 RSI loader after the Godot branch is merged.

@Acruid Acruid removed the W: Ready label Feb 12, 2018

@Acruid Acruid added the W: Backlog label Mar 12, 2018

@PJB3005 PJB3005 added W: In Progress and removed W: Backlog labels Apr 7, 2018

@PJB3005 PJB3005 assigned PJB3005 and unassigned Silvertorch5 Apr 7, 2018

@PJB3005

This comment has been minimized.

Member

PJB3005 commented Apr 7, 2018

Alright time for this stuff.

@PJB3005

This comment has been minimized.

Member

PJB3005 commented Apr 12, 2018

I'm gonna close this and make an issue about SpriteComponent.

@PJB3005 PJB3005 closed this Apr 12, 2018

@wafflebot wafflebot bot removed the W: In Progress label Apr 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment