@reldens/game-data-generator 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +21 -0
- package/examples/generate-monsters-attributes-per-level.js +60 -0
- package/examples/generate-monsters-experience-per-level.js +29 -0
- package/examples/generate-players-experience-per-level.js +17 -0
- package/examples/generated/.gitkeep +0 -0
- package/examples/monsters-attributes-per-level.json +9802 -0
- package/examples/monsters-experience-per-level.json +2401 -0
- package/examples/players-experience-per-level.json +601 -0
- package/index.js +15 -0
- package/lib/files/file-handler.js +43 -0
- package/lib/generator/game-data-generator.js +45 -0
- package/lib/generator/monsters-attributes-per-level.js +90 -0
- package/lib/generator/monsters-experience-per-level.js +129 -0
- package/lib/generator/players-experience-per-level.js +82 -0
- package/lib/validator/monsters-attributes-per-level-validator.js +33 -0
- package/lib/validator/monsters-experience-per-level-validator.js +29 -0
- package/lib/validator/players-experience-per-level-validator.js +29 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Damian A. Pastorini
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[](https://github.com/damian-pastorini/reldens)
|
|
2
|
+
|
|
3
|
+
# Reldens - Game Data Generator
|
|
4
|
+
|
|
5
|
+
A tool to create all types of random game data, like levels, experience, attributes, etc.
|
|
6
|
+
|
|
7
|
+
Need some specific feature?
|
|
8
|
+
|
|
9
|
+
[Request a feature here: https://www.reldens.com/features-request](https://www.reldens.com/features-request)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Documentation
|
|
14
|
+
|
|
15
|
+
[https://www.reldens.com/documentation/game-data-generator/](https://www.reldens.com/documentation/tile-map-optimizer/)
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
### [Reldens](https://github.com/damian-pastorini/reldens/ "Reldens")
|
|
20
|
+
|
|
21
|
+
##### [By DwDeveloper](https://www.dwdeveloper.com/ "DwDeveloper")
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Reldens - Game Data Generator - Examples
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const { MonsterAttributesPerLevel } = require('../lib/generator/monsters-attributes-per-level');
|
|
8
|
+
|
|
9
|
+
let monstersExperiencePerLevel = new MonsterAttributesPerLevel({
|
|
10
|
+
monsterBase: {
|
|
11
|
+
hp: 10,
|
|
12
|
+
atk: 10,
|
|
13
|
+
def: 10,
|
|
14
|
+
speed: 10,
|
|
15
|
+
mAtk: 10,
|
|
16
|
+
mDef: 10,
|
|
17
|
+
dodge: 10,
|
|
18
|
+
aim: 10
|
|
19
|
+
},
|
|
20
|
+
typeTemplates: {
|
|
21
|
+
melee: {
|
|
22
|
+
hp: {min: 7, max: 20},
|
|
23
|
+
atk: {min: 7, max: 20},
|
|
24
|
+
def: {min: 7, max: 20},
|
|
25
|
+
speed: {min: 1, max: 2},
|
|
26
|
+
mAtk: {min: 1, max: 2},
|
|
27
|
+
mDef: {min: 1, max: 2},
|
|
28
|
+
dodge: {min: 1, max: 4},
|
|
29
|
+
aim: {min: 1, max: 2}
|
|
30
|
+
},
|
|
31
|
+
mage: {
|
|
32
|
+
hp: {min: 5, max: 10},
|
|
33
|
+
atk: {min: 1, max: 2},
|
|
34
|
+
def: {min: 1, max: 2},
|
|
35
|
+
speed: {min: 1, max: 4},
|
|
36
|
+
mAtk: {min: 7, max: 20},
|
|
37
|
+
mDef: {min: 7, max: 20},
|
|
38
|
+
dodge: {min: 1, max: 2},
|
|
39
|
+
aim: {min: 5, max: 10}
|
|
40
|
+
},
|
|
41
|
+
archer: {
|
|
42
|
+
hp: {min: 5, max: 10},
|
|
43
|
+
atk: {min: 5, max: 10},
|
|
44
|
+
def: {min: 1, max: 4},
|
|
45
|
+
speed: {min: 5, max: 10},
|
|
46
|
+
mAtk: {min: 1, max: 2},
|
|
47
|
+
mDef: {min: 1, max: 2},
|
|
48
|
+
dodge: {min: 7, max: 20},
|
|
49
|
+
aim: {min: 7, max: 20}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
variationsScaleFactorsMinMax: {
|
|
53
|
+
monsterA: {min: 1, max: 1.5},
|
|
54
|
+
monsterB: {min: 1.5, max: 1.8},
|
|
55
|
+
boss: {min: 2.5, max: 3.5}
|
|
56
|
+
},
|
|
57
|
+
monsterTypesVariations: ['monsterA', 'monsterB', 'boss']
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
monstersExperiencePerLevel.generate();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Reldens - Game Data Generator - Examples
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const { MonstersExperiencePerLevel } = require('../lib/generator/monsters-experience-per-level');
|
|
8
|
+
const playerLevels = require('./players-experience-per-level.json');
|
|
9
|
+
|
|
10
|
+
const monstersExperiencePerLevel = new MonstersExperiencePerLevel({
|
|
11
|
+
levelsExperienceByKey: playerLevels,
|
|
12
|
+
variations: {
|
|
13
|
+
monsterA: 8,
|
|
14
|
+
monsterB: 9,
|
|
15
|
+
bossExtra: 15
|
|
16
|
+
},
|
|
17
|
+
decrementProportionPerLevel: {
|
|
18
|
+
'5': 0.8,
|
|
19
|
+
'10': 0.42,
|
|
20
|
+
'15': 0.4,
|
|
21
|
+
'20': 0.26,
|
|
22
|
+
'25': 0.15,
|
|
23
|
+
'30': 0.1,
|
|
24
|
+
'35': 0.08,
|
|
25
|
+
'40': 0.0025
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
monstersExperiencePerLevel.generate();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Reldens - Game Data Generator - Examples
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const { PlayersExperiencePerLevel } = require('../lib/generator/players-experience-per-level');
|
|
8
|
+
|
|
9
|
+
const playersExperiencePerLevel = new PlayersExperiencePerLevel({
|
|
10
|
+
startExp: 10, // experience required to reach level 2 from level 1
|
|
11
|
+
baseGrowthFactor: 2, // initial growth per level
|
|
12
|
+
baseGrowthFactorPerLevel: {'5': 1.5, '10': 1.35, '15': 1.271, '20': 1.1, '40': 1}, // growth factor per level
|
|
13
|
+
maxLevel: 100, // how many levels
|
|
14
|
+
growthIncrease: 0.005, // increase in growth factor per level
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
playersExperiencePerLevel.generate();
|
|
File without changes
|