Headless Support for Game Maker: Studio 2

Discussion in 'Game Design, Development And Publishing' started by Seabass (The Human), May 11, 2017.

  1. Seabass (The Human)

    Seabass (The Human) Member

    Joined:
    Jun 20, 2016
    Posts:
    357

    Attached Files:

    Monsi and Genetix like this.
  2. ThunkGames

    ThunkGames Guest

    I suppose it could open up some new possibilities. Game maker is for making games, though.
     
    Seabass (The Human) likes this.
  3. zbox

    zbox Member GMC Elder

    Joined:
    Jun 21, 2016
    Posts:
    793
    citation needed??

    there's a whole topic about the size of a small textbook discussing this, this is a bad idea kill it with fire

    GM is pointedly an end-user Game product. There are already lots of other, more appropriate, ways to do a server.

    IMHO. ;)
     
    Snayff and ThunkGames like this.
  4. Ninety

    Ninety Member

    Joined:
    Jun 21, 2016
    Posts:
    244
    silly zbox, change.org petitions always work
     
    Lukan, Dogarooski, Bleed and 3 others like this.
  5. zbox

    zbox Member GMC Elder

    Joined:
    Jun 21, 2016
    Posts:
    793
    you know what I've actually seen so many petitions (in general, not this specifically) that I don't like or think are bad but don't have an easy way to express my dissatisfaction. I think it's very unfair that you get Change.org to filter and show only positive support

    Every time I see one, I look and see if I can buy a domain in the region of "dont-change.org", and create a website in which every time someone creates a petition on change.org, it auto generates an "anti" petition to each one that people can sign. I reckon it would be great, maybe I'll do it one day ;P
     
  6. Yal

    Yal GMC Memer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    3,693
    Backed because why not. MAYBE THIS WILL MAKE PEOPLE TAKE GMS SERIOUSLY :D
     
    Genetix and Seabass (The Human) like this.
  7. Seabass (The Human)

    Seabass (The Human) Member

    Joined:
    Jun 20, 2016
    Posts:
    357
    That's what I'm talking about!
     
  8. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,894
    Citation needed.
     
    Dogarooski, Bleed, Monsi and 4 others like this.
  9. alexandervrs

    alexandervrs Member

    Joined:
    Aug 23, 2016
    Posts:
    18
    I'd say that an official open source C# framework -with only the parts of GMS2 needed to interface & make devs life easier like string/math/file/buffer/network functions etc.- to compile a server for use with GMS games would be more useful, than complicating the runner codebase for this
     
  10. Seabass (The Human)

    Seabass (The Human) Member

    Joined:
    Jun 20, 2016
    Posts:
    357
    Because simulating collisions, physics, and everything else would be totally easy in C#.
     
  11. Seabass (The Human)

    Seabass (The Human) Member

    Joined:
    Jun 20, 2016
    Posts:
    357
    My source would like to remain anonymous.
     
    zbox likes this.
  12. alexandervrs

    alexandervrs Member

    Joined:
    Aug 23, 2016
    Posts:
    18
    Like I said, it could have anything needed to do that stuff and be ready for compilation. If you're building an online game of that sorts, I'd assume you're somewhat versed with programming, and C# is rather easy to work with
     
  13. Seabass (The Human)

    Seabass (The Human) Member

    Joined:
    Jun 20, 2016
    Posts:
    357
    This is true but since Game Maker is meant as an all-in-one solution, it would only benefit us to have this feature as well. :)
     
  14. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,404
    Because writing server software in a single-threaded dynamic language without compile-time checks and exception handling is a good idea. Seriously, I applaud the enthusiasm.

    Late last year I was hired to port ~10 000 lines worth of GML because someone too thought that it's a good idea, only to realize half of year later that they are screwed.

    That said, if your server is ridiculously small or you absolutely desire self-harm, it is of no trouble to run GameMaker-Ubuntu applications on headless Linux servers (e.g. DigitalOcean units) - you only need to install dependencies and set up a fake screen driver so that GLUT is not upset about not being able to open a X11 window before you disable drawing permanently.
     
    Nocturne, Roa, zbox and 2 others like this.
  15. slojanko

    slojanko Member

    Joined:
    Jun 20, 2016
    Posts:
    113
    What other benefits does headless support have besides not having a UI? What's the difference between me minimizing my program and having headless support?
     
  16. The-any-Key

    The-any-Key Member

    Joined:
    Feb 2, 2017
    Posts:
    1,521
    Java? Jnode?... And all other headless possibilities?

    Sure I would like GM to be able to be headless. But I see a endless stream of bugs and how things would work.
     
    Last edited: May 11, 2017
  17. Seabass (The Human)

    Seabass (The Human) Member

    Joined:
    Jun 20, 2016
    Posts:
    357
    I spoke to someone about doing this but didn't have confirmation as to whether or not it worked. Still though, wouldn't it be nice just to add a "-headless" and have the executable run headless on Windows? Can't say that wouldn't be nice. I'm not writing a massive MMO or anything crazy and most people shouldn't do such a thing in GM. But even for a small server, it would be nice to have the option.
     
    DukeSoft likes this.
  18. ThunkGames

    ThunkGames Guest

    @Seabass (The Human) I forgot to mention this bit to you when I replied to your blog post about GM:S servers. Multithreading is imperative when deigning a half decent server. For your sake I am begging you not to use GM for your server (spoken as someone who used to use GM for servers). Using GM for your back-end is, to me, akin to using GM to build a AAA 3D game: while much of the underlying technologies are there, GM is an entirely inappropriate tool.

    Edit:
    I made a framework for communication between GM/Java clients and a Java server if you are interested in it.
     
    zbox likes this.
  19. Seabass (The Human)

    Seabass (The Human) Member

    Joined:
    Jun 20, 2016
    Posts:
    357
    I don't disagree with you at all on this matter but the server only needs to support (at most) 64 players. I've tested it with 16 (in my case) and I still have loads of overhead. If I was making something that required a lot, then I would use something else. As of right now, the server updates player positions and a few basic loops run. With YYC I'm sure it'll be ok for my current project.
     
  20. Roa

    Roa Member

    Joined:
    Jun 20, 2016
    Posts:
    560
    Gamemaker is multi threaded, you just don't have control over how its split up, and its split up well enough for general use. If you have the CPU time to run the game with other clients in general, then the server is also in the ability to run those clients data. There isnt some massive over head on a server if its just going to be a few packets and an exact copy of the game mechanics and world, the only change being authoritative measures. If you don't worry about drawing time and passing graphics, you actually have more CPU time than the clients, so idk what the issue is. Aside from that, its not even hard to make multiple servers that run dependently and just add load balancing features.
     
  21. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,404
    If you do
    Code:
    draw_enable_drawevent(false);
    on game start, DirectX will not be initialized, and no window will appear. If no sound assets are added to the project, OpenAL will not be initialized either, leaving it "headless" by your definition.
     
  22. Seabass (The Human)

    Seabass (The Human) Member

    Joined:
    Jun 20, 2016
    Posts:
    357
    As long as it can run on a Window Server without a GPU, then I'd be more than satisfied.
     
  23. ThunkGames

    ThunkGames Guest

    I misspoke. I realize that Gamemaker is multi-threaded automatically, but I mean support for concurrency (which you can control).
     
  24. Seabass (The Human)

    Seabass (The Human) Member

    Joined:
    Jun 20, 2016
    Posts:
    357
    *Bump* for more petition signers. ;)
     
    Roa likes this.
  25. Kenjiro

    Kenjiro Guest

    Yes! Signed. This would be awesome!

    This information is false.

    Yes, no window will appear. But DX will still be initialized, ready, and waiting.

    You can test this yourself

    Game Start - draw_enable_drawevent(false);
    Create - show_debug_message("Window device: " +string(window_device()));
    show_debug_message("Window handle: " +string(window_handle()));

    This would return 0 if there was no valid window device. There is even a valid hidden window here also.

    draw_enable_drawevent(false) merely disables the drawing of the window. Your project will still crash if you attempt to run it on a machine that has no DX capable graphics device (i.e. a terminal server, etc..).
     
    Last edited by a moderator: May 23, 2017
    Seabass (The Human) likes this.
  26. Rusky

    Rusky Member

    Joined:
    Jun 21, 2016
    Posts:
    11
    It shouldn't matter whether GM initializes Direct3D. Even Windows Server supports the API, and you can create a software device on machines with no GPU. The only reason YYG would need to touch anything for this is if they're creating the device in such a way that they prevent D3D from using that fallback.

    Whether GM is a great fit for a server is another question ;)
     
  27. Kenjiro

    Kenjiro Guest

    DirectX doesn't have a software device, out of the box. To use the 'software device' you have to write the implementation yourself and hook that into DirectX.

    Maybe you are thinking of the 'Ref' device, which does everything in software. But, you can't use this in Release mode.

    https://msdn.microsoft.com/en-us/library/windows/desktop/bb219625(v=vs.85).aspx

    Essentially, it is hardware accelerated or nothing.
     
  28. Rusky

    Rusky Member

    Joined:
    Jun 21, 2016
    Posts:
    11
    DirectX does have a software device out of the box, which works in release mode and can even be force-enabled on existing binaries: https://msdn.microsoft.com/en-us/library/windows/desktop/gg615082(v=vs.85).aspx
     
    Kenjiro likes this.
  29. Kenjiro

    Kenjiro Guest

    Ah, right you are. I was stuck in the DX9 mindset. Totally forgot about WARP.

    Well yeah, if WARP fallback was (is?) enabled then there shouldn't really be an issue.

    I might do a test on a terminal server and see what happens. Will keep you posted.
     
  30. KurtBlissZ

    KurtBlissZ Member

    Joined:
    Jun 21, 2016
    Posts:
    200
    So really in combination with that and http://docs2.yoyogames.com/source/_...reference/miscellaneous/parameter_string.html you could even emulate the -headless parameter.
     
  31. MudbuG

    MudbuG Member

    Joined:
    Jun 21, 2016
    Posts:
    43
    Yes, Headless please. Signed the petition.
     
  32. Kuro

    Kuro Guest

  33. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,404
    IIRC show_debug_message outputs into the command line. If not, making a DLL for that is trivial.
     
  34. andev

    andev Member

    Joined:
    Jul 2, 2017
    Posts:
    444
    I have written a GML "library" in python, that includes ds_lists, ds_maps, buffers, networking and instance scripts using exactly the same syntax as in game maker. I am in the process of testing it at the moment, but so far it can successfully communicate with game maker on a digitalocean linux server (so it will run on any VPS). I am going to do a public stress test soon with it, and if all goes well I will publish the full sourcecode and documentation to go with it here.

    That might be of interest to anyone reading this topic and feeling their heart sink lower and lower with every post :)
     
    Yal and ThunkGames like this.
  35. ThunkGames

    ThunkGames Guest

    That's really freaking cool! I've always been forced to do GM server stuff with Node or Java (for VPS reasons), but this seems intriguing. Is it legal though? I guess @YellowAfterlife made this, so it probably is.
     
    andev likes this.
  36. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,404
    It is not illegal to mimic APIs, as such people have made multiple attempts of such things (with varying accuracy - there's a lot that's hidden from the plain eye).

    GMLive in particular does not mirror APIs, however - it has a custom GML[-like]->JS compiler that generates sets of functions that can call the built-in GML functions much like the code generated by GM itself does. That has it that on average code works exactly the same as it does when written and compiled to HTML5 in GMS itself.
     
    ThunkGames, Yal and andev like this.
  37. andev

    andev Member

    Joined:
    Jul 2, 2017
    Posts:
    444
    Well if it was illegal (or at least frowned upon), I could tweak it so instead of ds_map_*, it could be like pm_* for python map or something. (typing ds_map_* is tedious anyway!)
     
  38. Spasman

    Spasman Member

    Joined:
    Jun 20, 2016
    Posts:
    20
    Sorry for the bump, but I've also wanted this feature but I found something with hosting GM apps on a Windows virtual environment. I hope it helps someone.

    I managed to get GM games to run a virtual Windows environment, however you need to make sure the VPS can support 3d acceleration, or your VMWare instance has it enabled. This feature will simulate a GPU through the server's CPU, however 1 GM instance can eat your entire CPU if it has a display. I resolved this by adding a "minimalism" server mode to my game, where the game will run in a room with a 1x1 room size, and undraw absolutely everything. My game with 16 player support maybe peaked at 5% CPU usage when it was the most demanding. Naturally, the downside to this is you can't see the game but I got around this with logging and implementing RCON features if you need to keep an eye on things.

    So while I have found something that works for me and I don't really have a need for the feature as much anymore, I still don't understand why some people are so openly hostile towards this adding this feature. Isn't Game Maker designed to be a tool for convenience? Headless support would make multiplayer games very convenient for developers. It's simple as that to me, efficiency or laziness doesn't really factor in because if you cared deeply about those traits you wouldn't be here. I highly doubt this feature being added will stop you from writing something yourself. Maybe YYG could charge for an headless export? I'd buy it day one, and I'm sure others would too.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice