R0J0hound's Forum Posts

  • Here's a example. It's not true perlin noise but it is smoothed noise.

    smoothed noise can be done as simply as filling an array with random values and using bicubic interpolation to get in between values. Here I went a step further and just used a 1d array and used a hash to pick an index from any x,y.

    Anyways, the actual terrain generation in event 6 should be much the same no matter what noise function you get. Although you probably would want to use a tilemap instead of sprites.

    uc8f57dfea5592d8863f7a1129e7.dl.dropboxusercontent.com/cd/0/get/Ch82Qkkb4Pc-tMDVEZhROhjUzSOHvKHiohmvqszHBLy8cZ5NTlVu5egyM2eSXZmXo9jHggimH8Xyxx3MROFyfy7R4-BVkY9l99_JzLTIu5IxXAWj_vWgMh3Gi2MkbXrX1b6vkq6nIj0kKmgqkbY3lLqz/file

  • Cool example. I thought I'd try my hand at preserving the horizontal letter spacing when on the curve.

    There is a text.textwidth expression that is useful for measuring the text, but it only gives a value after the text is drawn. Anyways, for example if you have a word like "Hi" I was first positioning the "i" after the width of "H", but found it worked better by positioning "i" after the width of "Hi" minus the width of "i". That way it indirectly got the horizonal kernal too.

    The second part is to position the letters a certain distance along a path. basically it involves converting the curve to a polyline so we can measure distances.

    Made in c2 but should work the same in c3.

    uc7bc80ddd0d33e0422ac49f0218.dl.dropboxusercontent.com/cd/0/get/Ch87IZEcF1R8OHlwdzAdkWepjBmMJ23zyM0jJen9F0etX_lplMz4zVTcN-XT-miA6SBjjUv6-b5uyrOveq3P-GiX9VndGnae9pRaZUKhQ8ic_DcR0DfdwL8YrzkEtQkg6AGBtRQPH4xlPA_pmdc4RajZ/file

  • Ah. Well looking at the values further it looks like there are 10bits per component instead of 8. They didn’t end up being spaced out every 10 bits but I came up with this.

    Basically if the color is negative you can get the colors back with this. Internally each component can have 1024 values.

    If the color is positive then my previous answer should apply. But only the old rgb() expression should do that.

    R=int(-color/2^38)%1024*255/1023

    G=int(-color/2^26)%1024*255/1023 B=int(-color/2^10)%1024*255/1023 A=(-color)%1024*255/1023

    It doesn’t give the exact value but it should be spot on if you round it. Unless I made a mistake somewhere.

  • Construct packs the color into a number. The usual standard is to pack the colors into a byte per component. On discord someone said it’s not packed like that but I haven’t looked into it.

    Anyways say for example the number is a 32 bit number then the color could be packed for example RGBA.

    R = int(color/256^3)%256

    G = int(color/256^2)%256

    B = int(color/256)%256

    A = color%256

    The order may be different but I haven’t checked.

    Edit:

    Looked at the manual and some of those expressions take values in the 0-100 range. It’s good to know that in the number it’s always in the 0 to 255 range. So if you want 0 to 100 you’d want to do r/255*100.

  • You can make them go backwards by subtracting from the d variable.

    I wasn’t planning on implementing the matching since I wasn’t planning on making a complete game. Just the interesting bits.

    The d variable gives an order to the balls so an idea would be to populate an array with the values and see if there are any runs of 3 or more of the same color. There are other methods I’m sure.

  • Similar question to this recent topic:

    construct.net/en/forum/construct-3/how-do-i-8/create-game-zume-deluxe-157333

    It doesn't use the physics behavior. You basically just move the balls along a path and when another ball hits you transition it onto the chain.

  • Hi,

    I had a partial go at figuring out some pointers on how to do a game like zume.

    First you need a way to move objects on a path. While there are many ways to do this I settled on needing one that will let you specify the distance along the path. Then you just change this distance to move the object back and forth. Another benefit is we can compare the distances with other objects on this path and know the order of the objects on the line. This is for pushing and seeing how many of the same color is in a line.

    The second part is inserting a free moving object onto the path. I ended up doing it with a dot product of the difference of positions of the objects and the angle of the path. It works well and pushes the other objects out of the way. However it's more of a snap, you'd want more of a smooth and fluid transition. As I write this I think it could be solved by calculating the perpendicular distance from the path and changing that to 0 gradually, as well as making the pushing of other objects be done till 0 too.

    Anyways, just some ideas. This is not a tutorial, more just implementing some ideas that may be useful for others.

    dropbox.com/s/6z39agcutpv63nx/zume.capx

    edit:

    made the balls join the path more smoothly.

    dropbox.com/s/ms16706ewavno2j/zuma2.capx

  • Fiddled with the math and cleaned it up a bit. Should be more correct now. Handles the screen aspect ratio, removed jquery dependency, and fixed the fov to use correct values.

    ucf696fc39303978e73844802c73.dl.dropboxusercontent.com/cd/0/get/Ch6tMGBduSYTyT2gepPQI8gMytVn5i8sNOuEJ77lHm-4jpdGjSW4EFNW_qKr972Hfxth9n8Ed_lb0V2eUyEq_k7kVld-lw6B7Y2Pd7Pl30tBJcxnamu42qCyCT_FE15grcAzosjbIV58KHsBfxy3xm5-/file

    I probably should remove the previous examples.

    MasterQuest

    This capx does the positioning math with the projectionpoint function. If you're asking about the original effect then the math would be similar but not the same. I won't be finding the math for the original effect because I found it broken. I made this instead.

    You can see if the update works better for you. I'm not sure if how it was before was causing the issue. I don't have a lot of time to debug what's amiss in other projects currently.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The math in the shader is probably off somehow. Or vise versa. The shader adds an extra step that I probably didn’t test too well. It should be working for 640x480 but I haven’t messed with it since.

  • If the physics had a fixed time step and always did the same number of steps per second, then the same impulse would give the same result. Barring any differences in the number calculation from one machine or js engine to another.

    That said I’m not sure how close you can get to doing that. I think you can specify a fixed stepping with physics, but the number of steps per second is frame rate dependent.

    The term is called deterministic when the same result happens each time. Might help for googling general solutions.

    Off hand the solution I can think of is to do the physics with events. We just need a way to do a fixed time step, and always do x amount of frames per second. There’s an article online called “fix my timestep” that gives a way. The physics is beyond that. Anyways that’s probably the roll your own solution. There may be features that make that simpler.

  • I think the way to do it would be to have a frame for every angle.

    X rotation from 0 to 360

    Y rotation from -180 to 180

    So if you wanted a frame for each 10 degrees that would be 36*36 frames.

    So the next step is to map an x,y angle to a frame. Z is handled by the sprite angle. A starting formula could be this:

    36*int(angX/10)+int(angy/10)

    X and y could be swapped depending on how your frames are laid out. You also want to ensure the angle is in the range 0 to 360. This should do it:

    Ang=(Ang%360+360)%360

    Ok cool. So all that’s left is to rotate the ball around in 3D somehow. I’m thinking just some physics. Simple case you’d want it to roll in the direction the ball is moving. Looks like it can spin in place in your gif. Might need some more 3D physics calculations. But I can’t calculate that off the top of my head.

  • To use a different uid. Change the parameter for the overrideDrawGl function.

  • All those events into one?

    On touched select_arrow

    — set body to ((select_arrow.body arrow?-1:1)+body+4)%4

    — local storage: save “key body” to body

    — set animation to tokenat("default,tux,mick,king", body, ",")

  • sqrt(Object.Velocity.X^2 +Object.Velocity.Y^2)

  • Glad it worked. I’ve never used that noise function. I thought for a second I may have answered wrong as I’m not sure what those rgb stops do exactly.

    I agree with you it would be more useful if the noise function was in a more useful range.

    Edit: as for the hard lines, it could be clamping. Isn’t the noise value a decimal number?

    You could try to use 28 and 72 to be the low and high values in the equation to give a slight buffer.