Split object

For questions about using Classic.

Post » Wed Jul 21, 2010 9:46 pm

Hi,
I don't know, how slip one sprite into two innregural objects.

Here's an image:


I think, that this picture explains everything
How can I split?
B
5
G
3
Posts: 8
Reputation: 1,048

Post » Wed Jul 21, 2010 10:35 pm

The only feasible way is to do it like puzzle pieces.
You start with not one object but many.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Wed Jul 21, 2010 11:10 pm

[quote="Kodek":w5utj0m1]Hi,
I don't know, how slip one sprite into two innregural objects.

Here's an image:


I think, that this picture explains everything
How can I split?[/quote:w5utj0m1]

you need to use canvases, but its by no means easy, and itll eatup VRAM if the objects is being split many times/ alot of canvases
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Thu Jul 22, 2010 4:57 am

You would have to use a distort map I think, as the fx method would drive the vram even higher.
The funny thing is you can disintegrate the image and have a sprite for each pixel, and still have less draw on the system.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Thu Jul 22, 2010 10:37 am

Yeah, object splitting that doesent eat up your whole VRAM would be nice addition to construct, ive seen some examples in flash games. Maybe it would be easier when Construct could support vector graphics, or at least have some "create polygon with texture" expression. Another thing are custom collision masks for sprites with physics ( I suppose You would like to see splitted parts respond correctly to collisions), I dont know if You could make them during runtime but that would be very usefull.

The example : http://armorgames.com/play/6375/faster-miter-master

EDit:

Actually it could be done with displacements, i will make example later
B
5
S
1
G
2
Posts: 70
Reputation: 1,140

Post » Thu Jul 22, 2010 1:46 pm

distort maps have their limit aswell, it would turn into a hopeless garble after only a few cuts and getting a texture to look right would be very difficult on pieces, not to mention distort maps dont have collision detection which adds even more complexity. if you use canvases and your objects arent to big (128x128 lets say being the max) the vram usage wouldnt be that big even with many since the more, the smaller the canvases are, and you could probably have up to 20 on screen with a decent card and absolutely no slowdown.

wtv way you do it, it requires some trickery.

something like that game would never use more than 4 "canvases", hence the reason its lag free.

or for example chisel http://www.nitrome.com/games/chisel/

even though it may seem like the world is always being destroyed and eventually it would use way too many canvases, you have to think about it in a smarter way, only 2 or 3 are needed, one or two to recieve "cut pieces", then a giant one to capture it all once it stops moving, and then those 3 keep repeating the cycle, notice how you cant make two cuts at once? its because it needs time to make sure you dont reveal the "cycle" as the pieces converge.
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Thu Jul 22, 2010 2:45 pm

You can get collision detection on a distortmap if you paste it into a canvas, and the texture can be done using u, and v.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Thu Jul 22, 2010 8:08 pm

[quote="newt":97mh5mjz]You can get collision detection on a distortmap if you paste it into a canvas, and the texture can be done using u, and v.[/quote:97mh5mjz]it may work just fine
but I'm not sure if distorted sprites paste correctly to canvases
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Jul 22, 2010 8:26 pm

It worked a few builds ago, I haven't tried in a while.
Keep in mind a distort map will be very chunky, all you can do is basic polygons.
Quasi's method would be best for the game he referenced.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Thu Jul 22, 2010 9:58 pm

Thanks for the help anyway, I guess Construct is not really suited for such tasks.
Last edited by Kodek on Fri Dec 11, 2015 1:45 pm, edited 1 time in total.
B
5
G
3
Posts: 8
Reputation: 1,048

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests