Git Product home page Git Product logo

luastg-x's Introduction

LuaSTG-x

English Readme | 中文简介


LuaSTG-x is a multi-platform game engine based on cocos2d-x and LuaSTGPlus. It is aimed at providing a powerful engine for building STG, especially bullet hell games.


Download

Full release download:

Main Features

Relevant Link

Build Instructions

  1. Clone the repo and submodules from GitHub (or download from release page).

     $ git clone --recursive https://github.com/Xrysnow/LuaSTG-x.git
    
  2. For releases before 2023, clone external libraries into frameworks/cocos2d-x/external (or download from release page).

     $ cd LuaSTG-x/frameworks/cocos2d-x/external
     $ git clone --recursive https://github.com/Xrysnow/cocos2d-x-3rd-party-libs-bin.git
    
  3. Download extra files from Cubism SDK if you need live2d module. (instructions).

  4. Generate project using CMake (instructions).

    • If your target is Android platform, just open frameworks/runtime-src/proj.android with Android Studio.
    • If your target is macOS platform, add -GXcode parameter to CMake.
    • If your target is IOS platform, you can search for a bash script that helps to configure CMake.
    • If your target is macOS/IOS platform, you need to open project setting -> TARGETS -> LuaSTG-x -> Build Phases -> Copy Files and check Code Sigh On Copy for frameworks.
    • If your target is Linux platform, you need to execute frameworks/cocos2d-x/install-deps-linux.sh before using CMake. It's recommended to add -GNinja parameter to use ninja since default make is very slow.
  5. Compile with your target compiler.

Build Requirements

  • CMake 3.20+
  • Android Studio 2021.1.1+ and NDK r22+
  • Linux with compiler supports C++17 (Clang is recommended)
  • macOS 11.3+ and Xcode 13+
  • Windows 7+ and VS 2019+

Runtime Requirements

Runtime requirements is actually decided by your compiler, but in most cases they should satisfy these conditions:

  • Android 5.0+
  • iOS 13+
  • macOS 10.15+
  • Windows 7+ and visual c++ runtime

Note that iOS 13+ and macOS 10.15+ are always required for std::filesystem (source).

Dependency Graph

LuaSTG-x
├ cocos-x
│  └ cocos-x-external
│    ├ cocos2d-x-gfx
│    ├ glslang
│    ├ openal-soft
│    └ SPIRV-Cross
├ cocos2d-x-imgui
│  ├ ImGui
│  ├ imgui_markdown
│  ├ ImGuiColorTextEdit
│  └ implot
├ cocos2d-x-live2d (optional)
│ ├ CubismNativeFramework
│ └ Cubism SDK for Native
├ cocos2d-x-video
│  └ FFmpeg (in lstgx_external)
├ lstgx_Audio
│  └ openal-soft (in cocos-x-external)
├ lstgx_external
│  ├ ANGLE (optional)
│  ├ BurstLinker
│  ├ FFmpeg (optional)
│  ├ libzippp
│  │ └ libzip
│  ├ Lua CJSON
│  ├ luafilesystem
│  ├ LPeg
│  ├ MicroTeX
│  ├ nanosvg
│  ├ NativeFileDialog
│  └ Yuescript (optional)
├ lstgx_Math
└ lstgx_LuaCore

luastg-x's People

Contributors

demonese avatar xrysnow 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

luastg-x's Issues

Linux Build Problems

这个 Issue 用来存放 Linux 平台下构建时遇到的问题。

目前问题:

In file included from /home/lilywhite/LuaSTG-x/frameworks/cocos2d-x/external/glfw3/include/linux/glfw3native.h:101:
/home/lilywhite/LuaSTG-x/frameworks/cocos2d-x/external/gfx/backend/gfx-base/GFXDef-common.h:123:12: error: unnamed scoped enum is not allowed
  123 | enum class Status : uint32_t {
      |            ^~~~~~
/home/lilywhite/LuaSTG-x/frameworks/cocos2d-x/external/gfx/backend/gfx-base/GFXDef-common.h:123:6: warning: elaborated-type-specifier for a scoped enum must not use the ‘class’ keyword
  123 | enum class Status : uint32_t {
      | ~~~~ ^~~~~
      |      -----
/home/lilywhite/LuaSTG-x/frameworks/cocos2d-x/external/gfx/backend/gfx-base/GFXDef-common.h:123:12: error: expected identifier before ‘int’
  123 | enum class Status : uint32_t {
      |            ^~~~~~
/home/lilywhite/LuaSTG-x/frameworks/cocos2d-x/external/gfx/backend/gfx-base/GFXDef-common.h:123:19: error: expected unqualified-id before ‘:’ token
  123 | enum class Status : uint32_t {
      |                   ^
/home/lilywhite/LuaSTG-x/frameworks/cocos2d-x/external/gfx/base/TypeDef.h:40:37: error: ‘type’ in ‘struct std::underlying_type<int>’ does not name a type
   40 |     inline std::underlying_type<T>::type toNumber(const T v) { return static_cast<std::underlying_type<T>::type>(v); }
      |                                     ^~~~
/home/lilywhite/LuaSTG-x/frameworks/cocos2d-x/external/gfx/base/TypeDef.h:40:37: note: in definition of macro ‘CC_ENUM_CONVERSION_OPERATOR’
   40 |     inline std::underlying_type<T>::type toNumber(const T v) { return static_cast<std::underlying_type<T>::type>(v); }
      |                                     ^~~~
/home/lilywhite/LuaSTG-x/frameworks/cocos2d-x/cocos/platform/desktop/CCGLViewImpl-desktop.cpp: In member function ‘void* cocos2d::GLViewImpl::getLinuxWindow()’:
/home/lilywhite/LuaSTG-x/frameworks/cocos2d-x/cocos/platform/desktop/CCGLViewImpl-desktop.cpp:820:28: error: invalid conversion from ‘Window’ {aka ‘long unsigned int’} to ‘void*’ [-fpermissive]
  820 |     return glfwGetX11Window(_mainWindow);
      |            ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
      |                            |
      |                            Window {aka long unsigned int}

[RENDERING BUG] Additional texture uniforms getting the wrong texture

The additional texture uniforms (those added by res:setTexture) are notably reading the wrong texture.
When I tried to add a secondary texture to a render mode or ResFX (PostEffect included), it appeared to read the last texture used instead of the sent one.
I also tried to send a texture uniform through ccb.ProgramState:setTexture, and it behaved the exact same way, even when changing the slot.
Here we can see the shader is using the player's option's image: (the option is on LAYER_PLAYER, while the images using the shader are on LAYER_ENEMY_BULLET)
LuaSTG-x_1Tpnrf2Hk1
And when an item appears (such as when the player dies), it changes the texture that's being rendered: (it's on LAYER_ITEM)
ApplicationFrameHost_0iGu1ZXrJr

Portable linux version

Have you succeed yourself compiling into a linux version ?
If yes, could you make a portable version and upload it in the mega archive ?

Particles disappear if it's lifetime is too low

When a particle with a very low lifetime spawns, such as for effects that require particles to be spawned every frame, it will sometimes disappear, making it look like the particle spawner stopped working for a frame, which can be really jarring.

I can't compile this project.

I did follow the instructions though.

e:\luastg-x\frameworks\runtime-src\proj.win32\SimulatorWin.h(30): fatal error C1083: Nie można otworzyć pliku dołącz: '
ProjectConfig/ProjectConfig.h': No such file or directory (kompilowanie pliku źródłowego E:\LuaSTG-x\frameworks\runtime
-src\proj.win32\main.cpp) [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
  precheader.cpp
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(42): warning C4244: "argument": konwersja z "int" do "
float", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(50): warning C4244: "argument": konwersja z "float" do
 "size_t", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(52): error C3083: "PixelFormat" : symbol po lewej stro
nie "::" musi być typem [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(52): error C2039: "RGB888": Nie jest składową "cocos2d
::Texture2D" [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
  e:\luastg-x\frameworks\cocos2d-x\cocos\3d/CCSprite3DMaterial.h(41): note: zobacz deklarację "cocos2d::Texture2D"
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(52): error C2065: "RGB888": niezadeklarowany identyfik
ator [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(180): warning C4244: "argument": konwersja z "double"
do "float", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(191): error C2653: "GL": nie jest nazwą klasa lub nazw
ą przestrzeni nazw [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(191): error C2039: "getName": Nie jest składową "cocos
2d::Texture2D" [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
  e:\luastg-x\frameworks\cocos2d-x\cocos\3d/CCSprite3DMaterial.h(41): note: zobacz deklarację "cocos2d::Texture2D"
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(191): error C2039: "__this": Nie jest składową "cocos2
d::Texture2D" [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
  e:\luastg-x\frameworks\cocos2d-x\cocos\3d/CCSprite3DMaterial.h(41): note: zobacz deklarację "cocos2d::Texture2D"
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(191): error C3861: "bindTexture2D": identyfikatora nie
 odnaleziono [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(192): warning C4244: "argument": konwersja z "float" d
o "GLsizei", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(214): warning C4244: "argument": konwersja z "float" d
o "size_t", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(223): warning C4244: "argument": konwersja z "float" d
o "int", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\SpriteVideo.cpp(222): warning C4244: "argument": konwersja z "float" d
o "ssize_t", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
e:\luastg-x\frameworks\runtime-src\classes\video\VideoStream.h(79): warning C4244: "inicjowanie": konwersja z "const _T
y" do "size_t", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
          with
          [
              _Ty=uint64_t
          ] (kompilowanie pliku źródłowego E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp)
e:\luastg-x\frameworks\runtime-src\classes\video\VideoStream.h(79): warning C4244: "inicjowanie": konwersja z "const _T
y" do "const size_t", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
          with
          [
              _Ty=uint64_t
          ] (kompilowanie pliku źródłowego E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp)
e:\luastg-x\frameworks\runtime-src\classes\video\VideoDecoder.h(35): warning C4244: "argument": konwersja z "const uint
32_t" do "float", możliwa utrata danych (kompilowanie pliku źródłowego E:\LuaSTG-x\frameworks\runtime-src\Classes\Video
\VideoDecoder.cpp) [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp(79): error C2039: "next": Nie jest składową "AVHWAcce
l" [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
  E:\LuaSTG-x\frameworks\runtime-src\external\ffmpeg\include\libavcodec/avcodec.h(3592): note: zobacz deklarację "AVHWA
  ccel"
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp(125): warning C4018: "<": niezgodność typu ze znakiem
/bez znaku [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp(215): warning C4244: "argument": konwersja z "uint32_
t" do "float", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp(225): warning C4244: "argument": konwersja z "float"
do "int", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp(232): warning C4244: "argument": konwersja z "float"
do "int", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp(231): warning C4244: "argument": konwersja z "float"
do "int", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp(403): warning C4244: "return": konwersja z "const int
64_t" do "uint32_t", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp(408): warning C4244: "return": konwersja z "const int
64_t" do "uint32_t", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp(418): warning C4244: "=": konwersja z "int64_t" do "d
ouble", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp(436): warning C4244: "=": konwersja z "int64_t" do "u
int32_t", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp(446): warning C4244: "=": konwersja z "int64_t" do "u
int32_t", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp(462): warning C4244: "=": konwersja z "int64_t" do "u
int32_t", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
E:\LuaSTG-x\frameworks\runtime-src\Classes\Video\VideoDecoder.cpp(466): warning C4244: "=": konwersja z "int64_t" do "u
int32_t", możliwa utrata danych [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]
e:\luastg-x\frameworks\runtime-src\proj.win32\SimulatorWin.h(30): fatal error C1083: Nie można otworzyć pliku dołącz: '
ProjectConfig/ProjectConfig.h': No such file or directory (kompilowanie pliku źródłowego E:\LuaSTG-x\frameworks\runtime
-src\proj.win32\WindowHelperWin32.cpp) [E:\LuaSTG-x\win32-build\LuaSTG-x.vcxproj]

Glslang errors.

CMake Error at frameworks/cocos2d-x/external/glslang/CMakeLists.txt:300 (message):
  ENABLE_OPT set but SPIR-V tools not found.  Please run
  update_glslang_sources.py, set the ALLOW_EXTERNAL_SPIRV_TOOLS option to use
  a local install of SPIRV-Tools, or set ENABLE_OPT=0.

This is present both in latest release zip and the git repo.

The install

It's overcomplicated, isn't it possible to have something more simple ?
That's just a question because I don't ask for help, to be honest I've already raged and deleted everything I've cloned after trying to understand what to do.

Fix compilation on both Windows and Linux

I have managed to compile the latest commit (at time of writing: 122fe39) under both Windows and Linux, but not without modification.

The issues I found and had to fix are as follows:

Windows/MSVC

Linux/GCC

I did not test Mac compilation because I do not have a Mac, but if Mac compilation didn't work before it should work now...

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.