R0J0hound's Forum Posts

  • you can do it with a normal for loop and the pick nth condition. Like the first half would be:

    For "" from 0 to Sprite.count/2

    Pick Sprite instance loopindex

  • If at 60pixels/sec it's moving at 2 pixels per frame sometimes then your graphics card isn't really supported by browsers. I probably have the same issue with my blacklisted card, which never can reach 60fps with html5 on browsers even though normal exe games can.

    Basically there are three things that could be at fault: C2, the browser engine, your machine.

    You've likely played those retro games you mentioned on your machine without issue, your PC is capable so we can rule that out.

    Here in this topic we explored many ideas from the C2 side to improve things. Since they're not working it can either be C2 or the browser. We can do tests with C2 vs other html5 engines or straight JavaScript and see if any do it better, and if they do we can find what they do different. However, I don't think C2 is to blame.

    Even with a simple js to move a box isn't smooth for me on my machine. So it's the browser to blame I'd say. It's either the js engine or the renderer. As mentioned earlier in this topic I was able to take a JavaScript engine and add enough of it to partially run a c2 html5 export. Even though I ran it though Python and didn't do any optimizations for the renderer (sfml) it was buttery smooth with a very stable framerate at low object counts.

    So I revise my statement to say that I think browser's renderer's are to blame.

    This isn't a call for a native exporter, but if the renderer could be replaced things might improve. I say that as if it's easy, but it's probably way to hard to do. Especially since browsers can take so long to compile.

    It's not possible to make an entire browser, but I do think it's possible to build a basic runtime using a JavaScript engine as a base and some multimedia library with it to handle input, graphics and sound. Of course that leaves out every single other browser feature.

    Anyways in the end I lack anything really helpful here.

  • 99Instances2Go

    1)

    Gravity is an acceleration and is the same for everything so it makes sense to affect everything.

    2)

    I can't look at the capx but it probably has to do with sleeping. Sleeping is an optimization where if an object stops it can be put in an idle state so calculations don't have to be done on them. It then wakes up if anything moving touches it or you move it. You can adjust how likely objects will fall asleep.

  • Aritz

    You'll have to approximate it with a polygon. Both chipmunk and box2d only do circles and polygons.

  • It's a mathimatical reason. The angle() function uses atan() to do the calculation, which has a range of [-180,180). Also that range is often referred to as a normalized angle and is usuful at times. Having the angle in the range of [0,360) is mainly useful in the case you stated above, and I usually convert it over in a expression with: (angle(x1,y1,x2,y2)+360)%360

  • Yeah, putting variables in the type would be like a static variable because the type is created only once during the whole game. I've done that before with my isometric behavior.

  • The names are abbriviations but the values need to be precise. This is to save/load objects and you don't want rounding to occur.

  • It gives the entire state of an object. You can look at the plugin's source to see what they are without the abbriviations. It's all abbriviated to save on space and because it's just data that's not meant to be modified.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi christina,

    I was looking at your capx again and did one slight tweak.

    I ignored the speed having to be able to evenly divide into 60, and using the minimum framerate action.

    Instead I tried doing rounding myself. So, instead of the pin behavior I set TWIN's position to (int(player.x), int(player.y)), and the scrollx to int(player.x) every tick.

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

    Before the player itself was the most jerky and made everything else look worse. However after the change it looked acceptable to me. Any stuttering I got was basically the same as I always get on my machine, which isn't so much to do with js as it has to do with the browser's renderer I think (well, partially confirmed by a previous test I did that used the v8 js engine with sfml).

  • Look at the canvas plugin for an example of this. There are perfomance issues when having the plugin not use webgl when the rest of the game does use it. The issue is namely that the html5 canvas needs to be copied to a webgl texture to be able to be drawn.

  • navel35

    To make it not use webgl just set set webgl to "off" in the project properties.

    I don't use mobile exports so I don't know what's amiss.

  • Ruskul

    Ideally you'd just make one plugin. A simplish design would be the make it an object you can put on the layout with zorder. That would mark where the effect would be applied. The plugin by default wouldn't have a effect loaded so it would do nothing when it draws. You'd load an effect as some text with an action which would compile the effect so it can be used. Then you'd need an action to set texture parameters and number parameters. That would give you a way to do full screen effects. Not terribly hard, just need an evening of motivation to put it together.

  • Ruskul

    I just saw your post here after replying in that other topic.

    Picking multiple textures to use to can be done in events easily. In my paster object the "draw textured quad" action just grabs the texture form some other object you specify. The same thing could be done in this case.

    Also to be clear you'd have to run the shader through the plugin instead of using C2's effects. Previewing in the editor wouldn't be possible in C2.

  • I don't know how simple it would be to add. To me it looks not so simple with my imperfect understanding of how C2's renderer works.

    However that's not my my point. My point is it is this could be done in a plugin currently, if you're willing to use webgl directly. Most plugins just use C2's provided drawing functions within the drawgl() function, but you can use any webgl in there as long as you:

    A. finish C2's current render batches at the start of the function.

    B. At the end set any webgl states you changed back to what they were at the start. There are some that don't need to restore, it just depends on what the renderer expects to stay the same.

    As a cursory exploration into this I did some custom webgl in this plugin:

    Basically it draws one large 2d mesh instead of multiple quads. In a similar way you can use your own fragment and pixel shaders and give them any parameters you'd like. This is where you'll need a good webgl tutorial as C2's way of using effects wouldn't be used.