Ashley's Forum Posts

  • I should probably add up all these hints and put them on an optimisation page on the wiki or something, heh...

  • C++ is not being implemented in to Construct guys, let's not try and confuse new users

    Eventing has very few similarities C++ programming and thus features like exceptions are simply not there.

  • The distance and angle expressions are meant to accept a two-parameter overload with a two-element array {x,y} defining each coordinate so distance(obj1.xy, obj2.xy) would work (as would distance({0,0}, {10,12}), but something seems broken there. It's a slightly quicker way of typing object distances.

  • Doppel's suggestion works, but I don't know why using .xy doesn't work (it is meant to!). I'll investigate since it's a bug.

  • deps: the renderer renders from back-to-front. So if you have a bunch of particles sharing the same texture, so long as they're on the same layer or are at least contiguous in the Z-order, there won't be any texture changing. If you intermingle other textures (say, other particles) in the Z order with a high degree of randomness, you will give the GPU more work since it will keep changing texture. At the moment, Construct makes no such optimisations on its own. It's up to you to organise your Z ordering.

  • Thanks, but I wouldn't be surprised if they delete it based on notability guidelines - might have to wait till Construct is better known!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Unfortunately no documentation exists on this yet - I think the best place to start is looking at other effects. Additive Plus is a good example, since it is an intensity-customisable version of the Additive effect. It's very simple. If you ignore the miscellaneous definitions around the file, the main function is EffectProcess(), which calculates the effect:

    // Effect function
    float4 EffectProcess( float2 Tex : TEXCOORD0 ) : COLOR0
    {
        // Add the front and back pixels
        float4 front = tex2D(foreground, Tex.xy);
        float4 back = tex2D(background, Tex.xy);
        back.rgb = (front.rgb * intensity) + back.rgb;	// Add colours
        return back;
    }[/code:j5si1p0d]
    
    This can be summarised as:
    
    1) Get the foreground pixel
    
    2) Get the background pixel
    
    3) Add together the foreground and background pixel (with intensity) and store result in 'back' (note the addition, hence 'Additive blending')
    
    4) Return 'back', which is the result of the effect.
    
    That's a simple [i]blending[/i] effect, which means it basically combines the texture and the background in some way (alpha channels are an example of blending, because they combine the foreground and background).  Other good blending effects are Dodge, Multiply Plus, Subtractive Plus etc.
    
    Note effects like Multiply (the PS 0.0 version with no intensity) are coded simply by render states, which is a limited way of processing effects on cards with no pixel shader hardware - I think we've covered most of the useful things that can be done with renderstate-only effects, though (but feel free to experiment).
    
    Other [i]distorting[/i] effects simply use the texture to distort a texture in some way.  Magnify is a good example - the texture's colours never reach the display, they're just used to define how to distort the background.   Warp is another good example that just uses sin and cos to make a kind of flag-waving effect on an image.
    
    Finally there are more advanced effects like the Blurs, HDR and combination... I guess these would take full on documentation to fully explain.
    
    Also I've found a fairly good general explanation of shaders here:
    
    [url]http://www.facewound.com/tutorials/shader1/[/url]
    
    It explains shaders in a general way pretty well, but it obviously doesn't cover Construct's implementation of shaders.
  • I think 0.94 will have fixed inflating filesizes - let me know.

  • Deadeye's solutions are good so far, except that you can do it without subevents, heh - 'pick random' could simply be a condition after 'every'.

    As for object picking via conditions, remember two things:

    • For Each works best as the first condition
    • Use built-in conditions wherever possible instead of System's Compare Values (eg. Sprite's Compare X rather than comparing Sprite.X to a value - works instance by instance)

    Also might help to post your .cap file, so I can tell you exactly what's going on.

  • If you think there's a flamewar warming up here, I have a bucket of water for you: Flamewars Get Threads Locked.

  • There should be a multiplayer plugin by the time we hit 1.0, and I'll have made it if nobody else has. Networking isn't my strong point though, even so I will try to do it properly, but I don't know how long that'd take - you might have to be patient if you're starting now!

    Also be aware there are known file-corruption bugs in 0.93, some but not all of which should be fixed by 0.94 - keep lots of backups!

  • Lol guys, fool'd

  • Thanks Exomarc, confirms my suspicion it's my fault

  • I think it's more likely a bug in Construct until I properly research the bug, in which case it would be coincidence Game Maker has this bug.

    If it is a problem with nVidia cards, I can't and won't do anything about the bug. In that situation it would be nVidia's problem so if the latest drivers still had the problem, you'd have to go complain to them about it. Right now though, can't say which it is. We'll see.

  • Well, it's much more efficient to send commands to the GPU all in one go (in a batch) than separately. I hadn't realised effect rendering wasn't batched, so was just a matter of fixing that.