Sprites and dynamic spritesheets

This forum is currently in read-only mode.
From the Asset Store
Firebase: Analytics, Dynamic Links, Remote Config, Performance, Crashlytics on Android, iOS & Web Browser
  • Hey guys!

    I began working on a game recently which, unlike my previous works with Construct, uses it's own engine for maps rather than different layouts and hard-designing through Construct.

    I am currently working on a MapEd utility for the game's engine and I'm using Image Manipulator to crop tilesets and dynamically apply them to sprites.

    Problem is that once I update one sprite (using both Load from file after saving a cropped tile with Image Manipulator OR using IM's "to sprite" function) the rest of them change into that same tile and therefore I end up having a map with the same tile repeating.

    Is there a way to fix that using a SINGLE sprite object, or should I give it up and use 128(!) different sprites per spritesheet...?

    Thanks in advance!

    Roy

  • Since the texture is stored on the sprite, I'd assume you need a single sprite for each tile.

    Which is why I keep nagging for the tilemap object

    Nice, however, cropping and assigning. And MapEd.

  • Thanks for your help Madster.

    I found out that assigning different animations to different objects before inheriting the image itself fixes the problem. So for now I've manually created 128 animations to the sprite and the code's just gonna call the right animation before sending the picture to the sprite object.. Till I find a better solution.

    Cheers!

  • Just checked, and the expression sprite.oid is usable, but sprite.uid is not.

    So there goes that idea.

    There might be a way via picking, to use system create object and switching from one to another.

    Edit never mind, disregard all that, its strictly one image per sprite, copies cannot have multiple images.

  • The animation route is a good solution to tile mapping, except it's hell when your designing your levels, because you have to assign the correct pv's to each and every tile so they display the right animation. Plus you don't see results in the layout editor. Anyway, you said your going be using a homemade level editor so thats not a problem i guess.

  • The animation route is a good solution to tile mapping, except it's hell when your designing your levels, because you have to assign the correct pv's to each and every tile so they display the right animation.

    Not if you create your own dynamic placement routine that checks the top/bottom/left/right edges of, say, tiled background object dummies, and places the sprites and assigns their frames accordingly.

    Or you could have each sprite detect whether it's got a neighbor on whichever side and have it set it's own frame to line up with it's neighboring tiles.

    Either way you wouldn't have to do anything except place one kind of tile per terrain type, and the map would sort itself out at runtime.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Not if you create your own dynamic placement routine that checks the top/bottom/left/right edges of, say, tiled background object dummies, and places the sprites and assigns their frames accordingly.

    hehe, i did do this for one of my games. I'm just talking about someone who wants to manually place tiles.

  • with Animations you would still be reserving the next power-of-two in VRAM for each tile though. which kinda misses one of the main benefits of tilemaps.

    (The other benefit being it's comfy)

  • Im pretty sure that a tile map would still have to be a power of two or it would be upscaled to the next power of two. That is just how the hardware and DirectX works.

  • Well the system is made so I could easily create maps, not for reserving memory.

    Each tile is 24x24, probably means it'll take a 32x32 memory of VRAM if what you guys say is true.

    Since every map reloads the tilesheet I don't think it will overload the system too much, even of your computer is a tad old.

    Another question though, guys: is it possible to encrypt archives with a password only the game has an access to, in order to store my files? Since almost nothing is reserved as a resource, I'd like to protect my files; I didn't find any password function within the ZIP object. So, what method could I use?

    Thanks!

  • There's no such function currently, but I wouldn't worry too much about people modifying resources of your game. Nothing is inpenetrable and it is the loss of an individual if they choose to change the art of a game.

  • But the game is going to be made as systems in constructs and resources outside: Maps, Graphics, Sounds, even Scripts; I don't want those to be easily modded, as people could build an entierly different game using this one's engine D:

  • If you're really worried then put in some security measures like checking the file size or something. If any one of your files has been messed with, don't run the game.

    Personally, I wouldn't be too concerned about it. If they break the game, they can't play it, and they have no one to blame but themselves. If they mod the game... well, no biggie. Put in a static title screen that will always show you were the original creator no matter what. It's not like people can claim they made the game then.

    And even if people are modding your game, that means that they're so interested in it that they want to extend the life of your game. It should be taken as a compliment.

    Hell, you could even be nice about it and show people how to mod your game. If you want. It's all a matter of perspective

  • If you're really worried then put in some security measures like checking the file size or something. If any one of your files has been messed with, don't run the game.

    Personally, I wouldn't be too concerned about it. If they break the game, they can't play it, and they have no one to blame but themselves. If they mod the game... well, no biggie. Put in a static title screen that will always show you were the original creator no matter what. It's not like people can claim they made the game then.

    And even if people are modding your game, that means that they're so interested in it that they want to extend the life of your game. It should be taken as a compliment.

    Hell, you could even be nice about it and show people how to mod your game. If you want. It's all a matter of perspective

    Hmm, I guess you're right. Thanks

    And yes, I thought of releasing the editors at some point, when and if the project is released. I just don't like the idea of people reverse engineering the game D:

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)