Alderin's Forum Posts

  • 7 posts
  • Here is the Git tutorial version instead of the SVN:

    construct.net/en/tutorials/collaborate-construct-2390

    (It is linked from the SVN tutorial, but I thought it would be good to add here.)

  • It was something simple: When syncing Object Instance Variables, do NOT put a "client value tag" for any value that is not a client Input variable.

  • Further stripped the project down to the barest parts needed to see the problem. Removed upgrades I had made to the tutorial patterns. Tried to slow down the updates to those Instance variables, thinking they might update too often, but that did not correct the issue. The host displays the warmup/cooldown correctly for all players. The Peers see the host warmup/cooldown correctly, but not themselves or other peers. In debug, the "warm" and "cool" Instance variables don't change on Peers except for the Host's Player object. Tried in the latest beta, same results.

    r215 c3p: drive.google.com/file/d/1ujpy4lKdbT09HLqfFZMRPhz4N08zuoLh/view

    I feel like I'm missing something simple somewhere, because everything else just works, and this ALMOST works, but I can't find a simple way to "force" an Instance variable update to a Peer.

  • I have stripped down my project for an example, removed my project name, removed the "Server" choice system, removed many unrelated functions and features, and replaced images with functional placeholder equivalents.

    Here is the resulting Project:

    drive.google.com/file/d/1ujpy4lKdbT09HLqfFZMRPhz4N08zuoLh/view

    You can only see the problem if you compare the Host and Peer displays, or at least the Peer debug data showing the Instance Variables.

    Thanks again for any help!

  • Thanks in advance for reading.

    I've been fighting this for a bit: I have a mechanic in my game where the main weapon has a "warm up" between click and actually firing, and a "cool down" after that. The Player object has instance variables for "warm" and "cool", these are in the Start of Layout with the other Instance Variable Sync commands (that work), but they never Sync. I've tried Linear (which makes the most sense) and None for Interpolation. I've tried both Very Low and Low bandwidth, as the values are always integer and lower than 100. The value is only set by the Host, but the Peer should be able to use the value for display purposes.

    The only thing I can think of is that it is updated too often so the Multiplayer system never Syncs it, since it is updated every tick, except that it does properly sync to Peers for the Host Player object. Other Synced Instance Variables all work: a 1 byte "active" bitmask set for player activities, a 1 byte "inputs" (as in the tutorials), HUID ("Host UID" for specifically identifying objects by the host's UID), TeamID, and lookx and looky for the mouse position. These all work, but "warm" and "cold" don't sync from Host to Peer except for the Host's Player object.

    I've even changed their names a couple of times, changed their position in the list of Sync Instance Variables on Start of Layout, and tried putting the Sync Instance Variable definition into the Host's Player Object Creation for newly connected Peers. No change. The Host's Player's gun warms up, fires, and cools down on the Peer display exactly as it should, any Peers on the Peer display don't (including the local one). The Peers ALL warm up, fire, and cool down as they should on the Host display. The display code is common, based entirely on the Player Object's Instance Variables.

    Sorry for the wall of text, but I'm stumped. Thanks for any help or ideas on how to move forward!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well, with many hours of work, an Array, two Functions, and half a dozen global variables, I finally have (most of) it working. I can add and remove modules just by changing the number of modules in the Player object's instance variable, and the HUD properly adjusts to the new number. While it is technically a loop, it only adds or removes one module per tick until the numbers are correct.

    I keep the UID of each created indicator in an Array, so I can get the UID from At() and then Pick instance with UID. I haven't gotten to the part where I change the Animation to indicate Full or not full quite yet, but it won't be too hard from here.

    Thanks for reading.

  • I am probably overthinking this.

    My game has a "Cargo" mechanic, and the player's ship can have a variable number of Cargo Modules that I want to represent in the HUD as Full or not full. But, since the plan is for ships to be player designed and altered during gameplay, I can't know what the maximum number of Cargo Modules will be, so I can't just place 5 or 10 in the HUD and call it done.

    This lead me to the thought of creating an irregular grid for the HUD display, and adding (and/or removing) Cargo Module indicators to the grid as needed. This is where I run into a wall of "How do I do that?" I have an event chain that will only run when the Player's Cargo Modules value changes, and an event chain that only runs when the Player's Cargo amount changes.

    How do I do the math loop in an event to fill in the grid when more or less sprites are needed?

    How do I select the correct HUD display sprite to update from the list of System->CreateObject created sprites?

    Thanks in advance!

    Tagged:

  • 7 posts