hey there yesterday i started developing the core of our game. in short its a 10 player rpg/rts fast paced action game. i thought because here is almost no live in the multiplayerforum i write a blog about creating the multiplayer core of our game. this might be interesting for some of you to read - at least i hope so. it helps me also keeping track of the project.
be aware, iam not the best coder i just want to cover developing a multiplayer project with a6. maybe this helps the community a bit when i show how i solve some problems.

i hope its okay for the mods, to leave the topic here and that i post each day iam working on. others are invited to give me hints or discuss problems.
if its not okay please tell me so, ill then post the blog at my own site but that would be difficult for others to join the discussion.

okay here we go: yesterday the 24.04. i used locoweeds tutorial to get a start all worked well and seemed logic. then i ran into a strange behaviour. the server code works well but the client never gets the server_says_yes variable wich is triggerd by the on_server function.
i did everything like in locoweeds tutorial until the part where the player entities are created and the players_connected are count.
i was shure i understood all the code.
after some testing i realised that i have to put a sleep(1) bevore the level load, so that the on_server command is properly triggered when the client joins the game. iam wondering why nobody else or locoweed had this problem yet? after i made this little change in the code, everything works well.

Code:

sleep(1); // solves the bug where event_join is skipped when a player joins
level_load(str_map); // load level, must be loaded after connection is set
sleep(1); // make shure level is loaded



today the 25.04. i have planned writing the chat part of the core and add some more debug information. lets see how far i come...

edit: i have successfully implented a chat and some debug information. you can see how far iam here:



however, i found a little thing in the tutorial to fix. when a client joins he doesnt see the right number of people already in the game. so i added this:

Code:

send_var_to(you, number_of_players); // send the number of players ingame to joined client this was not part of locoweeds tut



at the server_called function wich is the on_server function under the ifdef server; to fix it.

next things iam gonna work on are camera and unit selection...

Last edited by ulf; 04/25/06 12:52.