项目作者: SFTtech

项目描述 :
Modding API with a typesafe hierarchical key-value database with inheritance and dynamic patching :smiley_cat:
高级语言: C++
项目地址: git://github.com/SFTtech/nyan.git
创建时间: 2016-03-22T23:16:24Z
项目社区:https://github.com/SFTtech/nyan

开源协议:Other

下载


nyan - yet another notation

just make it meta-meta-meta.

nyan is a data description language,
It is a mixture of python, json, patch, wml, yaml and some new ideas.

It stores hierarchical objects with key-value pairs in a database with the key idea that changes in a parent affect all children.

We created nyan because there existed no suitable language to
properly represent the enormous complexity of storing the data for openage.

The main focus is readability and moddability.

github stars
#sfttech on matrix.org

The foundation of nyan:

Technology Component
C++20 nyan core
Flex Tokenizer generator
CMake Build “system”
Humans Doing it wrong all the time

How?

Let’s assume we have a fun λ half-life strategy game.

The game engine provides some functionality which is exposed by nyan.

  1. # This is the content and mod API of the Engine:
  2. Unit():
  3. hp : int
  4. animation : file
  5. Building():
  6. hp : int
  7. creates : set(Unit)
  8. model : file

Using this, the base game pack provides actual game content:

  1. # base_game_data.nyan
  2. OverwatchSoldier(Unit):
  3. hp = 50
  4. animation = "./assets/soldier.ani"
  5. Strider(Unit):
  6. hp = 2100
  7. animation = "./assets/strider.ani"
  8. CombineCitadel(Building):
  9. hp = 9001
  10. creates = {OverwatchSoldier, Strider}
  11. model = "./assets/lambda_hq.mdl"
  12. Citizen(Unit):
  13. hp = 60
  14. animation = "./assets/male09.ani"
  15. # gordon is a citizen with more hp
  16. Gordon(Citizen):
  17. hp += 40
  18. animation = "./assets/gordon.ani"
  19. RebelHQ(Building):
  20. hp = 5000
  21. creates = {Citizen, Gordon}
  22. model = "./assets/lambda_hq.mdl"

Now, let’s create a mod that adds the overwatch elite
and gives the striders even more hp.

  1. # elite_strider_mod.nyan
  2. # create a new unit:
  3. OverwatchElite(Unit):
  4. hp = 70
  5. animation = "./assets/coolersoldier.ani"
  6. # change the strider:
  7. ChangeStrider<Strider>():
  8. hp += 1000
  9. # change the citadel to build the elite:
  10. AddElite<CombineCitadel>():
  11. creates += {OverwatchElite}
  12. # create a mod that informs the engine about its patches
  13. StriderEliteMod(Mod):
  14. name = "Add the elite and make striders stronger"
  15. patches = {AddElite, ChangeStrider}

When the engine activates the mod (“applies the patches”),
the combine citadel can create the new unit and the strider is stronger.

The fun begins if you now create a mod that mods the mod.
Which is totally possible with nyan.

Specification

Read the specification.

Current State of the Project

nyan is fully functional and can be used in your project.
Please make us aware of your needs/experiences in our chat!

We try to keep the API stable, but there’s still some unknowns and need-to-change features.

Please submit bugs and feature requests (and patches) on GitHub!

Dependencies, Building and Running

Operating System Build status
Debian Sid Todo: Kevin #11
  • How do I get this to install on my box?

  • Waaaaaah! It

    • crashes
    • spams all kinds of shit on the screen
    • my girlfriend dumped me because I debugged for nights

All of those observations are intended, not bugs.

To get rid of them, recompile with --dont-segfault --shut-up --new-girlfriend.

If this still does not help, try the contact section
or the bug tracker.

Development Process

How does contributing work here?

The documentation is also in this repo:

  • Code documentation is embedded in the sources for Doxygen (see doc readme).
  • Have a look at the doc directory. This folder tends to outdate when code changes.

Contact

If you have the desire to perform semi-human interaction,
join our Matrix chatroom!

For ideas, problems, …, use the issue tracker!

If it’s a problem with the usage of nyan in openage, head over there.

License

GNU LGPLv3 or later; see copying.md and legal/LGPLv3.

We know that probably nobody is ever gonna look at the copying.md file,
but if you want to contribute code to nyan, please take the time to
skim through it and add yourself to the authors list.