R0J0hound's Forum Posts

  • My apologies. That's tested as fixed now. Also added another example.

  • Should be fixed now. Try the updated download. I had broke shadows when webgl2 was used.

  • Oh strange. I’ll have to test a few things to see what’s up. Maybe it’s a difference between webgl1 and webgl2 or something.

  • Rojo3d

    A 3D engine for Construct 2.

    Download:

    dropbox.com/s/xar8r765zh8t5uf/rojo3d%20v0.96.zip

    To install extract to this folder on your pc.

    <install path>\exporters\html5\plugins

    Examples:

    dropbox.com/s/kava3i096pf12b0/rojo3d_examples.zip

    dropbox.com/s/ya9hrc78tjkfpjq/rojo3d_05_bilboard_test.capx

    Main Features:

    * obj file loader.

    * load textures from files or sprites.

    * directional light with shading and shadows.

    * fog

    * zbuffer, and it is drawn within c2’s renderer, so you can put stuff in front and behind it on the layout.

    * ability to let you build meshes with events.

    Usage:

    The plugin has its own method of keeping track of objects, meshes and textures via text tags. So you can load any number of textures and meshes, and also have objects share them.

    There are three object tags available by default: “”, “camera” and “light”. Those are the world space, the camera and the directional light. “” can’t be changed, and light ignores position but otherwise they are complete objects. You can also create new objects via an action.

    Each object has position, scale, orientation, mesh, texture, texture rectangle, color, and some settings to tell if it’s affected by fog, shadows, shading or if it’s transparent or a billboard sprite.

    When creating an object you can have it copy another and just modify what you want instead of starting from scratch.

    You can set the position, orientation, and scale. You can also modify those things too.

    When you do the transformations it lets you do stuff relative to other objects with the “relto” parameters.

    Some examples:

    Rojo3d: move “camera” by (0,0,100) relto:””

    Would move the camera’s z by 100 in its world position. But if you wanted more of a move at angle feature you’d do:

    Rojo3d: move “camera” by (0,0,100) relto:”camera”

    Would move the camera forward relative to its own orientation.

    You can also utilize the relto feature to have one object copy the orientation of another:

    Rojo3d: set Euler orientation of “obj1” to (0,0,0) relto: “obj2”

    The idea is you can mostly get the transformation you want without touching trig or complex math.

    Be sure to look at the examples, and check out the actions and expressions. I didn’t cover everything here.

  • Looks like they can’t automatically detect what engine was used in a lot of cases. Look at the issues page of their GitHub page and see that construct and mmf have issues for them.

    Edit:

    steamdb.info/tech

  • If you keep track of the z position of the object you may be able to sort with something like this:

    Sprite: set sorting to sprite.y-sprite.z+1000*sprite.z

    Z sort sprite by variable sorting

    That’s what you’d call absolute sorting. By subtracting the z it sorts them as if everything was on the ground. The 1000 gives more weight to the z so it’s drawn above.

    You may need to tweak the equation. I forget is z sorting is low to high or vise versa.

    This method works well when the objects are all the same z height and z position is on one of those levels. I don’t think it works great when transitioning z position.

    Another option is relative sorting.

    Here’s a recent topic with some ideas:

    construct.net/en/forum/construct-3/how-do-i-8/proper-gridless-isometry-161391

  • They try to make it so it’s not possible to reverse the export back to the c3p file.

    But if all you want to do is change some text, you can search in the files and just replace the text there?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Eh, my ideas aren’t always the smartest or simplest. There are pros and cons to most solutions.

    Anyways, I’d say dop2000’s idea is the best way to do it. The more mathy solutions look tedious to implement.

  • Here is my latest example of a parser. Has error checking, and has functions like sin() and min(), but you can add more.

    dropbox.com/s/ogcxmjml4560avl/expression%20parser%20oct2021.capx

  • Which example? I've probably made too many. Depending on the example it's possible to make functions that take more than one parameter. Do you have a full list of features you want it to have? I'm guessing you want all the expressions that construct expressions have?

    numbers: 22, 33, 1.66

    binary operators: +-*/^

    unary operators: -

    parenthesis: ()

    functions: sqrt(x), min(x,y), max(x,y), sin(x),...etc.

    Can even make it have the the conditional operator (?:), but that can be a bit trickier.

    Even though I use old functions it shouldn't be confusing. I tend to follow the pattern of making local variables which i immediately set from function.param(n), which works the same as function parameters. At any rate i tend to not use c3 if i can.

  • You can also write a parser that does it. Basically it pulls out the numbers and operators from the string and solve it.

    This can be preferred over just running it as JavaScript for a few reasons.

    1. If the string is something the player writes they could take advantage and run arbitrary code.

    2. You have more control over how the text is parsed and the error messages if there is a typo.

    Anyways here are a list of various examples of the parsing way of doing it.

    construct.net/en/forum/construct-2/how-do-i-18/possible-convert-string-154631

  • Beveling the corners of the objects or merging together objects in a row would help fix it.

    It seems to be a general issue with physics engines.

  • The Wikipedia articles on them have pseudo code on how they are done. In construct I’d say utilize the json plugin to manage the data structures needed, although they probably could be done with arrays albeit with some tedium.

    There are simpler structures like a uniform grid with a list of the objects in them, as well as binary space partitions that may work well too.

    If your levels has stuff mostly on a grid I’ve had great speed boosts from using and array to store if a grid location has an object or not.

    Guess the gist of all of them is adding/removing objects from the structure, and getting a list of objects overlapping an aabb.

    Event loops and picking kind of slow things down so for the greatest benefit I’d recommend utilizing JavaScript to do it if you can.

    So I’d say best, as in fastest, would be going with JavaScript.

    If utilizing just events, use json.

    But those are just general ideas.

  • I just checked and the link isn’t dead.

  • You could also do it with a local variable, but it’ll still be two events.

    Local number any=0
    Sprite: x=33
    —— set any to 1
    Any=0
    ——do something

    The else one isn’t bad. It lines up pretty good with the logic of picking.

    The main rough spot with the picking system is the top level event picking of newly created objects.