Need Ideia(sugestion) to GameServer RPG Game

Douglas Farias

Expert
Licensed User
Longtime User
Hi all i m working at a game server for one game in b4a;
this game server is runing at b4j with this
https://www.b4x.com/android/forum/threads/websocket-client-library.40221/

ok for now its ok, i can connect devices, send infos, can log the server time at my devices fast etc.

i m using the AcceleratedSurface lib, the game is based on tiles.

X = 0 TO 200 <horizontal>
Y = 0 TO 200 <vertical>

ok, when my character move, i can log the position for example my character is under the
x = 5 and Y = 2.

ok, i know i need send this info to server, but now is my question....
How can i make to send my position to gameserver, if i go have more users online?
if another user move his character how all anothers users go know this?

i need a ideia for this *-* if u have send me pls.

basical its just a logic, if i have one user i know what make, but i dont know what make when have 10 20 players online.
how to distribute the position of each character to all devices ?

PS: with a minimal data use (internet use)

Sem título.png
 

WAZUMBi

Well-Known Member
Licensed User
Longtime User
Store all the active players data in a database which will include their world coordinates on the grid.

Use a timer to get all active users data and return it to the game.
In your game you will use this data to place the online characters coordinates in the game.
 

Douglas Farias

Expert
Licensed User
Longtime User
1° What best time to send Server info to all Users 1s?
2° If a user log out and i have stored the info on gameserver db what to make in this case?
3° If have 50 + players on, it is not a bug data to send all time?
 

sorex

Expert
Licensed User
Longtime User
1. it depends on how powerfull your server and data connection is and how the engine is written
2. if he logs out just remove the user and coordinates
3. see 1.
 
Top