R0J0hound's Recent Forum Activity

  • Here's one possible solution of the flood filling and masking.

    dropbox.com/s/z7afhehma5py976/draw_within_lines.c3p

    The flood fill basically just makes a hole that you then can draw into on the mask canvas. Didn't get it working with any full screen scaling though.

  • There isn’t a way to do that in the image editor. You’ll have to copy/paste it into another image editor that can.

  • Hmm. The for loop serves no purpose, you're just creating 10 objects at a time that are the same. You probably should set the width to the distance from the mouse. Also changing the image x offset could be useful, probably it would relate to the total distance so far.

    Anyways here's a different way to do it. I'm sure there are many other ideas.

    dropbox.com/s/wh1hf0ji0sueive/draw_dashed.capx

  • I couldn't find anything about some drivers doing that, but I suppose drivers could do anything behind the scenes. Even if it was slow it's not something that would need to be done per frame, or in the case of what that initial post only some specific objects would need to be changed.

    Realistically all that would be needed is an option for a canvas to be drawn without filtering if wanted. The pixelate effect can be used to do the nearest filtering instead but it's not 100% perfect and isn't simple to do.

    Jase00

    You can utilize the pixelate effect to simulate nearest filtering of a scaled up canvas. If the canvas and sprite are unscaled the sprite will paste 1:1 perfect as long as you offset the canvas by (-0.5,-0.5).

    dropbox.com/s/88hlbstc1gjol2e/simulated_nearest_filtering.c3p

  • It seems possible in webgl 1 since the sampling is set per texture, but maybe the worry is how slow looping over all the textures and changing each one would be? Webgl 2 adds the sampler object which would let the filter change be done in one spot.

    Anyways, I can appreciate the issue of having to do it multiple ways depending on the webgl version, not to mention any renderer redesign to support such a feature.

  • Your code wasn't correct. The total length is zero because you set it to zero when loopindex=p.count-1 aka at the last instance. It should be loopindex=0 like in the pseudo code. Also you don't need to use abs() with distance because distance is already always positive, but that has no effect.

    The verlet rope physics doesn't work too well when wrapping around small obstacles as you noted in the layout. It can be improved by decreasing the distance between links and/or running the physics with multiple smaller timesteps, but it still can fail. I think it could be improved by doing collision detection/response between the obstacles and the lines between links, but that's not a simple to solve with the circle vs sdf collision detection used.

  • Can't open your file. I think it's not publicly shared?

    Probably that wait is causing problems, but I can't really follow it.

    Anyways this should measure the total length between multiple instances of sprites making up the chain.

    var totalLength=0;
    
    for "" 0 to p.count-1
    -- loopindex = 0
    -- -- set totalLength to 0
    -- else
    -- -- add distance(p(loopindex-1).x,p(loopindex-1).y,p(loopindex).x,p(loopindex).y) to totalLength
  • Awesome Rojoh!

    Working great here on (Windows + Chrome)

    Thank you))

    Glad it worked. Just updated the css file to replace most of the pink icons on the forum as well. If you want a different color you'd have to edit each one.

  • Tested my idea:

    dropbox.com/s/9uksvlft6yxnx6f/transparent_when_behind.c3p

    Z goes up instead of down so that last condition needs adjusting and it works.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In an effort to get rid of the pink I made a css file to change the color in as many areas as I could.

    dropbox.com/s/4x3vuplxii5zzlq/Scirra_less_pink.css

    Tested as working on:

    iOS Safari using Userscripts extension.

    Windows Chrome using "User Javascript and CSS" extension.

    Other browsers likely has extensions where you can inject user css too.

  • A slightly different way you could do it is to sample points on the line between the camera and each tank. If any point overlaps a wall in 2d and the point z is between the top and bottom z of the wall, then that point is inside the wall and you can make it transparent.

    The events would basically look like this:

    var steps=0
    
    every tick
    -- tank: set opacity to 100
    
    for each tank
    -- set steps to ceil(sqrt((camera.x-tank.x)^2+(camera.y-tank.y)^2+(camera.z-tank.z)^2)/32)
    -- repeat steps times
    -- pick wall overlapping point: lerp(camera.x, tank.x, loopindex/steps), lerp(camera.y, tank.y, loopindex/steps)
    -- value lerp(camera.z, tank.z, loopindex/steps) is between wall.z and wall.z+wall.zheight
    -- -- wall: set opacity to 50

    I can never remember if z goes up or down so the code assumes z goes up. If z goes down you’d need to change the in between values condition to: wall.z-wall.zheight and wall.z.

    In the steps calculation it uses 32 to make it sample points every 32 pixels. You can make that smaller to make it more accurate although it would be a bit slower.

  • Hi,

    The new hot pink text color is pretty harsh on my eyes. The previous green color was better. Maybe as a compromise a setting could be added to the user profile to let users use a different color if they so choose?

    Thanks