Git Product home page Git Product logo

mengde's People

Contributors

chunseoklee avatar ragmani avatar seanshpark avatar sjsinju avatar wateret 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mengde's Issues

Enable ARM cross build

I'd like to support ARM cross build to run on Raspberry Pi 2/3
Two major tasks are needed

  • Script to prepare RootFS for ARM (#54)
  • CMake script changes to support ARM cross build (#56)

And some more

  • Update readme (#56)

Build modules as shared

Currently all the modules are built as one executable.
For the sake of modularity, we can separately build them as shared libraries.

  • liblua.so (But most implementation is in header)
  • libutil.so
  • libgame.so
  • libgui.so (Also can be built into 3 libs)
    • libguiapp.so
    • libguiuifw.so
    • libguifoundation.so
  • a runner executable

By doing so we can easily create unit tests for each module.

Support Choices in stage scripts

Let's support choices so players can make a call in the game. And the game flow branches according to the user's choice.

For example,

What is your strategy?

  1. Hold position
  2. Attack enemy

[GUI] Update MainView

MainView has a poor user interface which looks ugly and it only loads scenario example but the user cannot choose which scenario to run.

  • Enhance MainView look
  • Choose scenario to run

Ubuntu CI check is unstable

Ubuntu CI check intermittently fails. These are issues I have observed.

  • Hanging. No output for 10 mins
  • E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
  • Another error while apt-get install

Restructure script directory

Let's restructure and build/play script and scripts in ci. It would be nice if we merge them into one directory, but we should change the name of the directory(from ci).

Introduce Consumable items

Currently we only have equipments not consumables. Let's introduce consumable items.

  • Introduce Consumables
  • Introduce an Act Cmd for using consumables
  • Update UI for buy/sell consumables from deployment stage.

Support Windows build

Since all our dependencies support Windows it would not be hard to support Windows.

Things to consider

  • Make CMake to generate Visual Studio Project file? or other ways?
  • Main function is different for Windows (SDL_MAIN_HANDLE)
  • Handle include/lib directory
  • CMake path for SDL2(SDL2DIR, SDL2TTFDIR)

Support multi-staged scenario

Currently the game does not advance to next stage, pretty much done like single staged.

Let's make it like:

  1. scenario starts
  2. stage 1
  3. stage 2
  4. stage last
  5. scenario ends
  • Update assets after victory from a stage (Partially done)
  • Advance to the next stage or end the scenario

LC_RPATH related error

When I run build.py second time, I get this error. First time it is OK.

% The error does not make the build failure, but just want to remove the message.

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: no LC_RPATH load command with
path: /Users/hanjoung/ws/proj/mengde/build/Darwin.x86_64.Debug/game/src/gui found in: /Users/hanjoung/ws/proj/mengde/build/Darwin.x86_64.Debug/mengde/game (for architecture x86_64), required for specified option "-delete_rpath /Users/hanjoung/ws/proj/mengde/build/Darwin.x86_64.Debug/game/src/gui"

cc: @seanshpark

Change clang-format rules

Let's set these off.

AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true

These options sometimes cause unwanted diff.

Change the way of stage script

As is:

  • The script must have functions like on_deploy, end_condition, ...
  • The engine calls the lua function by those keywords

To be:

  • The script must have only one function main
  • The script must register functions via game:set_on_deploy, game:end_condition, ...

With this way(registration of callbacks), benefits are:

  • No need to match any function names between the engine and a script, other than main
  • Easily support optional or multiple callbacks
    • For example, user-defined events can be none or many.

This is also a prerequisite for #61.

Pass constructor argument `frame` by reference

Currently argument frame is passed as const Rect* for View subclasses.
Let's change it to const Rect&.

  1. Add a constructor with for all subclasses of View
  2. Remove constructor with const Rect*

Support save files with Flatbuffers

  • Bring up Flatbuffers to the project (Add it as a build dependency)
  • Create a Save/Load button in GUI
  • Design schema .fbs - which object to serialize #140
  • Write Serializer
  • Write Deserializer #149

Support multi-language

Support multi-language with utf8 encoding.

Currently all printed words are its ID which is not an actual language.

We may need another .lua file that contains ID-language mapping.

Moving to C++14

I would like to move to C++14, unless there is good reason for not doing this. We're currently on C++11.

Required compiler versions for C++14

  • GCC 5.0 or higher
  • Clang 3.4 or higher

Portability

  • Ubuntu 14.04 : AFAIR default C++ compiler is gcc 4.x
  • Ubuntu 16.04 or higher : OK
  • Raspberry Pi 2 Ubuntu ??.??
  • Other OS (far far far... future)
    • Android : AFAIR NDK toolchain is Clang 4 or higher
    • iOS : Not checked yet, but probably no problem

Execution Environment planning

Current plan of directory structure for execution

mengde
├── game           # executable file
├── liblua.dylib   # lua shared library
├── libutil.dylib  # util shared library
├── {more shared libs}
├── res            # resource directory (currently fonts only)
│   ├── Literation\ Mono\ Powerline.ttf
│   └── {more fonts}
├── sce            # scenario directory
    ├── example
    └── {more scenarios}

Issues to resolve

  • Make executable game finds shared library from in the same directory
  • ...

clang-format usage

I've tried to run ci/clang-format.sh file and got continous errors of

$ ci/clang-format.sh
YAML:36:23: error: unknown key 'SplitEmptyFunction'
  SplitEmptyFunction: true

Anyone how to run format check in bash shell?

Introduce unit status

Let's introduce unit status. Possible candidates are:

  • Poisoned
  • Stunned (Panicked)
  • Rooted
  • Sleeping

Add an example scenario

Currently one cannot run the game since there is no example scenario to play.

Q. It is OK to include example lua script files, but how to provide bitmap resource?

Change scenario directory structure

As is:

sce
└── {example}
    ├── config.lua
    ├── stage
    │   ├── {01}.lua
    │   └── {02}.lua

To be:

sce
└── {example}
    ├── script
    │   ├── config.lua
    │   ├── {01}.lua
    │   └── {02}.lua

Remove temporary move when user building an Action

When the user enters in the state StateUIMoving, the unit is moved from the map but we shouldn't(Should do that virtually from the graphic module).

  • Introduce a way for specially rendered units (remove no_render_ field from Unit)
  • Remove temporary move

Refactor Game API

Currently GUI module handles the game API directly and it is possible the GUI can has more permission than it was intended. For example, move a unit to anywhere (regardless of its move stat) is possible.

Let's remove GUI dependent interface for game engine.

A bug that app is aborted

After moving the character, press the button such as Attack then game app is aborted on ubuntu 16.04.

jang@jang:~/mengde/git/ragmani/mengde/build/Linux.x86_64.Debug/game$ ./game 
[DEBUG] <app.cc:26 FrameConfig()> FPS CAP : 60
[DEBUG] <app.cc:27 FrameConfig()> SPEED   : 2.000000x
[DEBUG] <main_view.cc:22 operator()()> Start
[INFO] Hero added to asset 'CaoCao' with Lv 80
[INFO] Hero added to asset 'ZhangLiao' with Lv 4
[INFO] Hero added to asset 'DianWei' with Lv 25
[INFO] Hero added to asset 'ManChong' with Lv 20
[INFO] Hero added to asset 'XiahouDun' with Lv 23
[INFO] Hero added to asset 'XunYu' with Lv 33
[INFO] StateMachine Pushed   [1] Top : StateUIView
[FATAL] <texture.cc:53 InitBitmap()> Unable to load image! : Error reading from datastream
[FATAL] <texture.cc:53 InitBitmap()> Unable to load image! : Couldn't open /home/jang/mengde/git/ragmani/mengde/build/Linux.x86_64.Debug/game/sce/example/model/support-1-red/mov.bmp
[INFO] StateMachine Popped   [0]
[DEBUG] <user_interface.cc:18 operator()()> AVAILABLEUNITS 9 2
[DEBUG] <user_interface.cc:18 operator()()> AVAILABLEUNITS 9 1
[DEBUG] <user_interface.cc:18 operator()()> AVAILABLEUNITS 9 9
[DEBUG] <user_interface.cc:18 operator()()> AVAILABLEUNITS 5 3
[DEBUG] <user_interface.cc:18 operator()()> AVAILABLEUNITS 9 4
[INFO] StateMachine Pushed   [1] Top : StateUIView
[INFO] StateMachine Pushed   [2] Top : StateUIUnitSelected
[DEBUG] <state_ui.cc:344 OnMouseButtonEvent()> Move to pos (10, 5) / move_id : 21
[INFO] StateMachine Pushed   [3] Top : StateUIMoving
[INFO] StateMachine Replaced [3] Top : StateUIAction

******** UNREACHABLE CODE "Unknown mouse button" ********
/home/jang/mengde/git/ragmani/mengde/game/src/gui/foundation/event_fetcher.cc:41 In function 'Poll'

Aborted (core dumped)

Error Handling for configuration import

We get configuration for scenario from lua files. We need to handle properly when the config format is wrong.

TODO

  • Insert try-throw-catch for all errors
  • Show the error message on the GUI screen and do not open

Add unit tests

Let's add unit tests for each modules.

  • Introduce test framework (Decision : gtest/catch/boost.test)
  • Lua binding
  • Core module - #4 must be preceded
  • Util module

Support game event trigger and handle from Lua callbacks

How to handle the event trigger and callback? So scenario developers can implement event callbacks and do various stuff with switches, variables and so on.

What we want to make possible is, for example, if a unit moves to a specific point, the user receives an equipment in return. And with Lua script, the scenario developers can do something more complex.

Refactor AttackRange

AttackRange is now zero-terminated array which is poorly designed. Let's create a class for it.

Display how many more heroes can be deployed from DeployView

DeployView as is:

=================================
Hero Hero Hero Hero |
Hero Hero Hero Hero | <Hero Info>
Hero Hero Hero Hero |
                    |
                    |
                    | [To Battle]
=================================

to be:

Show how many more optional heroes can be deployed.

=================================
Hero Hero Hero Hero |
Hero Hero Hero Hero | <Hero Info>
Hero Hero Hero Hero |
                    |
====================|
Deploy : 0/2        | [To Battle]
=================================

Add scrollbars to ScrollView

ScrollView is working now but it does not have scrollbars. This means that it can be scrolled by mouse wheel event only.

To support scrolling without a mouse wheel, let's create scrollbars(for both vertical and horizontal).

It would be nice the scrollbar is like these:

  • Hidden by default
  • User moves the cursor to right or bottom side, it shows up

Fix GUI module hierarchial structure

In GUI, the hierarchy of App/UIFW/Foundation is not complete. Still some files refers from lower layer to higher layer.

Things to consider

  • Move Drawer/TextureManager/FontManager to "app" (in foundation now)

Fix ifdef guard convention

Our #ifdef guard convention is #define {NAMESPACE_}{FILENAME}_H_ but most files are just #define {FILENAME}_H_.

For example #ifdef SCENARIO_H_ should be #ifdef MENGDE_CORE_SCENARIO_H_.

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.