KICK4H4's Recent Forum Activity

  • Advanced Random probability tables turned out to be quite convoluted. I ended up using this script alongside a couple of C3 functions, one to set the seed and another to get the next value:

    https://github.com/davidbau/seedrandom

    Its a little hacky since id prefer to keep everything as native as possible. Maybe Advanced Random could be updated in the future to allow it to be either instanced or have tags to allow for multiple RNGs along with an expression to simply pull the next number.

  • Thanks for answering Nepeo.

    Using advanced random to override system random using a known seed guarantees the numbers it spits out will be predictable, but thats across the whole runtime, not as and when you might need them.

    For example: using advanced random to pre-generate levels will work. I want to generate levels in real-time, which looks like it will only work as long as I use a single probability table and dont override system random.

  • I simply need an expression to pull a stream of predictable numbers from a seeded RNG. Something like AdvancedRandom.Random(). I could give noise a try.

    Edit: Noise isnt random enough but using a probability table looks like it could be a workaround. Thanks for your help Fib!

  • That would work and I can use Random to get system random, but how do I get numbers from Advanced Random?

  • Im looking to seed the RNG so I can pull predictable random values when needed but the only way it looks like I can get at the values is to choose to seed the runtime and use Random? If the runtime is using the same RNG for it will break the sequence of numbers?

    Ideally what I need is something like "Seed <tag>" and have something like "Random <tag>" to pull from that stream of numbers. Or maybe instances of Advanced Random with its own Random action.

    Nepeo Am I missing something? :)

  • I have 2 different 8bitdo NES style bluetooth controllers which work great with construct and sync with my Android phone hassle free.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Trying to make an endless game that can load the next randomly selected "section" of the layout with the use of xml or json?

    If anyone has done this before or know how to do this I would like to know.

    Any help would be breatly appreciated!

    Thanks!

    Yeah im doing an endless game which was generating levels on-the-fly like you see in a lot of examples. I decided to pre-generate and store level/section data because I wanted seeded level generation so players could all play the exact same level as a 'daily challenge'. Theres also other level generating tasks that having the data stored can benefit from.

    Advanced Random is great, but its global and only allows a single stream of numbers. It would be great if the RNG had some kind of tagging system like a lot of other Construct behaviours.

    You could just store a bank of numbers that you can reference for generation, but I preferred to make a generator that stores objects to spawn using a queue. Its just a JSON array containing a list of JSON objects in each element. Each array element is read every x pixels and the code goes through the corresponding list and spawns anything it needs to.

    It works. I tried other methods like wide layouts and spawning all the objects at the start but it ran into 100's of objects and you get the bloat of checking to see if they are on-screen and other triggering issues.

  • I just roll my own custom CreateObject function and pass it parameters.

  • Is it an apk or running in the browser? There is evidence of poor framerates on certain devices when running apks. Try running your game using remote preview.

  • Thanks R0J0hound that works like a charm! Thank you for the additional explanation!

  • I know we have some number wizards on here

    I have a scrollto behaviour attached to a camera sprite and I want to move the camera sprite around the layer and have the the layout zoom in on the camera sprite accordingly based on its distance from the layer center. It kind of acts as a bounded scale that never displays the outside of a layer.

    I can do:

    set layout scale -> <layer middle x> / <camera sprite x>  [/code:2xxb67lw] which works great, but only for values less than the center point on the x axis. It wont work for the opposite direction or y directions. 
    Ive tried using distance and using a scale thats an average of x and y which kind of works but isnt accurate.
  • The Renderer system expression returns canvas2d or webgl?

KICK4H4's avatar

KICK4H4

Early Adopter

Member since 25 May, 2014

None one is following KICK4H4 yet!

Trophy Case

  • 10-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies