punkice3407 / ObjectBuilder

MIT License
53 stars 39 forks source link

Same sprite in multiple objects #9

Open elewental opened 2 years ago

elewental commented 2 years ago

From: https://github.com/ottools/ObjectBuilder/issues/38

Using same sprite to different objects may help not making the client so heavy sometimes, perhaps is not something so impactful, and im not sure if everyone who do this way uses this reason, but I do sometimes.

And when I need add new sprites for only one of the objects, I must replace it by hand. Well I have a suggestion for this situation.

Example: image image image image

punkice3407 commented 2 years ago

If I understand correctly, you are telling about Sprites Optimizer which is in Menu/Tools. It will remove all empty, unused and duplicated sprites at once

elewental commented 2 years ago

Not exactly.

Example: test4

For a random reason, I have 3 duplicated objects (100, 101 and 102). Each one is 2x1. Normally it would have 6 sprite ids for it, but I used one id equal in the 3 objects, so I have 4 sprite ids instead. image

Then, if I want to replace only the first one, the object id 100, the sprite of 101 and 102 will be replaced too by issue: test5

The proposal is to create a option, for instead of replacing the sprite ID that will change in all objects, if you not choose "replace all", it will import new sprites at the end of the spriteid list and then automatically replace it as another sprite id, keeping the 101 and 102 configuration.

image

You see, If I choose to replace all, it will remain 4 sprite ids. (and keeping the issue shown at first gif) image image

But If I use the option I suggested, this will happen: (101 and 102 will still have a same spriteid, but will not share it with the 100). image image

punkice3407 commented 2 years ago

Does the same problem occur with the 1x1 spritesheet?

elewental commented 2 years ago

It happens for all, when the same spriteid is used in more than 1 object, doesn't matter the width/weight or pattern, or the square the sprite is located.

the-overdriven commented 2 years ago

+1 This is a big problem especially when editing ground tiles which share same sprites. Currently if you want to change a sprite only for one tile it will change it for all other tiles too!

When importing .png spritesheets it should always create new sprites, never replace old sprites! When importing .obd it already does that, so why not do the same on .png import?

elewental commented 2 years ago

When importing .png spritesheets it should always create new sprites, never replace old sprites!

When importing .obd it already does that, so why not do the same on .png import?

I disagree, the function of replace action is to replace, if you want to import new sprites you could just use the import tool or drag the .png into a blank object.

If you create an object with no sprites, set the correct size and then move a .png file it will add the sprites importing it.

test13