CairoCreativeStudios's Forum Posts

  • Nested loops are something to avoid if you can.

    Every tick doesn't slow the game down, as it doesn't actually do anything. The event would be the same if you removed that condition. "Every tick" functions as more of a title than an actual condition.

    If your goal is performance, the only things you can really do to improve it is to optimize your code, with almost no redundancy, and loops only when necessary, and don't use big images. If your image looks too pixelized, use an effect to smooth it out. Memory is one of the biggest concerns, especially on mobile. Typically the processors and graphics chips on mobile devices are decent enough to handle a fair amount of processes and effects.

  • In reference to sharing variables/information between players, I'd create an invisible object that's created when a player joins (both Host and Peer), and is associated with that player. Each player's info/variables would be added to those objects. Additionally, to sync that information, just follow the multiplayer tutorial and sync objects, as well as their instance variables (similarly to how Input is synced in the examples).

    For any text based data, you'll obviously want to send that as a message between the users. If I were you, I'd store each user's hand (deck) on the host's side, regardless of where it is seen. Store each user's hand/deck in an array. When a value on each changes, send that array to the peers. For example, if a card is added/removed from a players hand, send a message through Multiplayer "'UPDATE_HAND', *HandArray.AsJson*". Make an event for when that message is received, set the Peer's array to the JSON in the message.

    If you have any trouble, let me know. I don't have Construct 3, so I can't open your project.

  • In the meantime, I've decided to roll with the NW/Phonegap method. I'll still be looking out for a crossplatform solution, though.

  • Ashley, this is a question directly for you, as I'm not super experienced in all the details of Javascript.

    I have a couple of more advanced questions:

    1. Does LocalStorage exist in RAM/Memory at all times when the webpage (game) is loaded up?

    2. Do you know the current maximum size in bytes that LocalStorage is able to use in Chrome, NW, and Android?

    3. Is there a more efficient, cross-platform, method of saving and loading data? (Locally, editting project files at runtime)

    My project contains an editor that extends a lot of Construct2/3's base functionality, and I've made it so that I can import sprites/tilemaps and edit them within this new editor. The details of the editor itself are a bit complicated, but it's designed to allow the user to export the project, import it back into C2/3, change a variable, and export the game from Construct.

    The editor is organized by grouping Objects (using instances of a single object with multiple behaviors, with extra code within the Editor project to add functionality), 3D info (using Q3D), Sounds, Music, etc. in a Map, which is then loaded through a custom scripting interface on demand (Set up this way for level streaming, like UE's), therefore allowing the user to choose when and what information is using memory.

    If the editor were designed specifically for game projects, this would probably actually work, as maps could be saved as separate files within Project Files, and later loaded on demand using AJAX. This isn't the case though, as the project is built to allow for instant switching between Editor and Runtime modes by command, as well as limiting control in the editor to allow players to create Maps, "Missions" (as they're called in my game, they're just story segments), etc. for the game and share them online.

    Now, as you can see, the concern when using LocalStorage would be the amount of RAM used, if at all, both in the fact that a limit apparently exists and in the possibility of slowing down the game. The possibility that a project wouldn't reach the supposed 5MB or 12 MB limit?1 is slim to none, given all the information that exists within a single project (Storyboard and cinematic info, code, sprites/tilemaps, etc.).

    On both PC and Android, I could devise a method for each that uses NW/Phonegap to write to a file that references the projects/maps that have been created, but obviously this method only works for PC and Phonegap compatible platforms. My goal is to hopefully port my game to both Xbox One and Nintendo Switch (When they decide to open up the Webkit for development) and have map creation available on those platforms as well.

    So, after this far too long post, my question is, does a solution for this exist?

    EDIT: Something I hadn't considered is the fact that cross-platform play is becoming a norm now. If a solution to this didn't exist, it'd be fine. Most people have mobile devices, and though it'd be a bit annoying to have to build mods for the game on a different platform, the base game (modding and multiplayer) is free. Annoying, maybe, but I doubt many gamers would complain about this.

    Sources:

    1. https://stackoverflow.com/questions/7267354/javascript-memory-and-html5-localstorage-limitations-on-smartphones

  • brunopalermo, nah, it's all good, I was wrong and arrogant.

  • brunopalermo, Ah, I see. Regardless, Ashley added to the manual to explain that the upper bound is exclusive.

  • AmpedRobot, in regard to your last post, did you say that you're using "is between 0 and 271" or "is between 0 and 270"? If so, that would be redundant.

    If you use both these conditions, the result will be the same as if you'd only used "is between 0 and 271".

    If what you want is to lock the angle at 270 or 90, just add round() to where you're setting the angle of movement.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • AmpedRobot, I'd suggest not trolling the forums. Regardless, here is the official explanation for why this was made the way it was, given by Ashley: https://www.scirra.com/forum/viewtopic.php?f=151&t=196944&p=1145722&sid=82f00f8702353c836fae08ae9b337140#p1145722

    dop2000, you were correct.

  • I make your words mine: If one is going discussing stuff in forums, even if they think they know what they're talking about, they should learn to check the freaking facts first. You're welcome.

    When did I ever say that? I may have acted like a smart ass, but I never said anything like this.

  • Gigatron, thanks for your time! Yeah, I actually modified this depth effect to modify X and Y shift amount based on the distance from the center of the screen, and then used the stepping that that parallax shader I linked used to make all the pixels line up correctly, and it's all working.

    Yeah, the way I was going to about it is going to sound stupid to anyone that knows anything about GLSL, I was just trying to hack the displacement to do what I'd just stated above. It doesn't make much sense not to just use this Depth Map effect and extend it though.

    Regardless, I'll be uploading this new effect here soon.

  • Ah! Haha there have been a few on another topic that were quite confused as to why this was set up the way it was, but explaining it that way makes a lot of sense.

    If it'd be easier you could just add to the manual to state that the upper bound is exclusive. That way if anyone ran into the issue they'd simply have to check the manual.

    Thanks for your time!

  • dop2000, Well, I definitely look like an ass. It simply seems practical that "between" wouldn't be inclusive by nature, but I guess that most people would disagree considering that all of the "between" functions we're seeing are inclusive.

  • Problem Description

    "Is Between Angles" does not return true if the value is equal to the upper bound.

    Attach a Capx

    https://www.dropbox.com/s/ipe8nen5g6ozq0s/Is%20Between%20Bug.capx?dl=0

    Description of Capx

    There are four text boxes.

    The first two use the "Is Between Values" condition, if(0<=0/10<=10){Set Text}

    The first two use the "Is Between Angles" condition, if(0<=0/10<=10){Set Text}

    Steps to Reproduce Bug

    Compare upper bound value in "Is Between Angles"

    Observed Result

    Setting the value to the upper bound of "Is Between Angles" does not return true.

    Expected Result

    The same result as "Is Between Values"

    Construct 2 Version ID

    r244

  • Wait a second. This is totally a bug. I'm going to report this correctly.

    "Is Between Values" and "Is Between Angles" work the same way. They're both logically wrong as it includes the bounds and the result is not implied in the title of the condition, but it would appear that this is very much a bug.