randomly's Recent Forum Activity

  • [quote:223lsmr0]By the way, concerning the CPU power. I'm planning to have everybody playing in the same place, so I guess I could use a LAN and that would help a lot, right ?

    Well, that would at least double the upload/download speed.

    This would not decrease the amount the host has to deal with though since the data stays the same, it is just delivered faster.

  • Update

    rex_firebase_userid2id plugin: add "Action:Remove User ID"

    Awesome, thanks for the fast response.

  • Well did you add the instance variable to the family?

    You need an instance variable for the family which you will use to calculate the values.

  • Let me give you an example why this doesn't work.

    Let's go event by event.

    • You start with ActiveCharacter=1 and ActiveScreen=2
    • You press left on the Gamepad
    • Line 6 triggers and sets ActiveCharacter to 2
    • In the same tick, the event in line 9 triggers since ActiveCharacter is now 2 and sets it back to 1

    To you, this looks like nothing happened.

    The mouse events work since there can only be one mouse event happening at the same time.

    What you need to do, is replace ActiveCharacter=2 in line 8 with "Else".

  • Awesome graphic style.

    I guess that's pre-rendered Sprites right?

  • [quote:3pclflqo]On the debugger, I can see the "spawn" variable changing exactly as I wanted to, but the sprite never appear. Any idea what I did wrong ?

    Try this:

    • Add a family containing all the sprites, e.g."Sprites"
    • Add a family instance variable, e.g. "index"
    • Edit that variable for every Sprite and set it to the Sprite's number (don't set it in the event sheet, set it in the object properties)
    • Delete that long chain of conditions you referred to (Spawn=X, Spawn=Y,...) and replace it by this:

    ____________________________________________________________

    [quote:3pclflqo]I know I will be working with exactly 18 players, so I want to have exactly 6 in each room, but it has to be random.

    [quote:3pclflqo]I found a way to lead players to different chatrooms, but I am not satisfied since I have no way to keep balance between the different rooms.

    In your .capx, I can't find the way you are managing the different chatrooms...

    The way I would go about this, is the following:

    • since the Multiplayer-plugin included rooms can't communicate between each other, we need to have multiple game rooms in one actual multiplayer room
    • To assign peers to different rooms on joining, I'd use a global variable storing the room number you are in and using that variable to differentiate between messages that come from the host (to determine whether that message is important to you).

    I'd also use three dictionaries, one for each room, to determine how many people there are in one room and whether it is full or not.

    Those dictionaries are used by the host. When a peer joins, the host will go through the dictionaries one by one. As soon as one room is found where the dictionary's keycount is below 6, it will send the room number to the peer and add the peer to the dictionary. Randomness should be easy to add here.

    ________________________________________________________________

    [quote:3pclflqo]I want the "creatures" (presently represented with big numbers from 1 to 30) to appear in a random order and appear only once.

    I'd recommend you using blackhornet 's Smart Random plugin which allows you to get a random value out of a set amount of numbers while assuring that a set amount of numbers doesn't appear multiple times.

    _________________________________________________________________

    [quote:3pclflqo]A new one should appear every time the timer reaches 0. Here, I can't even make them appear at all and I don't understand why.

    I'd recommend giving the "creature distribution" task to the host only.

    The host would either have a "Every X seconds" or a "timer" behavior.

    (If you use the timer, broadcast the random value under the "On timer" event. Immediately after that, start a new timer)

    Try to transfer this task to the host only and see whether that fixes the issue, we will deal with that later if the problem remains.

    __________________________________________________________________

    [quote:3pclflqo]I still have no idea at all for how to compare what players wrote in the "answer" textbox and give them point for every other player that gave the same answer.

    Again, the best solution is to give those tasks to the host.

    Answer textbox:

    When a peer submits the content of the "answer" textbox, it will send it to the host. The host will store that in a dictionary, one for each room, or a single array.

    When the host receives an answer, he will check whether that answer already exists in the appropriate dictionary/array coordinate. If it does, it will add one to the value (dictionary) or the array's Z/Y value (array).

    If it doesn't exist yet, the host will add a new key (dict) or a new Y value (array).

    (In the array, the X value will be the room.)

    Note: dictionaries for this will be easier to handle, while an array will be more compact.

    Points for players:

    This will be a combination of host-/peer-sided to improve performance on the host.

    The host will use the same dictionaries /array as mentioned above.

    (But since points are room-independent, we don't need to compare the room variables here)

    Depending on whether you want the points to be given immediately after one creature round is over or after the whole game is over, there are different approaches.

    Immediately:

    When the peer submits an answer, he will save what he submitted in a variable to be able to send that to the host at the end of the creature round.

    When the round is over, he will send that value to the host.

    The host then checks with his dictionaries/array and see whether (and how many times) that answer has been given and send the appropriate amount of points to the peer that sent the answer.

    At the end:

    The peer will store all his answers in a dictionary, sorted historically.

    When the game is over, the peer will send his dictionary (as JSON) to the host. The host will have a dictionary for each peer which he loads from the JSON he just received.

    he will then go through his dictionaries/array and see how many times each item in the dictionary has been given before and give points.

    Note: since it's probably very unlikely that the same name will appear multiple times across different creatures, we can compare all the dictionaries/the whole array without differentiating between rounds.

    ______________________________________________________________

    [quote:3pclflqo]tell me if you think this seems possible

    Not a casual task, but yes, it is possible.

    Though I'd recommend you exporting the project to NW.js later since all that comparing on the host-side will take up some CPU and NW.js can use more CPU power than a browser tab.

    (Assuming, you don't use necessarily use high-end PCs only for that project)

    _____________________________________________________________

    [quote:3pclflqo]what tutorial I should read

    That depends on what topics you think you need help with. I won't put out links for every single object/behavior that will be used in this project, since that would be quite an amount.

    And since your project is a very specific, non-generic one, there won't be a tutorial tailored to your project.

    If you don't feel sure about a specific element in your project (e.g. arrays or dictionaries), just search for a tutorial for that or ask here or in the forum.

    ___________________________________________________________________

    ___________________________________________________________________

    That should be about it.

    *phew*

    PS: Don't think I am a C2 expert. I started using C2 in September this year, so I am in no way worth saying that I know everything about it. I just provide what I think is the best option.

    I am sure there are better ways to do this (that I don't know of), but this is the way I would do it.

  • Well, the image you uploaded shows no black bar inside the actual frame (the grey bounding box).

    That means that what causes the black bar, is that your project's width and height don't match with the browser rendering window.

    Could you try exporting to NW.js (all three checkboxes unchecked) and tell me what you see?

  • rexrainbow tried using userid2id.

    Works like a charm except that I can't seem to actually change an ID.

    I figured I can set as many ID's as I want but as soon as I want to set an ID with a UserID that is already bound to an ID. (The one I want to change)

    It triggers "On request ID failed".

    To have an effective username system, I would need to

    • Trigger success when trying to set an ID that is bound to my UserID
    • Trigger error when trying to set an ID that is already bound to a different UserID

    (Or is it just me being too dumb to use your awesome plugin? O_o)

    Thank you for your help.

    EDIT: any way to delete a ID would resolve that issue too.

  • Goddamnit, I'm too late.

    Anyways, if anybody wants a non-plugin variant...purely C2 code...

    here's my capx...

    Download

  • i need to replace the letters with sprites

    Alright, to do that, you need to do the following:

    • Insert your sprites
    • Add all sprites that contain money to a family, e.g. "money"
    • Give the family an instance variable, e.g. "value" and the "Drag & Drop" behavior
    • Replace "int(money.Text)" by "money.value"
    • Obviously replace the "money" family in my .capx with the new family
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Alright, with 2, I still don't know what you want. I asked you whether you want this or that and you answered with *yes*...

    Alright, with 3, you can simply add a layer, call it "popup" for example. It contains whatever you want in your popup.

    Now, you set the layers initial visibility to "invisible" and set it to "visible" whenever you want the popup to appear.

  • no, your link isn't work again =(

    Updated the link again. Dropbox seems to change the shared links without my knowledge..

    ___

    About the PHP stuff: I have no knowledge whatsoever concerning PHP.

    And I won't start learning it now, sorry.

    I think, it will be better if you start a new thread with the messaging layout you got and focus that thread on PHP, so other users who actually know PHP can help you.

randomly's avatar

randomly

Member since 26 Sep, 2016

Twitter
randomly has 1 followers

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies