sorlok_reaves
|
|
Posted on: January 07, 2014, 01:21:03 am |
|
|
Joined: Dec 2013
Posts: 260
|
Hello all, looking for some advice on a plugin I've been working on for GM5 compatibility in Enigma. Branch is here: https://github.com/sorlok/enigma-dev/tree/gm5_compatBasically, I've been working on getting Iji running in Enigma. To that end, I've pushed a few bug fixes here and there. Combined with the branch linked to above (which I do NOT recommend merging; it's buggy and hackish) the game basically starts: http://i.imgur.com/aXG69zA.pngI'd like some feedback on the idea of GM5 compatibility in general. Currently, I'm doing it all through a plugin, including the following: - I've duplicated functions like draw_rectangle(), since GM5 does not provide an "outline" parameter. JDI finds these duplicates just fine, but perhaps this affects argument validation?
- My duplicate draw_*() functions take pen_size into account and use draw_line_width() to mimic GM5 wide outlines.
- pen_color, brush_color and other "magic" global variables are added as top-level static variables in the plugin.
- draw_text_sprite() and draw_polygon*() were also implemented. These might be useful for other games, or they might be too niche, and should be left in the compat library.
- There are some outstanding issues on C++ keywords being used as variable names (e.g., "short") that will inevitably have to be addressed.
For now, my approach to GM5 compatibility has been to keep as much as possible isolated in a plugin, so that compatibility can be turned "on" or "off" easily. This makes sense to me, but I figured now would be the best time to start discussing this. Thanks, and happy coding.
|
|
|
Logged
|
|
|
|
|
Goombert
|
|
Reply #2 Posted on: January 07, 2014, 09:47:41 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Wow, I am surprised I was not aware GM5 had those differences. Also, sorlok, I loved your contributions so far they were good! Allow me to address some of your issues. There are some outstanding issues on C++ keywords being used as variable names (e.g., "short") that will inevitably have to be addressed. This is actually why we namespace everything in engima_user and keep it separate from the enigma namespace. I've duplicated functions like draw_rectangle(), since GM5 does not provide an "outline" parameter. JDI finds these duplicates just fine, but perhaps this affects argument validation? Well if you want, you could simply add those functions to the main repositories as overloaded functions. In fact, I'd be fine with you merging all of that into the main repository, as long as it does not break future compatibility. As in you overload functions and keep things separate so both versions can be used side by side. Other than that though, keep up the good work sorlok!
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
time-killer-games
|
|
Reply #3 Posted on: January 07, 2014, 09:55:13 pm |
|
|
"Guest"
|
That's great! Now all we need is a GM 4.3 GMD reader, then we will officially support virtually every half decent release of GM in history. But this is good enough. Thanks for everything! =)
|
|
|
Logged
|
|
|
|
sorlok_reaves
|
|
Reply #4 Posted on: January 08, 2014, 10:55:52 am |
|
|
Joined: Dec 2013
Posts: 260
|
Thanks for the excellent feedback everyone. I've been really impressed with the community here so far. Let me address a few specific replies: If there is a limited amount of GM5 games you wanna run then I think it would take less time and effort to just port them. My first step when looking at Iji was to manually "port" all incompatibilities, and the scope was pretty massive. I feel like a lot of GM users won't even consider ENIGMA unless they can Load+Run an existing game. Well if you want, you could simply add those functions to the main repositories as overloaded functions.
In fact, I'd be fine with you merging all of that into the main repository, as long as it does not break future compatibility. As in you overload functions and keep things separate so both versions can be used side by side. I'll prepare a clean branch then, and I'll move the generally useful stuff (draw_text_sprite(), draw_polygon()) to Graphics_Systems/General. I still prefer to keep certain GM5-specific stuff in a plugin for now. I feel that functions like draw_rectangle() and magic variables like pen_size are just going to confuse GM6+ users, and (as TheExDeus mentioned) they may be slow. I'd like to leave these particular constructs in Universal_System/Extensions/GM5Compat. That's great! Now all we need is a GM 4.3 GMD reader, then we will officially support virtually every half decent release of GM in history. I wonder how much of the backend 4.X shares with 5.X. I know 6 broke a lot.
|
|
|
Logged
|
|
|
|
The 11th plague of Egypt
|
|
Reply #5 Posted on: January 08, 2014, 06:09:32 pm |
|
|
Joined: Dec 2009
Posts: 274
|
I feel like a lot of GM users won't even consider ENIGMA unless they can Load+Run an existing game. ... I know 6 broke a lot.
I don't think GM 6.1 could "load and run" a GM 5 game straight away. I remember there was some kind of external converter, but even that required manual intervention after the first pass. Want me to try and find it out for you? EDIT: the converter was from v4 to v5 I still have it
|
|
« Last Edit: January 08, 2014, 06:22:06 pm by The 11th plague of Egypt »
|
Logged
|
|
|
|
|
|
TheExDeus
|
|
Reply #8 Posted on: January 10, 2014, 09:15:55 am |
|
|
Joined: Apr 2008
Posts: 1860
|
Things like draw_polygon*() seem to be exactly like draw_primitive*(), so I don't think we should include them in main. That will only confuse people, as they will start using functions that are from 2002 and clearly shouldn't be used. So while I am ok for this being a plugin (and disabled by default) I think that only few functions (like draw_text_sprite) should be added in ENIGMA's main. I feel like a lot of GM users won't even consider ENIGMA unless they can Load+Run an existing game. Yeah, but we don't really target the GM5 crowd (from which you are the only known person that I know). Originally we wanted ENIGMA to be something where you Load and without modifications Run an existing game. But as it is not even possible in GM (when a GM version changes) then we kind of abandoned the idea. We want the modifications to be quite minimal (like GM8 games will probably work without any changes in ENIGMA), but supporting deprecated functionality is no longer our goal. That will only bloat the engine and will make users accidentally use the deprecated functions. I think ENIGMA should be used just like GM - from the game's projects beginning. So instead of trying to load a GM game and then fighting with incompatibilities or bugs, people should just try code from scratch in ENIGMA. I do that all the time and that is why I think ENIGMA is mature enough, as I can create everything I could in GM with ENIGMA. And even more.
|
|
|
Logged
|
|
|
|
sorlok_reaves
|
|
Reply #9 Posted on: January 10, 2014, 11:58:29 am |
|
|
Joined: Dec 2013
Posts: 260
|
Since everyone seems to agree on draw_text_sprite(), I'll prepare a branch for that. In terms of polygons, there's one thing I should clarify: GM5's "draw_polygon()" can handle concave and self-intersecting polygons. Like this one: http://en.wikipedia.org/wiki/File:Complex_polygon.svgThis requires Platform support (my approach with OpenGL is GLU tessellation; I'll figure out something for DirectX9 later), as triangle fans just won't cut it for non-convex polygons. Regardless, I'll put features wherever the devs want them; just wanted to clear up a point on GM5's polygons. Edit: Bug-fixing went a lot faster than expected, so this feature is now ready. Moved the discussion on draw_polygon() here; other GM5 compat can stay on the current topic. http://enigma-dev.org/forums/index.php?topic=1704.0@The 11th plague of Egypt: Thanks!
|
|
« Last Edit: January 10, 2014, 04:34:59 pm by sorlok_reaves »
|
Logged
|
|
|
|
|