clodius666's Recent Forum Activity

  • hi and thanks for replying!

    and yeah i know i have a habit of blabbering with my posts lol

    i guess its partly just a habit and i also want to be as thorough about what im getting at. also english is not my first language, so im not always sure whats the simplest way of forming understandable sentences, epecially concerning coding and all this "technical" stuff.

    but anyway, the simplest way of making this question i cant get rid of:

    how to detect rotation speed?

    for example:

    -sprite rotates clockwise slower than 5 degrees ,say, every 100 milliseconds.

    --->play animation 1

    -sprite rotates clockwise faster than 5 degrees ,say, every 100 milliseconds.

    --->play animation 2

    and of course, same for the counter clockwise. (which would be animation 3. animation 1 would be in this case skating straight)

    tried to keep it as short as i could <img src="smileys/smiley36.gif" border="0" align="middle" />

    anyway, thanks for that piece of code. could always use less private variables, so its useful.

  • so i tried to get that angle/lastangle thing for the circle skating to work, i found some old thread about sort of similar issue here:

    http://www.scirra.com/forum/how-would-you-is-turning_topic41426.html

    tried to implement the code given there to my own purposes, but i still cant seem to get it right. first of all, the animation does not work. the turning skating animation shows a proper angle(though it randomly starts switching direction rapidly), but it doesnt play the animation, just the first frame. im not sure what the problem is. another thing: i tried to test and see if i could point out whats wrong with it. i put a text showing the angle difference between player sprite and variable "lastangle" BUT it only shows me the angle difference between 0(angle) and var. "lastangle" ?? <img src="smileys/smiley24.gif" border="0" align="middle">

    so, it doesnt update the player's angle at all, but assumes its always 0? do i need some additional maths to calculate the players current angle? or maybe i just dont know how to use anglediff properly.

    anyway heres the updated .cap to help understand my frustration:

    (sorry its kind of a little mess)

    http://dl.dropbox.com/u/11157144/hockey-concept.cap

    so, any advice or help would be really appreciated <img src="smileys/smiley41.gif" border="0" align="middle">

  • hi again!

    been a long while since i last booted up construct, my very own ministudio has kept me too busy. anyway, i decided to take a long break from recording and producing and dig into construct again. i got a great vision of making a sort of, violent, arcadey, top down, permadeath-ish, weird ice hockey, beat em up hybrid. (yes, thats right)

    i started slowly exploring possibilities and decided to first and foremost nail a convincing looking skating system with a small sense of inertia(?) and weight. physics behav is pretty much the way to go, but my issues are surprisingly more cosmetic, yet important,since i want to give myself some kind of vision, inspiration and motivation to keep going:

    1) comparing turning direction:

    what would be the best way to compare turning direction? i want to have a different, proper circling skating animation,when turning(both left or right), with anim(speed) connected to velocity AND with a little treshold, meaning that you dont have to go absolutely straight to switch to basic, non turning skating animation. in short, i would need to have some leeway before circling skate animation is triggered.

    does anyone have any good ideas?

    2) animation frame from 4 to 9 is playing (for example):

    how can i compare animation frames between certain values?

    the reason i need this, is that ive set up a sort of ice decal,pasted onto canvas when the character "kicks" the ice (that only happens during certain frames in the animation).

    and last

    3) detecting when the player adds force to an opposite direction of the curent velocity (again, with some kind of treshold):

    i would need this to make full sudden stops. i really cant use keyboard control presses with this, since im using physics and the movement angles are not absolute.

    basic idea is that if the player goes right and presses left(adding force to left), i would like the player to brake with more strength and change the direction when stopped (instead of starting a circling motion to turn as it is now). this would be rather easy with simple key press comparisons, but i have to take note of the velocity and angles between the basic directions. so it would be better if the comparison was made with the objects velocity in mind.

    thats all for now. im sure ill have a lot more issues with this in the future. im still trying my best to keep this simple, but you never know what ideas spring to mind. this proper skating system is my top priority as of now, though.

    the year is about to change so im sure you all are busy and stuff,so no need to scratch your head right away if you dont want to. i could try and post a simple .cap to illustrate my issues better later.

    EDIT: threw this together with a quick anim rip i made lol. theres also anims for circling skate animation if someone knows how to implement them:

    http://dl.dropbox.com/u/11157144/hockey-proto.cap

    anyway, thanks for advance and HAPPY NEW YEAR everyone!

  • well sh*t, it works beautifully!

    finally i get it. at least i think i do <img src="smileys/smiley36.gif" border="0" align="middle" />

    now its just a matter of trial and error to get the blur values just right but thats easily and quickly done. i already started thinking that i could make a top layer, scroll 0, stretch a sprite over the layer, make a transparent hole in the center, set position to player, use that blurmask effect someone made here, then apply this code to be used on the blurmask opacity, for example, sprite speed less than 20 px/s ---> set blurmask opacity to 0, and so on.. that could work really well!

    this also raised another question:

    could this be implemented on making 2 layers with different scroll rates communicate with each other, considering the collisions and overlapping? i remember seeing a thread long ago where this was briefly discussed, but couldnt find it.

    another thing: do you have any idea why the built in motion blur is so frigging heavy? its kind of a shame too, since it looks really good.

    the reason i got caught up on this was because i recently bought the new doom 3 bfg edition, and while it may not be as solid as all the mods for the original(i wouldnt know, i havent gotten the best mods to work), what really struck me was the added motion blur, that looks just absolutely stunning and delicious, combined with the rock solid no less than 60 fps. the fact that the blur affects everything else but the players hands and weapons gives the picture a surprising amount of depth

    and looks really great.

    but anyway, thank you so much for educating me on this matter, instead of just giving me a simple code, now i understand what it does <img src="smileys/smiley20.gif" border="0" align="middle" />

    ill be sure to give you credit whenever i get something finished with construct, once again its nice to see theres helpful people around here!

    <img src="smileys/smiley41.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i read that through about a hundred times and i feel i sprained something in my head <img src="smileys/smiley36.gif" border="0" align="middle" />

    "rv = max((current - min) / (max - min), 0)"

    so. i need to add a new calculation before the old calc?.

    if we go by the latest of your .caps:

    100 - ((Sprite('dist') / TimeDelta / 80) * 100)

    start value would be for example 20 px/s and max would be 80px/s in this case.

    dist/TimeDelta/80

    you'd think it would be easy to just throw the 20 somewhere there after dist, but i cant get it to work

    using 20 and 80 would result in a negative value, correct?

    im just not sure what and exactly where i should be adding something in that dist/timedelta/80 formula.

    <img src="smileys/smiley9.gif" border="0" align="middle" />

  • turned out i wasnt THAT far off yesterday when i gave up <img src="smileys/smiley36.gif" border="0" align="middle" />

    i managed to finally produce somewhat satisfying results, using "Blur motion" effect on a layer. didnt try any other blur methods yet, but it looks atleast promising. although one extra question came to my head(not really surprising issue since i kinda knew to expect it):

    since all this you have shown me takes notice of the sprites movement, whatever the direction, there needs to be some sort of "leeway" at the beginning of the calculation for the sprite's speed. for example:

    when the player jumps, it causes slight blur to be applied and i would assume that would start to cause a strain for the eyes. so i got to think. how would all this be calculated NOT from the start, but allowing some speed to build up before the blur starts appearing?

    for example, the speed value is calculated at the moment from 0px/s to, say 100px/s. to prevent the blur flickering, it would have to be within the values of for example from 20px/s to 100px/s. just to allow some starting movement and jumping in place without the blur?

  • i have to admit i really **** at this... <img src="smileys/smiley24.gif" border="0" align="middle" />

    after a few hours and big pile of ripped hair on my keyboard, i admit defeat. theres just something i cant figure out for the life of me and i dont even know what it is <img src="smileys/smiley36.gif" border="0" align="middle" />

    though i fear its something really simple and in your face- stuff. i tried like a million different things, resulting in pretty much me placing random stuff with my eyes closed hoping to get it.

    but no such luck, maybe im just stupid.   <img src="smileys/smiley4.gif" border="0" align="middle" />

  • i just meant that im not sure about the way the code should be made, i tried some variations, but didnt get any results.

    but if we go by your example in your post:

    max speed is 20

    condition----> always

    event---->    sprite-set blur to FormatDecimal((Sprite('dist') / 20), 1) going by your code, is this correct or am i missing something completely obvious? <img src="smileys/smiley36.gif" border="0" align="middle" />

  • spoke too soon i guess... <img src="smileys/smiley9.gif" border="0" align="middle" />

    "The rest is up to you. You have to decide at which speed value the blur has to be at full strength, either by calculating or by trial and error."

    thats exactly where i get lost <img src="smileys/smiley36.gif" border="0" align="middle" />

    im not eally sure how the code should look when applying the max value of speed(dist)

    in this code its easy to understand, since i already have the max speed value ready to be used in expressions:

    FormatDecimal(Sprite[Car].Speed / Sprite[Car].MaxSpeed * 100, 1) & "%"

    but using the dist value, i dont have the max speed, so, should i just use (Sprite('dist') / TimeDelta) two times to measure the start speed AND max speed, or should there be a different expression? i guess im just cofused about the code formula itself, even though i understand basically what im trying to achieve and how.

    sorry if i sound like everything has to be explained in the way a child would understand <img src="smileys/smiley36.gif" border="0" align="middle" />

  • thanks so much for explaining it so well!

    oh and both the relation and the speed comparison were really helpful and pretty much crucial for what im trying to do.

    i have used lastx and lasty before, but only for determining movement angles. that dist variable now makes alot more sense, ive seen it used before but really didnt know what exactly it was used for.

    well, i guess i'll be fooling around with this new knowledge for the rest of the day, see if i can get anything done with it. im still a little confused on how to translate all that knowledge into a working set of conditions and event, but eh, i guess i'll just have to GET it.

    but thanks again, i think i gained +2 int from this thread already <img src="smileys/smiley4.gif" border="0" align="middle" />

  • awesome, much appreciated! that works like a charm.

    although, TWO things:

    ever since i started using construct, ive had a hard time with speed and conditions needed to compare it.

    first, how would that code work with just a sprite? meaning, how would i compare the speed value? and the max speed value?

    second, i started wondering how would that be translated into using a physics behavior?

    i think i understand the basic logic you showed in that example, though the car behavior makes it (sort of) easy,because it already has the conditions for the speeds of the object. sorry to bother this much,but ive noticed ive stumbled upon this same (compare any kind of speed)issue for countless of times now, and i would be really happy to get rid of it by learning how to properly compare speed in any possible situation.    <img src="smileys/smiley36.gif" border="0" align="middle" />

  • hi. im not sure if i understood correctly, but anyway, i threw together a little example .cap for a 2d car physics, or at least one way of doing it. its just a barebones example with only a few events. you could add alot of things to it, like subtle steering while on air and stuff like that,also you can tinker with bounciness and traction and stuff to your liking,just have to experiment with the physics behavior. hope it helps even if just a little.

    grab the .cap here:

    http://dl.dropbox.com/u/11157144/2d-car-physics.cap

clodius666's avatar

clodius666

Member since 25 Aug, 2010

None one is following clodius666 yet!

Trophy Case

  • 14-Year Club
  • Email Verified

Progress

15/44
How to earn trophies