part12studios's Forum Posts

  • I have a pretty good grasp of the turret behavior and it's working well but each of them are doing full 360 degree targeting and i'd like to limit it to say.. 180 degrees or even narrower ranges.. otherwise still just trying to target whatever is within range AND within a certain degree of rotation range.

    Maybe there is some way to determine the angle of difference between two objects? and i'd need to compare something like:

    1. is the object an enemy?

    2. if it is an enemy is it in range?

    3. if it is in range, is it within the angle of attack based on the current turret in question

    4. if it is, then fire..

    My close to successful approach was simply to compare the X of the turret with the X of the enemy.. this worked fine with a single target, but things got weird when I had to then compare multiple enemies. I made a family called "Enemy" and compared the X of that enemy class and it works pretty well even with multiple targets but i hit some snags where it still didn't perfectly right..

    I wanted to try and use families because it seemed like the better way to handle many enemies rather than making a bunch of unique unit objects with their own variables, etc..

  • Ok really it wasn't even the clamp.. margin stuff was good though.. but ultimately linear dampening was the key to getting things to calm down when they get closer..

    dropbox.com/s/dgqz048gxv5jn8u/physics%20question%203.JPG

  • ok linear dampening seems to be helping. but i'm going to see how it goes with moving to an X and Y position, but i get it now.. friction is probably how items rub against each other on their sides.. not it slid on a surface.. that makes sense because this is a 2d game engine..

  • maybe someone knows an elegant way to some how measure an objects velocity (has to factor in X and Y, which tends to get me tripped up) as it gets closer and to introduce a smaller counter impulse? I'm going to try some stuff but basically it seems that the impulses are great moving to the right destination but nothing is slowing it down.. i just don't understand why i can't seem to get any friction.. no matter what i set my car's friction too it still seems to just glide.. i have world gravity set to 0 for now (since it's top down).

  • it's still doing the same basic thing.. i have an audio clip to let me know when the impulse is firing off.. but i can hear that the tolerance is still working as the sound turns off while in the acceptable range so it's working. this is what it looks like:

    dropbox.com/s/tvivt775zi17x2d/physics%20question%202.JPG

    NOTE: for some reason i can't upload a picture today so i'm using dropbox.

    It still does the same back and forth never getting closer to the target. there has to be some way to reduce the impulse value drastically faster than a steady downward slow (which is what you get when you simply apply an impulse value based on distance difference)

    the "tollernace" var is just a value set to i think 25 right now.. mostly just so i could hear the pause in audio triggering.. but it doesn't make any noticable difference if i change it to a tighter value like 5.. but also it actually has no effect if i make it 100 either..

    I've noticed also that friction doesn't seem make any difference either.. which is odd. i'd have thought friction would fight impulse.. or at least hinder it's effectiveness.

  • Ok i see what you're saying now about margins i think. i'll give it a try and see how it goes! Looks promising!

  • how do margins work? i do understand physics being physics in game will never be 100% tight.. i don't even mind a little overshoot but right now it's pretty much 100% overshoot.. perfectly going back and forth.. never getting closer to the target.

  • is there some kind of math formula that could make a value increase at some exponential level? my math fails me at this level..

    it feels like it needs to be more of a curve.. not an even slope of impulse but rather more gradual bell curve.. i want MORE impulse as it gets further away but much less as it gets closer.. even some possibly negative impulse to slow down the travel to the destination point.

  • ok so using the clamp approach worked but ultimately has the same result.. a sign wave effect.. the target overshoots the destination and comes back then overshoots again.. makeing the number bigger or smaller just makes the wave action less tight.. 100 50 or even 5 make no difference.. but going to 500 for example makes the width wider.. but no less "overshot" like smaller values.. just slower..

    maybe some kind of increase of "counter impulse" should go on as it gets closer to the center point? but it seems like if maybe the impulse just cuts down..

    friction seems to have no effect on this either.. i thought higher friction might make it take more impulse to move but it seems to have no "slowing" effect.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • that's awesome. i've not used clamp before. will research that some for sure. Thanks!

  • Hi everyone, I have a simple test where i want to do a kind of spy hunter style driving game but i want to move the vehicle around with physics not just "move to" stuff. I'm having some success but the biggest problem is that i can't figure out how to slow down the approach?

    my basic approach at this point is to compare the Y of the destination and the object.. this pic below is the basic approach but i did one better where i made the distance value be a variable to the impulse, but it didn't seem to make much difference. the idea being the further away it was from it's destination the more impulse and as it got closer less impulse.. but it would still effectively overshoot about the same.

    basically what happens is the object just keeps going back and forth overshooting the destination. like a sine wave behavior.. up down up down..

    I've been banging my head at this for awhile before i came to the forum. this is just Y but i believe if i can get this behavior under control i'll be able to apply the same to X. Just understanding how to throttle directional speed with impulse effectively.

    Thanks!

    Caleb

  • Thanks for the replies, it's great to know. Yea unity3d (even playmaker) is really no fun to work with for me. I enjoy Construct game making. I just don't understand why it's all that hard to make a 3D version of Construct.. we have everything needed to make games.. so we add a z axis.. is that really such a huge leap from x and y? I'm not even saying it has to be able to do complete 3D.. even if it were just something "2.5D" where you could tilt the viewing plain and insert 3d assets to move around effectively still a 2D game.. oh well.. someday someone will come up with a product that can do this and be easy to use like Construct.

  • Has anyone released anything using this plugin? I tinkered with it some but didn't know how viable it was to invest time in figuring it out without having some idea of what people are doing with it? Are folks able to port to mobile apps with this or perhaps it's reliant on browsers to interact with correctly?

  • yes thank you for that insight! It was the worker option. I didn't even notice the advanced options as it was a collapsed set of choices. with Worker unchecked it displayed fine on iOS device.

    Sincerely,

    Caleb

  • yea i used 164. how do i know "worker mode". i've not seen that option anywhere that I know of. How can i fix that? or should i just wait for 165?