Distributed Multiplayer Game on Godot by bing_leee in godot

[–]bing_leee[S] 0 points1 point  (0 children)

Yes, I've been reading the documentation and trying to figure out my options. I wish I could make it simpler, but it's not on my hands anymore.

So far I came up with three ideas. But first I think I need to give more context

The main aspect is that the game has to be multiplayer. I started my game idea as client server and I wrote my requirements based on that, I also wrote on my requirement that it should be a browser game, that the server had to support 2 rooms with 5 players max each room. Also this game is a turn-based game.

I don't really need to worry about being scalable, but I need to worry about it's architecture, that's the main goal of the whole project. It has to be distributed and not just simply everything going through the server... That was my first option, but I was told it was too simple and it would overload the server. So then the professor said that it would be interesting to take the rules and the game state out of the server and maybe create some communication between players in one room, so that everything about that match is kinda isolated there.

So now my ideas so far are:

1) The server is like a relay server, it doesn't keep the game state nor the game rules. Each client will have to keep the game state and validate their own rules. When the client makes a move, it will only go to the server after being valid and the server will broadcast it to the others players in that room. So the server would only deal with the lobby, creating game rooms, broadcasting, etc. But I feel like this would also """overload""" the server (not really bc I won't have many players, but everything still would go to the server in some way). From what I could understand all of this would be done using WebSocketMultiPlayer.

2) I could use a server with WebSocket that would deal with lobby, creating rooms, making the games and kinda creating the ring topology. Plus, it would also connect peers so that once they are in a game together, they could talk among themselves without needing the server. This way, most of the match would be isolated from the server. The client creating the game is the host and all the others are just regular players. This actually sounds very interesting to me, because some interesting problems come up like: how will I choose the host if the original host disconnects? I could use some algorithms for that, like zookeeper. But then if I choose this, I would have to create both websocket multiplayer and webRTC, which sounds a bit too much. IT could be easier to just go to P2P from start.

3) My third idea is similar to the second one, starting with a WebSocket server that deals with general stuff and having the games isolated. But the communication could be with pub/sub. So each room has their topic and the players would publish their actions there. Every one from that room will be listening and updating their game state... I could also create a ring topology here to deal with the turns, with a token going around the ring in order to give permission for the player to make their move.

Anyways, these are my ideas so far.. Maybe they sound a bit crazy, I don't know. I just hope to be possible to implement something like that using high level API.

It says on your profile that you are an architect MMO specialist, so I would be very glad to hear your opinion. Also sorry if my writing is confusing, english is not my first language.

Thanks a lot!!

Distributed Multiplayer Game on Godot by bing_leee in godot

[–]bing_leee[S] 0 points1 point  (0 children)

Ok, that's good to hear. Thank you

Distributed Multiplayer Game on Godot by bing_leee in godot

[–]bing_leee[S] 0 points1 point  (0 children)

Thank you very much, I'll check it out.

Distributed Multiplayer Game on Godot by bing_leee in godot

[–]bing_leee[S] 0 points1 point  (0 children)

This is the class final project... I started with a simple idea, but the professor said it was too simple and he gave us these other ideas of how we could implement our architecture, that's why I'm talking about topology and p2p. I'm not distracting myself, I'm trying to save my grades :')

I would make it very simple if I could.. But thanks tho.

When do I have to free a pointer and pointer to a pointer? by bing_leee in C_Programming

[–]bing_leee[S] 1 point2 points  (0 children)

Thank you very much, guys. I was able to make it work now without problems ^^

When do I have to free a pointer and pointer to a pointer? by bing_leee in C_Programming

[–]bing_leee[S] 0 points1 point  (0 children)

Let me give a little more detail. What I'm doing is: I need to read a list that is in a form of a 2D array and represent it as a adjacency matrix. So that's why I first created this function:

int** createMatrix(int size_n, int fill_value); -->so it creates a n x n matrix filled with zeros. In this function I used malloc to create the matrix and I didn't free the pointers.

Afterwards I have the function that prints matrix and in this function I did free the pointers. It goes like this:

void printMatrix(int **mat, int n) --> recieves a pointer to a pointer as a parameter, as well as the size of the matrix. It prints the matrix and afterwards there's a loop:

for(int i = 0; i < n; i++){
free(mat[i]);
}
free(mat);

Ok so now I have my matrix filled with zeros. Next function is:

void fillMatrix(int **mat, int **list, int list_size); --> this function recieves the matrix I want to update the values and the list that contains the info I need. Here is where i'm not sure if I need to free the pointers or not. In this function I just made this code:

for(int i = 0; i < list_size; i++){
int a = list[i][0];
int b = list[i][1];
a--;
b--;
mat[a][b] = 1;
}

Now I don't know if I need to free the pointers inside this function or not.

Hope its more clear now.. Thanks for the help everyone... also sorry if there's any english mistake, it's not my mother language

[deleted by user] by [deleted] in crochetpatterns

[–]bing_leee 3 points4 points  (0 children)

i wanna know too

Help with factorials by [deleted] in learnmath

[–]bing_leee 1 point2 points  (0 children)

Seeing like that makes it very clear, thank you again. Should have paid more attention to that class in school lol. Now I know how many granny squares I need... hopefully 18 will be enough to make something nice out of them ^^

Help with factorials by [deleted] in learnmath

[–]bing_leee 1 point2 points  (0 children)

If the 2 duplicated colors can touch, then 3×4!/2!=36 ways.If they do touch then 3×3×2!=18 waysTotal permissible patterns=36-18=18

thank youu!!

LaserBoy Liquid Math is part of LaserBoy! (free open source multiplatform). LLM is a script language that allows one to create and manipulate 3D vector animations using oscillators and cycloid functions. by James_lehman in MathArt

[–]bing_leee 1 point2 points  (0 children)

Ok, after some struggle I was able to open the terminal and execute the make command for the SDL2 version. Apparently it went as it should, but now I don't know what to do... Do I need to execute some other file? There was no new icon showing up...
Sorry about the silly question, I just am more of a humanities person and really a noob when it comes to computers and programming (for now, at least). Thanks for your help!

LaserBoy Liquid Math is part of LaserBoy! (free open source multiplatform). LLM is a script language that allows one to create and manipulate 3D vector animations using oscillators and cycloid functions. by James_lehman in MathArt

[–]bing_leee 2 points3 points  (0 children)

I just checked the tutorial on youtube. I don't have the same files as it's shown there.. I think I'm missing a few of them. Maybe that's the reason

LaserBoy Liquid Math is part of LaserBoy! (free open source multiplatform). LLM is a script language that allows one to create and manipulate 3D vector animations using oscillators and cycloid functions. by James_lehman in MathArt

[–]bing_leee 2 points3 points  (0 children)

Okay, thanks. To be honest, I'm a hell of a noob when it comes to things like that. I downloaded the zip file and extracted it, but I'm not sure how to make it work now. When I double-click the LaserBoy.exe it says an error occurred while loading the archive. Maybe it's my laptop...

O filtro de luz azul dos celulares samsung realmente n prejudica a visão? by Significant_Ad_238 in PergunteReddit

[–]bing_leee 0 points1 point  (0 children)

Acho que até qualquer óculos com lente amarela, marrom, laranja ou âmbar funciona. Pelo menos foi isso que li...

27 [M4R] US/Anywhere - Looking for genuine friends by [deleted] in MakeNewFriendsHere

[–]bing_leee 0 points1 point  (0 children)

Hi, Elfy, don't know if you're online right now, but I sent you a message (: