这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@brisvag
Copy link
Contributor

@brisvag brisvag commented May 7, 2019

Attempt at generating .sprite and .terrain files for #970 and following the specifications in #965.

UPDATE: now following new DataDefinition format in #1151.

@heinezen
Copy link
Member

heinezen commented May 8, 2019

One question that popped up in my head was whether we want to generate "verbose" .sprite files that include comments about the format or just plain definition data.

So either the output looks like this:

# format version
version 0

# image file references, relative to this file
# imagefile <image_id> <filename>
image 0 houses.png
image 1 house_shadows.png

# layer definitions, from bottom to top (later defined layers overdraw earlier layers)
# all layers will be drawn.
# layer <id> mode=off  position=<default|roof|shadow>
layer 0 mode=off position=default
layer 1 mode=off position=shadow

# frame definitions for an angle
#
# assign frames to their layers (their angle is implied by the last angle definition).
# *pos, *size and *hotspot is within the source image.
# all the hotspots of the frames will be drawn at the same pixel (requested by renderer)
# so that the alignment/movement of the frames is done solely by hotspots.
# frame <layer_id> <image_id> <xpos> <ypos> <xsize> <ysize> <xhotspot> <yhotspot>
angle 0
frame 0 0 0 0 50 50 25 25
frame 1 1 0 0 30 50 TODOOOOOOOOO

or like this:

version 0
image 0 houses.png
image 1 house_shadows.png
layer 0 mode=off position=default
layer 1 mode=off position=shadow

angle 0
frame 0 0 0 0 50 50 25 25
frame 1 1 0 0 30 50 TODOOOOOOOOO

The latter one is obviously more space efficient, but the size of comments is probably negligible too.

@heinezen heinezen added area: assets Involved with assets (images, sounds, ...) lang: python Done in Python code labels May 25, 2019
@simonsan
Copy link
Contributor

simonsan commented Oct 1, 2019

@brisvag Any news on this one?

@simonsan simonsan added the waiting for author This issue/PR is waiting for feedback of the author label Oct 1, 2019
@brisvag
Copy link
Contributor Author

brisvag commented Oct 1, 2019

@simonsan No. Unfortunately, I had no time to work on it, and probably won't for a while :/

@TheJJ
Copy link
Member

TheJJ commented Oct 3, 2019

One question that popped up in my head was whether we want to generate "verbose" .sprite files that include comments about the format or just plain definition data.

I think we should generate the plain definition data, and maybe add a comment as header in every file which aids in googling the format or we provide a link to the documentation (which might outdate, so I'd favor the former one. for example # openage sprite definition for $entityname or something like that)

@brisvag brisvag force-pushed the generate-dotsprite branch from 372c396 to 35f3780 Compare January 24, 2020 13:31
@brisvag
Copy link
Contributor Author

brisvag commented Jan 24, 2020

I closed up all the outdated conversations in this thread.

I just rebased on the current master and pushed the latest changes: they are based on the current signature of DataDefinition at #1151.

@brisvag brisvag requested a review from heinezen January 24, 2020 13:41
@brisvag brisvag changed the title [WIP] Early attempt at generating sprite metadata files [WIP] Generate sprite and terrain metadata files Jan 24, 2020
@brisvag
Copy link
Contributor Author

brisvag commented Jan 24, 2020

One question that popped up in my head was whether we want to generate "verbose" .sprite files that include comments about the format or just plain definition data.

There could be a parameter for this in the dump method. In that case, I guess we should implement this for everything that inherits from DataDefinition, right?

@heinezen
Copy link
Member

A few minor things need fixing/improvement. Then we're good to go :)

@brisvag
Copy link
Contributor Author

brisvag commented Jan 25, 2020

I should have solved all the issues. Let me know!

@heinezen
Copy link
Member

Great :) Now you only have to fix the CI complains that are still there.

@brisvag brisvag marked this pull request as ready for review January 28, 2020 10:11
@brisvag brisvag force-pushed the generate-dotsprite branch from f40aeed to a438dbf Compare January 28, 2020 12:55
@brisvag
Copy link
Contributor Author

brisvag commented Jan 28, 2020

Rebased to #1151.

@brisvag brisvag force-pushed the generate-dotsprite branch from a438dbf to 750c073 Compare January 28, 2020 13:17
@brisvag brisvag force-pushed the generate-dotsprite branch from 750c073 to 7f0125e Compare January 28, 2020 13:27
@heinezen
Copy link
Member

merged into #1151 :)

@heinezen heinezen closed this Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: assets Involved with assets (images, sounds, ...) lang: python Done in Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants