0
\$\begingroup\$

For a game I'm making (similar to games like Terraria, Starbound etc.) I want to ensure that the framework is as modder friendly as possible. This leads me to wonder if it would be too inhibitive to modders if I only allowed them to create one sprite, then the game flips the sprite depending on what direction you're walking/facing. The only reason I want to make the game flip sprites is because my file structure is already horrible, and I feel like creating another right/left folder would make the whole think even worse.

\$\endgroup\$
  • \$\begingroup\$ See the gamedev.stackexchange.com/questions/63804/… for the answer \$\endgroup\$ – Kromster says support Monica May 2 '15 at 21:21
  • \$\begingroup\$ Depends on your game. Manyland does what you describe and is pretty successful. \$\endgroup\$ – Anko May 2 '15 at 21:49
  • \$\begingroup\$ Going for the least restrictive approach seems like the best option. After all, if a modder decides that the left side of a character should be the same as the right side, he can simply flip the sprite himself. Rather than using separate sprites for each pose of the character, I'd recommend using a sprite sheet/ texture atlas (as Jon highlights in his answer). It is both easier to edit and faster to load (e.g. loading 50 poses in individual files versus loading one larger file containing all poses). Here's an example of a sprite sheet: bit.ly/1KE4en7 \$\endgroup\$ – Jelle van Campen May 3 '15 at 10:10
1
\$\begingroup\$

Using an atlas:
You can pack the left and right versions into a single texture for each sprite, and only swap UV's based on the player's direction.

enter image description here

Although you may put only left/right images into the textures, will your modders?
A few descriptors to think about:

bool AutoFlip;        //Swap UV's based on L/R?
bool ReverseTextures; //Reverse standard "autoflip" direction - who know's why...
bool MirrorUVx;       //Backwards? - who know's why...
bool MirrorUVy;       //Upside-down? - who know's why...
\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.