Distort Map problem.

This forum is currently in read-only mode.
From the Asset Store
Two types of minimap: "full map" and "player is the center" (square map and radial map)
  • Hi,

    Today I started making a side-scrolling game.

    My platforms use a distort map to have a random shape.

    Very nice, it works as I like.. BUT! Collision masks, after the distorsion, don't update.

    So the player walks in the same rectangular platform without seeing the distorsion of the platform.

    Have you planned to implement it?

    Anyway, what can I do?

    Thanks

  • Help? (I'm using 0.99 now, but same problem)

  • As far as I know, distort maps are purely cosmetic. If you want funky shaped platforms, you will have to have funky shaped shapes to start with.

    Perhaps you could make a system where you create the shape you want with the distort map, and use that as a guide to place invisible, solid objects at the distort map points and rotate/scale them as needed to cover the area.

    Or you might be able to work something out with pasting the distorted image into a canvas and using the canvas's collision mask. Just keep in mind that large canvases are memory hogs.

  • yea, distort maps don't support collisions. Deadeye mentioned some feasible workarounds, try those.

  • I agree with Davio, do what he said.

  • I try, thanks..

  • depending on how much you need to do this

    pasting distorted sprites onto canvases and updating collision masks would work

  • It'd be a really tricky algorithm to make distort maps collide properly and be very time consuming... what do you need it for?

  • He's making terrain that is very slightly randomly bumpy. We're working on a solution in chat that uses canvases.

  • With the help of deadeye and lucid, I made this example about random shape platforms:

    https://dl.getdropbox.com/u/1105488/RandomTerrain.rar

    Thanks again

  • I wouldn't do what you do in that .cap.

    Every 4 vertices in a distort map renders like a sprite (since a sprite is made of 4 vertices), so you've gone and created 1500 vertices on startup just for your terrain, the equivalent of 375 sprites. Spawning 60 canvases will unecessarily waste a lot of VRAM, especially if you have large levels. The paste and update collision masks are fairly slow functions and you shouldn't call them regularly.

    If you want that, why not just have 10 random images in a sprite animation and set them randomly? You'll use a HUGE amount less processing power and memory!!!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you want that, why not just have 10 random images in a sprite animation and set them randomly? You'll use a HUGE amount less processing power and memory!!!

    Oh yeah, that's a good one too. I was thinking of an alternate method that placed objects using Erase effect to reveal portions of a large ground texture. But this way makes much more sense.

    Not to mention you could craft each of the 10 frames to line up with each other so there wouldn't be any seams to deal with.

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