Giter VIP home page Giter VIP logo

moai-dev's Introduction

Moai SDK is an embeddable cross-platform game development SDK written in C++ and scriptable in Lua. You can use Moai to write games or apps, or you can embed Moai in other programs. You can also use Moai as an overlay in your apps.

Multiple build systems are supported in this project. Sourcecode is kept in a common folder. There is a separate folder for each build system in the project root.

For IDE build systems (Xcode, Android Studio, Visual Studio), reference projects are provided. Cmake is also supported for Android and HTML5.

Third party libraries are included as git submodules (in some cases). The rest are vendored in. As a rule, we do not make any code changes to third party libraries. If functionality must be configured or replaced, we use a header injection pattern to do so.

A goal of the project is one-step build for the reference binaries. We don't want users to have to download and configure dependencies, or build parts of the SDK in advance. If you open the xcode/osx project (for example) and click 'build,' then Moai SDK should build for you in its entirety. This goal isn't always realized across all platforms, but it is something we strive for and if you want contribute build process improvements, please keep this goal in mind.

The project's principal developer (patrickmeehan) primarily works on OSX these days. As a result, the xcode/osx project is typically the most actively maintained. (For major releases, we update and test all projects.)

pito

pito is a command line toolbelt for automating some aspects of the project. pito is just a bootstrapper that use command line Moai to run lua scripts. To use pito, make sure moai-dev/pito is somewhere in your path. When you first run pito, if the Moai binary is missing, pito will attempt to build it.

At the Moai SDK project level, pito does very little beyond generating the HTML documentation for Moai's Lua interface and running some build scripts that can be used for CI. If you want to extend pito with other commands, type 'pito help' on the command line and you will see an explanation of how pito searches upward through the directory hierarchy for extensions.

Project Structure

  • 3rdparty - Submodules and third party source.
  • 3rdparty/contrib - Third party code snippets included in Moai.
  • android-ndk - Android JNI build project.
  • android-studio - Android Studio reference project.
  • bin - Moai executables, organized by OS type, generated by the various build systems.
  • cmake - Cmake build project.
  • docs - Legal notices and attribution images. Run 'pito make-lua-docs' to generate API reference.
  • legacy - Old stuff kept for reference. Unless you are a moai maintainer, you can ignore this.
  • lib - Moai static libraries, organized by OS type, generated by the various build systems.
  • pito - Moai command line utility.
  • samples - Moai SDK desktop and mobile samples.
  • src - All Moai SDK source code for Moai libraries and hosts.
  • test - This is a legacy, Lua-based test runner. Will be replaced by Google Test.
  • vs2019 - Visual Studio reference build system and reference project.
  • xcode - Xcode build system and reference projects.

Be sure to check for README files in these folders.

Reference Projects

Reference projects are the projects we use for day-to-day development work on Moai. We do not provide any kind of Moai project generator or IDE templates (though this functionality is somewhat provided by Cmake). The usage pattern for Moai is to copy one of the reference projects, manually update the paths to either the Moai source or libraries, and tailor it to your needs. This might sound onerous, but in our experience, if you know how to use the IDEs it should only take you a few minutes.

In the past, members of the community have provided extensions to pito that generate high quality IDE projects from project templates. We don't maintain these in moai-dev; the moai-community repository was created to hold them.

Hey, there aren't any docs! How do I use this thing?

Start with command line Moai. Add moai-dev/bin/ to your path then run some of the samples. We try to keep these up to date, but don't always have time (though for official releases of the SDK they all should work).

The samples are very, very simple. You will find Moai to be unopinionated and low-level. It is very much intended to be an SDK. You can piece it together however you want to make your game or app.

Once you get the hang of using Moai, start your project using a window size that uses a resolution/aspect ration you are comfortable with. You can adapt this later to handle multiple resolutions and aspect ratios. It is fine to prototype on desktop; mobile support is robust enough that you can port your work once you have something going.

How do I get help?

There's no official support for the project right now. Check the forums or see if you can get an invite to the Slack team.

If you have lots of money and want to hire someone to work on features for you or help you with your Moai project, you can try your luck by emailing 'moai-sdk' at fallguyconsulting.com.

Tips

  • For any kind of serious app, you will need to figure out how to handle transitions yourself (screen-to-screen or level-to-level). There is no official way of doing this.
  • Don't get too wrapped up in writing class systems of abstractions on top of Lua or Moai. At least not at first. A light touch is usually the way to go.
  • Moai does not attempt to hide or abstract low-level graphics concepts. To get the most out of Moai, you will need to understand coordinate systems and shaders. Game development is hard. Our goal is to provide convenience, flexibility and power, not to simplify.
  • You will eventually need to manage the garbage collector and hunt down objects that get left in scope. Don't worry: when you get there you will find that there are powerful mechanism in Lua and some memory analysis tools build in to Moai that will make this tractable.
  • Once you understand Moai viewports and scale settings, you will understand how you can write your app to use a device-independent coordinate system. For 2D games, you will be able to update your assets to use higher or lower resolutions without changing object dimensions. In our projects, we typically use at our highest targeted resolution for all assets and downsample for lower resolution devices.
  • Plan your letterboxing scheme early. You will want to decide up front if you will reposition UI elements or draw extra UI to avoid black bars.
  • Prototype on desktop, but test (a bunch) on device, well ahead of release.

moai-dev's People

Contributors

conghuzhao avatar danadrew avatar danielswolf avatar eiriksm avatar ericwlange avatar fivevolthigh avatar hach-que avatar halfnelson avatar harningt avatar jdaance avatar jlytledistinctdev avatar jonathancho avatar joshlytle1 avatar joshlytlepi avatar kengonakajima avatar kibiz0r avatar ldeffenb avatar makotok avatar naturally-intelligent avatar patrickmeehan avatar peqnp avatar pygy avatar rdalton avatar seanzipline avatar seclorum avatar seebs avatar superquadratic avatar vavius avatar zeflash avatar ziplinejon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moai-dev's Issues

Expose basic cross-platform native pop-up and alerts UI

Some platforms support basic, native pop-ups for simple dialogues and alerts. To the extent these ad hocs and alerts can be supported across all platforms, we should expose them. (The intent here is not to provide a full featured native UI wrapper. Just alerts, pop-ups and simple dialogues that can be supported across all platforms.)

DirectX host with DirectInput

Made sure input devices are implemented to handle gamepad input. Add a demo that controls a character via a gamepad.

Font manager and glyph caching system

Fonts and glyph caching should be handled automatically and behind the scenes. Right now users have to explicitly rip fonts to specific point sizes and character subsets; this should be automatic and dynamic at runtime.

Collada to Lua file converter

Write a lua script to convert collada to an equivalent, platform-agnostic not-lossy intermediate format suitable for loading and further processing into a Moai scene graph.

Refactor MOAIHttpTask

Current cross-platform implementation is a little clunky. Look into replacing implementation object with derived class from abstract virtual MOAIHttpTask.

Sound drops out on multiple platforms

Some sounds will stop playing and no longer play until re-loaded. We've noticed this in Wolf Toss with the interactive music sounds. They usually play OK the first few times, then stop playing and don't come back until the sound resources are reloaded.

Add upper limits to A* pathfinding

Implement a way to bound pathfinding based on number of iterations and total nodes used. Current implementation is susceptible to filling entire available grid if no solution exists.

Move to Lua 5.2

Need to look into how this will break current users and what can be done to ease the transition.

Optimize USAnimCurve key lookup

Add a bin search and an optional 'hint' parameter to improve look-up speeds into USAnimCurve. This hasn't been a performance bottleneck yet, but as we move to 3D it may become one.

Re-implement optimized special case view culling for 2D

With the move to 3D we now use a view volume for culling, even when rendering 2D or mostly 2D scenes. This obviously is a lot less efficient. We should look into falling back on a simpler culling scheme using 2D rectangles in certain situations. This could be done automatically or as an extra setting on MOAILayer or MOAIPartition.

Improve MOAITransform internals (include shear; improve 3D)

To support generalized bind/unbind from parent transforms we need to include shear in the MOAITransform internals. We can consider rewriting these to look more like a basis with some extra info. The new representation should be well suited for 3D, able to quickly be animated across all components and readily return information about each component performing as few conversions and calculations as possible.

Improve performance of frustum culling against MOAIGrid

The current implementation naively intersects all edges of the frustum with the prop's plane then uses the in-plane bounding rectangle. We should consider scan converting a more snugly fitting polygon to produce a more efficient set of tiles to render. We also need a way to enforce a 'horizon' and/or maximum viewable tiles limit: right now, if grid is set to wrap, we wind up with a huge number of tiles to draw as the camera approaches a side-view of the tilemap.

Improve A* pathfinding performance (mempool, binary heap)

Current A* implementation is naive: dynamically allocates and frees ever node on demand and performs a linear search through the (unsorted) node list every step. Clearly this can be improved by adding a mem pool and a binary heap.

Compute/set maximum content size in decks

We need a way to compute or set content size in decks for use when drawing grids. When indexing a single deck element and displaying with a prop, it's not a problem: the bounds of that element are used for view culling. But when attempting to render a grid of arbitrarily sized elements, we need to pad the grid region with the dimensions of the largest element in the deck to make sure cells containing that element will be rendered even when just off screen.

Video playback

Add support for video playback on operating systems where video API is available.

Implement 2D rigid body physics proof of concept

This will integrate with the Moai 2D physics framework and the arcade style physics to provide basic support for rigid body physics and constraints. The proof of concept should mainly focus on stability of sets of resting objects.

Look into better A* heuristic for grids with shaped tiles

The current A* implementation uses Euclidian distance as the default heuristic for hex, oblique and diamond shaped grids. We need to implement versions of the other heuristics (where applicable) and also see if there are better heuristics to use for hex grids.

Multitouch events being lost on device

Josh Lytle reported that certain touch events appear to get dropped on iOS and Android in spite of the internal event queue. This needs to be investigated and fixed.

Improved styles system for MOAITextBox

Text style particulars (such as font, point size and color) should no longer be inlined into the text itself or set for the entire text box. It would be better to inline style names then attach a set of styles to the textbox for application when rendering. Styles should be user-named and support additional effects such as animation (offset of text being styled and text color).

Investigate adding luasec

We've received a request to include luasec. It is not clear how to link this library in statically as it redefines many of the methods in luasocket. Needs some research and possible help.

Backward compatibility layer to maintain 2D API

The new 3D API adds extra mandatory parameters to some frequently used functions (moveLoc, moveScl, etc.). To avoid breaking the world, use the new moai class 'extent' functionality to re-implement the original 2D style API. Right now we are refactoring to have just MOAIProp and MOAILayer. These should be extended with Lua APIs into MOAIProp2D and MOAILayer2D.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.