Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Combining frames into spritesheets

  • 06-07-2013 11:50pm
    #1
    Registered Users, Registered Users 2 Posts: 454 ✭✭


    Hi,

    Was hoping someone might be able to recommend a good free program for combining individual frames into spritesheets. I tried spritesheet packer, but it doesn't seem to give much enough control over the number of rows and columns the sheet is made from. Any takers? Thanks

    I'll post back when/if I find one.


Comments

  • Registered Users, Registered Users 2 Posts: 454 ✭✭Kilgore__Trout


    GIMP ended up working pretty well with snap to grid.


  • Registered Users, Registered Users 2 Posts: 7,182 ✭✭✭Genghiz Cohen


    Keep in mind the number of rows and columns isn't important. It's size of the sheet that matters. OpenGL loads you texture into memory, but allocates enough memory for a sheet that is square and of size 2^n x 2^n (so like 128x128 ot 1024x1024 and so on).

    You want to pack your sprites into the smallest possible space that will fit into the smallest 2^n square you can manage.

    TexturePacker is what I use now and it has a load of nice features. It's not free (there is a trial) but if you are going to use it for more than one project, its worth a few quid.

    I actually wrote a packing tool for fonts. If you are a coder you can copy and tweak this to suit your needs.


  • Registered Users, Registered Users 2 Posts: 454 ✭✭Kilgore__Trout


    I wanted a little more control over the rows and columns because I've set up the animation to play in this order. Guess it seemed the easiest way to set it up at the time, and I'm provisionally working with an artist now, so I don't want to start changing the requirements.

    Stand 1/ Stand 2/ Stand 3/ Stand 4/ Stand 5
    Walk 1/ Walk 2/ Walk 3/ Walk 4/ Walk 5
    Walk 6/ Walk 7/ Walk 8/ Walk 9/ Walk 10

    My game is a 2d shooter, so I needed space between the sprites so I could offset the frames so the character would rotate on his centre. I'm guessing there are better ways to do this. I started working on games after a 1 year general computing conversion degree, so it's a learning process.

    I'm using Unity and I've tried to get POT images whenever possible. Given I'm developing for PC/MAC/Linux, do you think it will create a big performance hit if a few of the spritesheets are NPOT?

    I've done some stress testing on an old laptop (1.8ghz single, 2gb, no GPU) and it seems to work alright. The main thing I noticed that crucified performance was using lights in the scenes.


  • Registered Users, Registered Users 2 Posts: 7,182 ✭✭✭Genghiz Cohen


    Probably not going to be an issue so.
    If you were porting to mobile though this can become a huge, crash causing issue very quickly.

    The way TexturePacker gets the effect you want is by exporting an XML file alongside the packed sprites. It tells the game engine where to find the sprite named "x", how big it is on the sheet and how much blank space was clipped off to save space. See TexturePacker will clip blank space, pack the sprite but keep track of that so you can add it back on again when you are loading the sprite.

    Keep going as you are now, but do keep it in mind for later projects.


  • Closed Accounts Posts: 753 ✭✭✭Jonny Blaze


    Just curious but why are you using Unity for a 2D game?

    My understanding is that Unity is a 3D engine and I have heard that you then have to shoehorn in the appearance of a 2D game into a 3D engine which can be problematic.

    Why not just code a 2D engine?

    They are vastly simpler than a 3D engine.

    Again, just curious!


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 3,831 ✭✭✭Torakx


    Is it just as easy to make particle effects in coding as it would be in Unity?
    I dont know much programming.
    But when building a 2D game for my college assignment, I found the particle effects and overall development quite fast, because the framework is already there for particles and other interesting effects.
    Instead of animations for bubbles coming from a submarine I was using, I used Unity's particle system with bubble sprites drawn in Photoshop.
    Parent the particle system to the player prefab and tweak it in the settings panel.
    Thats just particle effects.
    The lighting effects too I found usefull.
    It was also really easy to set up paralaxing backgrounds as well.
    Set up a few planes one in front of the others face etc and throw on some backgrounds with tansparent diffuse.Then script a scolling texture and you have a sidescrolling shootem-up background.

    But I don't have much idea how a lot of that is done when just coding a game engine yourself.

    From using Unity for a 2d game I think the 3D aspect isn't too disruptive and sometimes usefull(As I have more options in tackling game mechanics and visuals).Most of the time you can work off the coords and stick to 2 axis that way, with object placement.


  • Closed Accounts Posts: 753 ✭✭✭Jonny Blaze


    Oh definitely it is harder to code a particle system from scratch!

    Even in 2D. It's tempting to go for the easy route, but for me, I was happier to put the effort in to learning the difficult aspects myself in order to become a better programmer.

    I am no purist however and would recommend people use whatever they are most comfortable with! I took the harder route voluntarily, and now I can still go and use Unity or what have you and take advantage of the ease and so on. But imagine a case where perhaps you cannot achieve the necessary mechanics or effects you want for a project using the tool of your choice. It is at that point that you're hard effort earlier on to master the difficult hard to learn stuff will pay off.

    For example, coding a physics engine was hugely beneficial for me as a programmer, allowing me now to know that I can implement a custom physics effect or gameplay mechanic that may not be possible with havok or what have you. And also, these options are always there over and above what you have learned yourself.

    In the end it's a trade off I suppose. I am now looking into starting to learn Unity after having spent a number of years developing my skills without 3rd party. And in the meantime I have learned and developed my overall skills at general programming etc which I am very happy with. So though I have not produced a full game as such. I have spent enough time implementing features and playing with particles and physics etc that I know I could if I needed to. Whereas if you need a game out now then Unity or other 3rd party may be your best choice. It's up to you!

    Good luck in any case! ;)


  • Registered Users, Registered Users 2 Posts: 454 ✭✭Kilgore__Trout


    To be honest, accident is probably the main reason I am using Unity. I was making a game with Java + Libraries, and I got badly stuck with implementing the visual side of the game. I spoke to some people who put me in touch with a local developer, who happened to be using Unity. Was pretty impressed with prototypes they'd put together in a relatively short amount of time. I tried Unity out, and after a few months we became friends.

    I kinda like the idea of doing everything from scratch, but it's just not practical for me. The experience of making an engine would be great, but the demands of little game voices looking to be realised in code can't be ignored : )

    In terms of using a 3d engine for a 2d game, I really haven't encountered many problems. Set camera to ortho, 0 an axis, and you're pretty much good to go. It is going to be that little bit more complicated because you're still operating in a 3d environment, but there are benefits: the Inspector, and the advantages Torakx mentioned (not to mention it's free).

    Good luck also!


Advertisement