R0J0hound's Recent Forum Activity

  • Thanks, glad you find it interesting!

    Here's my main reference for it. I got most of the math from there. In events the formulas are a bit stretched out.

    gafferongames.com/post/how_the_go_stone_moves

    That series of articles gets a tad vague at the end, but still it does a good job explaining why certain math is used.

    Edit:

    This site is also a good reference for math in general. Much more readable than the equations on wikipedia.

    euclideanspace.com

  • Here's a test of a 3d physics engine done from scratch. Just a cube and the floor. It's fairly cool to watch though. All vanilla C2. No JavaScript or third party plugins. Just for the fun of it.

    dropbox.com/s/99nsqlg9psc9lh9/3d_physics_test1.capx

  • One idea you could use to specify the neighboring countries is to keep the countries spaced and add roads between them. So a neighbor would be overlapping one of the same roads that overlap the source country.

    Another idea would be to nix the roads and just use a text variable with a comma separated like of the uids of the neighbor countries. It's a lot more tedious to set up though. Could be simpler by making an in game tool to help do it.

    Anyways got my example to simple game status. I don't think the odds are that fair somehow.

    dropbox.com/s/fahqcjo44t8lgsb/risk_like_test2.capx

    generating a map is trickier, mainly because we'd want it to look good. I've found a hand designed map usually looks better.

    But here's one idea for the map generation, and selection of neighboring generated countries. The generation could be a lot quicker, it's mostly slow here because I only create one sprite per frame.

    dropbox.com/s/b9kany4mlibjk5q/map_generation_test1.capx

    It looks pleasing enough, although islands are an issue sometimes. I guess you'd also need to place a border otherwise the winning player would have a Pangaea instead of many separate countries.

    Anyways maybe some of that will give some ideas.

    -cheers

  • But you’re telling it to delete the file in that script. Sounds like it’s working correctly.

    I suppose it may not have deleted the file before if the file was currently being accessed by something else, so it couldn’t be deleted.

  • The upvote and downvote buttons on posts gives a nan error on the iPhone safari. It works on desktop though.

  • Multiple instances should be as simple as giving an array to each instance. With one object type you do that by putting the sprite and the array in a container, then the events would be the same.

    Now, you can't make a family in a container, so we'll have to do it ourselves with events instead.

    Add a family instance variable and call it "uidOfArray" or something. We want to create an array for each family instance and save the array.uid in that variable so we can pick the right one later.

    family: on create
    -- system: create array at (0,0)
    -- family: set uidOfArray to array.uid
    
    keyboard: space is down
    for each family
    array: pick by uid family.uidOfArray
    -- family: load from json family.back
    -- array: pop back
    
    [inverted] keyboard: space is down
    for each family
    array: pick by uid family.uidOfArray
    -- array: push back family.asJson
  • You could utilize sin(), it goes from -1 to 1 as well as smoothly inbetween.

    So you’d start with

    Sin(x)

    Shift it over so when x=0 it will be 1

    Sin(x+90)

    Next change it so it goes from -1 to 1 every 90 instead of 180.

    Sin(2*x+90)

    You could also use cos() instead. It’s just 90 off from sin()

    Cos(2*x)

    If you don’t want the smooth transitions inbetween you could utilize some rounding.

    Cos(2*round(x/90)*90)

    Hope that helps.

  • Has it ever happened in tests?

    It’s probably the type of thing that’s not worth handling unless it actually happens.

    I don’t mess with networking, much less server side stuff. An Ajax request shouldn’t mix stuff like that. I mean you could probably make server code that would do that purposely if you wanted.

    Best I understand it, for the Ajax request to work the server will receive the request with where it came from so it can send a result back. It’s not possible to mix it up accidentally.

  • Basically all that’s available is adding more points to the collision polygons. Or maybe make a number of sprites for various curves and such using as many collision polygon points as needed to make it smooth enough. Then build your terrain with a bunch of those.

    Another idea is to design your terrain with something else, and then use sprites as lines to define the outline.

    I’ve used a vector drawing program before and saved to its simplest file format and parsed that to get line segements making up the shapes.

    Another idea is to make your own in game editor that you could disable later. You could use qarp() and cubic() to do Bézier curves that you then split that up into lines. At least it beats manually placing individual points.

  • I haven't gone through the trouble to do it. I haven't really used C3, but it's capabilities are roughly the same as C2.

    There are three parts to this:

    1. Have a list of points to define a polygon. Then we can do the logic in the previous post to do the splitting. We wouldn't be working with actual Construct objects. So probably use arrays to store this stuff. This is math and algorithm stuff, which is doable depending on your skill.

    2. We need a way to draw these polygons. Construct doesn't have a way to do this. There's the paster object I made for C2 that has a "draw quad" action. That could be used to draw any polygon with some creativity. You'd have to deal with texture coordinates if the split objects have textures. The paster plugin was ported to C3 by someone, but it won't work with the new runtime at all if that's a concern.

    Alternatively you could just use sprites stretched into lines to do the outline of the polygon without third party stuff. The con is the polygon wouldn't be filled.

    3. Physics. The built in physics behavior is unusable for this. I don't think any of the third party ones are either. You'd either have to deal with another physics library directly in javascript or implement the physics in events. It's going to be a lot of effort either way.

    So more or less everything from scratch, plus most of it wouldn't be able to interact with other construct features. So construct doesn't really have anything to assist with making such a game. This safely throws this into the very advanced difficulty range.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Simulate control is working, it's just happening for a moment with those events. So any changes are not really noticeable.

    Maybe add a variable to bat to tell it what to do. Call it "state" or something. Then just add a event to to simulate the control continuously depending on the state.

    Bat: state = "wave one"

    -- bat: simulate control turn left

  • Here's an example of the idea you got from discord.

    dropbox.com/s/flpq3bf9hv4vsul/2.5Dtest1.capx

    There's a lot of ways it can be improved, but it's better than nothing. Hopefully it's useful.

    The crux of the idea is you have a hidden object with the platform movement, and you define the ground shape on the front edge of the ground. The rest of the ground is just looks.

    Then you move up and down by adding/subtracting from a variable. I called it z, but it can be anything you think appropriate. Then you have a separate sprite to be what you see and just position it above the invisible one. I also used clamp to limit how high and low you can go.