wateret / mengde Goto Github PK
View Code? Open in Web Editor NEWA turn-based RPG game engine inspired by 三國志曹操傳.
License: MIT License
A turn-based RPG game engine inspired by 三國志曹操傳.
License: MIT License
Currently the engine does not correctly ends the scenario when the user has finished all the stages.
Currently all the modules are built as one executable.
For the sake of modularity, we can separately build them as shared libraries.
By doing so we can easily create unit tests for each module.
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?
- Hold position
- Attack enemy
MainView has a poor user interface which looks ugly and it only loads scenario example
but the user cannot choose which scenario to run.
Ubuntu CI check intermittently fails. These are issues I have observed.
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
apt-get install
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
).
Every time travis job is invoked, it has to install the brew packages which takes 3+ minutes.
It looks like there is no trivial way to achieve this.
Reference: https://docs.travis-ci.com/user/caching
% For apt packages, we could just use docker for plan B.
Currently we only have equipments not consumables. Let's introduce consumable items.
Let's introduce a Tooltip View class to make our UI richer :)
Since all our dependencies support Windows it would not be hard to support Windows.
Things to consider
SDL_MAIN_HANDLE
)Currently the game does not advance to next stage, pretty much done like single staged.
Let's make it like:
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
Let's set these off.
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
These options sometimes cause unwanted diff.
In mengde/docs/How-to-Run-Example-Scenario.md
, description says sce
folder should be in game
folder.
(https://github.com/wateret/mengde/blob/master/docs/How-to-Run-Example-Scenario.md#L10)
After I failed to do so, I tried to copy sce
folder to mengde
folder and successed.
Am I wrong or correct?
As is:
on_deploy
, end_condition
, ...To be:
main
game:set_on_deploy
, game:end_condition
, ...With this way(registration of callbacks), benefits are:
main
This is also a prerequisite for #61.
Currently argument frame
is passed as const Rect*
for View
subclasses.
Let's change it to const Rect&
.
View
const Rect*
Pass these event objects by reference instead of by value.
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.
I would like to move to C++14, unless there is good reason for not doing this. We're currently on C++11.
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
game
finds shared library from in the same directoryI'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?
Travis job is only for macOS it would be nicer to have ubuntu build as well.
Let's introduce unit status. Possible candidates are:
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?
As is:
sce
└── {example}
├── config.lua
├── stage
│ ├── {01}.lua
│ └── {02}.lua
To be:
sce
└── {example}
├── script
│ ├── config.lua
│ ├── {01}.lua
│ └── {02}.lua
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).
no_render_
field from Unit)
boost::optional<uint32_t>
and sometimes uint32_t
are used for Unit ID, let's wrap it with Id
class.
UserInterface
Which license?
Maybe... MIT
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.
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)
We get configuration for scenario from lua files. We need to handle properly when the config format is wrong.
Let's add unit tests for each modules.
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.
The class Game
looks ambiguous we should rather rename it to Stage
.
AttackRange is now zero-terminated array which is poorly designed. Let's create a class for it.
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]
=================================
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:
Currently Assets are updated real-time but it should be updated after stage win(For restarting stage).
In GUI, the hierarchy of App/UIFW/Foundation is not complete. Still some files refers from lower layer to higher layer.
Things to consider
foundation
now)To keep top-level README simple.
Separate document file should be in directory docs
.
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_
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.