R0J0hound's Forum Posts

  • Joannesalfa

    It's interesting but not really usable for this. It's not a matter of using something that can use webgl or canvas2d, it's a matter of getting something to work with c2's renderer.

  • 1) layout size is only limited by what numbers you can store in a 64bit floating point number. Off the top of my head that you could use a number as big as 10^308, but you'll want to use something much lower. Read up on floating point numbers in Wikipedia to see why.

    2) this is done elsewhere on the forums by using the line of sight and pathfinding behaviors. The big layout isn't helping with that though since both those behaviors use a grid and the bigger the layout the larger the grid, so more stuff needs to be processed.

  • xoros

    It independent of C2's collision detection, so it doesn't trigger a collision event. The built-in physics does, but for this plugin it's better to use the collision triggers it has since you can get more info about the collision.

    striimix

    It's not exactly a simple change. Right now a vector is calculated from the object's center to the origin, and that is used to update the sprite's position from the physics position, and vise versa. I just need to update the math to use the COM instead of the center, which is tricky enough to require a re-think of a lot of the code. I need to handle moving the com when resizing and changing animation frames and collision shapes while at the same time keeping the object stationary.

    Calculating the COM isn't an issue as Chipmunk provides functions to do that for all of it's shapes. The tilemap would be a special case which would be an average of the tile's COM. But I probable won't do that since tilemaps can't rotate and are usually static so it would be a needless calculation.

  • Try Construct 3

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

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

    I disagree partially. Sure you can do any algorithm in C2, but it's by no means fast enough for something like this on my PC. Also with me staying with bundled plugins it ended up being more tedious to work with than it could be.

  • Very cool!

    http://rosettacode.org/wiki/Mandelbrot_set

    https://dl.dropboxusercontent.com/u/542 ... lbrot.capx

    I tried a sprite approach to draw the pixels with this one. The trick was to set webgl to off, "clear background" to no and make the layer transparent. One of these days I should actually learn how mandelbrots actually work.

  • [quote:11qmxxg4]Now Construct 2 isn't its own programming language, but instead based off JavaScript.

    I disagree. C2's event system is most certainly it's own language, and isn't really anything like Javascript.

    But this is a fun idea, I went with this one:

    http://rosettacode.org/wiki/Catmull%E2% ... on_surface

    Go big or go home, right?

    https://dl.dropboxusercontent.com/u/542 ... /cube.capx

    It took a while to debug it, but it had to be done today. I wouldn't know what I did in a week. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    It only take obj files with four sided faces, and I didn't look into the hole cases.

  • mindfaQ

    Paster creates the url to download the same way as Canvas. It's very odd if one saves as a png and one as a jpeg.

    You can look at the canvas.imageUrl string and see if it says "image/png" or "image/jpg" in the first dozen characters or so. The filename extension could be wrong. For some reason your friend's computer firefox could be defaulting to jpg instead of png.

    If you look in the runtime.js and search for "canvas.toDataURL()", you can force it to use png to see if that helps by adding 'image/png' as a parameter so it would look like "canvas.toDataURL('image/png')".

  • cheesewhiz999

    You can set the "max speed" to be higher.

    ome6a1717

    Also note that the deceleration will slow the object down.

  • mindfaQ

    According to the html5 specifications the file should be a png by default. jpegs can be saved, but this plugin doesn't ask for a jpeg.

    What browser are they using? Firefox and Chrome saves pngs for me.

  • If you save to old position of the sprite in some variables, you could then use a loop and lerp to create particles in between the positions.

  • I don't really have one. It's just that the rotate behavior is a very light behavior, and since it's only used on one sprite it's hard to believe it's a contributor to bad performance.

    You can't really squeeze any more performance from something so simple.

    My thought is the lag you're encountering has nothing to do with your game.

    But perhaps someone else has tips. I've only ever used the html5 and nw.js exports.

  • Every 0.017 seconds and lower is the same as "every tick". So dt can make sense there.

    All every x seconds does is check the time since it last ran, then if it's >=x it runs.

    The rotate behavior and doing it with events should be identical for performance. Actually the behaviors often should perform better.

  • Well, all the rotate behavior does is the same as a event like this:

    Every tick: sprite: rotate clockwise speed*dt

    With just one object, there isn't much you can do to make it faster.

    How is the performance bad?

    If you're getting a low framerate then you might have a blacklisted graphics card. If you can update your driver it may help.

    If instead you're getting a rotation that's not buttery smooth, then it's a current browser issue. You can have lots of sprites/events/behaviors or very few and it doesn't affect that. Chrome supposedly has a fix coming in a newer version, but other than that other browsers have varying degrees of stutter. Once one solves it well I'm sure the others will follow suit.

  • Here are the specs:

    https://en.wikipedia.org/wiki/Double-pr ... int_format

    1 bit for sign, 11 bits for exponent, and 52 bits for the fraction.

    With that it's only 15-17 significant decimal digits, but since it also stores an exponent it can store a value up to:

    1.7976931348623157 × 10^308

    which is plenty for a clicker game.

  • Numbers in C2 are 64bit floating point values so it can handle values like that.

    The editor doesn't let you type numbers with scientific notation so maybe that's where the misunderstanding is.