tulamide's Forum Posts

  • [EDIT] i think i also used your physics fix thing, sol gave it to me on chat

    What are you talking about? Everything that fixes something with the physics behavior is of interest to me, because I'm working on a physics based game idea, too

  • Do you know off hand if loops are unrolled at compilation? Or, likewise, if all the instructions in the branches of an "if" statement count as taking up instruction slots? It seems like they must, but I'm not sure what kind of optimization happens at compile time.

    There is also a time factor. If a loop uses only the allowed amount of instruction slots but is too time expensive, you will get an error too.

    If-statements count for every branch. A loop is one instruction plus the ones you enclose with the loop.

    float4 EffectProcess( float2 Tex : TEXCOORD0 ) : COLOR0
    {
        float4 color = tex2D(foreground, Tex);
    	for (int i = 0; i < 1023; i++)
    	{
    		color *= 0.9999;
    	}
    	
        return color;
    }[/code:1qvuvolp]
    This code uses 3 instruction slots, being a loop with 1024 iterations.
    
    But as soon as you insert a simple if-statement you are using 3 instruction slots per iteration (the if-branch, the calculation and the not typed but still existent else-branch)
    [code:1qvuvolp]float4 EffectProcess( float2 Tex : TEXCOORD0 ) : COLOR0
    {
        float4 color = tex2D(foreground, Tex);
    	for (int i = 0; i < 21; i++)
    	{
    		if (color.a != 0)
    		{
    			color *= 0.9999;
    		}
    	}
    	
        return color;
    }[/code:1qvuvolp]
    See? You now have to cap the loop to 21, which equals 21 * 3 = 63 instruction slots (plus the color assignment one line above)
    
    But be careful with extensive loops. You will use too much RAM. Better don't try the following example (I used the task manager to exit Construct after about 2 GB of RAM were assigned, and it took a very long time to get there):
    [code:1qvuvolp]float4 EffectProcess( float2 Tex : TEXCOORD0 ) : COLOR0
    {
        float4 color = tex2D(foreground, Tex);
    	for (int i = 0; i < 1023; i++)
    	{
    		for (int j = 0; j < 64; j++)
    		{
    			color *= 0.9995;
    			color /= 0.9995;
    		}
    	}
    	
        return color;
    }[/code:1qvuvolp]
    
    I'm not sure if attribute assignment is supported in Construct, I never tried it. HLSL generally allows you to add attributes to for- or if-statements (like [unroll] for for-statements or [flatten] for if-statements) to control compilation, but maybe Construct is taken care of that. You would need to try I'm afraid.
    
    [url=http://msdn.microsoft.com/en-us/library/bb509602%28v=VS.85%29.aspx]for-statement reference[/url]
    [url=http://msdn.microsoft.com/en-us/library/bb509610%28v=VS.85%29.aspx]if-statement reference[/url]
  • The method is called "premultiplied alpha" and is a standard in 3D (remember, Construct is based on DirectX). With this method the alpha is stored in the color channels when using rgb and stored in the color channels and the alpha channel with rgba.

    There are advantages and disadvantages to both methods, but the most important advantage is the speed factor. Calculations are less complex and speed up the process and that is essential in 3D-environments.

    You don't really lose precision, because you're working with relative values 0 to 1 in 32-bit-precision (The smallest representable number without losing precision is 1.401298464e-45). It's the picture model that may lose precision (e.g. 8-bit-colors).

    The way you work with the colors in an effect is simple:

    1) Calculate the alpha out of the rgb-channels before working on the color

    color.rgb /= color.a;[/code:2apdu4tj]
    2) Work on the color
    
    3) Calculate the alpha back in
    [code:2apdu4tj]color.rgb *= color.a;[/code:2apdu4tj]
    
    [url=http://en.wikipedia.org/wiki/User]Here is a very good summary of premultiplied alpha[/url]
  • If you can have a hand on photoshop, you can do that with the option called slicing. Then just export and select all slices.

    Also, I found an online splitter, but didn't try it myself: http://www.htmlkit.com/services/is/

  • I'm using "Play music from resource" under Xaudio 2's music tab. I think the pause is due to the filesize, since the song is a .wav file, but I could be wrong. I normally use ogg but it seems ogg only works for sounds.

    If you are using a .wav file, you could use it as a channel sound instead of music, which enables you to cache it

  • Q1: How much do I need to know about the pixel shader 2.0 limitations to code shaders that rely on convolutions?

    Basically, the only limitation you need to be aware of is that you only have 64 instruction slots. Esp for convolution effects it will limit you too much. You may get away with a 3x3 matrix, although I doubt it.

    Q2: Is there any good online reference for what you can and can't do in pixel shader 2.0.

    I suggest you use the official HLSL reference. You just need to accept that with Construct's implementation not all intrinsic functions work, even if they are said to work under ps 2.0 (e.g noise). You won't get any error messages then, it seems as if they just got lost in the dark universe of dead bits

    Q3: Is DirectX's "HLSL" language what construct shaders are coded in?

    See above

    Q4: Is it possible to make shaders that distribute their computation complexity over multiple passes, if the algorithm is to complex for a single pass?

    No, Construct limits you to single pass.

    EDIT: 1 addition, "pixel shader 2.0" is a profile, this links explains what it means: http://msdn.microsoft.com/en-us/library ... 85%29.aspx

  • I'm working on an effect that replaces colors by index. And this is much harder than I thought, when I started a few month ago. I'm at a point, where I don't make any progress. There are too many questions and issues, and I really don't know which way to go.

    That's why I think it's time to get the community involved. First I will give you an impression of what is currently possible, without giving to much dry information. Please download this .rar:

    C-DEX Demo.rar

    It contains two apps that demonstrate the effect (The second demo uses Disk.fx in addition). If you think it is worth developing it, I will post all information about how it works, together with its advantages and disadvantages. And the issues that lead me to ask for your help...

  • Maybe I didn't understand you right, but I had no problems with you cap. If I set e.g.

    +Blobby: Value "from_Layout" equal to "Layout 1"

    ->Blobby: Set X to 0

    ->Blobby: Set Y to 1930

    Blobby appears exactly there.

    EDIT: Ok, sry, you already did it

  • That isn't half bad. I like it. Nice sounds and the music carries the spirit of the 8-bit era

    A couple of proposals:

    1) Add an option to change the volume of the sounds/music. I played with headset and the music was way too loud.

    2) Integrate an about screen instead of a message box. It would add to the atmosphere.

    3) Make the enemies more "lively". Even if they just move their eyes.

    4) The start screen is a bit drab. Maybe you could pep up the buttons, add some art to the background, something like that.

    5) For the HUD, why not using icons for all the parameters instead of only the bomb?

    6) Although I like the music, the loop is too short if it's the only one you will hear throughout the game.

    7) Music muting via "s"-key should unmute as well.

    ...and add some peas

  • I wonder why "Multicore support/better general performance" isn't in the lead. It is the most essential of all options.

    And I'm one of the custom datatypes choosers. I can't believe nobody is struggling with more complex structures. But I can understand that multiplatform is desired and more basic stuff must fall behind

    But whatever it will be, it will make Construct even more attractive to part time and semi-pro developers and that's a good thing!

  • if im not greatly mistaken there seems to be a problem with layer zooming? I had to use python to do it instead as it seemed to only set the "zoom rate" rather than the actual zoom through events... I am very tired so if someone could confirm that would be lovely

    Yes, changing the layer zoom through events doesn't have any effect. Display zoom still works through events, and it is good to know the workaround with python...

  • You could try to tweak the world scale (both x and y at the same time) reverse relative to the time scale (the lower the timescale, the bigger the world scale)

    To be honest I never really understood what world scale is for, but your objects move slower the higher these values. If you set just the x or just the y the coordinates ratio is also distorted. (sry, I can't explain this, just see for yourself)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's a Construct issue. That would explain why it's not working for alee either since "\a" is also translated into a single character. I found the problem and the fix in "Runtime\system.cpp" line 5040, the line was commented out.

    That's good news! Does it mean also, we just have to wait for the next release to be able to work with it? Or do we need to submit to the bug tracker? (I apologize if this is a stupid question, I'm uncertain )

    Anyway, thank you for the help and the quick finding

  • Do I need to use timedelta on everything?

    If I'm going to do something like: always:add 1 to angle. To save having to put timedelta all over the place, can I just use the timer instead? Like: every millisecond: add 1 to angle. Would save a lot of timedelta placings...

    You can't do the exact example "every millisecond". Reasons can be read here and in other threads.

    You need timedelta where you want to make sure, that something is changed independently of the framerate. It doesn't make much sense here, but for more complex code that you use repeatingly you can always set up a function call, e.g.

    +on function "convert"

    ->Function: Set return value to Function.Param(1) * TimeDelta

    you would then call always: add Function.convert(1) to angle

  • Thanks a lot ROJOhound! I think we're coming closer to the issue.

    Does this file exist?: "C:\Program Files\Scirra\Construct\Data\Python\StringIO.pyc"

    If it doesn't, your exported exe will complain about no StringIO.pyc.

    Yes it does.

    I've run the very same script and this is what I got from preview:

    D:\Dokumente und Einstellungen\tulamide\Anwendungsdaten\Scirra\python26.zip
    .\DLLs
    .\lib
    .\lib\plat-win
    .\lib\lib-tk
    D:\Dokumente und Einstellungen\tulamide\Anwendungsdaten\Scirra
    D:\Programme\Scirra\Construct-92\Data\PythonD:\Programme\Scirra\Construct-92\Data\Python.zip[/code:p4b9i29b]
    
    And now the important part. After exporting and manually adding StringIO.pyc to the directory, I got this (look at the last line):
    [code:p4b9i29b]D:\Dokumente und Einstellungen\tulamide\Eigene Dateien\Construct\AI Example\python26.zip
    .\DLLs
    .\lib
    .\lib\plat-win
    .\lib\lib-tk
    D:\Dokumente und Einstellungen\tulamide\Eigene Dateien\Construct\AI Example
    D:\Dokumente und Einstellungen\tulamide\Lokale Einstellungen\Temp\cap342.tmp\PythonD:\Dokumente und Einstellungen	ulamide\Lokale Einstellungen\Temp\cap342.tmp\PythonLibs.zip[/code:p4b9i29b]
    What you can see here is that "\t" is replaced by a tabulator. But only in this last line and only once. There is no valid path to the PythonLibs.zip
    
    It doesn't matter where I export it to, of course. The path will always be the local user settings (so as long as I'm "tulamide" as user the error will occur):
    [code:p4b9i29b]C:\Tmp\python26.zip
    .\DLLs
    .\lib
    .\lib\plat-win
    .\lib\lib-tk
    C:\Tmp
    D:\Dokumente und Einstellungen\tulamide\Lokale Einstellungen\Temp\cap345.tmp\PythonD:\Dokumente und Einstellungen	ulamide\Lokale Einstellungen\Temp\cap345.tmp\PythonLibs.zip[/code:p4b9i29b]
    What I don't know is: Are we talking of a python issue or a Construct issue?