Best Way to use a sprite sheet

For discussions about game development that does not fit in any of the other topics.
Post Reply
ShawnSwander
Posts: 53
Joined: Thu May 17, 2012 12:31 am

Best Way to use a sprite sheet

Post by ShawnSwander »

For the most part my game doesn't use sprite sheets for animation but I have sprite sheets for all the critters in the game.

So I have the sheet with a grid of sprites: it might look like this:

1: Orc
2: Knight
3: Griffon
...
Do you just have to make a CSV file and load all that in I've been making little json keys like

Code: Select all

{"0":"Orc", "2":"Knight"...}
Obviously my code needs a way to see the first sprite and go "That's an orc" but I don't want all orcs to be the same I was going to write some base stats so I could make a level stat that scales them up in a simple way.

Is there a tool or a good method for data entry on sprite sheets I might have to make a few hundred names plus indicate that wolves don't hold swords and orcs do and things like that.
I'd love to hear what you guys use to connect data with sprite sheets. I'm probably going to just use a CSV unless I find something really good.

The end goal is that I can make some pretty dynamic spawns like this:
*A group of 3* *Level 5* *Orc(s)* with a *mace* who cast *fireball* and *stun* and who uses a specific *loot table*
Astresks on data that might vary from spawn to spawn

A few things I could get rid of with a good data sheet for example the loot could also just scale up with the level and the weapon being held could determine their spells for example a wizard might always be holding a wand so the wand can tell my game that the wizard casts a specific set of spells and I have enough wands and staves that this would work. I was already planning to code their AI to depend on the weapon they hold. This way goblins with crossbows will move to a safe distance before attacking. While the same goblin with a sword will not.

Should I just use objects in tiled? What I didn't like about objects was that while I can give the objects a sprite I also have to include the sprite data so if I forget once the spawn will need debugged.

My data is all pushed server side so it won't have to send empty spawn tiles it will just have to do the initial load to make spawn objects.

What I was thinking about doing is using spawn information layers like we use tiles. So I could stack an orc under a mace on a number 5 tile for his level and a 3 tile for his squad size and then code my server to know to spawn 3 level 5 orcs with maces.

Thanks for your ideas and input :)
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: Best Way to use a sprite sheet

Post by Jackolantern »

Sorry, I didn't quite follow what the question was. Were you wanting feedback on this setup?
The indelible lord of tl;dr
Oroton
Posts: 39
Joined: Wed Dec 02, 2015 4:56 am

Re: Best Way to use a sprite sheet

Post by Oroton »

why not use a database, then use php to get the data and format it unto a JS array or objects populating all the values..

This is how i do my map sprites at least..
Post Reply

Return to “General Development”