fisholith's Forum Posts

  • Hey evillair, <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Just an interesting note...

    It might be worth looking at the "Delaunay Triangulation".

    It's probably overkill for what you're building, and it specifically produces a mesh of triangles which is a bit stricter than what you require, but it has some nice properties.

    The Delaunay Triangulation does a good job of connecting nearby points without creating sliver triangles.

    It's the dual graph of the voronoi graph.

    If you're familiar with voronoi patterns, for the Delaunay Triangulation, you get the center points of the voronoi cells, and create links between points in bordering cells.

    Boris Delaunay, who came up with this Triangulation solution, worked on this back in the 30s. He also climbed mountains, and somewhere there's one named after him. I don't know much else about him, so I can only assume he lived as hard as he mathed.

    Here's a visual animation of a Delaunay Triangulation algorithm working on a set of random points.

    Subscribe to Construct videos now
  • Q1: When I save data via the Local Storage plugin, is it stored in a human readable format?

    For example, if I save the current level the player is on via Local Storage,

    say key "level" = value "3",

    is there now a file somewhere that, you can open in a text editor, and see a line like "level = 3"?

    Q2: Regarding human readability, Is there a difference between using Local Storage from a browser, vs a desktop (NW.js) platform.

    I've found what I think is the location Local Storage data would go (for NW.js at least),

    "%AppData%\Local\<GameName>\Cache",

    but what I see is a bunch of hashilly-named files most of which are 1KB.

    None of it looks human readable, but I don't know if I'm looking in the right place.

    I'm just going by a comment Ashley made in another post.

    Any help is appreciated. :)

  • That is super helpful rexrainbow, thanks!

    Looking at the pin behavior is a great suggestion.

    I'm happy to hear there's an "afterLoad()" function, because I was wondering how to set up connections to things that might not be loaded yet.

  • What's the best way to serialize an array of references to C2 object instances?

    Overview

    I have a third-party behavior, that holds an array of references to C2 object instances. (These references are gotten from the SOL.)

    This array is part of the behavior's internal state, with "this.references" being declared in the onCreate() function.

    To get this behavior to cooperate with C2's native Save/Load state feature, I need to be able to save and load the behavior's internal state, using the saveToJSON() and loadFromJSON() functions.

    The saveToJSON() returns an object to be serialized via JSON.stringify(), I think.

    I think that JSON.stringify(), if given an array of C2 object refs, will try to serialize the entirety of each C2 object referenced. This causes a "Circular structure error", and isn't what I need to do anyway.

    I don't want to serialize C2 objects, as all I need to save are the references to those objects.

    Maybe I can get the UIDs of the referenced objects, and save those.

    Then I can rebuild the correct references upon loading by looking up object instances by the saved UIDs.

    Does anyone have advice on serializing an array of C2 object instances?

    Any thoughts or sugestions are welcome.

    Specific case

    Finally, the specific behavior I'm trying to extend is Azis's "Store Reference" behavior:

    I've already found and fixed some other problems with this behavior, but I just recently noticed it has no Save/Load support built in.

    It's a nice idea for a behavior, but I'm just about at the point of replacing it with native UID-based events, since I know I won't have to fix anything else in the future if I just stick to event sheets.

  • Thanks for letting me know ,

    I fixed the links.

    This is the updated bundle.

    Themes Bundle - Fisholith Themes v2.zip

    It also includes some notes on choosing and setting C2 "Styles", which are different from "Themes".

    Example of choosing a Style

    Styles - what are they?

    Styles vs Themes

    "Styles" are different from "Themes".

    Themes mainly set colors for event sheets. (You can edit them with my Theme Editor, or in C2's properties.)

    Styles set the colors for the overall user interface, like scrollbars, and panels. (Style colors aren't editable.)

    Choosing a Style

    1. On the ribbon, choose the "View" tab.

    2. Click the "Style" button (with the brush icon), and from the drop menu, choose a style.

    (Note: The default style is found under "Office styles" > "Office 2010 Silver".)

    The 3 notable Styles

    • Office 2010 Silver - This is the default theme for C2.
    • Visual studio 2012 Dark - Good for dark themes.
    • Carbon - Not as dark as 2012 Dark, but it's the only other Style with a dark background.

    Tip: If you use a dark Theme, then also change the Style to "Visual studio 2012 Dark",

    so you don't have bright white panels right beside the dark event sheet.

    Style Limitations

    C2 comes with some pre-built Styles to choose from, but you can't edit their colors.

    This is because Styles are developed by Microsoft, and embedded across a mixture of DLLs and system files.

    The 3 important styles

    Dark Styles are important because they can be paired with dark Themes.

    All styles for comparison

  • After exporting via NW.js, what is the propper way to rename the executable files in the Linux & OSX folders, so they show the name of my game instead of just "nw"?

    For example, I know that in the exported Windows folders (win32 & win64), I can rename the "nw.exe" to "My Game.exe".

    What would I do in the Linux & OSX folders to equivalently replace the default export name with the actual name of my game?

    For example, in the Linux64 folder, if I change the name of the "nw" file to "My Game", would that work, or would it break something that's expecting the file to be named "nw"?

    Any insight or suggestions are welcome.

  • Thanks for letting me know redfoc,

    I just updated the link, so it should work now.

  • Hey , (...not sure how to a name with a space in it)

    Thanks for letting me know.

    I just updated the links, so they should work now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Happy to help.

    Also, if you have a Windows computer you may need to install DirectX. Though installing NW.js for C2 should automatically prompt you to install DirectX if needed.

  • No problem.

    Compressing the png files will help with download times, but I believe when the game is running the images will be fully decompressed in memory, so prior compression won't have an effect on runtime performance.

    If you want to see an example of the rain cluster approach, it's what I used in a project I'm currently working on,

    Subscribe to Construct videos now

    . The graphics are based on the GameBoy hardware, so they are a bit simplistic, but only the spacing of droplets really matters, they can look like whatever you want. In that video I have two layers of rain, a foreground layer, and a background layer. The background has smaller droplets, falling a little slower.

    To give an idea of the droplet spacing used in the example above, the texture would look something like this,

                !
       !
                        !
            !
                  !
                          !
     !
                !   
                       !
          !
    [/code:16eaui5v]
  • Hey NiceJared, <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    This may mean you're using a browser that doesn't support WebGL, or has it disabled.

    Some browsers have a setting labeled "Use hardware acceleration" or something similar. If this is disabled, WebGL might not work.

    An alternative is to export the project as an NW.js desktop application.

    A NW.js application takes your game and bundles the WebGL and HTML5 platform stuff in with it.

    This way you don't need to rely on a browser for those things, though your file will be bigger as a result.

    To try previewing your game with NW.js:

    In the "Projects" panel, click the project folder (top-most folder).

    Then in the "Properties" panel, in the "Configuration Settings" section, change "Preview browser" to "NW.js".

    Now preview your game.

    You may need to download NW.js for Construct 2 first from here:

    https://www.scirra.com/nwjs

  • Hey CreativeMind,

    Different devices can behave pretty differently depending on how they handle rendering. It's been a while since I've looked into this in depth, but I recall hearing that some even have a limit for the maximum number of overlapping drawable objects that can be rendered in a single frame refresh period.

    There's a good overview of Construct 2 mobile performance considerations in this article

    Performance Tips

    Another good general article is,

    Optimisation: don't waste your time

    That said, I can try offering some thoughts and suggestions that might help out.

    Rain is a bit tricky though because even the tips I'd normally think to give for optimization can be double-edge swords on mobile devices.

    Two possible approaches

    Particles will probably give you better performance than sprites, because particles exploit some render optimizations, and eliminate a bunch of sprite features you don't need to use like animations and collisions.

    You still end up with a lot of individual things that need to be updated moved and drawn though, if each rain drop is it's own particle. A workaround is to put a lot of droplets on a single particle texture.

    ("Droplet cluster particles" below)

    Another option would be to use a single tiled repeating texture and scroll it downwards, as it would only require 1-step to render it, instead of 1 step per particle. This takes up much more memory than a single raindrop texture, but probably not much more than any of the other larger textures in your game, like backgrounds and such.

    ("Scrolling tiled rain texture" below)

    Both of these workarounds ("Droplet cluster particles" and "Scrolling tiled rain texture") involve using images with large amounts of transparent area. Normally this is something you'd want to avoid on a mobile device, but in this case the transparency isn't just superfluous uncropped area, and the alternative blizzard of individual raindrops might be worse. Again it partly depends on the device.

    Scrolling tiled rain texture

    With the tiled scrolling rain approach, you risk loosing the randomized look of raindrops, so you might want a largish texture. If you want a more randomized look, you can use two tiled textures of different sizes, overlap them, and then scroll them at different speeds. The interplay between the different textures will help break up the appearance of repeating patterns.

    This also gives you the option of changing the angle of the rain drop graphics, which can't be done with particles as far as I know. (One of the optimizations used by C2 particles relies on all the particle textures maintaining the same angle, if I remember correctly)

    Also just a note, you wouldn't scroll the tiled texture in the same direction forever, just until it got to a looping point where you could snap it back to its starting point, giving the illusion of continuous scrolling.

    Droplet cluster particles

    If you want to try using fewer particles to create the same visual density of rain drops, you can use a larger texture with randomly placed raindrops on it. This takes up a little more memory, because of the larger texture, but if each texture has 30 droplets on it, then the number of particles needed becomes 30 times smaller. which should improve the performance of the rain effect. However, this depends a lot on how the mobile device renders things. As I mentioned earlier, sometimes, it's the number of overlapping objects that causes problems, in which case particles may not help you.

    Some care must be taken in drawing/creating this kind of droplet texture, because otherwise it will look like the droplets are falling in clumps.

    When drawing this texture, it's usually good to have a fairly uniform distribution of droplets, with about the same amount of space between them. Avoid placing two right next to each other or you'll see that unique pair on every texture. It can also be good to build up the droplets from the center of the texture outward, with the vary outermost set of droplets at about half the density of the more central cluster. This edge drop off in density helps the particles (each one a cluster of droplets) blend together more seamlessly, because there's not a hard all-to-nothing density transition on every texture. You can think of it like feathering, but with amount instead of opacity.

    finally you'll need the emitter to create enough of the particles (droplet clusters), so that any spot on the screen is covered by two particle clusters on average, kind of like house shingles. Since there will always be about 2 clusters overlapping any given spot, when drawing the texture, you should put the droplets about twice as far apart as you want them to finally appear in the resulting rain.

  • Thanks

    Also I just wanted to note that I fixed the dead link resulting from Dropbox's new "no more public folders" policy. The link should now work exactly as it did before.

    Finally for anyone else having to update their Dropbox links, the new link will end with

    "?dl=0"

    And it will take you to a download page, instead of opening as a direct download.

    If you change the 0 to a 1,

    "?dl=1"

    then you should get the original direct download behavior when clicking the link.

  • Hey Rco250jmx,

    To my knowledge, there's no reasonable way to change the styles, because they are developed by Microsoft, and are hardcoded into a convoluted cross-section of DLLs and other miscellaneous system files, which are not intended to be editable. So unfortunately as far as Styles go, you really only have the options provided.

    I created a visual reference sheet of all available styles (2nd image below) to make it easier to brows them.

    * "Visual studio 2012 Dark" (2nd from bottom) is good for dark themes.

    * "Carbon" (2nd from top) is also good for dark themes. It is not as dark as 2012 Dark, but is the only other Style with a non-white property bar background color.

    First a quick reference for the 3 most important styles, those being the default style and the only two dark styles:

    The 3 important styles

    All Styles

    As an aside since, , Arima, sqiddster, Katala, and Tetriser, discussed the usability of dark themes earlier in this thread, some of you might be interested in the Style reference sheet as well.

    Also, credit to Colludium who I think was the first to mention the " Visual studio 2012 Dark" Style in this thread.

    As you can see from the chart, 2012 Dark really is the best (and almost the only) Style choice to pair with dark themes.

    Hope that helps out.

  • Update - Release 4

    New features:

    * Preview selection colors now finally include the Condition and Action selection borders.

    * New scrollable embedded help with information on controls, interface, workflow, examples, and more. (M-Click to toggle XML view)

    * Color hue name display, shows name of nearest Primary, Secondary, Tertiary, or Quaternary color, for a total of 24 names evenly spaced around the color wheel.

    * Color Hue preview bar has a variety of display styles. (hover and Mouse Wheel to change style.)

    * Color Hue preview bar styles with variant hues or hue gradients can be right clicked to adjust the current Hue. This is handy for uniformly rotating the hue of several elements in quick succession.

    * Added optional toggleable Hue Zone modifiers. Press "W" to display the hue strips as separated bars. Press "Q" for partial desaturation.

    * 15 new themes come with the download, combined with the prior 25, for a total of 40 themes in all, including some variations.

    * Various bug fixes, and optimizations.

    * Happy Valentines Day, all. :)

    Download

    ThemeEditor_r4_(win64).zip

    ThemeEditor_r4_(win32).zip

    Themes Bundle - Fisholith Themes v2.zip

    (This is the Themes bundle, by itself. Note, the Editor downloads include this bundle.)

    Theme Editor r4

    New Themes

    fi_FlatLight

    fi_GameJolt

    (Like the Scirra Site theme I made for the first bundle, this is based on the GameJolt site colors. Also like the Scirra Site theme, no one asked me to create it or anything, I just kind of like the colors. This is probably overkill as a disclaimer, but better safe than sorry.)

    fi_GraySoft

    fi_GrayTech

    fi_GrimGreen

    fi_LinedPaper

    fi_Mint

    fi_MutePastel

    fi_Neodymium

    fi_NeodymiumComBlue (Neodymium with Blue tinted comments)

    fi_Oasis

    fi_RedTailBright

    fi_RedTailBright_selPink

    fi_StoneFlax

    fi_StoneViolet