• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

buildsystem/H08-Jul-2018-2,5501,979

doc/H08-Jul-2018-1,240908

extra/syntax_highlighting/H08-Jul-2018-8677

legal/H08-Jul-2018-841681

nyan/H03-May-2022-11,4596,575

test/H08-Jul-2018-11984

.gitignoreH A D08-Jul-2018425 4840

README.mdH A D08-Jul-20184.9 KiB191125

copying.mdH A D08-Jul-20183.7 KiB7456

kevinfileH A D08-Jul-2018262 1713

README.md

1nyan - yet another notation
2===========================
3
4> just make it meta-meta-meta.
5
6**nyan** is a *data description language*,
7It is a mixture of python, json, patch, wml, yaml and some new ideas.
8
9It stores hierarchical objects with key-value pairs in a database with the key idea that changes in a parent affect all children.
10
11We created nyan because there existed no suitable language to
12properly represent the enormous complexity of storing the data for [openage](https://github.com/SFTtech/openage).
13
14The main focus is *readability* and *moddability*.
15
16[![github stars](https://img.shields.io/github/stars/SFTtech/nyan.svg)](https://github.com/SFTtech/nyan/stargazers)
17[![#sfttech on Freenode](http://img.shields.io/Freenode/%23sfttech.png)](https://webchat.freenode.net/?channels=sfttech)
18
19
20The foundation of **nyan**:
21
22Technology             | Component
23-----------------------|----------
24**C++17**              | nyan core
25**Flex**               | Tokenizer generator
26**CMake**              | Build "system"
27**Humans**             | Doing it wrong all the time
28
29
30How?
31----
32
33Let's assume we have a fun λ half-life strategy game.
34
35The game engine provides some functionality which is exposed by `nyan`.
36
37``` python
38# This is the content and mod API of the Engine:
39
40Unit():
41    hp : int
42    animation : file
43
44Building():
45    hp : int
46    creates : set(Unit)
47    model : file
48```
49
50Using this, the base game pack provides actual game content:
51
52``` python
53# base_game_data.nyan
54
55OverwatchSoldier(Unit):
56    hp = 50
57    animation = "./assets/soldier.ani"
58
59Strider(Unit):
60    hp = 2100
61    animation = "./assets/strider.ani"
62
63CombineCitadel(Building):
64    hp = 9001
65    creates = {OverwatchSoldier, Strider}
66    model = "./assets/lambda_hq.mdl"
67
68Citizen(Unit):
69    hp = 60
70    animation = "./assets/male09.ani"
71
72# gordon is a citizen with more hp
73Gordon(Citizen):
74    hp += 40
75    animation = "./assets/gordon.ani"
76
77RebelHQ(Building):
78    hp = 5000
79    creates = {Citizen, Gordon}
80    model = "./assets/lambda_hq.mdl"
81```
82
83Now, let's create a mod that adds the overwatch elite
84and gives the striders even more hp.
85
86``` python
87# elite_strider_mod.nyan
88
89# create a new unit:
90OverwatchElite(Unit):
91    hp = 70
92
93# change the strider:
94ChangeStrider<Strider>():
95    hp += 1000
96
97# change the citadel to build the elite:
98AddElite<CombineCitadel>():
99    creates += {OverwatchElite}
100
101# create a mod that informs the engine about its patches
102StriderEliteMod(Mod):
103    name = "Add the elite and make striders stronger"
104    patches = {AddElite, ChangeStrider}
105```
106
107When the engine activates the mod ("applies the patches"),
108the combine citadel can create the new unit and the strider is stronger.
109
110
111The fun begins if you now create a mod that mods the mod.
112Which is totally possible with **nyan**.
113
114
115Specification
116-------------
117
118Read the [specification](doc/nyan.md).
119
120
121Current State of the Project
122----------------------------
123
124`nyan` is fully functional and can be used in your project.
125
126There's some features left to implement, but those only
127cover special use cases:
128
129* [ ] Inverse patch generation
130* [ ] Subobject set specializations
131* [ ] Callback trigger when a value changes
132* [ ] Member name qualifications for name conflict resolving
133
134
135Dependencies, Building and Running
136----------------------------------
137
138 - How do I get this to install on my box?
139   - See [doc/building.md](doc/building.md).
140
141 - Waaaaaah! It
142   - crashes
143   - spams all kinds of shit on the screen
144   - my girlfriend dumped me because I debugged for nights
145
146All of those observations are intended, not bugs.
147
148To get rid of them, recompile with `--dont-segfault --shut-up --new-girlfriend`.
149
150
151If this still does not help, try the [contact section](#contact)
152or the [bug tracker](https://github.com/SFTtech/nyan/issues).
153
154
155Development Process
156-------------------
157
158How does contributing work here?
159 - Extensive [syncronization](#contact)!
160 - Report [issues](https://github.com/SFTtech/nyan) and send [pull requests](https://help.github.com/articles/using-pull-requests/).
161
162
163The documentation is also in this repo:
164
165- Code documentation is embedded in the sources for Doxygen (see [doc readme](doc/README.md)).
166- Have a look at the [doc directory](doc/). This folder tends to outdate when code changes.
167
168
169Contact
170-------
171
172If you have the desire to perform semi-human interaction,
173join our **Matrix** or **IRC** chatroom!
174
175* [`#sfttech:matrix.org`](https://riot.im/app/#/room/#sfttech:matrix.org)
176* [`irc.freenode.net #sfttech`](https://webchat.freenode.net/?channels=sfttech)
177
178For ideas, problems, ..., use the [issue tracker](https://github.com/SFTtech/nyan/issues)!
179
180If it's a problem with the usage of **nyan** in **openage**, [head over there](https://github.com/SFTtech/openage).
181
182
183License
184-------
185
186**GNU LGPLv3** or later; see [copying.md](copying.md) and [legal/LGPLv3](/legal/LGPLv3).
187
188We know that probably nobody is ever gonna look at the `copying.md` file,
189but if you want to contribute code to nyan, please take the time to
190skim through it and add yourself to the authors list.
191