Grasscutter icon indicating copy to clipboard operation
Grasscutter copied to clipboard

feat: add loot tables

Open diauweb opened this issue 2 years ago • 12 comments

Description

See #1378. Please note this is a prototype and need future discussions.

Please carefully read the Contributing note and Code of conduct before making any pull requests. And, Do not make a pull request to merge into stable unless it is a hotfix. Use the development branch instead.

Issues fixed by this PR

#1378

Type of changes

  • [ ] Bug fix
  • [x] New feature
  • [x] Enhancement
  • [ ] Documentation

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] My pull request is unique and no other pull requests have been opened for these changes
  • [x] I have read the Contributing note and Code of conduct
  • [x] I am responsible for any copyright issues with my code if it occurs in the future.

diauweb avatar Jun 26 '22 05:06 diauweb

I like your loot table schema, but personally would prefer every monster loot table in one json file instead of in many files (per monster).

ghost avatar Jun 26 '22 06:06 ghost

I like your loot table schema, but personally would prefer every monster loot table in one json file instead of in many files (per monster).

I afraid we'll eventually get a very huge file. How about organize the tables by monster group? e.g. All types of Hilichurls use one file with conditional tweaks in loot table rules

diauweb avatar Jun 26 '22 06:06 diauweb

I like your loot table schema, but personally would prefer every monster loot table in one json file instead of in many files (per monster).

I afraid we'll eventually get a very huge file. How about organize the tables by monster group? e.g. All types of Hilichurls use one file with conditional tweaks in loot table rules

I agree, it would become too messy after a while. By mob type / groups within table would be easier to maintain.

GiRx8 avatar Jun 26 '22 08:06 GiRx8

I agree, it would become too messy after a while. By mob type / groups within table would be easier to maintain.

The reason i prefer it to be in one file is because i would rather not have to deal with 100s of json files with one for each monster. It would be better to make a tool to create drop tables for each monster and then have it compile everything into one json.

ghost avatar Jun 26 '22 09:06 ghost

I agree, it would become too messy after a while. By mob type / groups within table would be easier to maintain.

The reason i prefer it to be in one file is because i would rather not have to deal with 100s of json files with one for each monster. It would be better to make a tool to create drop tables for each monster and then have it compile everything into one json.

Yeah big + for a tool, but yeah as it stands it’s a huge mess. Will be good to organize it at least.

GiRx8 avatar Jun 26 '22 10:06 GiRx8

I added a new layer LootRegistry which can help reduce the count of the files

diauweb avatar Jun 27 '22 13:06 diauweb

I have added an example on handling gacha with loot table

diauweb avatar Jun 29 '22 11:06 diauweb

I'll mark this pr as ready as I have implemented most of it. Future developments and migrations can be done in other new prs.

diauweb avatar Jul 03 '22 12:07 diauweb

I'll have to look deeper into some other details on this PR later, and I do agree with the general ideas of it, but I'd prefer to sort things out a bit more before merging this.

It's a big, breaking change and do need more attention. It's important for me to receive reviews to make it good for everyone.

diauweb avatar Jul 03 '22 15:07 diauweb

object SceneObj_Area_Common_Property_Ani_Prop_BGM_01 should be add to file ChestReward.json ,because i see WARN:GadgetChest Could not found the handler of this type of Chests when trying to pick up bgm. 表现为无法拾取旋曜玉帛

eternalcomet avatar Jul 07 '22 08:07 eternalcomet

object SceneObj_Area_Common_Property_Ani_Prop_BGM_01 should be add to file ChestReward.json ,because i see WARN:GadgetChest Could not found the handler of this type of Chests when trying to pick up bgm. 表现为无法拾取旋曜玉帛

It's somehow unrelated to this PR. However you can solve this problem by adding your tables after this PR is merged

diauweb avatar Jul 07 '22 09:07 diauweb

why haven't it been merged yet? does it work?

eternalcomet avatar Aug 01 '22 02:08 eternalcomet

Recent DMCA compliance push closed active PRs.

Apologies for taking so long to address loot tables, things keep popping up and the todo pile keeps growing :smiling_face_with_tear:

Birdulon avatar Aug 21 '22 12:08 Birdulon