fisholith's Forum Posts

  • Is it possible to access private variables from Python?

    I've been trying to get expressions like

    Sprite.Value( 'privateValueName' )[/code:3vrx0x9k]
    to work in python, but so far it seems like I only get back some kind of null value.
  • What is the purpose of the "PreviousTexture" mentioned in the wiki?

    http://sourceforge.net/apps/mediawiki/c ... el_Shaders

    It seems to be exactly the same as "BackgroundTexture" when it is the first effect, and exactly the same as "ForegroundTexture", when any effects come before it.

    Is it just so you can make effects that work on both the background and the foreground depending on its position in the effect chain?

  • This may seem like an odd question (and it's unrelated to Construct), but is there a way to flip the entire XP desktop vertically. By "flip", I mean mirror vertically, not rotate 180 degrees. By "desktop" I mean everything shown on the monitor. That is to say, the mouse pointer, windows, menus, text; everything would be upside down, while the computer continued to operate in real-time. I know there are ways to rotate the display, but that isn't what I'm looking for.

    e.g. If you laid a mirror flat across the keyboard of a laptop computer, ordinarily the reflection of the screen would be flipped vertically, but not horizontally. To make the reflection appear right side up, you would need to vertically flip the image on the monitor. Rotating the image on the screen 180 degrees would not work, because you would get the reflection right side up, but it would be flipped from left to right at that point.

    Essentially I'm looking for anything that will allow me to flip the screen along the X or Y axis in software. I don't know if there are any third party tools or plugins for windows that do that but I figured I'd ask.

    I've looked around for something to do this for a while now and if anyone knows of anything, please let me know. Thanks

  • One of the most awesome features added into construct since I've started using it is the ability to transfer objects and code between cap files.

    Does anyone have any recommendations on how best to write code, break up event sheets, and, name objects to make such transfers as simple and modular as possible.

    I've been investigating this on my own for a while, but I'm curious what advice is out there.

    Ideally, I'd like to be able to build game engine modules in separate cap files, and then pull them together into full applications, if that makes sense.

  • What is the purpose of "Object Folders"?

    Is there anything special you can do with them?

    For example, can you place two different objects with the same name in separate folders, to avoid name space conflicts?

    Just curious, as I can't find much documentation on them.

    One thing I have noticed is that if two different objects have the same name, the "Object List" will only show you one object listed under that name, while the object folder will actually have two distinct objects that share the same name listed.

    You can get two different objects with the same name by copying an object from another .cap file and pasting it into a .cap file containing an object with the same name as the object being pasted. At least it works with "Text" objects. I think you can also get away with renaming objects so that they have the same name if you're using the "Object Folder" view, and that method appears to work on any kind of object.

  • Okay, cool. I'm just glad I'm not going crazy.

    I figured it might be a means of sidestepping the weighting calculations to get a performance gain. I ran into premultiplied alpha a while back using Maya. Granted, you can get away with disabling premultiplication for Maya, because Maya is by no means a real-time application.

    It makes sense that Construct uses it to speed up compositing, since the name-of-the-game is flooding the screen with sprites, and 99.9% of those sprites will get drawn onto a fully opaque backdrop. Though actually what about transparent layers? Do they just force z-ordering, unless you tell them to render themselves as an intermediate texture?

    Sadly though, it seems then that you can't store arbitrary alpha maps without irreparably degrading the image information in the RGB maps.

    For example, the divide by alpha method you describe, is the same method I described in the 5th paragraph of my first post, and it's not capable of retrieving the original RGB values, because they have already been degraded by premultiplication, followed by quantization into the 8-bit color model. The best you can get is a quantized/depth-aliased approximation that gets less and less accurate as transparency increases. (Unless I'm thinking about this the wrong way, but I've already tried a number of different methods and it would appear that the original data really just isn't there to be retrieved.)

    One of the reasons I was interested in getting at the original RGB image data is that I wanted to make a small painting application that could do gamma accurate color blending. For that I would need to have access to the unaltered RGB and alpha maps.

    I can't really complain though, a lot of the cool things you can do with separated channels aren't really what Construct is designed for, so like everything it's a tradeoff. And I agree that in Construct's case premultiplied alpha is the way to go.

    If there was a way to disable premultiplication for certain objects though, that might be nice, but understandably that probably won't be a priority any time soon. Even so, it might be worth looking into the problem with the Construct image editor (see 6th paragraph of first post).

    That said, is there a way to use effects to apply a grayscale texture to an object as an alpha map? I know there's a "Mask" effect, but I'm not sure if you can set it up to punch through only the object one z-index behind it. It's seems like you couldn't, because any object one z-index lower would have already been flattened into the scene. Then again, I'm not that familiar with DirectX.

  • RGB values seem to be wrong when alpha less than 1.0?

    ===============================

    I first noticed this when building a shader that would allow you to view channels in various ways. I was going to post this in the "Construct engineering" forum, but after closer inspection it seems that this odd issue originates from Construct itself rather than the effects system, so I figured I'd ask here.

    I may be doing something wrong, but it really looks like the alpha channel somehow corrupts the image data in the R, G, and B channels.

    Specifically it's as if, for each pixel, the alpha value is being multiplied into the R, G, and B values. If that's really what's going on, it means that image data is being destroyed, as the color depth resolution in the R, G, and B channels is discarded in the presence of non-1.0 alpha values.

    To see an example of what I mean, using the Construct image editor, try loading and saving an image with 0 to 1 alpha gradient. You should see all the R, G, and B channel values clamped to black as alpha approaches 0, irrespective of what data was originally in the R, G, and B channels.

    At any rate, if the alpha is really being multiplied into the data, the R, G, and B channel information can't be recovered. For example, dividing the RGB values by alpha will approximate the original colors, but with lots of ugly banding, quantizing, and aliasing as you near low alpha areas. The original data is definitely not recoverable from that.

    This may also explain another kind of glitchy behavior I've seen in the image editor, namely, that the soft edged brushes paint a kind of dirty aliased range of colors rather than just the color you selected.

    To see this effect for yourself, in the image editor, pick a gray-green color (or any other desaturated color) and fill the whole frame, now get a large soft edged brush and draw the same color in the center of the frame. Obviously you should not see anything change, because the whole frame is already the color you're trying to draw with. Instead however, you will get a grungy mess of various colors loosely similar to the selected color. I think this may be because of the alpha glitch I mentioned above, causing waves upon waves of compounding rounding errors. That's sure what it looks like anyway.

    So, my question is, is this weird RGB behavior really what it looks like, and if so is there a work around that would allow the RGB values to remain in tack while at the same time using alpha?

    Please let me know if this appears to be a real issue, or if I just overlooked something simple, or am missing a setting somewhere that resolves the odd alpha behavior mentioned above.

  • Thanks!

    I've been looking over the Microsoft HLSL reference site you mentioned.

    I'm glad I asked before investing a lot of time in trying to build a bunch of convolution stuff.

    I've built a few shaders that are a bit more straightforward thus far, and I'm getting a feel for HLSL. (albeit rather slowly)

    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.

    Thanks again.

  • I have a few question regarding effects coding, (which I'll number for ease of reference).

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

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

    I've read through the Construct Wiki page on shaders, and that helped with the Construct specific stuff, but it doesn't mention much about the actual language.

    Q3: Is DirectX's "HLSL" language what construct shaders are coded in? (i.e. Will this Wikipedia page "http://en.wikipedia.org/wiki/HLSL" help me at all?)

    While I'm familiar with a variety of image compositing and processing algorithms, I have no background in coding pixel shaders. I'm not even sure if "pixel shader 2.0" is a language or a target machine code standard, or what.

    There are a number of effects I'm interested in building, and several rely on various forms of convolution, and particularly blurs.

    After spending just a little time coding effects, I've run into a number of errors resulting from registry allocation, overflows, and illegal computation complexity. Which reminds me of my last question.

    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?

  • Okay, after doing a bit of analysis of Construct's interaction with the registry, I think I may have found out where the data is stored.

    "HKEY_CURRENT_USER\Software\Construct\Construct\ProfUIS\Profiles\Construct"

    There are three keys under that key named "ControlBar", "Customization", and "PaintManager". Each of those keys holds a block of data in the form of a list of binary values, but nothing human readable.

    Construct writes to these blocks immediately upon closing, (which I assume is why if Construct crashes after you make changes to the preferences, but before closing it properly, all your changes are lost).

    Because the data is in the registry, it should be simple enough to back up and restore, assuming it really is the customization data I'm looking for. It might even be possible to build a ".reg" file to automate that process.

    That still doesn't explain why I keep losing my custom keys and such, but if I can restore them with a few clicks it will make the problem a bit more manageable.

    I'll let you know how this turns out after I try it.

    --------------------- Edit:

    === Success!

    Backing up and restoring the three keys ("ControlBar", "Customization", and "PaintManager") do indeed back up and restore the Construct preference customization.

    I've tested it several times, under a few different circumstances, and it seems to work perfectly.

    === How to do it:

    • - Preparation:

    Before doing anything, BACK UP YOUR REGISTRY!

    Use the freeware tool "Erunt", or the built in Windows System Restore utility to create a restore point.

    Needless to say,

    don't fiddle with the registry unless you know what you're doing.

    • - Backing up Preferences:

    Construct stores this data in the registry, under the following key.

    "HKEY_CURRENT_USER\Software\Construct\Construct\ProfUIS\Profiles\Construct"

    You can use regedit, to export the "Construct" key as a ".reg" file. That exported ".reg" file is essentially a full backup of all your hotkeys and quick-bar preferences.

    • - Restoring Preferences:

    To restore your settings, simply navigate to the "Construct" key, and delete the three sub-keys, "ControlBar", "Customization", and "PaintManager". (Do NOT delete the "Construct" key.)

    Alternatively, you can run a ".reg" file like the one below to remove the sub-keys.

    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Construct\Construct\ProfUIS\Profiles\Construct]
    
    [-HKEY_CURRENT_USER\Software\Construct\Construct\ProfUIS\Profiles\Construct\ControlBar]
    [-HKEY_CURRENT_USER\Software\Construct\Construct\ProfUIS\Profiles\Construct\Customization]
    [-HKEY_CURRENT_USER\Software\Construct\Construct\ProfUIS\Profiles\Construct\PaintManager][/code:39nyml6m]
    
    Now run the ".reg" file you made during the "Backing up Preferences" stage earlier.
    All your preferences should be restored.
    That's it!
  • Near as I can tell, all the persist files are 1KB xml files with a ".persist" extension. They can be opened in notepad and all appear to have an internal structure along the lines of the example below.

    <?xml version="1.0" ?>
    <persistence>
        <windows>
            <layout name="Layout 1" scroll-x="192" scroll-y="110" active="yes" />
        </windows>
    </persistence>[/code:1u8x9blp]
    
    So unfortunately, it doesn't look like the persist files are what I'm looking for. Thanks for the suggestion though.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm using v0.99.92.

    It seems like every few days, I loose all my custom hotkeys. This just started happening within the last month or so. I have a lot of custom keys, so it's a bit of a hassle to reconfigure Construct every time my customizations vanish. This also happened with 0.99.91 at least once, (as I remember taking that opportunity to install 92.)

    Is there a way to back up the hotkeys and other preferences? It doesn't seem like there is any built in save and load preferences system, but I figure the information has to be stored in a file somewhere, so perhaps I can simply back up that file.

    The problem isn't that bad, as I have all my configurations written down in a text file, and it's just a matter of going through that list and setting everything up again. But if there's a way to avoid that, it would be nice.

    Any advice would be appreciated. Thanks.

    ====== Edit:

    Backup Solution:

  • I did try using RGB(rrr,ggg,bbb) expressions, and I got the same results. Interestingly, turning the opacity from 100 to 255, caused the points to display correctly for a few runs, but eventually I was back to only seeing the red channel. The "Draw line" and "Fill rectangle" actions seem to work fine for drawing points of any color though.

  • I might just be doing something wrong, but the "Draw Point" action for the Canvas object seems to treat the green and blue color components of the color parameter as zero, regardless of the color I pick.

    That is, if I try to draw a white (255,255,255) point, I get a red (255,0,0) point.

    Likewise a gray point (128,128,128), is drawn as a dark red (128,0,0) point.

    A blue (0,0,255) point is drawn as a black (0,0,0) point.

    It's as if the blue and green values are being discarded.

    Am I just doing something wrong, or is this a known issue? I couldn�t find another mention of it in the forums.

  • Wow! "Grab Layout".

    I can't believe I didn't see that.

    Awesome. Thanks, I'm definitely going to try that out.