R0J0hound's Recent Forum Activity

  • Joannesalfa

    I have, but I'm wrapping the html5 api to sfml. It's not an issue using a graphics library since I'll only be using a small subset of it. The issue currently is I haven't been able to build the V8 library yet.

    That game seems to go fast, but I have no idea if it's faster.

    Nesteris

    Because it's interpreted. So is Javascript for that matter but it's faster because portions of the code is compiled to machine code when it's run.

  • Well according to benchmarks JavaScript is anywhere from 3 to 60 times faster than python.

    http://benchmarksgame.alioth.debian.org ... g2=python3

    Python is still garbage collected and yes it can be used for games, even 3d ones. Usually though for 3d the engine part is made in C and python is used for the scripting parts that don't need to be fast as possible.

  • Lunarovich

    I've had a look into it and the bug occurs when I use:

    for x in instances[/code:2a9uzrdq]
    in my code.
    
    "instances" is an array so x just loops over the indices of the the array (0, 1, 2...).  But when it fails x's value is "random".  Looking in rot.min.js the Array object has these two methods added:
    Array.prototype.random
    Array.prototype.randomize
    
    Adding methods to the Array object will break Array.foreach since it will now loop over the the methods after the indices.  I can fix it in that particular case in my code, but any other plugin or part of C2 itself that uses Array.foreach will break as well.
    
    The solution would be to do something like this to redefine the other prototype methods of the array to compensate.
    [url=http://kenegozi.com/blog/2009/04/13/javascript-and-the-extended-array-prototype/]http://kenegozi.com/blog/2009/04/13/jav ... prototype/[/url]
  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound