R0J0hound's Forum Posts

  • Arima

    I would like to eventually but I don't have much time as of now to do it. WebGL is straightforward enough but I will need to study C2's renderer to get it to work with effects. When I made the plugin webGL wasn't even on the table so with the 2d canvas most of the features were a piece of cake to implement. Getting it working with the webGL renderer is a lot harder and time consuming than "a piece of cake". It's more accurately somewhere between "a three course meal" and "an all you can eat buffet".

  • I made a bubble shooter capx a while ago. It also found connected bubbles with a flood fill algorithm. It only did it when a bubble landed as there is no reason to do it continuously. I also thought the lag to not be a problem because of when it occurs.

    Some ideas to make it faster:

    1. Lookup the capx I made and see if my implementation of flood fill is more efficient than yours.

    2. You could limit the amount of lag by doing the flood fill over multiple frames.

    3. As a last resort you could come up with some type of data structure to make the flood fill more efficient by making the picking of a bubble's neighbors a simple lookup instead of a collision check against all the other bubbles. In theory it will be much faster, but it will require a lot of events and be very tedious to setup.

  • Savvy001

    Just added save/load function. Re-download from first post. It is likely to be slow with larger images.

  • It's done the same way. The order of the animation frames should be like this:

    "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.,:;'""?!()"

    or have what ever characters you wish to use. Then change the expression to not use lowercase():

    find("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.,:;'""?!()", mid(Text.Text, loopindex, 1))

  • You could use the 3dObject and change the textures with the texture Setter plugin and see if you get better performance with that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I managed to get something working with python.

    http://dl.dropbox.com/u/5426011/examples17/ffmpeg.zip

    It extracts frames to a file and then loads it into a sprite. I'm getting about 15 fps on my machine.

  • There isn't a simple solution to this.

    I was looking into solving this when I made the python examples and I didn't like how much work it looked like it would take to do it the correct way. AKA writing a plugin using directshow. Besides that solution my thought is the problem boils down to two things:

    1. Read a frame from a video

    2. Get that frame to a texture so that Construct can draw it.

    One (1) is easy, there are many python libraries that can do this. Two (2) is the problematic step. Existing ways in Construct to draw video aren't drawn by Constructs rendering engine but instead are drawn by other means to a child window. That's why the video is on top and has the side issue of not having a texture that textureSetter can get.

    One idea I have is to use python with pyffmpeg to read individual frames from a video and write them to a temporary file. Then load that file with the "load frame from file" action to a sprite every frame. This may work but will kill the framerate because of the constant hardrive (hd) access. This could be helped a bit with a plugin and saving and loading a file in memory to avoid hd access.

    Even if it's working to that point it's not going to be optimal. Loading a image to a texture stalls Construct's renderer, and still there is the audio of the video to deal with.

    SHORT ANSWER:

    The solution is to write a plugin to do it, which will be time consuming.

    or use existing methods and scratch the need for the video to not be on the top.

  • The project is likely being loaded just fine but no editor windows are opened. Construct saves the ui state when saving so it is possible to load with no open windows.

    My original post still stands as a solution.

    This is what I meant by project toolbar:

    http://sourceforge.net/apps/mediawiki/construct/index.php?title=Project_Bar

    Another solution is to delete the .persist files in the same folder as the .cap. All a .persist stores is the ui state so it can be safely deleted.

  • It is backward compatible, since it's just standard javascript. All Asm.js will do is more efficiently convert javascript written in a certain style into fast machine language. The code will work in older browsers, but it will take a newer browser that does the conversion to see any speed improvements.

  • GamesDev

    1. You change the speed by adjusting the target angle. In the example ang is set to point a bit above the target, to make it go faster just have ang point a little lower. If ang points right at the target the speed will be fast enough to reach the target in one frame.

    2. You could just position a sprite to the mouse.

    bon4ire use this modified equation:

    angle(posx,posy,mouse.X,mouse.Y-clamp(abs(mouse.x-posx), 100,1000))

  • Go to the project toolbar and open it from there after loading.

  • From r123 changelog this is the affecting change:

    pdated Google Closure Compiler to the latest version

    I don't think there is anything I can do on my end to fix it as the minifier just fails and produces a c2runime.js file with a size of 1kb containing only one comment. An empty project produces a c2runtime.js file with a size of 81kb.

    One solution would be use the minifier from a previous release. Just copy this file:

    ..\Construct 2\exporters\html5\tools\closure\compiler.jar

    from an older release over to a new.

  • Here is a way a bit different to what you were doing:

    http://dl.dropbox.com/u/5426011/examples17/selection_interface.capx

  • ut I heard that the performance is really bad on mobile

    It's always best to test it to see the actual performance as hearsay can be exaggerated.

    For moving objects you should take the manual into consideration:

    ou should also avoid pathfinding every tick, since this will cause extremely high CPU usage and also increase the amount of time it takes for other objects to determine their paths.

    https://www.scirra.com/manual/154/pathfinding

    You'll still end up having to calculate a new path periodically, but all you need to do is get it close enough to the player so it has a line of sight to the player. Then you can switch to a much less cpu intense behavior such as the bullet behavior, to close the gap.

    You could also try and do what gillis did and break the area up into boxes and make a list for every box of the best direction to get to any other box. It's a bear to setup as you'll basically be defining the path from every box to every other box, but once the game is running pathfinding will be very fast as it's just a simple lookup.

    http://www.scirra.com/forum/quadralant-pathfinding-optimization-solved_topic60379.html