The Gang Garrison 2 Forum

Gang Garrison Development => Development Discussion => Topic started by: PrOF on October 19, 2019, 07:46:49 am

Title: Tracking progress of a Game Maker Studio 1.4.9999
Post by: PrOF on October 19, 2019, 07:46:49 am
https://github.com/PrOF-kk/Gang-Garrison-2-Studio

Don't expect this to go anywhere soon
While porting to 8.1 was a great effort, I don't think it'll bring any noticeable improvements for how complex the fixes are. Porting GG2 to a far more modern and, let's face it, saner engine will make it easier to update it in the future, even if that means sacrificing my beloved plugins.
The biggest issue I'm having is just how much we use execute_string and execute_file, there are extensions to replace that functionality but I'm not sure they'll work as we'd like them to
Oh also Faucmix (https://github.com/wareya/faucmix) will be essential for this to work, as GM:S disabled panning sound the legacy way
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: Phantom Brave on October 20, 2019, 10:22:51 am
Good luck. I don't have a 32bit-capable C++ toolchain anymore.
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: PrOF on October 21, 2019, 08:15:35 am
(https://i.imgur.com/SO1y3ik.png)
Surprisingly after only 34 commits I can boot to the Main Menu, although it's completely unreponsive since the entire menu api is based on execute_string
The splash screen works fine, although I probably have to remove antialiasing somewhere
I've had to disable the DevMessageChecker, I made some changes (https://github.com/PrOF-kk/Gang-Garrison-2-Studio/commit/d679c108c3df031a11df6473f5cdc13148cfa29a) that I thought wouldn't matter that much but apparently broke everything
I'm liking the stricter syntax for now, I'll probably backport some small fixes to the GM8 version soontm
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: Heapons on October 21, 2019, 11:37:28 am
(https://i.imgur.com/SO1y3ik.png)
Surprisingly after only 34 commits I can boot to the Main Menu, although it's completely unreponsive since the entire menu api is based on execute_string
The splash screen works fine, although I probably have to remove antialiasing somewhere
I've had to disable the DevMessageChecker, I made some changes (https://github.com/PrOF-kk/Gang-Garrison-2-Studio/commit/d679c108c3df031a11df6473f5cdc13148cfa29a) that I thought wouldn't matter that much but apparently broke everything
I'm liking the stricter syntax for now, I'll probably backport some small fixes to the GM8 version soontm

Good luck, buddy  :c1:
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: Saniblues on October 21, 2019, 06:04:41 pm
You can disable interpolation via texture_set_interpolation(bool).
I would recommend turning AA up to 2 via display_reset( aa:0,2,4,8 , bool:vsync ) since it smooths things out just enough without being too overbearing. Scales better.
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: PrOF on October 22, 2019, 04:19:29 am
(https://i.imgur.com/LooWnx6.png)
This looks, uh, promising?
I was worried I wouldn't be able to move forward because of map loading issues, but since it's done by GG2DLL we should be fine, unless it uses execute_string in which case I'd have to bin the whole project. I'm still struggling with "Error: this file does not contain level data.", probably due to GMS no longer exporting stuff to temp_directory and instead to /datafiles/ or something
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: PrOF on October 23, 2019, 03:27:43 pm
Since dynamic code has been removed in GMS I had to remove the global.__HttpClient = object_add() in __http_init, instead I added a normal __HttpClient object in the IDE and changed every reference to it (see commit) (https://github.com/PrOF-kk/Gang-Garrison-2-Studio/commit/d679c108c3df031a11df6473f5cdc13148cfa29a)
I thought this was fine since it shouldn't change anything, yet I'm having this error
(https://i.imgur.com/vwAsiH4.png)
which is weird because in the debug window I clearly see linebuf = "" for __HttpClient, whose instance id should have been passed to the script, but the id is wrong
Does anyone have any idea what could have caused this? In GM8 we disabled "treat uninitialised variables as 0", so it's not that
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: BlackDoomer on October 23, 2019, 04:49:23 pm
Good effort. But I have to make some remarks.




Anyway, keep up the good work!
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: Saniblues on October 23, 2019, 09:30:43 pm
Good effort. But I have to make some remarks.

Removing plugins from the game is not an option IMHO.
Yes it is. You can just implement chat into the game, the code for the chat mods is literally open-source, and that's basically the only plugin that's truly used on most servers.
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: PrOF on October 24, 2019, 03:28:33 am
  • Removing plugins from the game is not an option IMHO.
I would have agreed with you until about a month ago. To be honest plugins are the only reason I stuck around for so long, I had a blast coding my plugins and fixing others, but apparently very few actually cared, and I can always make a community version of the game with integrated client-side plugins toggleable in the options. Lorgan's chat is also obviously a must, so if I ever get the game to work properly that'll be my next step. I'd also include his DamageIndicator and a few others
  • Use the GM4HTML5 1.0.218 (https://archive.org/details/GMHTMLPatcher) as a classic GM. AFAIK it's pretty the same as 8.1.141, but its internal version of Windows runner is 8.1.218 and it supports the same VCS-friendly source format as Studio does.
I'm not sure that's an option, the Faucet extensions uses dlls so while they could be compiled to work in Linux I'm not sure about HTML5
  • Use the fct_ prefixed edition of FaucetNet, available as standard one in the release archive here (https://github.com/Medo42/Faucet-Networking-Extension/releases).
    This resolves all the naming conflicts and is much better than that commit with very ugly approach (https://github.com/PrOF-kk/Gang-Garrison-2-Studio/commit/fea191f90fc30b206b3b3aca00aea5687d158f70).
Nice find, I'll be sure to replace the one we have, but right now I'm more concerned about actually getting the game to run
  • This commit (https://github.com/PrOF-kk/Gang-Garrison-2-Studio/commit/6ab7d7ce61337ee66374b02d99bb172de5239872) is not so beautiful too.
    It should be pretty easy to determine if argument is required or optional from the code of script itself.
That commit was and still is required, in GMS optional arguments have to both be written as an array (argument[0] instead of argument0) and checked if they actually exist, which I did in various later commits. Also in the script header optional arguments are between square brackets

Unrelated: yeah the Menu API will have to be mostly rewritten, I'll try to reuse some code from Vindicator's alternative menu mod (https://www.ganggarrison.com/forums/index.php?topic=33845.0)
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: BlackDoomer on October 24, 2019, 04:24:12 am
I'm not sure that's an option, the Faucet extensions uses dlls so while they could be compiled to work in Linux I'm not sure about HTML5
I didn't mean HTML5 - GM4HTML5 supports creating the Windows executables too, just like any other classic GM version.
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: PrOF on October 28, 2019, 04:37:34 am
I tried GM4HTML5, but I couldn't get it to run the game
(https://i.imgur.com/NyPSCu6.png)
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: BlackDoomer on October 28, 2019, 07:26:10 am
I tried GM4HTML5, but I couldn't get it to run the game
(https://i.imgur.com/NyPSCu6.png)
This is a well-known bug of GM 8.1 (whose direct descendant is GM4HTML5).
You need to backup the rundata file in the directory of GM just after installation, before first launch.
After that you should restore the file every time when GM IDE corrupts it.
I wrote a small .cmd for such cases and simply put it to the directory, with link to it being added into the Start menu.
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: notarctic on November 02, 2019, 08:59:43 pm
Oh also Faucmix (https://github.com/wareya/faucmix) will be essential for this to work, as GM:S disabled panning sound the legacy way
i just thought id stick my head in cus i wanted to make this old shit that never got implemented known
https://github.com/arctic5/Gang-Garrison-2/tree/audio
https://github.com/wareya/fausnd
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: Phantom Brave on November 02, 2019, 11:11:14 pm
faucmix fixes some basic design problems that fausnd had, you'll have to tie up the loose ends on your own though
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: PrOF on November 06, 2019, 10:01:29 am
(https://i.imgur.com/vrjkytb.png)(https://i.imgur.com/qgQTadP.png)
(https://i.imgur.com/F7xtMtx.png)(https://i.imgur.com/yixgMct.png)
Progress report: disabled DevMessageChecker, started adding some replacement scripts for menu_addlink, lost one when because of a mistake so I'll have to write it again.
In the most experimental build I can somewhat get around in the menus, although since the back button doesn't work it's quite painful
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: PrOF on November 12, 2019, 07:11:19 am
I managed to get gg2 running in GM4HTML5, after a basic import the Controls menu locks you there unless you spam the back button, the maps get exported to the .exe directory instead of the /Maps/ folder, and after moving every map to /Maps/ it still can't load any map.
I'll try to see if anything screwed up after importing, but I'd say it looks promising anyway.
Should I set up a Github repo for this project too?
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: Heapons on November 12, 2019, 07:14:18 am
Should I set up a Github repo for this project too?

Yes, please.
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999 port
Post by: PrOF on November 14, 2019, 07:51:21 am
I was afraid GM4HTML5 removed several options for managing Included files:

GM8:                                                             GM4HTML:
(https://i.imgur.com/Tp90omM.png) (https://i.imgur.com/aozhyzW.png)

But looks like they're just hidden, for whatever reason, so if they still work I'll mess with the project file and should get it working
(https://i.imgur.com/1O7ifme.png)
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: PrOF on November 29, 2019, 02:58:42 pm
I've been very busy lately and will probably continue to be extremely busy for some time
Anyway, I'm not sure but looks like the dir structure when dealing with scripts is different between GMS and GM4HTML, if that's the case we don't gain anything by porting to GM4HTML
I'll have to take a better look when I have some more free time
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: BlackDoomer on December 15, 2019, 03:02:32 pm
I was afraid GM4HTML5 removed several options for managing Included files:
Yep, that's just like the GMS does.

But looks like they're just hidden, for whatever reason, so if they still work I'll mess with the project file and should get it working
I've already tested it and unfortunately no, they're completely removed.
But I think it could be possible to emulate Included Files behavior by adding them into EXE using Windres or smth and then call WinAPI's resource functions using an extension.
https://docs.microsoft.com/en-us/windows/win32/menurc/introduction-to-resources
https://docs.microsoft.com/en-us/windows/win32/menurc/resource-compiler

Or just disable the startup unpacking using code hotpatching.

I've been very busy lately and will probably continue to be extremely busy for some time
Anyway, I'm not sure but looks like the dir structure when dealing with scripts is different between GMS and GM4HTML, if that's the case we don't gain anything by porting to GM4HTML
I'll have to take a better look when I have some more free time
GMS 1.4.9999 is able to import projects from the older versions, including GM4HTML5. That's exactly what I've intended to use.
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999 port
Post by: PrOF on August 21, 2020, 08:14:52 am
I finally managed to load the fist map in Studio
(https://i.imgur.com/OSM8c1E.png)
Different resolutions are in game but the window size is fixed so everything gets squished
(https://i.imgur.com/qlLaTV3.png)
It's a crash minefield, it's not yet possible to choose a team, but man it feels good
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: PrOF on August 25, 2020, 06:56:58 am
So here's something fun: room_set_views, which is the main way we set our window size/resolution, is neither in the Game Maker Studio Obsolete Functions list, nor in the official Studio docs.
In the IDE it gets highlighted, the compiler compiles it, but as far as I can tell only the first half of the function works. I have managed to "fix" the resolution issues by doing some black magic using surfaces (as window_set_size does not allow full scaling because "Who would ever want that, right?"), but now menus are scaled wrongly.
I'll fix this later =/
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: BlackDoomer on August 25, 2020, 09:42:44 pm
So here's something fun: room_set_views, which is the main way we set our window size/resolution, is neither in the Game Maker Studio Obsolete Functions list, nor in the official Studio docs.
In the IDE it gets highlighted, the compiler compiles it, but as far as I can tell only the first half of the function works.

I think you've meant room_set_view() cause there's no such function room_set_views().
And what did you mean by "only the first half of the function works"? What specifically works and what no?
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: PrOF on August 26, 2020, 04:37:29 am
I think you've meant room_set_view() cause there's no such function room_set_views().
And what did you mean by "only the first half of the function works"? What specifically works and what no?
As far as I can tell either only the view gets set and the viewport doesn't, or the window refuses to change size with the viewport like it did in GM8. GMS added some restrictions in scaling to "keep a 1:1 ratio", but modifying the application surface directly ignores those restrictions and sets the window size correctly, apparently
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: BlackDoomer on August 26, 2020, 05:12:44 am
Did you try to assign viewport properties (view_xport / view_yport / view_wport / view_hport) instead?
Also try to restart the room after room_set_view() and see if it helps.
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: PrOF on August 26, 2020, 06:59:00 am
Did you try to assign viewport properties (view_xport / view_yport / view_wport / view_hport) instead?
Also try to restart the room after room_set_view() and see if it helps.
I can't directly assign viewport properties because it's only possible to set them for the current room (without using room_set_views), while we need to set them for other ones (CustomMapRoom and BuilderRoom).
I'm working on it on the resfix branch, it kinda works that way but it also scales the menus which we don't want.
Title: Re: Tracking progress of a Game Maker Studio 1.4.9999
Post by: PrOF on November 12, 2020, 03:02:11 am
If you are in the GG2 Discord then you probably already know this, but I have been stuck on figuring out why map collision is borked for quite some time. Since GM8 and GMS repositories are set up in a completely different way it's also quite hard to rebase the changes on current (next update's) code. I'm not sure it'll ever happen.