David's Forum Posts

  • Had a go at using the Wink program to make a tutorial...tell me what ya think

    http://www.scirra.com/tutorials/lighting.htm

    Its 3mb so it takes a little while to load which is the downside :/ I kinda prefer writing tutorials.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The scrollbar thing has been fixed..but as for the crash can someone give me a cap that's crashing? It's easy to reproduce the picture editor crash, but I cant reproduce the layout editor one. It might be related to a particular plugin or special textures that are only allocated when effects are used or something like that.

  • I love how Rich is able to rephrase what took me 14 lines to say, into a mere 3 lines and make it make more sense

  • Newt I love you! I've been looking for software like this for ages! I was even thinking of having a go at making something like that! But its already been done and looks pretty good from the flash video. I'll have a look at it when I get home

  • Found this nice api for pen pressure. Just posting it here coz i'm at work:

    http://www.billbaxter.com/projects/bbtablet/index.html

  • I'm all for videos if they are kept short and sweet. I've seen some terrible ones for photoshop where people are flailing their mouse about miss clicking and theres long awkward silences and 'no wait...scrap that...i mean'

  • We'll probably add a right click menu in the event wizard so you can arrange your objects there and then.

    Just like adding private variables, its most likely that the time you'll think 'man this object really shouldn't be listed in the event wizard' is when you're actually in the event wizard

  • Damn gradients dont render too well with float scrolling positions. I guess thats because they use the bouncing box co-ordinates. If you replace all the gradients with sprites the scrolling looks fine.

  • Just tried out single player, its really fun! I was like pfff another tanks game but this one is really good! Sadly its 2am and I got work tomorrow morning so I better go! Night!

  • You do not have permission to view this post

  • I figured I'd write a quick tutorial that goes over the basics of writing a pixel shader.

    The first turial will just be a quick overview of an existing shader so you understand how it works.

    Open the directory or its equiv: C:\Program Files\Scirra\Construct\Effects\

    This is where all the effects are. Each effect is a single *.fx file which can be opened in any text-based editor. I would personally recommend notepad++ because its free, simple, has syntax colouring, and multiple undos. Anyway it doesn't really matter for this tutorial, we are simply going to be reading over the file.

    Open Multiply Plus.fx

    Lets take a look at the first few lines of the file:

    // Multiply
    // Ashley Gullen
    // PS 2.0
    // Multiplication blend with intensity.[/code:2lblvyj0]
    The first line is the name of the effect, the second is the Author, the third is the Pixel Shader version, and the fourth is its description. The // means this text is a comment, and therefore not part of the fx file...however Construct reads these specific lines and obtains information from them, so your fx files MUST contain these comments
    
    Next we have our parameter for our effect
    
    [code:2lblvyj0]//#PARAM percent intensity 1 : Intensity : Intensity of the effect.
    float intensity;[/code:2lblvyj0]
    
    The first line is a Construct definition, which goes in the form:
    #param type fxvariablename initialValue : nameInConstruct : Description
    
    For type we can either use percent or float. Currently these are all that are supported, but later we may include more (such as a texture!)
    
    Next we have any declared variables that are needed for our shader. 
    [code:2lblvyj0]
    // Foreground texture
    texture ForegroundTexture;
    
    // Background texture
    texture BackgroundTexture;
    [/code:2lblvyj0]
    
    Constructs runtime will check to see if certain variables are declared in the effect file, and will pass appropriate values to them. Here is a complete list:
    [ul]ForegroundTexture
    BackgroundTexture
    SourceTexture
    PreviousTexture
    frameCounter
    boxLeft
    boxTop
    boxRight
    boxBottom
    boxWidth
    boxHeight
    hotspotX
    hotspotY
    pixelWidth
    pixelHeight
    bgStart
    bgEnd
    [/ul]
    Other shaders such as 'wave' use most of these variables, but multiply doesn't require them so they aren't declared.
    
    Now we have our sampler definitions:
    [code:2lblvyj0]// Foreground sampler
    sampler2D foreground = sampler_state {
        Texture = (ForegroundTexture);
        MinFilter = Point;
        MagFilter = Point;
        MipFilter = Point;
    };
    
    // OriginalTexture sampler
    sampler2D background = sampler_state {
        Texture = (BackgroundTexture);
        MinFilter = Point;
        MagFilter = Point;
        MipFilter = Point;
    };[/code:2lblvyj0]
    
    In a pixel shader, samplers determine how the computer calculates the colour value of a point in the texture. If you use 'point', it will go to the nearest pixel, if you use linear, it does a linear interpolation between pixels. We tend to only use these two. Point is faster than linear, so we tend to only use linear when its possible we are looking up pixels that are between pixels. Magnify uses linear so that the magnified image looks smooth rather than 'pixelly'.
    
    Now we have our effect definition. 
    
    [code:2lblvyj0]// Effect function
    float4 EffectProcess( float2 Tex : TEXCOORD0 ) : COLOR0
    {
        float4 front = tex2D(foreground, Tex.xy);
        float4 back = tex2D(background, Tex.xy);
        front.a *= back.a;
        front.rgb *= back.rgb * intensity;
        return front;
    }[/code:2lblvyj0]
    
    This is the actual function which calculates every single pixel. It's best to write the function as simple as possible, because the fx file is converted into a machine language which is optimised and the shaders read. 
    
    [code:2lblvyj0]tex2D(foreground, Tex.xy);[/code:2lblvyj0]
    the tex2D function obtains a pixel colour from a sampler. 
    
    float4 structures are awesome. You can write stuff like: front *= 2 and the a,r,g,b values all get doubled, or front.rgb * 2 will multiply only red, green, blue, or you can refer to them individually as front.r, front.g, front.b, etc.
    
    these float values are all between 0-1, and if you want to add two colours together you simply write
    front.rgb + back.rgb.
    
    Finally we have our effect definition
    
    [code:2lblvyj0]// ConstructEffect
    technique ConstructEffect
    {
        pass p0
        {
            VertexShader = null;
            PixelShader = compile ps_2_0 EffectProcess();
        }
    }[/code:2lblvyj0]
    
    All our shaders tend to either be ps_2_0 or ps_1_4
    
    The pixel shader definition determines what functions can be used, and how many lines of instructions you can have per shader.
  • This kind of behaviour sounds like it would be rather simple, and could be a good tutorial for writing behaviours

  • Yeah we need more info

    You could just have an object 'Achievement' with a string private variable for 'name'. And then like:

    pick up achievement code:

    Create object Achievement at

    Set Achievement variable 'name'

    And then in another event somewhere else, you could display the achievements by loop eaching achievement, possibly having a string object contained with it so you can display a name as well

  • I'm really surprised people are getting slowdown....if you dont mind me asking how is your scene being rendered ? Are there any pixel shaders? It looks beautiful btw!

  • Heh we should make a list of 'common game design questions' which we can provide simple 'event-wise methods' of achieving stuff in the simplest way possible...enemy 'waves' and spawning positions in general is a good topic to add!