R0J0hound's Forum Posts

  • You could also apply a sheer with mesh distort if you want to do it in the same way they did it in sf2. Basically make a 2x2 mesh and move the top two points left or right by the same amount.

  • Guess you could just start with a polygon with say 30 points and drag the points around to sculp it. Could use some math to do falloff brush so it would move more points at once.

    Then just reuse the small bit that converts a list of points to a distort mesh. If the polygon ever gets concave then it may visually not look right but there are probably ways to solve that. However if the user keeps the shape convex it should be fine.

    Guess there are other interesting ways to modify the shape. Maybe a convex hull of multiple basic shapes you can drag around. Or maybe some csg combinations of basic shapes. We can get away with slightly concave stuff on one axis with one distort mesh, but multiple meshes would be needed for severe concavity.

    Just some ideas. I like to push what’s possible. Construct provides some basic stuff, but with math, geometry and algorithms it’s a bit more open ended. To a point at least. Construct features have limits that can require some creativity to work around.

    Nothing wrong with scoping down to do something that’s more doable. Worst case you could just have a bunch of premade body shapes the user could pick from. Or like dop suggested assemble stuff from parts. You wouldn’t have to deal with polygons then.

  • Here's this week's test. Event based Marching Squares to extract polygons from an image, then uses mesh distort to change the polygon. I would have guessed that we'd need js to do this fast enough, but events seem fine.

    dropbox.com/scl/fi/1s0xet28gg4h9aiwaz6li/marchingSquares.c3p

    Here's some older stuff I didn't reference. They use a handmade js implementation of marching squares.

    dropbox.com/scl/fi/1wuqpu4xe05bto5im4kh1/marchingSquares.c3p

    This one seems broken. Sizes are off

    dropbox.com/scl/fi/cuvne5uvea1yhwv1aodlu/marchingSquares2.c3p

    Anyways, just some stuff to mess around with.

  • It’s just a lot of work and maintenance with not much to gain.

    As is it’s probably simple enough to use some JavaScript to load the rive library and have its own canvas on top of constructs canvas. Is that integrated? I’d say no, just construct and rive stacked on top of each other.

    To make a plug-in there is a fair amount of work to create the properties/consitions/actions/and expressions. Plus if rive uses some other data types besides numbers or strings the plugin will have to implement a system to deal with that. Another big thing is having rive objects render with constructs renderer. As is construct’s renderer isn’t super feature rich so it likely cant render everything rive needs. Solutions include rendering to its own image and copying that over to a texture, but that memory transfer will be a performance hit. The other option is to try to use webgl and/or webgpu directly and still play nice with constructs renderer. The second way will require long term maintenance as it would be fairly sensitive to any updates constructs renderer has.

    That’s just to interact with rive and get it to render in constructs canvas. Tighter integration will require more work resolving differences. And should you want it to interact with other construct features more will be more work on top of that.

    Overall there will be a fair amount of connecting code to integrate them. So it’s a long term project unfortunately.

    You can look at plugins for Spine or Spriter to get a general idea of what kind of integration you’d get with something simpler.

  • You can change the sprites origin point in the image editor. Just move it to the center

  • Unfortunately this is in the realm of impossible to debug from screenshots.

    If all the bullets are getting destroyed then you’ll want to look at all the places you destroy them. Or maybe you have a behavior that destroys them like fade.

    Logic wise I’d say the hot spots to look at are your events around the waits and the else events. Maybe the logic is doing something unexpected.

    If I end up with events that don’t work as expected I try to isolate it, and maybe incrementally re-build it a bit at a time while doing tests as you go.

    Events have a fair amount of hard to follow edge cases so I’m often either just using stuff I fully understand or doing extra tests while I implement stuff.

    Anyways, good luck

  • There is animation software that does that sort of thing like spine or spriter.

    But the idea is simple enough. To animate you just move objects to different positions. You can get away with less key frames by using an ease to blend between frames. And that’s about it. The rest is just creativity.

  • Here's a way to do it. The meat of it is to take a line and divide a polygon into two. Then you can utilize a mesh distort to apply a polygon to a sprite. The more complex part was to eliminate bad edge cases.

    When you right click on the sprite it divides it in two then divides one of the halves in two as well. There are probably other strategies to break things up.

    dropbox.com/scl/fi/ufj7xvqguta7lcbmo7ia2/mesh_slice3.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • They changed it. FPS is the number of drawn frames in a second. What fps used to be is now tickspersecond I think.

  • Visually the easiest solution would be to use sprites instead of the tilemap so you could ysort.

    I also agree the two tilemap idea is one option. A tilemap for the collision and base of the walls and another tilemap for the top. It wouldn’t quite work for your example images unless the walls were taller though.

    Another idea is to mask out the parts of the player behind the walls. To do that you’d put the player on its own layer with “force own texture” then you’d place a bunch of rectangle sprites over the walls, and give those sprites the “destination out” blend. Finally you’d ysort the player with those mask sprites. Enemies and whatever else can be on that layer too. I’m not convinced it’s a better idea. It would work with any size walls but you’d have to go through the trouble of manually placing the mask sprites.

    A third option would be to have a second empty tilemap above the player, then every tick look at the tiles the player was on and place tiles on the second tilemap if they should be above the player. You’d need more events to each type of tile but would be fairly straightforward. The main con with this way would be that it only would work with one object.

    A more generic variation of the above would be to have a sprite with all the same images as the tilemap tile set and just blindly create a sprite at any tile the player overlaps. Then you’d just ysort with those created sprites. That would trivially support enemies too. It would give the benefits of sorting just sprites while only doing it in places that need it.

    There are probably other ideas too.

  • Thanks but I often combine too many things together so it’s not super readable to others. I also did some ugly shortcuts toward the end which made it even less readable. But my goal was to test my ideas instead of just talk about them. If any part of it is useful that’s a good thing.

    You’ll probably want to do it in your own style in a way you understand.

    By far the easiest way to go about the ai would be with simple math and manually inputting the probability numbers.

    Count = claimCount - (number of ones) - (number of dice=claimPip)

    If (number of other players dice)=5

    If count =5

    — set probability to 0.045

    … and so on for ever combination of dice count and count. In a more compact way you can have all the probability numbers in an array and you can access it with one event. That link you posted has a table of some of the probabilities. Or you can calculate them with that formula.

    An amusing side effect of writing the probabilities down manually is you could just use arbitrary numbers and you’d change the ai’s decision making.

  • The actual array object is nice and all, but it’s also nice to be able to have arrays be scoped like local or instance variables. It’s also nice to be able to have temporary arrays.

    It would also be nice to not have to deal with picking with them. Picking two instances separately at the same time, and how created objects have certain limits on how they can be picked for a bit are two complications of using picking.

  • I think we are limited to only numbers, text and Booleans for variables and parameters for the foreseeable future.

  • One way is to have the sprite and shadow as separate objects. Say you click somewhere you'd have the shadow move in a straight line and the sprite in a curved one. Here's one way to do it. You may be able to do it with eases instead, but I'm not super familiar with a lot of C3's easing, timeline or move to features.

    mouse: on click
    -- sprite: set t to 0
    -- sprite: set startX to self.x
    -- sprite: set startY to self.y
    -- sprite: set goalX to mouse.x
    -- sprite: set goalY to mouse.y
    
    sprite: t<1
    -- sprite: set t to min(1, self.t + 5*dt)
    -- shadow: set x to lerp(sprite.startX, sprite.goalX, sprite.t)
    -- shadow: set y to lerp(sprite.startY, sprite.goalY, sprite.t)
    -- sprite: set x to lerp(sprite.startX, sprite.goalX, sprite.t)
    -- sprite: set y to qarp(sprite.startY, (sprite.startY+sprite.goalY)/2-100 ,sprite.goalY, sprite.t)