Feature Req: Trimming and Collision Polygons

  • Hello There,

    I wanted to request what is hopefully a small thing though of course that usually means it's a big change :)

    I import a lot of sprite sheets into C2 for tile sets. I then go about trimming them all which gives me the 1px margin on each side. This is fine until I have to go and manually adjust the collision polygons on each one. Could you guys look into snapping the collision polygon to the visible pixels? Or giving an option to not have them auto expand to the trimmed area when you apply the trim to your animation frames? I have to go to each frame and manually adjust the collision corners back to the edges of the actual tile.

    It would also be great if I have multiple animations that use the same basic shapes in them, if I could copy the collision frames from an animation and paste it into another one. As the above scenario with the trimming happens across all my animations and most of them are just recolored versions of eachother using blocks with the same shape in each frame.

    Thanks,

    BluePhaze

  • With the collision displayed in the sprite editor, you can right click and apply it across the whole animation or all animations.

  • Look at it like this, you have created a tile strip with 44 tiles in it. You import it, then trim it, then have to manualy go into each tile to set the collision polygon to match only the visible pixels of the sprite not the trimmed transparent pixels added on all side.

    Then in your graphic tool of choice, you create different color variations of that same tile strip. You import the various colored versions of the tile strip. You then have to go through each one manually adjust the collision polygons on each frame (44 frames for each tile set) multiply that by about 10 sets of tiles and you can see that it gets pretty tedious...

    So being able to either A. Have it stick the collision rectangle to the visible pixels as an option, or B. be able to copy the collision polygons from one animation to another (especially if they have a 1 to 1 match up of collision polygons between the frames. For example if visible pixels in frame 1 of SPrite A match the shape of the visible pixels of frame 1 of Sprite B's animation then copy the collision polygon between them.

    Thanks...

  • "generate collision from alpha channel" button would really rock in the editor. An always on for import feature would rock too!

    Nice suggestion.

  • Look at it like this, you have created a tile strip with 44 tiles in it. You import it, then trim it, then have to manualy go into each tile to set the collision polygon to match only the visible pixels of the sprite not the trimmed transparent pixels added on all side.

    Then in your graphic tool of choice, you create different color variations of that same tile strip. You import the various colored versions of the tile strip. You then have to go through each one manually adjust the collision polygons on each frame (44 frames for each tile set) multiply that by about 10 sets of tiles and you can see that it gets pretty tedious...

    So being able to either A. Have it stick the collision rectangle to the visible pixels as an option, or B. be able to copy the collision polygons from one animation to another (especially if they have a 1 to 1 match up of collision polygons between the frames. For example if visible pixels in frame 1 of SPrite A match the shape of the visible pixels of frame 1 of Sprite B's animation then copy the collision polygon between them.

    Thanks...

    Unless I'm completely not understanding what you're writing here, you can already do this. Import all your sprites, as many animations as you want, then go into any frame on any animation and modify the collision. Then right click and apply to all animations. This will copy the collision shape to all frames of all animations.

  • each of the 44 frames of animation has a different shape in it. So I don't want the same polygon in every frame of the same animation. I want frame ones collision polygon to be copied to frame one another animation, frame 2's polygon to be copied to frame 2 of another animation, etc... etc.... each frame has a different shape it in, but each animation is made up of the same series of shapes. For example frames 1-4 may be triangle, square, circle, octagon. Having the triangle collision polygon copied to all frames does not help me at all. But if I have another animation that has a difference colored triangle, square, circle, octagon, then copying the collision polygons from each of those frames in animation one to animation two makes sense. The triangle is in frame 1 so the triangle collision polygon get's copied to frame 1 of each animation, the square is in frame 2 so the squares collision polygon gets copied to frame 2 of each animation, etc... etc... see what I mean?

  • If you have a folder based project, you can overwrite the image files in the project folder directly without affecting the collision masks.

  • Tell me more!?!?!? This sounds like an amazing thing all my graphics, etc... are stored infolders, but doe you mean a specific project type? Or just using folders? That would be great, Could I duplicate the animation, then just swap out the graphics in the copy?

  • Tell me more!?!?!? This sounds like an amazing thing all my graphics, etc... are stored infolders, but doe you mean a specific project type? Or just using folders? That would be great, Could I duplicate the animation, then just swap out the graphics in the copy?

    He means if you are saving your project as a folder project instead of capx (in the file menu it's something like project), then you can go to wherever you are saving your construct game and see all the files. They're in the "animations" folder. So in C2, right click on the file/sprite you wante duplicated (not in the image editor, the actual sprite on a C2 layout or in the file browser) and select duplicate type. And I apologize for not being near C2 at the moment so my terminology may be off.

    Then you can go into the animations folder (the one made by C2), go to that new duplicate, and copy-paste replace the frames you want to replace. C2 will read those new graphic files but it won't go through the import process so the collision polygon will remain. So you'll still have to set the polygon at least once, but for subsequent variations, it goes much faster.

    Hopefully that all made sense.

  • Thanks C-7 if this works it will save me much time when creating new levels/worlds... if I am currently saving as a project, wouldn't I be able to save as a folder the next time, then make the changes, then after that switch back to saving as a project?

  • Thanks C-7 if this works it will save me much time when creating new levels/worlds... if I am currently saving as a project, wouldn't I be able to save as a folder the next time, then make the changes, then after that switch back to saving as a project?

    Yes. You can switch back and forth as much as you'd like.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley, C-7 that worked like a charm. Is there any way we can get this type of option built in? Swap out sprite strips while retaining collision polys? That would stream line things a bit. So now the workflow I have is I created a clone of an already configured sprite. Called the clone PlaceHolder. And now I use place holder to import and trim my sprite strips. Then I save, close construct 2 and copy the sprites from the animations folder for placeholder, and paste them into the animations folder for the sprite that I needed to change out the grahics on.

    Works with new sprites as well, clone an existing sprite, rename it, then follow the same procedures to add the new images to it's frames and keep the collision polys.

    Thanks for all the help!

  • Dude just use collision tiles..You don't want every single tile checking for collisions anyway.

  • I don't want to have to create each level twice... if I use collision tiles for every tile, that is basically what I would have to do layout all the tiles twice in each level. I now have a method that works in minutes to swap out complete tile sets. It works fine.

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