Smooth Transition from Topdown to Platformer

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Create your own adventure map with this easy to use asset pack.
  • I want planets that do this. The surface of that circle is generated with one dimensional perlin noise - ignore my terrible paint art. It's for demonstration purposes.

    I want the circle to split open on the opposite side, and "unroll" as you move in, into a platformer level, and once you land, platformer controls take over. If you move in a bit and then back out, it should form back into a circle. I'm not sure if this makes any sense, but ideally it will also orient with the bottom of the screen and blow up in size.

    If this makes any sense to you, and you have any idea how to make it work - please respond, because that would be a dream come true for me. I'm not sure if it would require an effect, or a custom plugin, but I have the resources to make it work, if I had any idea where to start.

  • Not sure about the unrolling part, but using a distortmap set to 1c,1r, you could take the coords at 0,1,and 1,1 up to half to form a semi-circle.

    For an unrolling you might actually make a polygon out of a distortmap, a one pixel image would do, and take the coords from say a six sided poly, at the bottom center, move the left side up, and to the left, and the right side up and to the right.

  • At work, so no time for a detailed answer, but what you'd have to do is lerp between a line and circle formula.

    If t is a value between 0 and 1, that represents represents the path around the circumference of a circle, or the path along the line from beginning to end where it wraps.

    Then for each point on the perlin plan you get a height value, and use this added to the minimum radius for the circle. Calculate the angle of that point from the circle.

    On the line version angle would just be 0

    Using distance as a factor lerp the two together to get the x and y coordinates of the nonnoised surface, and interpolate the angles to get the correct angle to offset that point in the land from the surface. If none of this makes sense let me know and ill explain in greater detail when I have a chance

    As far as visualization, id say it'd have to be distortmaps

    Tho in my experience on a mass scale like this, its best to modify the sprite plug to take distortion commands from another plugin to avoid the event overhead

  • line to circle using "s"

    I'd try the interpolation, but I suck with arrays in "s", and the array object doesn't take to vectors easy.

  • here ya go arsonide. the solution was actually a little more involved than I thought when I first replied

    here?s an exe of an unwrapping planet,

    http://dl.dropbox.com/u/1013446/unwrappingplanetoid.exe

    control the unwrapping of the planet by moving the mouse from left to right

    rotation of the planet that translates to scrolling as it unwraps is possible as well, though it might make more sense to rotate the camera

    this cap requires s, but only for two expressions xoffrot, and yoffrot, and using them is no different than any system expression

    http://dl.dropbox.com/u/1013446/unwrappingplanetoid.cap

    time to get ready for work, but if you want me to break down the math later, let me know

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi lucid, I downloaded your cap. I have s plugin and perlin noise plugin. When I click to Run All, I have a white blank screen. I have Construct Classic r1.2 Why it might be like that ?

  • Not sure. Try run layout instead. One possibility is I've been messing around with my personal copy of sprite plugin and its no longer compatible with the normal one

    I guess let's see if it happens to anyone else.... the exe runs ok?

  • Just tried the .cap and it worked fine. Impressive :)

    zen

  • Runs fine here.

    Might be an a different version of "s" that's the issue.

    Nother reason to add those expressions to "math"... poke <img src="smileys/smiley20.gif" border="0" align="middle" />

  • Or it might be that he's using Noise 2.0 and Lucid is using the original Perlin Noise plugin in this example.

    Lucid that is awesome. I have no idea how it works though as I haven't had the time to play with it yet. I'm going to mess with it tonight, but that's exactly what I'm looking for.

  • Actually, since its noise across a single axis you could just use normalrandom().

    You would have to write it to an array, and you would probably get way more peaks, and valleys, but ehh.

  • just wanted to run a few ideas by you arsonide. first, as I said in the pm, it doesn't have to be perlin noise, it'll work with any set of numbers you can refer to by position, even an array as newt suggested.

    so if you were planning to use gridtree, and tunnel into greater detail there's no reason this can't be adapted to that. When I have a little time, if you need me to, I can try to put this into function object form, cuz it's kindof a pain fiddling around in that formula, and also what you said about how distorted the texture gets in the distortion

    but anyway. what you said about the mask might not work, because the texture would have to wrap in a circle. depending on how urgent this is, cuz I'm really busy lately, but I can help you get a workable method to reliably wrap a tileable texture around the planet in a smooth looking way. I've been working alot with distorting textures around curves and into different shapes lately.   which brings me to my other idea, if you wanted, it could even be made to look like the planet surface was becoming more spherical as it became more circular, so your texture would actually bulge forward and make it look like a 3d planet, and flatten to a more 2d look as it unrolled into the sidescroller view.

    anyway, gotta get to work. see ya, glad you liked it!!! It was an interesting challenge.

  • Given the time I could probably figure out the rotation - I got something working a bit ago but it was rotating around 0,0 instead of the correct origin of the object. I'm in the middle of a work week as well though so I haven't had much time to putz with it.

    The example Davioware posted here could probably be adapted to allow the planet to be collidable. From space it wouldn't need a collision mask, when it unwraps, after the transition is complete, the mask would be generated.

    As far as art goes - I have no idea where to even begin with that. Like, fundamentally how would that even work. Libnoise (Noise 2.0) has support for spherical and cylindrical noise. It's built in, Noise 2.0 just doesn't have access to it. Cylindrical is just noise that tiles on one edge rather than two. Spherical is...complicated...to say the least. I figured those two mappings wouldn't be necessary in a 2D engine, but if they would help, let me know and I'll activate them ASAP. I'm not sure if either one of those things would help, though. If the art can't be solved, I'm willing to scale back the graphics to just solid colors and go for a retro type of style, but actual noise would be awesome. In fact, I'm not even sure if noise would work, as the noise color would have to line up with the elevations on the outside, and be solid in the interior. (White peaks, etc.) Maybe it should be done algorithmically rather than with noise, as you suggested.

    This was honestly just a crazy idea I had brewing in my head for a while. I didn't think it would actually go anywhere! It's crazy. Imagine my universe populated with these things along with procedural content. It'd be like a ton of Terrarias in one program. I will continue throwing myself at your math and attempting to decipher it - I got a few things down in the little time I had to mess with it tonight, but now is time for sleep and then work. I appreciate the help, and any future help.

  • Hey arsonide. Sorry for the brief answer, but I'm pretending to work as I type this.

    I think it would have to be triangular or conical. Imagine an upside down pyramid. The top doesn't tile with anything, the left and right sides have to wrap. Of course, depending on how the texture thing works, this would mean that when it unrolls, the vairation would decrease as you looked lower on the screen, which isn't too bad, considering you're probably not going to have the entire texure show up down that far. I know we've discussed realtime noise generation speed before, but forgot. If its possible on the plug side, I could figure out this end of making it interpolate between triangular and rectangular versions of the same noise, with the single bottom point expanding into the bottom edge of the rectangle

  • With a canvas for collision detection you would paste the distortmap into the canvas, and get perpixel collisions, but you probably don't want collisions for the mountains at the platform level. That means you would need to use a second distortmap, but that could actually help you out with the texture.... unless you really want to go from a z on the planet to a y on the platform. In which case the texture will be a nightmare.

    As to the angle thing, to make things easier you can go beyond 50-64 columns since its only 2 rows. Something that divided into 360 even would be better... even 360.

    That brings up another thing to think about. Do you want the platform level to be scrollable?

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