tulamide's Forum Posts

  • Welcome to tula's school of mathematics! ( <img src="smileys/smiley4.gif" border="0" align="middle"> sorry, I couldn't resist)

    Always remember the formula and then think about what parts belong to what name in the formula. For example:

    Sprite('dist') / TimeDelta / 80

    Here we use real values and variables instead of the names in the formula. Also don't forget that we omitted 'min', because it is always 0 in this example. The formula here was just 'current / max'.

    Let's first assign the real values to the names of the formula:

    <font color="red">Sprite('dist') / TimeDelta</font> / <font color="blue">80</font>

    where red = current, and blue = max. Now we have to add 'min' back into the formula:

    (<font color="red">current</font> - min) / (<font color="blue">max</font> - min)

    Replace the colored parts with the real values. You get

    (<font color="red">Sprite('dist') / TimeDelta</font> - min) / (<font color="blue">80</font> - min)

    Next step is to replace min by a value of your choice, for example 20 px/s:

    (<font color="red">Sprite('dist') / TimeDelta</font> - 20) / (<font color="blue">80</font> - 20)

    And last but not least you have to use max(a, b):

    max( (<font color="red">Sprite('dist') / TimeDelta</font> - 20) / (<font color="blue">80</font> - 20), 0 )

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

    Extended the cap again, this time using globals that match the names of the formula (like 'current', 'maximum', 'minimum' and 'relative_value'). The scale effect will not start until the sprite is 20 px/s fast (or whatever value you set the global 'minimum' to): http://db.tt/8OB13G0C

  • Ashley

    It is still Firefox I'm using.

    Mozilla Firefox release 16.0.1

    But I doubt that it is so easy. WebGL isn't always that fast on my computer. Would you mind doing a test?

    There's a WebGL Aquarium, quite similar to Fish Tank for IE. Follow the link, click on 'options' and make sure, that every option is turned on (highlighted in red). Set the number of fishes to 50. With your desktop set to FullHD (1920x1080) go to fullscreen mode (F11 in Firefox, don't know the keys for the other browsers)

    I now have a framerate of only ~16 fps

    Now turn off all the options (7 in total).

    I now have a framerate of ~16 fps

    Turn all the options back on and set the number of fishes to 500.

    I now have a framerate of ~16 fps

    And last but not least go the full distance. Set the number of fishes to 1000.

    I now have a framerate of ~15 fps

    This doesn't make any sense to me. If the cpu would be the limiting factor I should experience an immense drop when going from 50 to 1000 fishes. And if the gpu would be the limiting factor, it should drop the framerate when activating all options (like normalmaps or reflections).

    I would love to know, if you experience a higher framerate AND if the framerates differ noticeable more than in my test?

    http://webglsamples.googlecode.com/hg/aquarium/aquarium.html

    Sorry for being so cautious, but better checked twice than being as pleased as Punch although the real world framerates might not keep the promises of the draw call test.

  • If you carefully look at some of the older posts, you will find the almost appropriate formula

    relative value = (current - min) / (max - min)

    If we test this with values, the results are almost right. For current = 20 and current = 100, while max = 100 and min = 20 we get

    rv = (20 - 20) / (100 - 20) = 0 / 80 = 0

    rv = (100 - 20) / (100 - 20) = 80 / 80 = 1

    The only problem is that current could become less than 20, e.g. 0:

    rv = (0 - 20) / (100 - 20) = -20 / 80 = -0.25

    To avoid that there are a few solutions. The easiest from my point of view is to just cut out everything below 0 by making it being 0 too:

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

    max(a, b) will return the higher of the two values. For the example of current being 0 it would result in

    rv = max((0 - 20) / (100 - 20), 0) = max(-20 / 80, 0) = max(-0.25, 0) = 0

    EDIT

    You can also limit everything to certain angles. Angle detection works almost the same as speed detection, just exchange the "distance between points" expression with the "angle between points" expression. You'd store the current angle in a pv and use a condition that compares this pv with the allowed angles before calculating the blur strength and else set the blur strength to 0.

  • Ashley

    Here are the results of the CC performance test:

    picture 1

    picture 2

    picture 3

    About 58000 objects, pretty stable. But without a reference I don't know if this is close enough to the WebGL test to make it an evidence?

    I didn't try FF Nightly or Chrome Canary. I would want to avoid having too many browsers installed, that's why I didn't use Chrome yet. Do you think it would be helpful? I could try to overcome my resistance then <img src="smileys/smiley9.gif" border="0" align="middle">

    I also retried the WebGL test two times. Results were 45666 and 43576. The differences between these tests and the CC test were that the latter was more stable with a result after less than a minute, while the WebGL test had peaks up to 49k and coming to a result took until a few thousand ticks (approx. 3-5 minutes)

  • Ashley

    Now comes the fun: I still have my low end pc, a AMD Athlon II X2 250 (2 cores)@3Ghz, 2GB RAM, WinXP SP3, NVidia 460 GTX Hawk, FF 16.0.1

    In the Canvas 2D test it starts at 15 fps slowly raising while the object number increases (I already know why, you explained it well in another thread), but it reaches 30 fps very rarely. The result however was 375. <img src="smileys/smiley19.gif" border="0" align="middle" />

    But doing the WebGL test was like having a totally different pc. The result was 47882 (!!), which is more than 3x of your result. And my cpu is much less capable than a Core i5 3.3GHz (for example, there is no level 3 cache on the AMD cpu), but my gpu is a lot more capable than the 6570

    My conclusion is that the gpu has a bigger impact on the performance than the cpu (contrary to your description?), at least in this test configuration. Or do I miss something?

  • The running cycle looks like that of a wolf's or something similar. I imagine a boar running at full speed would look quick and goofy due to it's massive body and tiny legs...more like a trot I suppose.I don't think so. While the animation could run a bit faster, a running boar doesn't look goofy. In fact it looks a lot more like -Silver- animated it:

    Subscribe to Construct videos now
  • Thank you very much! I hope you'll like the next ones, too. <img src="smileys/smiley4.gif" border="0" align="middle" />

  • I'll rework the snout and update tomorrow. I still think it's an issue with the end looking like a nose instead of a snout, rather than the length, but if people still think it doesn't look right tomorrow I'll edit the length too.I think it is the combination of the end looking more like a nose plus the eyes. They are more or less round, but to make it look more aggressive you painted the eye more lengthy (man, that is hard to explain without using my main language, hopefully you understand it anyway). When working on the snout, why not reworking the eye area as well, just a test?

    EDIT: um, where is the tail? <img src="smileys/smiley4.gif" border="0" align="middle" />

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

    There's so many things that could prevent a desired result. For example, whatever the blur effect is you're using, it might not expect the value range that you use. Or it might be programmed to not be reliably alterable in runtime. There is a lot that might not work.

    I extended my "speed measurement" example. This time the sprite has a "pattern" effect and the left scale of the sprite is changed from 100% to 0% while gaining speed (from 0 to 80 px/s). It uses nothing more than the calculations and rules I explained in this thread.

    http://db.tt/nnzTp9e5

  • Well, yes, you are missing 2 things <img src="smileys/smiley4.gif" border="0" align="middle" />

    1) FormatDecimal is a function that outputs a string, I used it to format the string in the text box. Just omit it.

    2) Sprite('dist') / 20 will be a relative number [0, 1] If the blur shader you're using accepts a strength value in that range, then everything's ok. Else you need to transform the value just like in the first cap, I uploaded here, but for the value range the blur shader expects.

    You are close to a result. Step by step we will get it right. <img src="smileys/smiley2.gif" border="0" align="middle" />

  • As far as I know you can only time the whole sequence, not individual frames.

    The animation player is one of the things, where comfort is missing. It plays all layers that are on top of the hierarchy. Before testing any set or subset, you have to move the frames of those sets to the top and delete all other sets and layers.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Would you mind uploading the .cap and the music? I'm interested in this, as MrMiller experienced it exactly the other way round, whereas I never had any issues.

  • Hmm, I just don't know how to explain it other than "by trial and error"

    dist is just a variable, and like all variables it can be of different values. It may be at 2 or at 10 or at 20 and changing a lot throughout the game. You'd first run the game and have a look at what situation you want the blur to be most prominent. With the events implemented, you could constantly fill a text box with the current speed value. This way you see the current speed at the moment where you want the blur to be at full strength. This value is your max-speed-value.

    Example: You experiment with your game and see that the sprite has a current speed of 20 at the moment where you want the blur to be at full strength. And you decide the minimum speed to be 0.

    Then the calculation would be

    dist / 20

    and that will produce a relative number in the range [0, 1] for 0 <= dist <= 20

  • Anyone have any thoughts on GIMP for animation?I'm not an animator, but I work a lot with GIMP. Just like Photoshop it is a workhorse for everything related to graphics.

    The layer system offers layers, sets and subsets, wich helps organizing the animations. You can do onion skinning manually by setting the transparancies of the layers. There's an animation player that plays layers as animation, complete with definable fps and playing speed.

    What you don't get is a timeline. But for sprite animations to be used in Construct you'll barely need it.

    I think it is an alternative if you can't afford a professional animation suite. You get almost the same functionality, it is more or less the comfort that is missing. Without this comfort it takes a little bit more time to get the same results.

  • So, the real question isn't how to set two values in relation, but how to determine speed?

    I already answered that in a thread somewhere here on the forums, but I'll try to summarize it (although I can't guarantee that it will be the simplest description. I tend to say more than would be needed^^)

    Speed is "distance over time". To measure speed, you can either set a fixed distance and measure the time passed, or set a fixed time and measure the distance passed.

    When you move your sprite with your own events you don't need to measure anything - you already know the speed. For example, if moving a sprite by

    Sprite.X = Sprite.X + 10 * TimeDelta

    then the speed is 10 px/s at any time. It almost looks like a rule: n * TimeDelta = n px/s

    You may also have acceleration/decceleration, but let's not make it too complicated. I just mention that these dynamics are a part of n. Something like

    (10 + 20 * TimeDelta) * TimeDelta

    still can be reduced to

    n = (10 + 20 * TimeDelta)

    and therefore the rule still applies.

    If you don't have access to the values, you need to measure the speed. The simplest way is to just measure the distance moved per tick. Create three PVs (lastX, lastY, dist), set the first two to the position of the sprite at start of layout and then

    + Always

    -> Set dist to distance(lastX, lastY, Sprite.X, Sprite.Y)

    -> Set lastX to Sprite.X

    -> Set lastY to Sprite.Y

    You now have a speed value at any time. dist is the speed, expressed as px/tick. You can even extrapolate that to px/s by using TimeDelta:

    -> Set Text to FormatDecimal((Sprite('dist') / TimeDelta), 1) & " px/s"

    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.

    EDIT: The simple example above as a .cap -> http://db.tt/enNzNAQr