R0J0hound's Forum Posts

  • Not much progress as of late. The culprits are technical difficulties mainly, so I have to change my approach.

    Nesteris

    It's a cool idea, but I don't have enough time for such a project. Python would be a cool language for the editor, but no so much for speed in the game itself. I'm using it here because it has allowed be to make the wrapper fairly quickly, but the side effect is it runs slower.

  • What object are you pasting to the canvas?

    When pasting an object to the canvas the object's non-webgl draw function is used. When webgl is on and the browser supports webgl, then plugins do stuff to get ready to draw with webgl, and have no need for the non-webgl draw function to work. For instance pasting a tilemap object with webgl on will have that problem. One solution is to set webgl to off in the project properties, but for most that's not an acceptable solution. You could use the Paster object instead as it doesn't have this issue.

  • A solution that's kind of hacky is to use a paster object as well.

    1. Paste the tilemap to the Paster object

    2. Load the Paster.imageUrl to a sprite

    3. paste that sprite to the canvas.

  • rexrainbow

    I haven't looked into getting it working with the minifier as of yet.

  • Try Construct 3

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

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

    Did some tweaks to get that capx working. This can draw a third as many sprites as NW.js can and have the same performance on my pc.

    https://dl.dropboxusercontent.com/u/542 ... 3bench.zip

  • The crashiness seems to be related to the Python wrapper for the graphics library from what I can tell, or I may have created an issue somewhere since it's been crashing a bit more for me lately.

    It might work on xp, if it doesn't I probably just need to tweak how the exe was made a little.

    I've tried capx with lots of objects and it seems to drop framerate. When the count is low it performs better than the browser, but with a lot the browser seems to hold out longer. Probably it's something I can improve. The bottleneck is going to be with renderer not js execution speed since it uses the same engine as chrome.

    Ghost shooter was just a convienient example. It can handle much more elaborate projects than that. I'll look into getting yours working tomorrow.

  • Here's an update demoing the ghost shooter tutorial, just without any text:

    https://dl.dropboxusercontent.com/u/542 ... ithpy2.zip

    This is what is tested as working:

    * Blend modes

    * Transparency

    * "Force own texture" and some of the Canvas and Paster objects

    *Sprites, Particles, Tiledbg and SpriteFonts

    * Mouse and keyboard input

    This is what is disabled, but won't prevent the game from loading:

    * The text object. It's actually partially implemented but was crashing so it's disabled.

    This is what is known to make a game not load:

    * The built-in physics behavior. It needs asm.js which isn't implemented.

    * Not all png images will load, they need to be at least 8-bit. :/

    * Any form controls.

    * Sound. It will probably not load if there are any sounds in the project.

    * AJAX only has enough implemented to load data.js, the object probably isn't usable.

  • Whichever works, the first one doesn't look right to me, but I haven't tested it.

    I suppose sin and cos are relatively more expensive to compute from what I know, then again so can sqrt. You can simplify the equations and use trig identities such as cos(a+pi/2))=-sin(a) then re-arrange stuff so you only calculate stuff once that's used many times.

    But all that may be a futile effort. The best way to see which is more efficient is by profiling it.

  • newt

    I just am implementing 2d right now, but in the future I think could do webgl by wrapping all needed webgl calls to opengl or something. The limiting factor would be differences in the shading language.

    TiAm

    The png issue is a limit of the graphics library I'm using, right now I'm working around it by converting all the png files to be 32 bit after I export.

    Keyboard support is not implemented yet, just most of mouse and enough of the canvas to draw stuff. Soon though.

    ryanrybot

    Most certainly. As you can see with the example it does work, although work could be done to package it up in a nicer way.

    Joannesalfa

    It's probably the overhead of running through python and lack of optimization with the renderer. Once I get things working I'll have a good outline of all the stuff that needs to run, and I could convert the bottle necked parts to C to avoid python. Also the GC could be an issue, I haven't investigated if I need to manually call it yet.

  • Joannesalfa

    If you mean graphics, then I too find that as a bottleneck on my pc with html5.

    ryanrybot

    Yeah, that's basically what it is and it's ending up much simpler to get going than I originally supposed.

  • Unsatisfied with the graphics performance of web browsers on my machine I wanted to see what kind of performance I would get making my own wrapper. The idea was to run an exported html5 game with the V8 JavaScript engine and then only implement the parts of the browser that the game needs to run.

    Here's an example of the results so far. A python/javascript hybrid that can run an exported C2 game. ...well actually a small subset of C2 games.

    Packaged example:

    https://dl.dropboxusercontent.com/u/542 ... withpy.zip

    Wip wrapper script:

    https://dl.dropboxusercontent.com/u/542 ... nwithpy.py

    You could try dropping in another exported game but it may not work, because a lot is not implemented. Basically it has enough to draw objects and handle mouse events so far. The performance is better than I expected considering I don't think I've done it in the fastest way possible and it's running in python.

    The goal is to get rendering, input and sound working, as well as some AJAX for file access. I probably won't be implementing everything else such as video, networking or form controls. This probably won't ever be a complete browser engine, just enough of it to run games.

  • irina

    I don't know, I haven't touched that capx in a while.

  • Solano

    Here's the capx I used to make the ring image. It uses the Canvas Plugin.

  • irina

    You can rotate particular objects in the same way as the player polygon is isolated. When "loadobj" is called you can provide a "group" tag that you can use in the rotate function later so you can only affect those points when rotating. Zooming can be done by scaling. There is no function for it but it's just a matter of multiplying all ( or just a certain group) of points by a number. You can change the scaling center by doing this: x=scalefactor*(x-centerx)+centerx.

  • Uniqui22

    Here's how yo can loop over the pixels to find how many are not-transparent:

    It's very slow though, so instead you could just calculate the approximate area of the sprite using the area of a circle or box.