-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use UUID for quest ID, and split up giant quest JSON file #89
Conversation
Removing code that we don't need, to reduce the amount of code that needs to be updated
Removing code that we don't need, to reduce the amount of code that needs to be updated
…ading code We should probably refactor this code out of QuestCommandDefaults at some point
This isn't directly related to my other changes, but somehow something I changed seems to be triggering this latent bug.
What is the benefit of allowing custom IDs? As I understand it, the quest ID is something that is supposed to be mostly invisible, and only used internally, so its exact value / form isn't something that we should normally need to worry about. As for the quest clustering in |
generally sorted by this id.
as long as this can be sorted together, preferably in order. |
Hmm, how about this? In addition to grouping quests by quest line, they are now sorted by (English) quest name: |
|
why translating has anything to do with quest id? The text of the quest is availiable the same way. I can understand that for some questlines, you want to do them one by one to keep text coherent, but it shouldn't matter as translating a quest doesn't need the context of the other quests. UUID is the ultimate solution for us when we do quest work, we can't ditch it. |
Alright, I modified the ordering of quests to do a depth-first traversal of the requirements graph. How's this? There may be some strangeness in ordering for quests that have multiple requirements, since the logic requires it to be ordered after all of its requirements. Also worth mentioning, with the new changes, it's possible to do translations in-game, too. Just modify the quest text directly, and then do |
this couldn't be better, thank you. |
31b4614
to
00d1096
Compare
Quests are now grouped by quest line, and ordered within a quest line by an algorithm approximating depth-first traversal of the requirements graph
00d1096
to
8610d40
Compare
Share code for quest IDs and quest line IDs
* Update to new NBTConverter methods * Fix bad type in subset param
Also remove code duplication in ImportedQuestLines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this for dev and sort out any more problems with smaller PRs
This is *heavily* based on the following pull request: GTNewHorizons#89 Co-authored-by: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com>
This commit fixes the compilation errors left by pass 1.
This commit fixes the compilation errors left by pass 1.
Automated code cleanup (reviewed)
This PR contains the following changes:
DefaultQuests/
directoryDefaultQuests/Settings.json
DefaultQuests/QuestLines.json
DefaultQuests/Quests/<quest line name>-<quest line UUID>/<quest name>-<quest UUID>.json
DefaultQuests/Quests/MultipleQuestLine/<quest name>-<quest UUID>.json
DefaultQuests/Quests/NoQuestLine/<quest name>-<quest UUID>.json
/bq_admin default savelegacy
, if neededYou can see the new format here (little bit stale, and still using integer quest line ID):
Given the large amount of changes needed, particularly the changeover to UUID, I'm sure that there are bugs in here. This PR needs extensive testing; any help would be appreciated! I will leave this as a draft for the time being, until more testing has been done. Here's some pre-built jars:
These are the bugs that I feel are most likely to occur:
==
to compare UUID, rather than.equals()
(leftover from the old integer IDs, which used==
)NullPointerException
from failing to handlenull
quest ID (leftover from the old integer IDs, which could never be null)ConcurrentModificationException
from replacing arrays with collections, and then trying to modify them during iterationI'm sorry to whoever has to review this. I tried breaking the changes up into several commits to make your life easier, but there are still an enormous amount of changes.
Oh, I also deleted a bunch of old code that it didn't look like we were using. This is code for importing from other questbook formats, etc. which didn't seem like it would be at all useful for GTNH. Check the first two commits to see this.
Migrating from old versions: this should theoretically work seamlessly. If the new format database is present, we'll use it. If the new format database is not found, we'll fall back to the old format. Saving will always be done using the new format. There is only one clean-up task that needs to be done post-migration, which is to remove the old format database after the new one is created, but not doing this just means that the old file will be left around and not actually read.
Any old quests or quest lines in the database that use integer IDs will have those integer IDs converted to a UUID with mostly 0's; e.g.,
8
becomes00000000-0000-0000-0000-000000000008
. This conversion allows us to carry over old quest database files and player progress.I wasn't sure what
DefaultQuests-us.json
was for. It didn't look like it was being read, so I removed it. But please let me know if we need it.I also made some changes to how translations work. Hopefully, this will reduce or remove the need for separate translation workflows and tools. Translation will now always be on, so it will no longer be necessary to switch out the quest database in order to enable translations. All that will be needed is to provide a
.lang
file with the appropriate keys. Additionally, when saving in the new database format, an exampleen_US.lang
file will be generated, which will contain the correct lang keys as well as the English quest text.Here's an example of what the generated
en_US.lang
file looks like: