Nepeo's Recent Forum Activity

  • The eventsheet blocks any other execution until it has completed. You need to split the work up somehow, ideally into chunks that occur in under 16ms. A wait action for 0 seconds should pause work until the next tick, allowing the layout to render.

    It can be quite hard to decide when to pause, often it's easier to pause more often than you need which slows down your loading significantly. But at least if your not blocking anymore you can show a nice loading animation.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Haha well perhaps not a mind reader, I just happen to remember that technique! Not that I ever actually implemented it, my experiments used Perlin noise with a few transforms on top. I had a dig around in my bookmarks to see if I had anything else you might find interesting in there:

    Simulating fluid movement with cellular automata

    Visualising Poisson disc sampling, Fisher Yates shuffle, Sorting and Maze generation algorithms ( Poisson and maze generation might be of interest )

    Maze/Dungeon generation

    Caves and terrain with noise

    Book of shader Interactive book where you can modify the examples

    Youtuber Sebastian Lague does some interesting game dev/procedural generation tutorials.

  • Nepeo What about the possibility of adding a seed to probabilities?

    Well in a way it's already seeded, it uses the PRNG that AdvancedRandom includes. Each time you use the expression to get a value from it a new random number is generated which is then used to pick one of the options. If your using a fixed seed, and the order of PRNG uses is predictable then you would get the same output each time.

  • Thanks for explaining the reasoning boulerzzz the gradle depreciation issue is frustrating, but at least we can work around it with the auto refactoring for now. Keeping my ear to the ground for cordova updates...

  • Ah yeah that algorithm, I've actually looked at that in the past. I did a fair bit of reading on procedural terrain generation at one point and that was recommended for smoothing out caves.

    http://www.roguebasin.com/index.php?title=Cellular_Automata_Method_for_Generating_Random_Cave-Like_Levels

    https://gamedevelopment.tutsplus.com/tutorials/generate-random-cave-levels-using-cellular-automata--gamedev-9664

    https://gamedev.stackexchange.com/questions/154540/messy-results-from-simple-cellular-automata-algorithm

    I haven't done much cellular automata work in the past but I've tended to use 2 arrays; one to read from and another to write to. This prevents you from breaking your existing data. Then after processing all of them you swap the arrays. In C3 I did this by using a 3D array with a depth of 2, then alternating the read/write z index between 0 and 1.

    I think you could probably just perform a finite number of passes of your "smoothing" automata without trying to decided if it's "done"

  • Construct 2 is not forwards compatible with Construct 3. Someone might have ported the exporter to C3, you should ask around on the addon forum.

  • As I said the base requirements of a cryto PRNG do not require it to exhibit a better quality than a standard PRNG. There's many different qualities exhibited by different PRNG algorithms, and being cryptographically secure does not make one "the best". There are likely some which appear better, but also some which appear worse.

    Don't use cryptographic PRNGs in games. They are much slower, and will not exhibit any improvements for your players over a good quality standard PRNG. Even with a bad quality one players are unlikely to notice any difference.

  • I think the file plugin we use in the c3runtime to get some assets sets the latter 2 as it's intended for general purpose file access, not sure about the 1st permission. I have been meaning to look into replacing the file plugin with something with less required permissions.

    In terms of removing the permissions you can likely do it by exporting as an Android Studio project, editing them out of the AndroidManifest.xml file and building a signed APK.

    Apparently some version of Google Play Services will add READ_PHONE_STATE and WRITE_EXTERNAL_STORAGE:

    stackoverflow.com/questions/39668549/why-has-the-read-phone-state-permission-been-added

  • I'm not that familiar with Pascal, although I believe Diego knows some. Depending on the language the source code is often compiled to a series of linear instructions. A "do...while" loop would compile to the conditional block followed by a conditional jump to the start. This is pretty similar to what pascal does ( probably not a coincidence ). A "while" loop has a conditional jump at the start that skips the entire block if the condition is false, and a normal jump at the end of the block that returns to the conditional section. I wasn't really sure what sort of notation to use here, so ended up with something like BASIC... ( had to outdo your pascal after all ;) ).

    do...while

    10 code
    20 conditional jump ( 10 )
    

    while

    10 conditional jump ( 40 )
    20 code
    30 jump ( 10 )
    40 ...
    

    Interestingly a C style "for" loop

    for (let i = 0 i < 10; i++) {
    	print(i);
    }
    

    is basically just sugar over the while loop

    10 let i = 10
    20 conditional jump ( 60 )
    30 code
    40 i = i + 1
    50 jump ( 20 )
    60 ...
    

    Can read more about it in the "Crafting interpreters" book, I think Writing A Compiler In Go talks about it as well but I can't remember.

  • Sounds equivalent to a do...while loop. I can't say I really use them myself, I don't find it that common that I want to execute at least 1 pass of the block before checking the condition. In fact the example you gave works fine without. I wrote up a few variants based on the example you gave:

    let found = false;
    do {
     const x = time() % 10;
     if (x == 0)
     	found = true;
    }
    while (found == false)
    

    Fairly simple usage of the do...while loop in JS, uses a variable external to the statement to keep track of the "found" state. Can loop forever.

    while (true) {
     const x = time() % 10;
     if (x == 0)
     	break;
    }
    

    Infinite while loop with a break when the condition is met, simple and easy to read. Can loop forever.

    let repeats = 10;
    while (repeats-- > 0) {
     const x = time() % 10;
     if (x == 0)
     	break;
    }
    

    Same as before but will only repeat a certain number of times, so it won't loop forever.

    let found = false;
    while (found == false) {
     const x = time() % 10;
     if (x == 0)
     	found = true;
    }
    

    Just a normal while loop instead of a do...while, works exactly the same in this example.

    loop {
     let x = time() % 10;
     if (x == 0)
     	break;
    }
    

    Special mention here, the Rust language actually has a "loop" statement, while is basically the same as while (true) {}. Functionally identical, and easy replaced with a normal while loop. But I find the simplicity of it pleasant, something about putting "true" as the condition for a while loop has always bugged me.

  • TILK the default random number generator uses the JavaScript Math.random.

    Returns a Number value with positive sign, greater than or equal to 0 but less than 1, chosen randomly or pseudo randomly with approximately uniform distribution over that range, using an implementation-dependent algorithm or strategy. This function takes no arguments.

    Each Math.random function created for distinct code Realms must produce a distinct sequence of values from successive calls.

    The actual implementation of this method differs from browser to browser. I believe Chrome uses the xorshift128+ algorithm for this. All psuedo random number generators require a seed, the difference here being that the JS Math.random method doesn't allow you to choose a seed. It is chosen by the browser using a source of randomness provided by the operating system.

    We use xorshiro256** for our random number generator, which is of the same family as xorshift128+. I would expect the quality levels to be fairly similar to the Chrome one. I will note neither of these methods are considered "cryptographically secure" but that doesn't mean the quality is poorer. It just means that you cannot use the output of the generator to derive other values in the sequence ( before or after the current output ). They can still exhibit excellent pseudo randomness and distribution.

  • The GMTK Game Jam was fairly recently, there's normally a Youtube video that goes with it show off the best games. It doesn't appear that this years has been published yet but you always look at last years. There's normally some very interesting entries and it takes place over a weekend so won't be too complex.

Nepeo's avatar

Nepeo

Member since 8 Mar, 2016

Twitter
Nepeo has 583,792 followers

Trophy Case

  • 8-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • x3
    Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

13/44
How to earn trophies

Blogs