Zakeru's Forum Posts

  • Ah ah thanks. It's actually combining several of your ideas that made me think about it.

    I see one problem with using that solution though : in case anybody is disconnected and has to connect back, he will get a new number. So a single disconnection would ruin an entire gaming session. Well, disconnections are a problem anyway, it would be better if that does not happen. But that is something I should think about maybe (but later ).

    Concerning the multiplayer, I read that tutorial, but it is still unclear to me how events work in multiplayer. What is hard to understand, in particular, is what is common to all players and what is specific to each. For example, when you have a global variable, it's neither in the host or peer related event so it applies to both, but when you put an event to change that variable, each player can get a specific value (like in our example above). Another example, when I create an object such as a dictionnary on any layout, how does this work in a multiplayer ? Does every player gets its own dictionnary or do they all write in the same one ?

    And when you say to give that task to the host, do you mean the host is the one generating the smart random and then send their numbers to each peer ? Or even the peer has access to the smart random once it is create and so the host just has to create it ?

  • Well it is still very confusing to me how this whole multiplayer thing work, so maybe my explanations are not good. But let's suppose I don't actually put a limit to the number of member in a group. So nobody check for that (neither host nor peer nor the system or whatever).

    Instead, the group value is just given to every player by one and only infinite string of "1-2-3" loops (in random order) generated by the smart random. Upon connexion, every player gets the next value in the smart random list. Of course, this would work only if it is possible to use the same string of "1-2-3" to set the group value of every player. If this is possible, then, everytime the total number of player is a multiple of 3, I would automatically get a balanced distribution of player. The advantage is that I would not need to make any modification if I want to have bigger groups, just keeping sure the total number of player is a multiple of 3 would guarantee that the groups are balanced.

    I don't know if this is more clear...

  • [quote:2a1zbnt8]Since there is a player limit for each room, you need to take into consideration whether the room is already full or not.

    But with a threshold of 0 in the smart random, I would always get a balanced distribution. So even if I do not check if the group is full, the balance would still be maintained. For example, if the smart random generates something like this : 1-3-2 / 2-1-3 / 3-1-2 / 3-1-2 / 3-2-1 / 2-3-1 / 1-3-2 / 1-2-3 / 1-3-2 / ... (where "/" represents the end of a loop)

    As long as I have a number of player that is a multiple of 3, I would always get the exact same number of players in each group, right ? I am sorry to insist, I just want to be sure I understood what is wrong with this solution.

    [quote:2a1zbnt8]Did you try what I wrote on my first post? This would make it more compact and easier to handle.

    I wanted to try it, but I am using the free version for now, so I can't use "families" right now. I will have to keep that for later (I mentioned it in one of my edits above, but since it's a mess, you may have missed it XD)

    Edit : By the way, I will go for a non separated host for now and think about an alternative if the game is really running too slow. Because that is one fewer computer to put in a room, and that is a non negligible advantage

    Once again, thank you very much for your help (you definitely earned a special place in my thesis' acknowledgments section ha ha).

  • So your advices made me think about something : let's consider that everybody is on the same room, but the host acts as a filter for messages and thus creates the "groups" of players.

    All I need is a global variable "group" for each player that is set on connection by smart random (start 1, end 3, threshold 0). Doing this would guarantee the balance between groups right ?

    This solution, if it works, would be good for several reasons. I actually need to create several versions of the game with slightly different parameters. Sometimes, I would need more than 3 groups (so I would need to change only the "end" value of the smart random). Sometimes, I would like to have just 1 player being able to see messages from 2 or more groups (so I would just need to add "& X & Y" to his "group" value).

    What do you think about it ? I haven't tried it yet, I'm actually thinking about how to do it properly.

    Also, when you say it will be hard for the host CPU, do you think that would actually take a lot of time to deal with all the comparisons ? More than 30 seconds ? Several minutes ? Of course it depends on the computer, but it's just to get an idea of how long it would take.

    Do you think it is best if the host is not a player and I just use my best computer only to deal with the host's tasks ?

    Edit : Ok, I tried something but I don't know if that would work. So, upon joining the room, each player get a random group value (smart random, 1, 3, threshold 0)

    When you are a peer, you send message with a tag corresponding to your group value. And even if you get messages from everyone, you display only those that has a tag corresponding to your group value.

    When you are the host, you also send message with a tag corresponding to your group value and you broadcast every message you get. However, you only display those who have a tag corresponding to your group value.

    I updated the capx. file, I edited the yellow information texts in event sheets to explain what I intended to do. Do you think that would work ?

    dropbox.com/s/247hslkh28garey/ChatProject.capx?dl=0

  • Wow, what a long and detailed answer. Thank you very much for your help, I will try everything you suggested !

    Also, I realized the login/login events layouts does not appear when you open the .capx, maybe that is why you couldn't see what I did to send players to different rooms.

    Edits :

    • I can't use families right now because I am using the free version, but I should be able to buy a license soon, so I will keep that for later.
    • 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 ?
    • The changes I made to login/login events layouts have not been save apparently, my bad.
  • Hello again everybody,

    I am sorry for the double post, but I wanted to narrow down my questions and share my capx for people who think they can help me.

    So the link is here : dropbox.com/s/vzce7mxqet4o12d/ChatProject.capx?dl=0 (I don't know if I am doing this right)

    As you can see, the game is not very sophisticated. Actually, I don't have the sprites I want to use in the end, so I just use random pictures for now. I have 3 major problems so far:

    • 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. For exemple, 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.
    • I want the "creatures" (presently represented with big numbers from 1 to 30) to appear in a random order and appear only once. 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 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. Also it would be cool if I could save what is written so it could appear on the "previous creatures" page later.

    Once again, I don't want you to do it for me, but just to tell me if you think this seems possible and what tutorial I should read. Thank you in advance for your help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello everyone,

    I need to create a game for a research project (in linguistics), but I don't know anything about creating games. I have been trying to use Construct 2 and I think it is a very interesting tool. Nevertheless, I am not sure if what I am trying to do is possible. Here is a description of what I am trying to do :

    I need to create a multiplayer game in which players use a chat box to communicate. So, I am currently using the multiplayer chat room example as a basis. The purpose of the game is to name creatures. So, basically, players see a picture of a creature, they enter the name they want in a textbox, and they click on a "vote" button. They can chat during the whole process to come to an agreement. Players get points according to the number of other players who gave the same answer as them. Players must be separated in different chatrooms, so they can't communicate with everybody, but only with the people in their room.

    For example, if there are 9 players, they are divided in 3 groups of 3 players. Each player can chat with the two others in the same group, but not with the 6 others from the other groups. However, they get points even if people from others groups gave the same name as they did.

    I know it doesn't sound like a very entertaining game, but remember it's for research purpose. So here is a list of the most important questions I have :

    • Does this project seem doable on Construct 2 ?
    • Is it possible to make the system do an action only when every player answered ? (waiting for everyone to vote, then compare answers, give points and change picture)
    • Is it possible to compare a text answer across several chat rooms ?
    • Is it possible to make players change from one room to another, randomly, during the game ?

    Also, I saw there are a looooot of tutorials out there. So it would really help if you could indicate me which are the one you think will be the most important for me to read. And of course, any advice is welcome !

    If anything was not clear or you need more details, please ask.

    Edit : I realised that it was actually better to use a timer instead of waiting for every player to do an action, so forget about question 2.

    Here I am having a little problem : I am trying to make a random sprite appear every X seconds. I have a global variable "spawn" which is set to a floor random value between 1 and 30 every time an X second timer reach 0. And then I asked the system to create sprite 1 when "spawn" = 1, sprite 2 when "spawn" = 2, etc. 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 ?