yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.33k stars 1.56k forks source link

Mod Images folders - documentation and reality #5238

Closed SomeTroglodyte closed 2 years ago

SomeTroglodyte commented 3 years ago

Roughly half of the mods I see, including 5Hex, have Image subfolders directly under the mod's root, but we document they should go one level deeper under mod/Images/subfolder.

While the placement is largely irrelevant as long as the atlas and texture are included and correct, we should get this straightened out. It pains me to say so, but I propose we make sure the code supports the Images/* placement, such that the packer works for that, and that only, even if it might mean more work for our stressed modders.

We might also consider warnings in the mod checker, and also warnings for json misplacement (yes they manage that, too, and the game simply ignores the jsons making it an empty mod).

AdityaMH commented 3 years ago

Maybe this little oot. But, can you explain why, a mod can change map editor on improvement button. image

ravignir commented 3 years ago

Roughly half of the mods I see, including 5Hex, have Image subfolders directly under the mod's root, but we document they should go one level deeper under mod/Images/subfolder.

While the placement is largely irrelevant as long as the atlas and texture are included and correct, we should get this straightened out. It pains me to say so, but I propose we make sure the code supports the Images/* placement, such that the packer works for that, and that only, even if it might mean more work for our stressed modders.

We might also consider warnings in the mod checker, and also warnings for json misplacement (yes they manage that, too, and the game simply ignores the jsons making it an empty mod).

yes, yes. That is because I have not updated 5Hex for a long time. 4 Months actually. It is surprisingly timeproof. I only renamed couple things and manually edited .atlas file to accommodate.

SomeTroglodyte commented 3 years ago

Hey, I'm not criticizing. Glad I'm not imagining things. I'll go make sure then (in time) that ImagePacker and wiki are in sync (OK, they are, mostly, but the bit about the multi-textures still needs confirmation for me and my forgetful tiny brain).

yairm210 commented 3 years ago

If we decide to extract a new set of images, this definitely shouldn't suddenly "outdate" mods.

SomeTroglodyte commented 3 years ago

No, this doesn't suddenly "outdate" mods because those will simply continue to run from their provided atlas, but not be able to generate a new one, I think.

Just tested out: The current code will build a mod atlas when Images//.png exists and the atlas is deleted. It will not do the multiple controlled atlases thing for a mod - I'll definitely look into enabling that in time. It will rebuild RekMod's atlas but not 5Hex's - as expected.

SomeTroglodyte commented 3 years ago

Maybe this little oot

Maybe if I knew what an "oot" is? Typo for "Oort cloud"? Off-topic anyway. And I've seen something similar long ago when ravignir had a hexagon sprite changed in size in there. Not directly an Unciv issue, though map editor is making itself dependent on actual sprite pixel dimensions in a way that may not be really necessary. Maybe I'll look for alternate ways, if I ever get around to rework map editor.

SomeTroglodyte commented 3 years ago

@ravignir - the thing with having control over which textures go in which atlas for mods: Needs both packer and loader refactored, and while I have it coded and superficially tested, I'm a little wary about it. So - a - how important would you deem that? And - b - would/could you test from a non-PR'ed branch from my repo? image

SomeTroglodyte commented 3 years ago

(Yes I moved some less-frequently-used unit pixel sprites from the Unit atlas to the main atlas so neither spills, though I'm not sure which distribution will actually give best performance)

AdityaMH commented 3 years ago

Maybe if I knew what an "oot" is? Typo for "Oort cloud"? Off-topic anyway.

oot = Out of Topic

And I've seen something similar long ago when ravignir had a hexagon sprite changed in size in there. Not directly an Unciv issue, though map editor is making itself dependent on actual sprite pixel dimensions in a way that may not be really necessary. Maybe I'll look for alternate ways, if I ever get around to rework map editor.

So, i need resize all my pixel sprite to same dimension to fix this bug?