Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Need help with Deform tool

A topic by Tengu_Yamabushi created May 22, 2023 Views: 267 Replies: 13
Viewing posts 1 to 5

I'm using the Deform tool to stretch some dungeon walls/door sprites to give a sense of perspective (these are for use in custom 1-bit game engine).

The problem I'm having is that the Deform tool puts a hitch/bend at the bottom of the image... the top deforms fine, but the bottom edge acts like a part of it is 'pinned' in place and will not move - problem area circled in red here:

How can I deform the bottom edge to be a nice straight edge like the top edge?

I think I've solved it... I had been trying to apply the post-masked image (green stuff for transparency later) which was taller than it was wide.  I trimmed it to just the part I was really interested in, which was same width_x_height, and things work much better:

(2 edits)

Ok yes because the triangles should be better oriented for this deformation now. Glad you find a solution ! But maybe you will have an issue if you need to deform the other way, but I guess you mirror the images ?

Yes, I'll be mirroring them :)

The deform has been upgraded some times ago to handle bones animation so the deformation are now using polygones which is nice to use with bones and complexe image but that's true that for simple rectangle it's not very adapted because the polygon will create two triangles so the deformation can be wrong.

So for you issue I propose you these following solutions :

Using a 3D image with perspective. The advantage is when you find your perfect setup you can save it and reuse exactly the same but this is less customizable. 1) create a project with 3D layer 2) Import a 3D image 3) change the layer camera settings (I think the best way is to start from back view and rotate the Y and change the fov to find best settings)

Maybe my example is a bit bad, it should be better to increase the camera rotation and reduce the fov to approx 70°

(2 edits)

Ah, ok.  I'll try that also (assuming for more complex work).

Thanks for the quick followup! :D

Edit: no, the 3D thing won't work for this particular thing... the end result needs to be the exact same size/shape/corner-coordinates as the template image (these pieces go together like a jigsaw puzzle).  I can do that with a 2D setup by just matching the corners of the fancy image over a template, but that won't work in 3D (the template is 2D).  Will stick with 2D transforms for now, I think.

Well, having a square texture image isn't working for the walls (it worked fine for the doors, but not the walls... strange).

What I'm trying to do is make a drop-in replacement for this:


using this texture:



And wind up with something like this (note the precise dimensions/locations for the texture corners, these have to be exact so the pieces fit together properly):


So, I can get the size/corners right so that all the puzzle pieces fit together, but can't figure out how to stop the bricks in the wall from getting crooked.

thank you for the texture, I'll do some tests to see how the polygon is built with this

I think I've got it (see further down the thread), but you'll probably do it much easier than I did :D

Just showing how the various pieces fit together (there are lots more, but this gives an idea)... I built this set last night, so not quite the same as what I'm doing today, but you can see the same 'crooked walls' syndrome ;) - this is running on the Playdate console (400x240 1-bit display):

(1 edit)

Ok, I think I got things working... very tedious to tweak numbers until things match the template in 3d, but I finally got it :) :


And the output:

So it looks like going 3D was the proper route, after all(?).

Thanks!

Yes it looks fine that way, nice job !

Cycled the various parts through the workflow - looking good! :

Thanks again :D