Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sorlok_reaves

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
256
Developing ENIGMA / New feature: Complex Polygons (review requested)
« on: January 10, 2014, 04:32:46 pm »
Hello all,

I've added some functions that allow ENIGMA to draw complex (self-intersecting) polygons. For example:



Since this is my first contributed feature --and it's really important to me not to step on the other developers' toes-- I decided to post here for feedback before I make a pull request. The code is available here:
https://github.com/sorlok/enigma-dev/tree/draw_polygon

Discussion is welcome, but please specify if any issues you have are deal-breaking issues. Everyone has different best practices, and I will try to accommodate your suggestions, but I have other features I'd like to work on too if there are no critical mistakes.

In particular, here are some potential issues, none of which I consider deal-breaking. Please let me know what you think:
  • Currently only works for the GL1 backend. Rationale: I provide a fallback for other platforms that renders convex polygons. I can add GL3 support easily, too.
  • Uses a custom class (PolyVertex) in a list to buffer calls to polygon_vertex(). Rationale: Drawing all at once minimizes GL errors (not ending the polygon) and memory leaks (not freeing temp. vertices for tessellation).
  • Uses software tessellation (GLU). Rationale: If we move to hardware tessellation, we can still use this code as a fallback for GL1 and possibly GL ES (with some hacking).
  • draw_polygon*() functions are in Graphics_Systems, not a plugin. Rationale: Drawing complex polygons is needed for GM5, and is (I feel) substantially different from primitives (such as triangle fans) to warrant inclusion as a main feature.
  • (If I made a mistake in the GLU tessellation code, please let me know. That would certainly qualify as deal-breaking.)

Thanks in advance for your comments. If there are no deal-breaking issues, I'll prepare a pull request.

257
Developing ENIGMA / Re: GM5 Compatibility plugin --feedback requested
« on: January 10, 2014, 11:58:29 am »
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.svg

This 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!

258
Developing ENIGMA / Re: GM5 Compatibility plugin --feedback requested
« on: January 09, 2014, 02:16:24 pm »
EDIT: the converter was from v4 to v5
I still have it ;)

Wow, that's pretty amazing, all the way back to 2002! It'll be some time before I look at v4, but thanks!

259
Developing ENIGMA / Re: GM5 Compatibility plugin --feedback requested
« on: January 08, 2014, 10:55:52 am »
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.






260
Developing ENIGMA / GM5 Compatibility plugin --feedback requested
« on: January 07, 2014, 01:21:03 am »
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_compat

Basically, 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.png

I'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. :)

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18