R0J0hound's Forum Posts

  • One idea is to record the state of everything into an array and use that to play it back for the demo.

    Here’s an example with just one object. Could be a start.

    construct.net/en/forum/construct-2/how-do-i-18/replay-meatboy-55099

    Another idea is to just record the player input in an array. This is likely what those old arcade games did, but the frame rate was fixed. With construct the frame rate is variable. Even at 60fps each frame can vary a tiny bit which can throw off the reply.

    A solution to that is to make your game logic run at a fixed rate. However that can be complicated since events and behaviors aren’t made to do that.

  • It doesn’t work because everything within quotes is just text and not an expression. So what’s happening is basically int(“object.x”), and when text is converted to a number it becomes 0 if no digits were found.

    Maybe you meant to build the text you saved to the dictionary.

    “Smoke=“&object.x&”,”&object.y

  • The rot instance variable is the rotation. Flipped it would be 180, but I just have it rotating continually with "add 100*dt to rot". You can set rot in any way you like. Maybe using some easing or something like that.

    One way is to add another instance variable rotVel=-90. Then "set rot to clamp(self.rot+self.rotVel*dt, 0, 180)".

    On card click

    -- set rotVal to -self.rotVal

    It's done when rot=0 or 180.

    Just an idea.

  • There’s this:

    construct.net/en/forum/game-development/tools-and-resources-27/spritefont-generator-168408

    I think there’s another tool floating around the forum too.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Looks cool, the art has quite some polish to it. Runs a bit slow on my machine but it was playable. Got as far as finding a horse creature that I tried killing with fire but had no success. I'm not much of a gamer but it was fun.

    How you made the ground texture was interesting. I should mess with blender nodes more. I've seen other tools such as zgameeditor allow you to generate textures in a similar way in the editor.

    I also enjoyed reading your devlog. Gamejam devlogs are always interesting. I should have a go at a gamejam eventually.

    -cheers

  • You can only rotate the 3d shape by the z axis. Another option is buying the third party 3dobject which lets you rotate any way you like.

    The third option it to use distort meshes to make the 3d object, then you can rotate it any way you like with various amounts of math. Here are all the examples I've made to date. Some are much simpler than others.

    If you like math here is the gist of what's going on with vector math:

    rotatedVector = (positionVector-centerVector)*orientationMatrix3x3+centerVector

    Rectangles

    dropbox.com/s/9uko7hxjyp9z1uu/xyRotate.c3p

    dropbox.com/s/6qs81zmktsd3so8/yaxis_rotate.c3p

    Cubes

    dropbox.com/s/unnqd7exmaca6lk/mesh_cube.c3p

    dropbox.com/s/5n5umhdkfhr0qhg/cube_roll.c3p

    dropbox.com/s/zis7zp6rggxpdny/dice.c3p

    dropbox.com/s/hvrhxk4bsslm8f3/3d_dice_v2.c3p

    Spheres

    dropbox.com/s/lucl1153bmmr3qo/mesh_sphere.c3p

    dropbox.com/s/2l2dtel4t0zf9jw/mesh_sphere_roll.c3p

    dropbox.com/s/rkomtba52rlqw3t/mesh_sphere_roll_terrain.c3p

    Model

    dropbox.com/s/uy6yfhpag7d1t2p/obj_loader_and_raycast.c3p

  • Conceptually ai is simple. have the ai decide what to do and then proceed to do it. Then either when it finishes or it's interrupted it decides what to do again. It can be complex as you like. Simplest would be to to pursue or flee depending on if it has ammo. More complex would be to keep track of the things it was interrupted from doing and try to resume them later, which gives a bit more nuance to the illusion of intelligence.

    The second part is to smoothly switch from one state to another. steering behaviors could give smoother results as it can be jarring if things suddenly change direction.

    Here's one example. The two ai's collect the closest rock then moves to the other and throws the rock at them. Also they try to roughly avoid flying rocks. Mast of the mess it to make it less perfect to make it more interesting.

    dropbox.com/s/pgzp5et61mncq6y/failed_ai_test.capx

  • I haven’t messed with prestep with chipmunk physics too much to be honest. At the time I was just exposing as much as I could to the plug-in.

    You may be able to rework the logic to not be reliant on prestep being triggered again. But I don’t have any concrete ideas on that front.

    You could use rotated box sdfs to do the collision detection and response so you wouldn’t need to use a physics library and allow more control. Just as long as the player can be thought of as a point or ball. It even works with 3d boxes with minor modification.

    Guess an example is better. Give me a bit. I probably stick with vanilla construct features though.

    edit:

    Basic example of 3d physics with z-rotated boxes and a heightmap.

    dropbox.com/s/nhh07w51gex0q1j/3d_collision_detection_response_sdf.capx

  • You say it old happens in your game, but if you add save/load to the template does it still happen?

    Most plugins do try to save load everything but it could be something that was just overlooked so it would be a bug.

    Other option would be to try to work around the bug. Maybe try to do some things when the game loads to fix the orientation or request pointer lock again.

  • Is it possible to select a specific instance of an object for a 3D face to use as a face object?

    Yes, you just need to pick a specific instance to use with conditions.

    When an instance of an object is being used as the face of a 3D object can I use the attachment points of that instance?

    Just the image is used when setting the face of a 3d shape. You’d have to calculate that from scratch.

    For example, a unrotated 3dshape with its origin at the bottom center, with the front face set from a sprite. You can then calculate the image point location on the front face with something like:

    ipx = (sprite.imagepointX(1)-sprite.bboxLeft)/sprite.width
    ipy = (sprite.imagepointY(1)-sprite.bboxTop)/sprite.height
    X=3dshape.x +(ipx-0.5)*3dshape.width
    Y=3dshape.y +0.5*3dshape.height
    Z=3dshape.zelevation+ipy*3dshape.zheight

    If the 3dshape is rotated that would be another step:

    NewX = (x-xcenter)*cos(angle)-(y-ycenter)*sin(angle)+xcenter

    NewY = (x-xcenter)*sin(angle)+(y-ycenter)*cos(angle)+ycenter

    Anyways, that’s roughly how it can be done. You’d pick a sprite to use as the front face, set the front face, and calculate the position from that picked sprite on the front face.

  • Competitions like that are fun. It would be cool if they did it again for another type of game. Platformers are the easiest thing to prototype in construct, so it got an edge there.

  • You do not have permission to view this post

  • Trig functions in construct use degrees instead of radians so you don’t have to use pi.

    And yeah you’d only change the 100.

  • Guess it would help to show what you’re trying to use as a formula.

    Here’s one possible formula using sin() and the day as input. Every 100 days it will oscillate between 50 to 90.

    70+20*sin(day/100*360)

    Alternately you can use cosp() which interpolates between two values using a sine wave.

    cosp(50,90, day/100/2)

    The /2 was needed otherwise it would be 200 days for a full cycle.

  • In the json file itself you can only have text and numbers. The parser can be made to run them.

    Anyways, it's not exactly simple but you can make it do whatever you like.

    Here is a partial example using just a dictionary. I ran out of time but it will run stuff like:

    foo=33
    bar=foo/3
    a = a + 5

    I didn't get around to making it handle operator precedence (multiplies before additions), or parenthesis. You can assign a single value or a simple one operator equation. For error checking it knows when it's wrong but I didn't get around to giving anything more than a message that says syntax error.

    dropbox.com/s/w49tbarkexaq3bb/dict_parser_partial.capx

    Overall it's a tradeoff. Polishing up a parser and adding all the features you want vs doing more in the event sheets.