WackyToaster's Forum Posts

  • Just wanted to show even with changing values like the picture below it does not work. It only registers the first click and then wont come back.

    Ah, I saw another thing: since events are executed from top to bottom, it will first send the platform left, set directionID to "right" and then instantly after the second condition will be true, sending the platform right again and resetting the directionID to "left". You have to use an "else" in the second condition.

  • This doesn't work because both Tweens send the Platform to the same position X = 1200. One of them should be different.

  • Isn't this the main benefit of a tree structure, that sparse areas can just be one large node/cell and it only sub-divides where many instances are?

    I think the issue is that an infinite area cannot really be devided into two smaller areas as a quadtree does, because mathematically speaking infinity/2 = infinity. And a tree structure also has the limit of how many times it can divide. Even if we assume a limited size of 1 million x 1 million units, a quadtree depth of 4 would have the smallest cell size be 125k units, which possibly still contains a vast amount of instances.

    What about a plugin that can be placed like a sprite though? For infinite games you'd pin it to the player and ignore everything outside. The object could easily be adjusted with the properties bar and it being an object rather than being buried in the depths of the engine allows to tap into its optimization outside of just collision detection. It would have a "Pick candidates" action that can be called to pick the candidates from the relevant cells. This then allows to do whatever with the picked instances, be it "is overlapping" or any kind of loop. Although that means that the engine builds both collision cells and the tree then for the instances, which could again be not ideal.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have the feeling that just with construct events you might not have much luck. You can load the binary data and then convert it into either text or base64. Are you trying to make a hexeditor or something? What exactly are you trying to achieve?

    I'm also not very familiar with hexadecimal values in general. Maybe this helps you? byby.dev/js-hex-to-decimal

  • According to the manual

    construct.net/en/make-games/manuals/construct-3/plugin-reference/filesystem

    List content

    nly applies to folder pickers. Retrieves a list of all files and folders within a previously picked folder. The Folder path identifies a subfolder to list the contents for, or can be left empty to list the contents of the originally picked folder. The File tag is optional and allows identifying when the listing operation completes or fails with the On file operation complete/error triggers. Once completed, the available files and folders can be accessed with the FileCount, FileNameAt, FolderCount and FolderNameAt expressions.

    So you'll make a loop using FolderCount, get FolderNameAt(loopindex) and then also list that content. You'll probably want to set this up so it runs recursively until no more folders are found.

  • I stand corrected, this is the best vampire survivors example I found, by fedca I guess I wasn't up-to-date.

    drive.google.com/file/d/1xL7J-6fcYV0DROR24FHLW_w1j78QgD4a/view

    BUT the example does not even use the collision system, it uses the physics behavior, which I assume uses it's own implementation and also runs as wasm. I don't particularly like working with the physics behavior though, it rubs me the wrong way, but that's besides the point. So I change my statement to: I have not seen a vampire survivors example that performs well that uses default methods of collision detection. I don't have any examples at hand, I just vaguely remember that one from r0j0hound.

    I'd be curious if tuning collision cell size (or even better: allowing us users to tune the collision cell size) would improve things already. It seems quite clear that at least the current settings do not fare well with densly packed sprites, due to the collision cell size. And that rBush thing Fedca just "hacked in", wow this thing is fast. :D I've never heard of it before.

  • I'd assume the los behavior shoots raycasts at all imagepoints to attempt to make sure that even if a small part of the object peeks out, it triggers the los. With such a small cone you'll shoot through these objects if it doesn't happen to hit an imagepoint + I think the objects being a obstacle themselves will potentially obscure image points on the backside that otherwise would trigger the los.

    Meaning small gaps can also fail to register los even if you set the cone bigger if no imagepoint happens to be visible behind the gap.

    I guess the way to mitigate that would be to cast a bunch of raycasts along the lines defined by the image points, rather than only the imagepoints themselves, with the tradeoff being that it's more expensive to do. Although I've been told raycasts are super cheap. OR you increase the amount of imagepoints but I don't think that's the smart way.

  • You'd first read in the file (or all files in your array if you want to load everything at once) With the "file system > Read binary file" action. This will automatically load the file into the selected binary data object. Once done loading, you can set the src tag to BinaryData.getURL. That should be it.

  • I don't think you need a variable for this? You can just use System > Set group active and activate/deactivate the entire group at will.

  • It's always so hard to read these copypasted events. I'd rather see a screenshot of the events.

    But I think the issue might be this line

    MyDictionary.Get(MyDictionary.CurrentValue)
    

    You are trying to get a value from the array, it should be

    MyDictionary.Get(MyDictionary.CurrentKey)
    

    And you are already looping through anyway, the current value is already availabe with just

    MyDictionary.CurrentValue
    
  • I usually don't do it either, but I do sometimes email myself various random files.

  • Well if you have any tips on possibly making it faster I'd appreciate it. But I honestly would really like to get access to the collision cell optimization in scripting and SDK.

    construct23.ideas.aha.io/ideas/C23-I-221

    construct23.ideas.aha.io/ideas/C23-I-408

    Or perhaps even a construct official quadtree implementation written by someone with more knowledge than me. I've talked with Federico a bit and he speculated a directly integrated quadtree would probably already be faster than getting instances through the runtime.

    construct23.ideas.aha.io/ideas/C23-I-433

    I can see the argument for it, especially since the massive success vampire survivors had, which is btw. also written in javascript. Spawns a lot of copycats of course, and I have yet to see a solution in C3 that doesn't slow my high-end PC to a crawl at 200ish instances even with nothing else happening. I would even think the current collision cells will not suffice for these type of games, considering a cell is the size of the entire screen.

    FWIW collision cells are not actually applicable to testOverlap(): the point is to eliminate even checking instances, so it is basically a filtering system that efficiently reduces the set of instances that you might call testOverlap() on. So it is not possible to implement collision cells within the testOverlap() method itself, it's something that has to come before it.

    Oh I'm aware of that, I just kinda worded it wrong.

  • I also have gotten stuck a little here and there and I think a one-line codeexample would have answered all the questions I had.

    For example:

    Create probability table from JSON

    Create a new probability table from a JSON string. The input should be an array of (weight: number, value: number|string) tuples.

    Google "What's a touple?" and only find a bunch of references to python scripting. Uhh... I ended up adding entries with events and then using "ProbabilityTableAsJSON" to export the json so I could figure out what it wants from me.

    All I needed was a single example like:

    	"[[100,'foo'],[50,'bar'],...]"
    

    And I could have gone "Ah ok, that's what it's supposed to look like".

    The scripting reference for Tweens is probably a good example in contrast.

    construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/behavior-interfaces/tween

  • You mean at runtime? Maybe with the browser object I guess?

    construct.net/en/make-games/manuals/construct-3/plugin-reference/browser

  • Just a heads-up. If you use scripting and email a .c3p file, some mailservers will rename all contained js fails for security reasons. So main.js will be renamed into main.j_ which will result in the project not being able to load anymore. To fix it you have to unzip it yourself and rename it back. Took me by surprise, thought it might be good to put this info out there.

    stackoverflow.com/questions/54385807/javascript-file-extensions-are-renamed-from-js-to-j