R0J0hound's Recent Forum Activity

  • tulamide sqiddster

    The plugin actually does use gl.MAX_TEXTURE_SIZE on creation and when changing the resolution. The confusion I caused was from utilizing an assert I found elsewhere that would recommend a texture size of 2048x2048 if a size was used that's larger than the max texture size. I didn't test to see what the max texture size actually was and incorrectly recalled what the size was in the assert.

  • gamepopper

    Save/load is working here. The freeze isn't a bug, it's just a slow operation to save/load the contents of the canvas. It was a feature request that has it's uses but when using large canvas' it's speed becomes impractical so the "no save" behavior is a good solution.

  • Opps, it was a typo on my end. Should be fixed, just re-download.

  • I just made a plugin that may be useful in this situation.

    http://www.scirra.com/forum/topic78654_post466046.html#466046

  • Sprite Sheet 1.0

    https://www.dropbox.com/s/ani7jkuhhcffb ... addon?dl=0

    A single image object where a sub-image can be used for drawing.

    For lack of a better description it's like tiledbg with image offset but without repeating textures. It should be useful in situations like this:

    http://www.scirra.com/forum/request-til ... 75513.html

    cheers

    [edit]

    One thing to point out is this object's "load image url" action replaces the replaces the object type's image not just the instance's like sprite and tiledbg does. So only one image per object type.R0J0hound2013-10-26 19:38:27

  • So I did, I guess I'm not paying attention. :)

    I'll have to look again. It actually varies, here are the stats:

    webglstats.com

  • The resolution is the size of the texture the plugin uses and by default it uses the initial size of the instances. So ya, it VRAM usage is the same as an equivalently sized image. The only limit other than memory is the max texture size which on my PC is 4096x4096.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • sqiddster

    The issue should be fixed now, re-download from first post.

    It's pasting fine here. Tested with r148 and Firefox 24.0. I also tested with chrome but not the latest.

  • Ah, I hadn't looked into the case where the resolution is larger than the size. I'll be looking into it.

  • sqiddster

    This is by design, the set resolution action deletes it's current texture and creates another of the new size, so anything that's drawn to the object is lost. Resolution is basically the internal texture size of the object, and it defaults to the initial size of the object. It is completely independent of the object's size and any drawing done to it is mapped accordingly with no extra events to position it right.

    In the case of your example just set the resolution once. If you set it to 1024x1024 it will look crisp if the window size is anything from 512x512 to 1024x1024. On a side note the largest supported texture size for webgl is 2048x2048.

  • Modulo with integers will always be exact. Hence 4160%64 = 0. Modulo with decimals will be as accurate as the computer can represent it. (tivia: 6.4 cannot be exactly represented with floating point numbers)

    416/6.4 is not acctually 6.4 it's 5.399999999999977, but Construct does some rounding so numbers look prettier. For example if you set some text to 416/6.4 you'll get 6.4 and if you set the text to str(416/6.4) you'll get 5.399999999999977.

    Back to the issue, it's bad practice to check to see if a floating point value is equal to an exact value.

    So instead of this:

    number=value

    The usual method is to do something like this:

    abs(number-value)<epsilon

    Where epsilon is a small number such as 0.00000001. The idea is you don't check if it's exact but rather it's close enough.

    When using modulo for example a%b the result will be in the range of 0 to b so to check if the result is close enough to 0 or b you can do an expression like:

    abs(a%b - b/2)>b/2-epsilon

    Of course I don't think such a formula is needed, but I'm too lazy at the moment to watch the tutorial video to see exactly what they do.

    You could re-write your formula for time. I assume speed is in pixels/tick and you're events are something like this:

    <img src="https://dl.dropboxusercontent.com/u/5426011/examples19/a.gif" border="0" />

    You could rewrite it to be time based so it would run the same speed no mater how many ticks per count, and you'd avoid the cpu math precision issue.

    <img src="https://dl.dropboxusercontent.com/u/5426011/examples19/b.gif" border="0" />

    The issue now is the platforms aren't always butted up against each other, sometimes there's a gap. So instead you could check the last platform's distance from the edge of the screen to see when to create another platform.

    <img src="https://dl.dropboxusercontent.com/u/5426011/examples19/c.gif" border="0" />

    No gaps, but with constant 60fps you may run into the need to create more than one platform if the speed exceeds 32*60 or 1920pixels/second. Not sure if the player will die long before that speed. If the issue comes up you could just duplicate the last event for a quick fix.

  • For the undamped version add an action to the top of event 4 to set step to mouse.x/vx/11.

    Or in general:

    (targetx-startx)/vx/loop_length

    For the damped version it is more complicated. The basic objective is taking the equations for x and y positions and solving for the time when x and y are at the mouse.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound