Planimeter / game-engine-2d

Planimeter Game Engine 2D - LÖVE-based game engine for Lua
https://github.com/Planimeter/game-engine-2d/wiki
MIT License
736 stars 74 forks source link

Release `v8.0.0` · Design problems and growth #90

Closed andrewmcwatters closed 7 years ago

andrewmcwatters commented 7 years ago

Preface

Design problems

Version v8.0.0 is taking longer to release than desired due to a number of issues. To resolve this, I'm calling for a request for comments from various communities, including LÖVE Forums, /r/love2d, and /r/gamedev.

Growth

Planimeter and Grid users are also now at a reasonable size where not having a subreddit or forums hurts. In order to keep growing, we need a place where a community can be fostered and others can be encouraged in their development efforts, while not intruding on the existing LÖVE community.

Background

Interface wrappers

Grid has a number of interface wrappers that map to LÖVE modules. For example, Grid has graphics while LÖVE has love.graphics. These wrappers provide additional methods that LÖVE does not have, such as graphics.getAspectRatios() and others.

They were intentionally designed to provide an abstraction layer above LÖVE so that Planimeter could, in the future, pursue creating a framework you can use to make 3D games in Lua. The objective was to provide a hobbyist solution for those who do not want to use Unity, and it was hoped that this effort would replace Polycode's position in the game engine scene, since it is no longer maintained.

Unfortunately, this is no longer a long term goal for Planimeter, and, as a result, we are rescinding these wrappers. We also believe that removing Grid's abstractions here will allow existing LÖVE developers to seamlessly transition to higher-level engine development, while still using the LÖVE API.

Module definitions

Grid and LÖVE being built on LuaJIT, use Lua 5.1. Since the arrival of Lua 5.2 in Dec 2011, Lua developers have changed the way they write modules.

While it was once commonplace to use module, which created its own function environment, now developers opt into returning _M tables instead. This usage of require is a shift from loading modules and exposing them to _G to storing their values in locals.

However, Grid still relies on module due to it's real-time scripting architecture. During Grid's evolution, some interfaces started out as modules, then became classes to remove "local declaration boilerplate" while avoiding package.seeall, and have since underwent a refactoring process to go back to becoming modules.

Migrating from gui to love-panel

Perhaps the largest part of Grid is its gui subsystem. When it was originally designed, it was a basic imperative GUI library built with various engine controls that could be used to start building your own game elements.

At its current size, it has proven to require far too many lines of code to style, even with the help of schemes which define color and fonts that can be referenced. Draw calls comprise a majority of all of the controls' code.

In order to trim the engine size, gui will be heavily refactored, and moved to a separate repository, much like lauxlib, love-require, love-graphics, love-conf, and common. Starting in v8.0.0, Grid will use love-panel as its underlying gui library, originally written as a high-performance alternative to Löve Frames.

To reduce the number of calls required to style panels, love-panel will be designed around HTML and CSS's normal flow and box model. It should be noted that this implementation will behave similarly, but not include a heavyweight full implementation of HTML nor CSS, and all styling will continue to use Lua.

TODO

This issue is currently a living document, as such, it is incomplete.
Last updated Tue 5:34 PM, November 15th.