Getting started

Before you start

Make sure you understand how to use Drag & Drop and a bit of GML before you start. Make sure you know what variables & INI files are. This post will mostly focus on setting your game up. It'll describe what you need to do to get the game connected to the server, how to make the connection, and lastly how to show a login screen and have players log in to your game.

When starting a new project, there are a few things you need to do before your game will be able to connect to GameMaker Server. Firstly, you'll need to register your game on the GameMaker Server-website.

Registering your game

GM8 / GM8.1:

The GameID can be found by opening "Global Game Settings" and then clicking on the tab "Loading". The GameID is the number in the text box labelled "Game Identifier" at the bottom of the window.

GM:Studio:

The GameID can be found by opening "Global Game Settings". The GameID is the number in the text box labelled "Game Identifier" at the left upper part of the window.

Open up the GameMaker Server website and login if you haven't already. If you're not registered as a developer, click your name in the upper right corner of the page, and then click "Register as a developer" and follow the steps on the web page.

Now that you're registered as a developer, click the "Developer" tab on the menu bar at the top of the page. Scroll down to the "Register a new game"-section. Enter the GameID of your game, and type in a title. The title can be changed later if you want. The GameID however, cannot be changed. If you want to use a new GameID, you'll need to create a new game.

Connecting to the server

After you've registered your game, the game will be able to connect to the server. To do so, you should set up an object that initializes the extension. Make sure you've added the extension to your game.

GM8 / GM8.1:

To add an extension, double-click "Extension Packages", select "GameMaker Server+" on the right, and press the Arrow left-button to move it to the left. If you don't see "GameMaker Server+" in the list, click "+Install", "+Install" again and load the "GameMaker Server X.X.XrX - GameMaker 8 and 8.1.gex" file (the file can be found in the download).

GM:Studio:

To add an extension, right-click "Extensions", select "Import Extension", and load the "GameMaker Server X.X.XrX - Studio (All/Windows).gex" file (the file can be found in the download). Make sure the file type, in the list box in the bottom right corner of the window is set to "GameMaker Legacy Extension". You should load the Windows file if you do not plan on releasing your game on other platforms. If you do plan on releasing on other platforms, select the All version. This version will also work when exporting to Windows. This can easily be changed later on.

GM:Studio:

Games made in GM:Studio will need an extra object. Create an object, and name it "GMS". Add the following code (Control -> Execute a piece of code):

Create:

gms_init(GMS)

Step:

gms_step()

Draw:

gms_draw()

Lastly, if you're using the All version of GameMaker Server, add this code in the networking event:

gms_network()

Make sure the object is marked as Persistent, and the depth is set to a low value like -100000.

GM:Studio:

If you see an error stating global.__set is not recognised/set, that means you're calling another GameMaker Server-function before calling gms_init(...). gms_init(...) should be called before any other GameMaker Server function.

Add the following piece of code to either the GMS object, or another initialization object (this object will be referenced later on as "GMS". Make sure the object is persistent). gms_settings(...) must be called before any other GameMaker Server function, but after gms_init:

gms_settings(true, 1.0, obj_player, obj_other_player);
room_goto_next();

The Drag & Drop action "Server settings" on the tab "Online 1" and the Drag & Drop action "Next Room" on the tab "Main 1" can also be used. When using the Drag & Drop action, the simple mode is always enabled.

Add the following code to the Game End event of the GMS object:

gms_logout()

The Drag & Drop action "Logout" on the tab "Online 1" can also be used.

It is important that you log out correctly. When a player logs out incorrectly, it is possible that not all data is saved properly on the server side.

obj_player and obj_other_player should be two different objects. The "player object" (obj_player) should be the object in which you place all game logic. Walking, shooting, health, setting variables, etcetera.

The "other player object" (obj_other_player) will be representing all other players that are online. Every player that is online will get an instance of the "other player object". You should not put any game logic in this object. This object should not be put in a room. This will be done automatically by the extension.

Add a sprite and some logic to make the object move when pressing the arrow or WASD keys to the obj_player object.

Showing a login box

Create a new object, and name it something like obj_login. Add this piece of code to the create event:

gms_show_login()

The Drag & Drop action "Show a login window" on the tab "Online 1" can also be used.

When the user logs in the Event User 15 event is called. If the login window is closed, event user 14 is called.

Add the following code to the Event User 15 event:

room_goto_next();

The Drag & Drop action "Next Room" on the tab "Main 1" can also be used.

Putting it all together

Create 3 rooms: rm_init, rm_login and rm_play. Add the GMS object to rm_init, the obj_login object to rm_login, and the obj_player object to rm_play. You should now be able to run the game and walk around. When running a second instance of the game, and logging in to a different user name, you should be able to see the other player.

Replies (276)

Last message on 23 Mar 2017

Size43 (Administrator) on 6 Jul 2014, 18:00:30
I spent a lot of time writing this tutorial. Please let me know if it's better than the old one. Would it be useful if I did more tutorials like this covering the rest of GameMaker Server's capabilities?

Please let me know what you think.
peril94 on 9 Dec 2014, 17:03:21
Hi thanks got it all set up, when I click register though the form comes up but then I fill it in and click register nothing happens.
NodziGames on 11 Dec 2014, 20:12:33
Thanks for this awesome tutorial! How do I make the other players appear red on the game?
Size43 (Administrator) on 11 Dec 2014, 21:11:47
Callinggms_optimize_variables(false, false) will disable sprite synchronization. After that, you can change the sprite of the other players and it won't change back ;)
NodziGames on 12 Dec 2014, 16:56:20
Thanks for your quick response! I did that and it works. My issue now is that the other player no longer faces the mouse and just faces to the right. How do I fix it?
Size43 (Administrator) on 13 Dec 2014, 15:55:52
You can set the image_angle variable manually by adding this to the step event:
image_angle = gms_other_get(player_id, "image_angle")
NodziGames on 21 Nov 2014, 08:30:23
Hey there. I am using Game Maker Studio, and I set everything up. The login works, as well as the highscores. Can you tell me why the chat box won't show even though I used drag and drop for it?
Size43 (Administrator) on 21 Nov 2014, 17:41:26
If you're using GM:Studio, please make sure you're calling gms_chat_draw() in the draw event of the GMS object. This is undocumented (and could be considered a bug). The next updates will automatically draw the chat if gms_draw is called.
NodziGames on 22 Nov 2014, 08:50:18
Thanks for your quick response! That seems to have fixed it. Sorry to take so much time but I need help just once more. When I use the Show Highscore list, it shows an empty screen, even though the highscores are updated on the website. I am using the correct ID's etc. Thanks for you time :)
Size43 (Administrator) on 22 Nov 2014, 15:52:20
This is a bug in the gms_show system (which was probably overkill anyway, it contains a complete xml-like parser and renderer). It'll be fixed in the next update, which will be released very soon.

The gms_highscore_* functions are not affected by this bug, so you should still be able to draw the highscores yourself.
Forgeio on 1 Oct 2014, 22:25:29
I followed the game example exactly (the one that came with the extension)
but in the room where you wait for other players, it wont load the next room. PLEASE HELP!
Size43 (Administrator) on 3 Oct 2014, 19:02:02
It waits for - I believe - 2 players, it should move to the next room if you open 2 clients at the same time.
Forgeio on 11 Oct 2014, 14:54:15
I tried that, I should clairify it: When 2 people login, it wont work. It did on the DnD shotgun game tut, and I followed its code exactly (exept with the players)
Size43 (Administrator) on 13 Oct 2014, 17:05:26
Just to confirm: The example works correctly, but when you tried to build the same game from scratch it doesn't work?
Forgeio on 25 Oct 2014, 05:56:09
the same for the start screens, but in-game its different.
Size43 (Administrator) on 25 Oct 2014, 13:26:01
Did you enable the VS mode on the site? Try setting the minimum amount of players to 1, does that work?
Forgeio on 27 Oct 2014, 23:00:36
I tried that, it still wont work. btw is there some way I can contact u without spamming this documentation?
Forgeio on 27 Oct 2014, 23:42:12
I figured it out! thank you for all your quick replys and stuff!
Forgeio on 28 Oct 2014, 12:43:31
ok, so, I figured out why its not working, but cant fix it. I tried using the examples Game ID and it worked, but when I used my own ID it didn't work, so that means the problem is not the game, but the server. My In-Game settings are: Version: 1
Max-sync: 480 Roomspeed: 30 Vs mode: on min players: 2 pref players: 2 max players: 2 min wait time: 10 max wait time: 15. PLEASE HELP
Size43 (Administrator) on 28 Oct 2014, 21:03:44
Would you be able to mail me your gmk to gamemakerserver@outlook.com?
Forgeio on 31 Oct 2014, 00:30:49
I did...
Size43 (Administrator) on 31 Oct 2014, 13:14:10
I received it, but unfortunately I'm having to deal with real-life stuff before I can start debugging your gmk ;)
Forgeio on 1 Nov 2014, 13:22:06
understood completely :D Ill be waiting for it ;)
Size43 (Administrator) on 3 Nov 2014, 11:49:09
I've fixed a bug on the site which resulted in every change to the settings not being saved. Because of that bug, the VS mode wasn't enabled for your game. It should work once you enable the VS mode ;)
Forgeio on 8 Nov 2014, 05:06:42
THANK YOU SO MUCH!!!
Forgeio on 8 Nov 2014, 05:24:29
ok, so can you post an example of how we would make it so we can make an MMORPG login type thing where all you need is 1 player to play, and other players join it and theres unlimited players, like a Minecraft server?
Size43 (Administrator) on 8 Nov 2014, 17:00:56
The MMO-like multiplayer is the multiplayer type that's enabled by default. You don't need to do anything to get it working :)
Forgeio on 8 Nov 2014, 17:51:05
so non-vs mode?
Size43 (Administrator) on 8 Nov 2014, 17:52:21
Correct. Disabling VS mode (or registering a new game, since the default for the vs mode is off) will get you the MMO-like multiplayer.
Forgeio on 14 Nov 2014, 21:19:06
Thank you so much. One more question, is there a way you can change the font of the chat?
Size43 (Administrator) on 16 Nov 2014, 16:01:17
Please see gms_chat_set_font
Forgeio on 2 Jan 2015, 22:12:58
Ive been trying and just cant seem to be able to make an MMO game, can you post some kind of tutorial how to do that?
Forgeio on 1 Oct 2014, 02:27:14
I cannot log in, I used to be able to but now I cant PLEASE HELP
Size43 (Administrator) on 1 Oct 2014, 09:25:29
Just to confirm, you are able to login in game but not on the site?
Forgeio on 1 Oct 2014, 22:21:10
yes, but it is fixed now thanks :D
bluberblaber on 16 Jul 2014, 01:49:35
I would be glad to help make tutorials. All you would have to do is tell me how to type it out what means and what objects and rooms to make and I could take all that info and make a video for it and post it on youtube. You can email me at gaamingpros@gmail.com
Size43 (Administrator) on 16 Jul 2014, 10:29:35
If I have to write down & explain how everything works first, that's not really going to save me much time. :)
bluberblaber on 14 Jul 2014, 23:19:47
One more thing how would you make a lobby in game maker server
Size43 (Administrator) on 15 Jul 2014, 14:36:27
The "Total Shotgun" example covers this a bit. Basically, you enable "VS mode" on this site, and GameMaker Server will automatically handle the lobby/session making part. (make sure you call the right functions like in the example)
bluberblaber on 14 Jul 2014, 23:14:10
I really like how you made this extension but after this getting started tutorial I don't really know what kind of objects to make and how I should type things out, I'm just really stumped. I know you said ur making another tutorial but can you make a tutorial for everything basically. Maybe even make videos on YouTube
Size43 (Administrator) on 15 Jul 2014, 14:33:57
I'm working on making more tutorials. Eventually I'll cover every part of GameMaker Server, but each tutorial costs me 10-25 hours to write depending on how much I need to cover. The next tutorial will be instance synchronization, which is a very big topic. I've already got more than 5 pages of text and I'm still not done. I'll try to release one every week if I have the time to do so :)
bluberblaber on 13 Jul 2014, 04:52:52
in game maker studio i get this error for the GMS object

___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Create Event
for object GMS:

gms_init(): The GameMaker Server-object should be persistent.
at gml_Script_gms_init (line 9) - show_error("gms_init(): The GameMaker Server-object should be persistent.", true);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_gms_init (line 9)
called from - gml_Object_GMS_CreateEvent_1 (line 1) - gms_init(GMS)
Size43 (Administrator) on 13 Jul 2014, 10:06:30
Please make sure you've marked the GMS object as persistent. The checkbox below the depth, on the left side of the Object Properties window should be checked.
bluberblaber on 14 Jul 2014, 00:48:19
i checked the box and then i got this

############################################################################################
ERROR in
action number 1
of Draw Event
for object GMS:

Data structure with index does not exist.
at gml_Script_gms_network (line 1) - if(ds_map_find_value(async_load, "id") == global.__socket)
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_gms_network (line 1)
called from - gml_Object_GMS_DrawEvent_1 (line 2) - gms_network()
smashi on 13 Jan 2015, 20:58:12
how? got the same problem and dont know how to fix it :S
Size43 (Administrator) on 16 Jan 2015, 20:15:16
The gms_network function should be placed in the Networking event (under asynchronous), not the draw event ;)
bluberblaber on 14 Jul 2014, 06:48:42
i fixed it
bluberblaber on 14 Jul 2014, 00:14:26
Ok thank you
alikarim0089 on 7 Jul 2014, 03:57:19
verrrrrrrrrry nice thank u very much
Size43 (Administrator) on 7 Jul 2014, 11:16:13
Cool :D

I'll do a few more. I've had a few requests for an instance synchronization tutorial, so I'll do that one next.
SaitoZero on 13 Jul 2014, 08:40:52
Hello.
I'm new to this site and I actually have no idea what the "PIXELS" do, since there are no sites explain it.
So please at least tell me what can I do with those, please.
Size43 (Administrator) on 13 Jul 2014, 10:11:59
Pixels can be used to upgrade things like the GameINI/PlayerINI size, add a background to the game's page on this site, and a bunch of other things that use additional CPU/RAM. You don't need any to make a game using GameMaker Server. If you're going to store a lot of data or do something that uses a lot of CPU power on the server, Pixels can be useful.
SaitoZero on 2 Sep 2014, 17:14:23
Hey Size, can you turn everything into an ebook file? I'm not always online actually and I don't have time for memorising all of these things.
SaitoZero on 13 Jul 2014, 10:45:55
Thanks alot.
MrBlackCarey on 22 Mar 2017, 19:18:58
Error : gml_Script_wle_parse_value(1) : Assignment operator expected

Error : gml_Script_wle_parse_valuelist(2) : Assignment operator expected

Error : gml_Script_wle_parse_layout(2) : Assignment operator expected

Error : gml_Script_wle_load(1) : Assignment operator expecte
Size43 (Administrator) on 23 Mar 2017, 15:32:32
Do you have an object named txt? If so, you should rename it to something else.
MrBlackCarey on 23 Mar 2017, 16:25:20
O! thx m8 real great help :3
Lorddirt on 2 Jan 2017, 04:37:45
I can't seem to get the login window to show up, i've done everything you have said but on room_login, the login window doesn't show up. I'm currently using Game Maker v1.4.1763 on Steam, and using the Windows Game Maker Server.
Size43 (Administrator) on 3 Jan 2017, 13:02:57
There were some server issues that have now been fixed. Please let me know if you're still having issues.
Lorddirt on 2 Jan 2017, 04:40:29
I have also keybinded C to show_message("Connected: " + string(gms_info_isconnected())) , and it says Connected: 1, what am I doing wrong? I can't see the login screen at all.
TheSilverSpade on 24 Dec 2016, 08:17:22
Hey I have a couple questions if you would reply that would be great!
So, I am currently develping a game; Right now I am setting up the essential gameplay mechanics like movement enemys and such; So my questions are

1. Does this allow Multiplayer

2. If you use this and then use the "create application" feature to make it an exe and put it on a site like gamejolt will the multiplayer/server still work?

3. Is it free?

4. If multiplayer do people host a server on their internet? do they connect via ip? or can i make a username / friend system and connect through that?

Thank you for your time

-Andrew
Size43 (Administrator) on 3 Jan 2017, 12:51:43
1. Yes.
2. Yes.
3. Yes. There are some limitations to the number of players that can be online at the same time to keep the server running smoothly.
4. All games need to connect to the main GameMaker Server. It's not possible to run it over LAN or without the main server
TheSilverSpade on 13 Jan 2017, 02:22:02
Ok, Follow up question, can i use a username system without using this login system, i dont want people to have to make a account here, incase they come here in the future and forget it. If its without lan thats fine aslong as they can connect with other players, i want to make it so 4 people can play a game at a time
Size43 (Administrator) on 14 Jan 2017, 10:57:42
You can have players log in as guests, which does not require an account. (this does require unused usernames)

Completely disabling the account system is not possible in the current version of GameMaker Server. It will be possible in the rewrite that I'm working on.

You can use the VS mode to matchmake players, or if you need more control over the matchmaking you can write your own matchmaking using the sessions.
Exploshi on 12 Dec 2016, 22:49:40
PLEASE HELP! This plugin looks awesome. I am using version 1.9. But whenever I run the game I get this error:

Error in Object GMS, Event Create, Action 1 at Line 2, Position 20: Unexpected symbol.

Thx. Plz respond.
Size43 (Administrator) on 16 Dec 2016, 21:13:08
Please post the code you put in the create event as well.
techguy816 on 4 Sep 2016, 20:52:34
Hello, I need help with the login box.

Whenever I start the game, the box appears, but for some reason in the "username" part of the login box, it only let's me type in 1 character, which appears highlighted, and any other characters that I type in only replace the previous character, leaving me only able to have a 1 character login.

Also, when I click "register" the register box pops up but I can't type in any of the text boxes, leaving me unable to register.

A response would be greatly appreciated, and thank you for your time.
Size43 (Administrator) on 6 Sep 2016, 21:15:06
Are you calling gms_show_login in the step/draw event by any chance?
techguy816 on 7 Sep 2016, 04:32:25
Thank you for responding :)

I did put gms_show_login in the step event rather than the create event, oops.
NodziGames on 13 Jul 2015, 15:19:53
Greetings!

I'm making a game with your extension, and I want to know. How do I send out a message of the day to players logging in? I'm currently using the Show Message DnD function after they log in, but is there a way for me to update it in such a manner that I can easily change the message?
Size43 (Administrator) on 14 Jul 2015, 22:09:14
The easiest way would be to store the message in the GameINI, and load it from there. You could also try to use the server-sided login script, but the server-sided scripts are deprecated so I won't be fixing any bugs in them.
Gamewolf10 on 14 Aug 2015, 09:54:10
Cool I did that too on my TWSI Online game :D
Anaking on 20 Nov 2014, 15:51:29
For some reason the INI's, statistics and analytics dont work at all for me. Logging in and multiplayer work fine but when i try to store anything to the server it doesnt appear on the list + i can't read it from the game either. Any idea why this happens?
Size43 (Administrator) on 21 Nov 2014, 17:57:13
INI data is cached on the website, you may not see it until you log out & in again. I've checked your GameINI, and there are a handful of keys in there. Are you able to see those on the website?

Analytics don't show the current week, so it may take up to 7 days for logins to show up in the analytics view. There are logins on your game, so they should show up within a few days.
rater193 on 5 Jul 2014, 10:22:20
Size43, this is rater193 from the gmc, i was wandering if there is a way i can contact you, in regards to the engine, and game maker studio, i want to help fix the studio version, it seems like every time you release, studio versions are bugged

contact email:
rater193@gmail.com

Skype(Preferred if you contact me via here, rather than email):
mms1911

thanks in advance!
rater193 on 5 Jul 2014, 10:27:27
also, there are a few bugs i want to tell you personally, but there is no way to pm you on here, if you can please contact me via skype, i have something to show you, before people abuse it!
Size43 (Administrator) on 5 Jul 2014, 11:31:23
Please contact me at gamemakerserver@outlook.com, on the GMC or on Steam (Size43)!
rater193 on 6 Jul 2014, 09:46:31
thanks
MrBlackCarey on 19 Mar 2017, 00:36:36
howdy i followed the instructions perfectly every step done. but once i load the game it says to check the compile window and the only way i can remove it is if i remove both objects entirely can u help

here's my code for proof!
Create Event:GMS
gms_settings(true,0.001,obj_player,obj_other_player_obj)
gms_message_reporting(mt_none)
gms_show_set_fonts(fnt_textbox_normal, fnt_textbox_normal, fnt_textbox_normal)
Step Event:GMS
gms_step()
EndGame:GMS
gms_logout()
Networking:GMS
gms_network()
Draw Event:GMS
gms_draw()

Create Event:obj_login
gms_show_login()
User Defined 15:obj_login
room_goto_next();


i don't know what i did wrong can u plz help!
Size43 (Administrator) on 22 Mar 2017, 18:57:26
Please scroll up through the compile window and post any line that says 'error' here.
MrBlackCarey on 22 Mar 2017, 19:19:28
Error : gml_Script_wle_parse_value(1) : Assignment operator expected

Error : gml_Script_wle_parse_valuelist(2) : Assignment operator expected

Error : gml_Script_wle_parse_layout(2) : Assignment operator expected

Error : gml_Script_wle_load(1) : Assignment operator expecte
TheLandimizer on 5 Mar 2017, 01:21:41
help





___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Create Event
for object obj_login:

global variable <unknown built-in variable>(-1610512674, -2147483648) not set before reading it.
at gml_Script_gms_show_login (line 1) - if(global.__xls_window == -1)
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_gms_show_login (line 1)
called from - gml_Object_obj_login_CreateEvent_1 (line 1) - gms_show_login();
Size43 (Administrator) on 5 Mar 2017, 17:18:26
Looks like you're not calling gms_init before gms_show_login.
io_gamez on 6 Feb 2017, 21:22:07
Hi folks, the login is not displayed. Otherwise, everything works. I do not see any error code. The output box is: "FreeType :: unable to find Font file Arial Black"
Size43 (Administrator) on 16 Feb 2017, 16:06:08
Did you register your game ID on this site?
antonzik on 17 Dec 2016, 16:02:56
MP isn't working properly right now. What should I do?
Size43 (Administrator) on 3 Jan 2017, 12:33:30
Hey, apologies for my very late response> I've had some issues with ml hand that prevented me from using a computer (RSI).

There were some server issues that have now been fixed. Please let me know if you're still having issues.
oddjowkerstudios on 1 Sep 2016, 21:59:48
PLEASE HELP!!!!!!!!!

Im still new to GMS and im having trouble with players joining teams.
How do I have 6 different teams and make it so the player randomly joins one of the 6 different teams.

PLEASE HELP!!!!!
oddjowkerstudios on 2 Sep 2016, 17:20:04
Also how to hide the log in pop up (when someone logs in it shows everyone that they logged in) How would i hide that feature.
Size43 (Administrator) on 6 Sep 2016, 21:14:25
gms_message_reporting to hide certain, or all messages.

You can use gms_team_auto_join and gms_team_set_max to set the number of teams.
ziad87 on 6 Jan 2017, 13:28:33
Well that gms_team_auto_join made my life easier!
before it was a mess like:(example)
[code]
a = 1
b = 2
c = 3
d = 4
teamj = choose(a,b,c,d)
if teamj = 1 {
gms_team_join(1)
}
else if more code more code........
oddjowkerstudios on 27 Aug 2016, 00:56:20
How would I sync enemy's into the game.

for example i have a zombie in the game and when it gets close to the player it chases the player however only one player can see the zombie chasing the player not all the players in the game.
Size43 (Administrator) on 27 Aug 2016, 13:39:06
gms_instance_sync can be used to synchronize instances between clients.
oddjowkerstudios on 27 Aug 2016, 14:19:22
Thanks by the way could you help me syncing the bullets direction for my game.

At the moment my bullets shoot from the characters gun and goes in the correct direction however other players do not see the bullet point in the correct direction. For the other players the bullet goes in the correct direction but doesn't point in the correct direction it always points right.

How would i fix this ???
Size43 (Administrator) on 27 Aug 2016, 16:35:45
The User Defined event 12 will be called after the extension sets the x, y, speed and direction of the instance. You can then use the direction to set the image_angle properly (something like image_angle = direction).
oddjowkerstudios on 27 Aug 2016, 17:23:56
Would this be the same code to set the direction for npc's looking at the players.
Size43 (Administrator) on 27 Aug 2016, 18:35:27
What are you using right now to set the image_angle and direction of the bullet?
oddjowkerstudios on 27 Aug 2016, 18:38:05
i.direction = image_angle; in the step event
image_angle = direction in the user defined 12 event
oddjowkerstudios on 27 Aug 2016, 18:38:33
By the way my bullets are fine now its the npc's that are playing up
oddjowkerstudios on 27 Aug 2016, 18:42:45
The only problem with my Npc'c is they chase the play if you get close to it and point in the direction of the player however other players can not react with the NPC once one player is not close to the NPC.

Here's my code for the NPC

Create event:

hp = 100;
image_speed = .20
gms_instance_sync(id, is_full);
gms_instance_set(id, "hp", hp);

step event:

if distance_to_object(obj_player) <220

{
mp_potential_step(obj_player.x,obj_player.y, 1.5, false)
image_angle = point_direction(x,y,obj_player.x,obj_player.y)
}
else
{
speed = 0;
}

//health
hp = gms_instance_get(id, "hp")


draw event:

draw_sprite_ext(sprite_index, image_index, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);

draw_healthbar(x-10, y - 16, x+10, y - 10, hp, c_red, c_green, c_green, 0, 1, 1);
Size43 (Administrator) on 6 Sep 2016, 21:10:42
You should only let one player control an instance at any given time. An easy way to do this is to check whether the player owns the instance (gms_instance_is_owner).

You'll also need to modify your code to include all player and other player objects. Right now it only looks at the player of the client that destroys it.
oddjowkerstudios on 21 Aug 2016, 23:07:19
HELP PLEASE!!!

My game has a character selection in it so you can choose between 4 different characters
however at the moment you can only see character 1 not 2,3 and 4.

Basically my question is how do I have multiple characters and characters fighting show up on the game so other players can see different characters.
Size43 (Administrator) on 27 Aug 2016, 13:38:31
How did you impletement these characters? If they're separate objects, you should create a single parent object for all of them and set that as the player object.
oddjowkerstudios on 27 Aug 2016, 14:15:27
its okay now i figured it out
oddjowkerstudios on 20 Aug 2016, 13:49:41
Just wondering would GM SERVER work with a fps game made on game maker studio???
Size43 (Administrator) on 20 Aug 2016, 22:51:27
Yes, that would work. You might need to disable or add some extra calls around gms_draw() since that tries to draw in 2D.
oddjowkerstudios on 14 Aug 2016, 23:56:18
Hi Im still a noob to GM SERVER and I have a few questions

1. How to i make lobbys players can choose and join (like in project amaranth or minecraft)

2. How do i make lobbys have a certain amount of players in them (for example max players 20)

3. How do i make chat system disappear for example (player says "HI" 3 seconds later the "HI" disappear)

4. Is it possible to resize and move the chat box?
oddjowkerstudios on 15 Aug 2016, 12:36:04
3. Is meant to say how can i make the chat box not be there at the start but when press enter the chat box appears and when the message has been sent the chat box will go.
Size43 (Administrator) on 18 Aug 2016, 16:19:49
1. You should use the gms_session functions, maybe in combination with INI storage to store additional info about the sessions.

2. You can implement this by looking at the number of players in a session (gms_session_player_count)

3. The built-in chat system does not support this. Either you'll have to implement your own chat system, or you could try setting the background alpha of the chat to 0, which will only hide the chat background.

4. See gms_chat_bind_pos
oddjowkerstudios on 19 Aug 2016, 01:48:30
Thanks for the help ive managed to do the chat thing now but im still struggling on how to make lobby's and have players choose between them.
oddjowkerstudios on 27 Jul 2016, 19:25:18
When I tried to run the VS mode .gml for Game maker studio i got this error


############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object GMS:

ds_map_exists argument 1 incorrect type (5) expecting a Number (YYGI32)
at gml_Script_gms_action_get_id (line 1) - if ds_map_exists(ds_queue_head(global.__actions), "type")
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_gms_action_get_id (line 1)
called from - gml_Script_gms_step (line 80) - case 1://Player login
called from - gml_Object_GMS_StepNormalEvent_1 (line 2) - gms_step();



please can you help???
Size43 (Administrator) on 29 Jul 2016, 21:22:08
Hey,

Please let me know what version of GameMaker and GameMaker Server you are using.
oddjowkerstudios on 30 Jul 2016, 11:43:59
Game Maker studio (v1.4.1749)
Game Maker Server (1.9)
Size43 (Administrator) on 1 Aug 2016, 20:32:25
Please try removing and re-adding the extension. That bug has been fixed already, which moved the line in the error from line 1 to line 3, so the version that GM is using must be an older one.
oddjowkerstudios on 2 Aug 2016, 13:08:49
Alright I updated my Game Maker to

Standard Edition (v.1.4.1757) (im using game maker on steam is that a problem)

But im still getting the same error :(


___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object GMS:

ds_map_exists argument 1 incorrect type (5) expecting a Number (YYGI32)
at gml_Script_gms_action_get_id (line 1) - if ds_map_exists(ds_queue_head(global.__actions), "type")
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_gms_action_get_id (line 1)
called from - gml_Script_gms_step (line 80) - case 1://Player login
called from - gml_Object_GMS_StepNormalEvent_1 (line 2) - gms_step();


Im Using Game Maker Server 1.9 edition is that the latest one?
oddjowkerstudios on 27 Jul 2016, 14:41:06
I followed all your instructions and even tried running the example but my game wont run.
every time i try and run the game i get an error saying( could not find path 'C:\USERS\MYNAME\DESKTOP\TOPDOWN SHOOTER-GML.GMX\EXTENSIONS\GM DRAGACCEPTFILES\DAF_SETUP.GML'.

Im running the latest version of Game Maker studio on steamand still nothing happens is there a new download file ???

please help !!!
Size43 (Administrator) on 27 Jul 2016, 15:25:47
This seems to be an issue with an extension named "GM DRAGACCEPTFILES", not GameMaker Server.
oddjowkerstudios on 27 Jul 2016, 16:39:33
Is there anyway i can fix this ???
oddjowkerstudios on 27 Jul 2016, 16:46:38
Im not sure if its to do with Game Maker Server or not but every time i run my game with the Game Maker Server Extension this error always happens.
Size43 (Administrator) on 1 Aug 2016, 20:14:14
Like I said, this is an issue with an extension named "GM DRAGACCEPTFILES", not GameMaker Server. If you're not using that extension, try deleting the entire GM DRAGACCEPTFILES folder in your project.
Grei on 11 Jun 2016, 18:43:31
Hey. I want to ask, Is there a code script for "Check whether the instance has been created by enemy team"?
I need to know.
Size43 (Administrator) on 12 Jun 2016, 19:28:56
There's no script that does exactly what you want, but there are two scripts that you can use to check this. gms_instance_get_owner will return the PlayerID of the player that currently controls the instance (this will be the player that created it for onetime / extended instance synchronisation, for full instance synchronisation you should sync a custom variable to keep track of the player that created it).

After that, you can use gms_team_player_is_friend to check if the PlayerID is a player on the same team. If this returns false, the instance was created by the enemy team.
sylvia2963 on 7 Dec 2015, 22:41:09
hey
could anyone help me further for my game ?
i hope to get some information http://gamemakerserver.com/en/forum/board/1/view/66/
pancakebob on 5 Dec 2015, 16:49:10
I have a question. After following these instructions, how could one turn this into a turn based card game? Or at least put it in the right direction. This setup seems to be for live games with visible players.
Size43 (Administrator) on 7 Dec 2015, 11:40:55
Correct. The "live" game thing is the easiest use case, and the most used one. I'll do a rundown of some things that you might want to consider, feel free to ask if something isn't clear :)

If you want to use GameMaker Server for a turn based game, you're most likely better off disabling the entire simple mode, and simply setting the player and other player object to -1 (or noone).

Disabling the simple mode will turn off all the "nice" stuff like automatic syncronisation of the player position and variables. You'll still be able to use gms_self_set, but you'll have to use gms_other_get to retrieve the variable.

You can use P2P messages to send turns, or anything else really, from one player to the other. This can be done cross-session, as long as you know the playerID. I think this is the best way to send a turn to the other player, but you could also use player variables.

Sessions can be used to separate different players. Global/local/instance variables are only shared within a session.
sylvia2963 on 21 Nov 2015, 17:30:50
hey i got a question.
i did this part and tested it with a friend.
but it seems we cant see each other animations of the character ? so its like the other player is just lets say standing still and when they move the image wont change. but our characters do the animation perfectly.
hope you can help me :)
Forgeio on 22 Nov 2015, 20:34:00
use gms_optimize_variables(true,true);
NiuWeb on 15 Nov 2015, 02:59:31
Hi,
How can i save images or other files on the server? Can i do it?
Size43 (Administrator) on 15 Nov 2015, 20:33:12
If you just want to store small images, you could use Binary Data Blocks.

GameMaker Server is not intended as a file hosting platform, so it's not possible to host big files on GameMaker Server.
Forgeio on 5 Oct 2015, 01:27:59
hey I didn't really know where to put this comment so Ill just post it here, but why haven't you sent my example back? I really need it for my game.
Size43 (Administrator) on 9 Oct 2015, 14:45:15
I might have missed something, I'm not too sure what I'm supposed to send back. If you mean the instance syncing problem (or was that someone else?) -- I'm still working on that. There are a few bugs that need to be fixed before it'll work, and I haven't had the time to do that.
Forgeio on 10 Oct 2015, 19:20:33
yeah the instance syncing one. And I don't mean to rush you or anything, I just need it as soon as you possibly can finish it :)
Size43 (Administrator) on 17 Oct 2015, 15:43:57
Sent you a mail :)
Forgeio on 18 Oct 2015, 05:11:41
Thank you!!
RefresherTowel on 27 Sep 2015, 13:34:35
Hey, I'm trying to get the server working, but I'm getting absolutely nowhere. I tried inserting the code (using the Windows version, not the All version) into my game and it would display the login box, but if I clicked login, nothing would happen and if i went to the registration section, clicking register did nothing as well (before and after filling out the forms). So I figured I must have made a mistake somewhere.

I then opened the VS Mode - GML project example you included and ran that. The exact same thing happens. No matter what I do, it simply won't do anything when I click the login button or try to register a new user.

I've tried the gms_info_isconnected() function and it returns true, however if I remove the Windows version and add in the All version (and add the gms_network() to the network section) the gms_info_isconnected() function returns a false. Nothing else will work. It doesn't show a ping, most of the other functions I tried returned as false. Using v1.86b of GMS and v1.4.1657 of GM.
Size43 (Administrator) on 27 Sep 2015, 16:17:14
Apologies, something was wrong with the server. It should all work now.
RefresherTowel on 27 Sep 2015, 16:22:30
Thanks a lot for the speedy reply size (and the fix) =)
POTATO on 27 Sep 2015, 04:37:20
What is event user 15? I have no idea what it is and any help would be appreciated.
faiz876creations on 27 Sep 2015, 09:11:47
User Defined 15
On an Object, click on Add Event and click on Other, and select User Defined 15
faiz876creations on 26 Sep 2015, 05:13:35
Im new to this Game Maker Server.
And this tutorial helped me alot. Thanks.
Size43 (Administrator) on 3 Oct 2015, 19:18:28
Thanks, that's good to hear!
Cubit_Works on 13 Aug 2015, 18:31:33
Hello, I'm new to GMS but would it be possible to remove the 'by using GMS you agree to the terms of use' at the bottom of the login? I want to make the game more professional.
Forgeio on 14 Aug 2015, 04:36:32
LiamScaife on 18 Jul 2015, 09:21:03
When i run my game it opens the login room, but not the login window. Why?
Size43 (Administrator) on 24 Jul 2015, 15:36:00
The login window will not show up if you're not connected to the server (gms_info_isconnected), or when the GMS object does not exist. Please make sure both are not happening.
jose_cv21 on 15 Jun 2015, 19:47:45
1. When I import the project topdown shotter gml I get the error can not find extension package: Gamemaker Server +
2. Then I import the extension GameMaker Server 1.8.5d - GameMaker Studio (All) .gex and compile I get the following error: ###########
FATAL ERROR in
action number 1
of Create Event
obj_login for object:

Push :: Execution Error - Get -5 Variable .__ socket_connected (100430, -2147483648)
  at gml_Script_gms_info_isconnected (line 1) - Global return .__ socket_connected;
#####
-------------------------------------------------- ------------------------------------------

3. If I create a new room and call there rm_init and hit the GMS object as you say in the manual with it compile, then logging calls me and tells me to wait until another player connects, then I connect with another player and I 2/2 but says players starts the game.
What do I do wrong?
Size43 (Administrator) on 20 Jun 2015, 15:20:36
Please make sure you're running the latest version of GM:Studio. Extension packages are included in the gmz, so you should never see that error.
DrGains on 23 May 2015, 00:22:08
Hey Im not really sure I understand what this site is suppose to do. Is it suppose to host a server thats already made.? Or is this just an extension that sends values to this site from your game? Because I have an online game written on GM8.0 with 39dll.dll but could find a way to make it public.

Maybe someone could point me in the right direction if I am in the wrong place.~
Size43 (Administrator) on 23 May 2015, 14:03:38
This is the site for the GameMaker extension with the same name. The aim of GameMaker Server is to make creating multiplayer as easy as it can be. You won't need to worry about server hosting or the underlying networking protocols. Instead, you can focus on the gameplay and other aspects of the game.

Besides multiplayer hosting, this extension also offers online highscore, achievements, INIs and statistics & analytics.

Hosting for 39dll, HTTP2 dll and GM:Studio Networking API games is being worked on and will be supported in the future.
DrGains on 26 May 2015, 00:54:39
Oh wicked. Will you be hosting any of the old gmmo's than? Id love to see ArAd again. Ill be checking in every now and then, cant wait. :)
Size43 (Administrator) on 26 May 2015, 11:05:23
(Almost) anything made in GM8/GM8.1/GM:Studio will be supported. It does require the server gmk/gm81/gmz, because everything will be re-compiled into a much faster binary that also offers some safety features to prevent someone from breaking my server.
DrGains on 26 May 2015, 22:56:22
That sounds fine, if you want I can send you a copy of my server.gmk just for some sort of reference. It still needs some work on my end.
Size43 (Administrator) on 30 May 2015, 16:30:43
Yes, that'd be great! Please send it to gamemakerserver@outlook.com

I'm currently rewriting the compiler from scratch, but it'll be really useful when I start running tests with real game servers to iron out the bugs and other issues.
trg601 on 9 Apr 2015, 04:46:17
It works for windows fine, but not with html5 export.

I am using the gms_networking() script in networking, is there anything special I need to call for an html5 game?
Size43 (Administrator) on 9 Apr 2015, 12:00:23
HTML5/JavaScript exports are unfortunately not supported at the moment due to the lack of proper socket functions.
ZETiNET on 10 Mar 2016, 16:26:45
When it will support HTML5 exports?
Size43 (Administrator) on 14 Mar 2016, 16:28:48
When the rewrite (v3) is finished. I don't have a specific timeframe for that.
crocusgames on 17 Mar 2015, 07:13:38
Hello Size43,
I love your work. It is currently just the thing for my needs. However, I have some doubts. I would like to ask these to you and clearify.
I will be using the game.ini function of GMS heavily. Due to the nature of my game there will be a section with around 70 keys and players will constantly change them. On weekdays I have around 5-7K players daily and on weekends that number goes up to 40K. My doubt is that; I wonder if GMS can handle such a load? I have so little knowledge to networking so GMS is perfect for me. But I also need to know id it would function seamlessly or not?
Thank you.
Forgeio on 24 Jul 2015, 19:06:06
what's your game called? can I play it? Ive been looking for a good multiplayer game for a really long time :P
Size43 (Administrator) on 17 Mar 2015, 11:15:37
Hey,

The highest load the server has had is 20K connections in a week (that ends up being 3k a day, but it's definitely been up to 5 or 6k on a single day), which was fine. I don't expect problems with the loads you're describing.

One thing you may want to check out is the binary data block feature. Unlike INIs, binary data blocks can be "locked" when writing to them, to prevent multiple clients from overwriting eachother. Binary data blocks are also downloaded on-demand instead of on-connect, so your game would only download the data it actually needs.

Lastly, please consider donating (http://gamemakerserver.com/en/account/pixels/buy/) if you're going to use GameMaker Server. It helps pay for the costs of running a server :)

Size43
Syntation on 14 Mar 2015, 22:44:01
Hey, when i load the extension, it says : "Error loading action library : GameMaker Server+(Windows)1.lib" and i also cant uninstall the extension. How can i fix that?
Size43 (Administrator) on 15 Mar 2015, 16:57:03
Please delete everything starting with GameMaker Server in the following folders:

%appdata%\GameMaker\extensions
%localappdata%\GameMaker8.1\extensions

or for GM:Studio (but I believe this bug is fixed in GM:Studio)

%appdata%\GameMaker-Studio\extensions
%localappdata%\GameMaker-Studio\extensions

Not all folders will contain files to be deleted.
Syntation on 15 Mar 2015, 19:20:44
In my AppData / Game Maker / Extensions Folder is nothing beside then a readme. But the extension is still in Game Maker . By the way, i use Game Maker Studio.
Syntation on 16 Mar 2015, 15:58:26
I forgot to delete the datas in the localappdata, that worked for me. But when i start the game ( with your settings) , i just get an empty error screen. How can i fix this?
Size43 (Administrator) on 17 Mar 2015, 11:00:56
Seems like the game is not connecting to the server. What game are you trying to run?
Syntation on 17 Mar 2015, 15:42:26
I dont know if you mean the name of the Game , but the game is named "Eternity".
Size43 (Administrator) on 17 Mar 2015, 15:46:17
You'll have to give me a little more info. What is supposed to happen?

Please let me know what version of GameMaker Server (All / Windows / GM8 or 8.1) you're using.

Please double-check that your GameID hasn't changed (GM:Studio sometimes does this) the GMS object exists before you call gms_settings, and that gms_init, gms_step, gms_draw and when using the All version gms_network are called in the proper events.

Thanks,
Size43
Syntation on 17 Mar 2015, 17:11:15
I am using Game Maker Studio, And i use the Game Maker Server Windows version. The GameID is still the same, The GMS object exists before gms_settings get called, and the codes are right. I did everything just like you did.
Size43 (Administrator) on 17 Mar 2015, 17:17:42
It seems like the game is not connecting to the server. Please check whether the game is able to connect to the server at all by putting the following code in a key press event, and checking what the messagebox says:
show_message("Connected: " + string(gms_info_isconnected()))
.
Syntation on 17 Mar 2015, 17:51:24
I think you missunderstand, or i just didnt said it right, but the game doesnt even start its just an empty error message.
Size43 (Administrator) on 17 Mar 2015, 18:39:13
Sorry about that. Please check the console window. There should be an error somewhere in there.
Syntation on 17 Mar 2015, 18:53:24
When i start the game , those are the error messages which appear in the Console :

Error : gml_Script_XGms_undef_ined(1) : unknown function or script is_undefined
Error : gml_Script_gms_session_player_count(3) : unknown function or script is_undefined
Error : gml_Script_gms_session_type(3) : unknown function or script is_undefined
Error : gml_Script_XServer_step(785) : invalid token
Error : gml_Script_xGms_bdb_open(5) : invalid token
Error : gml_Script_xGms_bdb_get(1) : invalid token
Error : gml_Script_gms_bdb_close(2) : invalid token
Error : gml_Script_gms_bdb_seek(2) : invalid token
Error : gml_Script_gms_bdb_tell(2) : invalid token
Error : gml_Script_gms_bdb_size(2) : invalid token
Error : gml_Script_gms_bdb_read_real(2) : invalid token
Error : gml_Script_gms_bdb_read_string(2) : invalid token
Error : gml_Script_gms_bdb_write_real(2) : invalid token
Error : gml_Script_gms_bdb_write_string(2) : invalid token
Error : gml_Script_gms_bdb_read_hex(2) : invalid token
Syntation on 17 Mar 2015, 18:53:51
Error : gml_Script_gms_bdb_write_hex(2) : invalid token
Error : gml_Script_XGMs_remove_undef_ined(1) : unknown function or script is_undefined

Sorry for that long post.
Size43 (Administrator) on 17 Mar 2015, 19:00:34
You're running an older version of GameMaker: Studio, which is no longer supported by GameMaker Server. Because GM:Studio introduced backwards-incompatible changes by adding undefined values, support for older GM versions had to be dropped.
Syntation on 17 Mar 2015, 19:03:40
Thank you that you figured it out. I´ll probably get a new version soon, and thank you again for the time you spent to help me :)
Size43 (Administrator) on 17 Mar 2015, 19:04:38
No problem ;)
Syntation on 18 Mar 2015, 19:54:12
My fried gave me his newer GameMaker :) Now the game runs, and the login screen appears. But when i click on login/register , nothing happens. Why?

Sorry that i waste your time again ^^
Size43 (Administrator) on 19 Mar 2015, 14:33:52
Are you using the All or the Windows-version of the extension? If you're using the All version, please double-check that gms_network is called in the asynchronous networking event. If it isn't called, you'll be able to connect to the server, but logging in or registering will not do anything, just lik you described.
Syntation on 19 Mar 2015, 23:48:18
I had the Windows version and it didnt worked for me, i changed to the all version and it worked. But now, when 2 players are on the server, we just see each other bugging around instead of walking. Is this because of the game maker server or one of my scripts?
Size43 (Administrator) on 23 Mar 2015, 20:01:18
Please make sure you're running 1.8.4. 1.8.3 had a bug just like the one you're describing.
Syntation on 26 Mar 2015, 22:06:10
This worked for me , thank you. But now, i made a shooting script, and we cant see the bullets / we cant hurt each other. how can i fix that?
Size43 (Administrator) on 28 Mar 2015, 13:55:28
Are you syncing the bullets? Syncing them with the is_onetime flag should be enough. gms_instance_is_owner will come in handy to prevent the player who shot the bullet from getting hit by it.
Muldoon on 26 Feb 2015, 12:00:56
Hi Size43,

Thank you for this great extension, it helps us a lot. I followed your tutorial and browsed through some example files, but i can't find a solution to my problem.

I have a test room and a green square as obj_player. If i connect to the server the movement of other players doesn't sync properly. The other players flash a lot when moving and sometimes ghosts of their instances appear on the screen. This doesn't happen if they stand still.

One thing though, if someone moves exactly to right, the problem doesn't occur. The movement is smooth and no flashes / jitters.

My setup:
- GM: Studio 1.4.1522
- GameMaker Server 1.8.3
- ping: ~45ms
- movement: WASD
- i used all the events / actions you mentioned in the tutorial
- room size: 1136 x 640
- room speed: 30
- syncing distance: 1600
Size43 (Administrator) on 26 Feb 2015, 16:30:38
Thank you for all the details, it helps a lot!

Are you applying any sort of movement to the other player object at all? If not, could you send me (gamemakerserver@outlook.com) your project, so I can take a look? It's probably a bug somewhere.
Muldoon on 26 Feb 2015, 17:49:03
The only action applied to obj_other_player is draw_sprite(sprite_index, image_index, x, y); in it's draw event.
I sent you the project. Thank you!
Size43 (Administrator) on 1 Mar 2015, 18:20:43
Wow, I'm not sure how I missed that while testing. I'll fix the bug for 1.8.4.
bobman1 on 14 Feb 2015, 22:42:50
Hi Size43,

Thanks for making this great extension, it sure beats tackling the GM:S TCP features. I have one problem though, the clients aren't synchronizing correctly. The obj_player_other jitters around my client as if I had a latency of 600ms and their position is inconsistent on each client.
Size43 (Administrator) on 15 Feb 2015, 13:07:19
GameMaker Server runs on a server hosted in Amsterdam, The Netherlands. If you're far away from the server, you'll experience some lag. You can get the ping to the server by calling gms_info_ping.

If an object moves really quickly, the extension will stop trying to smooth/interpolate the movement, because it thinks the object jumped to that other position. That may also be the cause of the jittering.
bobman1 on 15 Feb 2015, 14:44:57
I've checked my latency and it is only at 60ms. I'm in the UK and this is quite a good speed for me.

I've reworked my code so that the movement script is played through the step event, I had hoped that this would induce more refreshes, but it didn't work.

I am using another extension for my movement, because I need the objects to move on a grid based on mouse clicks. Could this be the source of my problem? Every other example I've seen use vk_keys.

I've also noticed that the player objects sometimes disappear on other clients, but remain in place on their masters.

Thanks for the speedy reply, btw. It's very much appreciated.
bobman1 on 15 Feb 2015, 15:01:22
The movement extension doesn't seem to be the problem. I tried using a simple wasd script to the same result. :/
Size43 (Administrator) on 15 Feb 2015, 16:21:33
Please double-check that you're using 1.8.2, since previous versions of the extension did have a bug that made players jump all over the place.

The only other thing I can think of is that the obj_player_other object has the wrong speed and direction. That would cause the player to move all over the place. You can try different types of interpolation, extrapolation or smoothing by calling gms_optimize_set_spc. spc_none will disable everything, and just put the object at the last received position. spc_smoothen will disable all inter/extrapolation.

If that doesn't help, please send me a mail at gamemakerserver@outlook.com with the project file so I can take a look at it ;)
bobman1 on 15 Feb 2015, 16:33:20
using gms_optimize_set_spc threw an error in both cases, I'll send you the project now.
Size43 (Administrator) on 16 Feb 2015, 19:56:00
I think we accidentally joined at the same time today. The game ran fine on my side, no visible lag at all. One thing I did notice is that the server did not receive any ping updates while you were not moving.

In older versions of GameMaker: Studio there was a bug where a socket would not receive data if the length was less than 12 bytes. That may include the position data that's sent to the clients, which will only come though every 3 seconds when the server sends a ping to the clients. The ping and position data together would be enough to go over that 12 byte threshold.

Please try switching to the Windows version and let me know if you experience the same issues. :)
bobman1 on 16 Feb 2015, 20:43:38
Bingo, you got it. Just needed to update.. I can't believe it was that simple, haha, yet it tends to be the case with most problems in programming. Thank you for your help, I really appreciate it.
Size43 (Administrator) on 17 Feb 2015, 16:56:36
Hahaha, I'm really glad that worked. I was really just guessing to be honest ;)
bobman1 on 17 Feb 2015, 18:39:54
New problem. :(

The master client is ID 81717, which doesn't exist on the server, nor any clients. I can't utilize the master client until I get rid of it somehow to allow a new master to be assigned.
Size43 (Administrator) on 17 Feb 2015, 18:47:48
The master player ID is sent every time someone logs in or out. ID 81717 belongs to an account named DasKobi, which seems to be you as well. Does the master client ID have a valid value when the first user logs in? (Also, note that the gms_other_* functions do not include the client itself)
bobman1 on 17 Feb 2015, 18:50:40
Oh, is the master id not related to the player_id? Following your "Synchronising instances" tutorial didn't spawn any NPC objects so I assumed that I was not the master. Perhaps I have just implemented it incorrectly, I'll look more closely at my code now.
Size43 (Administrator) on 17 Feb 2015, 18:56:06
The master player ID is the ID of one of the online players. More precisely, it's the ID of exactly one of the players in a session. That means it's either gms_self_playerid() or one of the gms_other_find(n) playerIDs. I can look those IDs up, which is why I know the account that belongs to that particular ID :)
bobman1 on 17 Feb 2015, 19:35:10
Hmm, I see the logic.. but it doesn't seem to be working in practice. I did a check "gms_self_ismaster()" to see if any of the online players (including daskobi) were the master client and each came back false. The NPCs that I have created by following your tutorial also do not spawn without a master client present.
bobman1 on 17 Feb 2015, 21:03:45
I had to kick the master client and now it works correctly.
Size43 (Administrator) on 17 Feb 2015, 21:41:12
That's very strange. Please let me know if it ever happens again!
bobman1 on 19 Feb 2015, 13:52:35
Yeah, it has. :l kicking the player doesn't work anymore. I used your code below and here's the result.http://i.imgur.com/3wXO2PK.jpg

My ID uses gms_self_playerid()
bobman1 on 19 Feb 2015, 13:59:07
I'm using GameMaker version 1.4.1474.
Size43 (Administrator) on 19 Feb 2015, 20:26:11
The fact that the masterID is different pretty much implies someone else is online as well. Does gms_other_count() return more than it should? (it should return the number of clients that are connected - 1)

Just to make sure the gms_self_playerid() is returning the correct value: Did you login as Guest_625?
bobman1 on 19 Feb 2015, 22:16:36
I was logged in as DasKobi and gms_other_count returns 0. (I only logged in with one account)
bobman1 on 19 Feb 2015, 22:54:31
Out of curiosity I created an account called "Guest_625" and it worked! I then logged back into daskobi, no success. I then created a new account which also didn't work. I then enabled guest accounts (which I had disabled) I logged in as "Guest_"625 but it didn't work! The only way the master is correct is if I use an account named "Guest_625" that is not actually a "Guest_". o.o I'm so confused.
Size43 (Administrator) on 20 Feb 2015, 15:56:26
There is indeed a bug in the code. PlayerIDs are still read as a two byte number, so anything higher than that will be truncated to fit in the two bytes. This only affects the (All) version of GameMaker Server. The (Windows) version works properly.

I'm in the process of getting update 1.8.3 ready. This bug will be fixed in that update. :)
bobman1 on 20 Feb 2015, 16:02:37
Ah, yes I've been using the (all) version. Thank you very much for looking into it.
Size43 (Administrator) on 19 Feb 2015, 23:22:28
161581 is actually 81717 converted to a two-byte unsigned integer. Many versions back, the extension used two-byte integers to store playerIDs, but this changed because playerIDs started to reach the limit of values that can be represented by two bytes (65536). Seems like I forgot to change the type somewhere in the code. I'll look through it tomorrow, and let you know what I find.
Size43 (Administrator) on 17 Feb 2015, 21:00:32
That's very weird. I modified the project you sent me and changed the draw_text in the GMS_controller object to:

draw_text(x,y,"Am I master?: " + string(gms_self_ismaster())
"#Who's master?: " + string(gms_master_player()))


This seems to work fine. What version of GameMaker are you on right now?
LightUpGamesTM on 10 Feb 2015, 16:37:56
Hey size i have an idea for you that you can use in the extension you can make so that everything that you can make in code you can make in Drag N Drop? im like only familliar with drag and drop in your extension :)
Size43 (Administrator) on 11 Feb 2015, 20:37:22
I do try to add D&D actions when I think of it, but it's hard to translate the functions into useful D&D actions most of the time. Anything in specific you're missing?
LightUpGamesTM on 9 Feb 2015, 20:12:41
I think this multiplayer gta game is a bit much to start with do you have any ideas what i can start with in multiplayer,like a simple game thats fun to play against friends P.S im not that old and im using drag and drop only(only for multiplayer otherwise i use code)
Size43 (Administrator) on 9 Feb 2015, 20:51:58
A shooter of some sort or something like Speedrunners would be easier to do than a GTA clone :)
LightUpGamesTM on 10 Feb 2015, 19:35:30
Hi Size! um i got a little problem with the drag and drop functions, i looked at the shooter example and i sat up the teams exactly as you did but instead of coordinates i made so the players go to the objects .
now the problem is that when i come to the "Waiting for players" and when 2 players connect it is still on lobby and it doesnt change room and it should cause i added goto next room but it doesnt work
Size43 (Administrator) on 11 Feb 2015, 20:37:59
Enable the VS mode on the game settings page on the developer part of this website ;)
LightUpGamesTM on 9 Feb 2015, 20:04:25
Sorry if i ask much but i didn`t know that you could only have 5 accounts so is there a way to delete them?
and P.S i use drag´n´drop
Size43 (Administrator) on 9 Feb 2015, 20:06:02
There's not. If you've got 5 accounts you'll have to recycle them a little more :)
LightUpGamesTM on 9 Feb 2015, 19:45:17
I`m trying to make an online gta game and ive made a car that i can enter and exit and i can drive of course:D
now here`s the problem : the other player doesn`t see when im driving and i dont see when he is driving, i tried drag and drop with the sync but it doesn`t work. How am i supposed to do
????
Size43 (Administrator) on 9 Feb 2015, 19:47:45
Set a variable for the players:

//When in a car
gms_self_set("in_car", true);
//When not in a car
gms_self_set("in_car", false);


Now you can just draw the car on top of the other players without having to sync additional objects:

if gms_other_get(player_id, "in_car")
{
    draw_sprite(x, y, spr_car, bla bla not too sure about the argument order here...
}
LightUpGamesTM on 9 Feb 2015, 19:52:00
Im not sure i know alot about arguments and i want the car to be able to turn and stuff can u please make an example and remember that i have to be able to enter and exit cars.
if its not to much to ask! :D
Size43 (Administrator) on 9 Feb 2015, 20:03:07
I'm sorry, but I can't. most of the time I'm dealing with 5-6 people at the same time. If I'd start making examples or ask them to send me their project files so I can fix it for them, I'd be doing a full time unpaid support job. :) I only ever accept GameMaker Project files when I'm fairly sure it's a bug, and I need something that will help me reproduce that bug (so it saves me time, not gives me more work).

The draw_sprite part in the code I posted above should be:
draw_sprite(spr_car, -1, x, y)
LightUpGamesTM on 9 Feb 2015, 20:08:53
K, thanks anyway
BTW good extension,before i found this i didn´t understand anything about online but thanks to you
and this awesome extension i can make a fricking multiplayer Game!
THANKS ALOT! I APPRECIATE ALL HELP! :D :D
:D :D :D :D
Size43 (Administrator) on 9 Feb 2015, 20:50:22
Glad you like it :)
LightUpGamesTM on 9 Feb 2015, 19:34:56
Um Size can u help me with a thing
Size43 (Administrator) on 9 Feb 2015, 19:38:06
Ask away :)
LightUpGamesTM on 9 Feb 2015, 19:34:18
Hey Size i have a quick question
peril94 on 10 Dec 2014, 17:33:34
Hi thanks got it all set up, when I click register though the form comes up and I fill it in but when I click register nothing happens.
peril94 on 10 Dec 2014, 00:05:37
Hi thanks got it all set up, when I click register though the form comes up but then I fill it in and click register nothing happens.
Size43 (Administrator) on 10 Dec 2014, 11:17:36
This is a known issue, it will be fixed in update 1.8. ;)
peril94 on 10 Dec 2014, 17:34:12
Thanks ! :)
Ajay on 2 Dec 2014, 08:26:15
Ohh my God Size43....
Thank you so much for the help................................
Now working fine when i used INI in networking event..............

BIG THANKS TO YOU............I LOVE YOU,,,,,,,,,.........................


:) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :)


:D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D


THANKS AGAIN................
Size43 (Administrator) on 2 Dec 2014, 18:43:23
Glad I could help :)
Ajay on 1 Dec 2014, 12:34:36
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Create Event
for object obj_login:

Push :: Execution Error - Variable Get -5.__socket_connected(100421, -1)
at gml_Script_gms_info_isconnected (line 1) - return global.__socket_connected;
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_gms_info_isconnected (line 1)
called from - gml_Script_gms_settings (line 2) - if(!gms_info_isconnected())
called from - gml_Object_obj_login_CreateEvent_1 (line 4) - gms_settings(true, 1, obj_local_player, obj_dummy_player);



Please help me, I tried :((((((((((((((((
Size43 (Administrator) on 1 Dec 2014, 21:07:24
Please make sure you're calling gms_init, gms_step, gms_draw and (if using the All version) gms_network in their respective events. gms_init should be called before gms_settings. The provided example gmz has an object GMS which demonstrates the proper usage of these functions.

Size43
DarkHades251 on 10 Nov 2014, 22:58:21
This doesn't work with physics based games does it?
Size43 (Administrator) on 11 Nov 2014, 20:43:25
Physics are not synchronized to other players, but that's not to say it's impossible to create a physics-based game. You'll have to send all game data to the other players yourself.
kostrastudyos on 2 Nov 2014, 17:58:16
ok but... WHERE IS THE EXTENSION DOWNLOAD?!?! :S
Size43 (Administrator) on 2 Nov 2014, 20:36:44
The downloadlink can be found on the homepage of this site.
ericbomb on 9 Oct 2014, 05:20:10
Hey so I've been using GM a long time but been to lazy to set up server stuff, so my question is, will this work on android? And is it cross platform? If an android device and a windows device both connect can they play together?
Size43 (Administrator) on 9 Oct 2014, 12:26:09
GameMaker Server should work on all non-HTML/JavaScript platfroms (all platforms having network_* and buffer_* support). Cross-platform play is enabled by default. ;)
Miksamoo on 8 Oct 2014, 11:33:57
After GM:S update, gms_show_login not work. It gets this error:


___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Create Event
for object login:

undefined value
at gml_Script_XWindow_parse_layout (line 291) - while(__key != 0)
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_XWindow_parse_layout (line 291)
called from - gml_Script_XWindow_load (line 38) - _ret = XWindow_parse_layout(str_layout, data_p);
called from - gml_Script_gms_show_replace (line 6) - global.__xls_window = XWindow_load(argument1);
called from - gml_Script_gms_show_login (line 1) - if(global.__xls_window == -1)
called from - gml_Object_login_CreateEvent_1 (line 1) - gms_show_login()

Before update all works.
Size43 (Administrator) on 8 Oct 2014, 14:33:11
What version of GM:Studio are you using (after the update)?
Miksamoo on 9 Oct 2014, 18:23:35
I am using 1.4.1398
Miksamoo on 9 Oct 2014, 18:24:09
I am sorry 1.4.1451
Size43 (Administrator) on 9 Oct 2014, 18:28:41
Seems like YYG introduced "undefined" values, and changed a lot of functions to return undefined values. I'll be working on fixing this, but it may take quite a while to go through the entire code.
namlunthkl on 6 Oct 2014, 23:58:39
I have found some bugs! When the guest login with the same name, they won't see the other!
(Sorry, I am bad at english)
Size43 (Administrator) on 7 Oct 2014, 19:50:27
Are you using the default login box?
Orbacal on 12 Aug 2014, 19:10:46
Hello. What i need to do to get chat working?
It worked for me automatically in some previous game maker server version (1.6.1) but now seems like i have to do something for it to work, no one can write in chat anything, only Enter key flashes the chat.
Size43 (Administrator) on 13 Aug 2014, 15:52:59
Alright, I've managed to find the problem: Having a constant that contains chr(...) will break the default font (which the chat uses unless you override it). The fix for now is to use gms_chat_set_font(...) and change the chat font to your own font.

I'll be working on a permanent fix, but that may take some time.
captain_davy on 13 Aug 2014, 15:01:04
Having the exact same problem with GM 8.1, the build in chat system is neither working by use of D&D or GML, not when making a new game, regardless of views, nor in the examples such as Total Shutgun.
As Orbacal explains, it only displays the chatbox and flashes when pressing "Enter".
Size43 (Administrator) on 13 Aug 2014, 15:52:55
Alright, I've managed to find the problem: Having a constant that contains chr(...) will break the default font (which the chat uses unless you override it). The fix for now is to use gms_chat_set_font(...) and change the chat font to your own font.

I'll be working on a permanent fix, but that may take some time.
captain_davy on 13 Aug 2014, 18:31:05
Tank you so much :D
Size43 (Administrator) on 13 Aug 2014, 15:02:00
I've received Orbacal's file and I'm looking into it!
Size43 (Administrator) on 12 Aug 2014, 19:13:02
What version of GameMaker are you using?
Orbacal on 12 Aug 2014, 19:50:54
GameMaker Standart 8.1
Size43 (Administrator) on 12 Aug 2014, 20:25:54
Are you using views? If you're using multiple views, you should bind the chat to only 1 view (using gms_chat_bind_view)
Orbacal on 12 Aug 2014, 20:40:52
Well i based the game on Total Shotgun, it is using views.
Previous game that i based on Total Shotgun was working.
But with new server version new game doesn't work
Size43 (Administrator) on 12 Aug 2014, 20:44:47
Its working fine for me. Would you be able to send me a file that demonstrates the problem?
Orbacal on 12 Aug 2014, 21:23:50
Send to gamemakerserver@outlook.com?
Size43 (Administrator) on 12 Aug 2014, 21:27:36
Yes, that would be great!
LightVelox on 24 Jul 2014, 20:09:44
Last Question,on gms_register(username,pass,pass2,mail,callback)
what i put on CallBack?
Size43 (Administrator) on 24 Jul 2014, 20:42:14
The callback script is (this also applies to gms_login_execute) used to notify you of what the result of the registration/login was. gms_register/gms_login_execute only send a request to the server. The callback script is then called when the server responds with either "login/registration" OK or "error." (argument0 is set to an e_* constant for gms_login_execute and a re_* constant for gms_register)

I've updated the documentation of gms_register because it did not mention what arguments were used for calling the callback script.
LightVelox on 24 Jul 2014, 00:27:49
sorry for the question,how i make a login system with codes?i know how make a register system but no a login system is:

gms_login_set_password(string(var_password))
gms_login_set_username(string(var_username))

???/

please respond.sorry for bad english i are brazillian
Size43 (Administrator) on 24 Jul 2014, 16:56:01
You can use gms_login_execute to finish the login process after calling gms_login_set_password and gms_login_set_username. Alternatively, gms_show_login() can be used to show the default login screen.
Ajay on 28 Nov 2014, 12:30:12
############################################################################################
ERROR in
action number 1
of Create Event
for object GMS:

server_settings wasn't called before calling an other script!
at gml_Script_XServer_verify (line 3) - show_error("server_settings wasn't called before calling an other script!", 0);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_XServer_verify (line 3)
called from - gml_Script_gms_ini_game_read (line 1) - XServer_verify();
called from - gml_Object_GMS_CreateEvent_1 (line 2) - Update = gms_ini_game_read("Updtae.ini","Version")




error in gamemaker studio
Size43 (Administrator) on 28 Nov 2014, 21:01:33
Please make sure to call gms_settings before you try calling gms_ini_game_read. Also, note that in GM:Studio, all networking events are asynchronous, meaning the GameINI may not be available the first few moments after opening the game.
Ajay on 29 Nov 2014, 08:12:26
I can't understand this. Please make example project and put on Home page.
Size43 (Administrator) on 29 Nov 2014, 20:23:25
There's a sample GM:Studio project in the download :)
LightUpGamesTM on 4 Mar 2015, 17:30:51
Hey size, does this work with 3d
Size43 (Administrator) on 4 Mar 2015, 17:33:48
It does, but you'll have to disable automatic drawing. (gms_draw_toggle)