Skip to content
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

Improvements that the Bestiary needs. #4412

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

MillhioreBT
Copy link
Contributor

@MillhioreBT MillhioreBT commented Apr 20, 2023

Pull Request Prelude

  • I have followed [proper The Forgotten Server code styling][code].
  • I have read and understood the [contribution guidelines][cont] before making this PR.
  • I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.

Changes Proposed

These changes improve the readability of the code and raceId has been moved to a better place.
now the occurrence must be set with a name and not with a raw number. (common, uncommon ect...)
Thanks to @ranisalt and @joseluis2g for all the information and suggestions.

Issues addressed: Nothing!

@EPuncker EPuncker added the enhancement Increase or improvement in quality, value, or extent label Apr 20, 2023
omarcopires
omarcopires previously approved these changes Apr 20, 2023
EPuncker
EPuncker previously approved these changes Apr 20, 2023
@ArturKnopik
Copy link
Contributor

maybe let's leave the hybrid option, if there are no blocks responsible for setting kills, let's set it by default depending on the number of stars, if this data is present, then instead of the default ones, let's use these
this will allow us to generate custom bestiaries records(example: 1000-5000-15000 kills)

@MillhioreBT
Copy link
Contributor Author

maybe let's leave the hybrid option, if there are no blocks responsible for setting kills, let's set it by default depending on the number of stars, if this data is present, then instead of the default ones, let's use these this will allow us to generate custom bestiaries records(example: 1000-5000-15000 kills)

It's very easy to create a new table based on names or raceId or whatever you want, and hook it up to the getBestiaryKills method for custom behavior.
image

[3] = {kills = {50, 500, 1000}, charmPoints = 25},
[4] = {kills = {100, 1000, 2500}, charmPoints = 50},
[5] = {kills = {200, 2000, 5000}, charmPoints = 100}
}
Copy link
Member

@ranisalt ranisalt Apr 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if I want to create a monster with a custom amount of kills per step?

I'm OK with defaulting to Tibia behavior, but not as much with only being able to have Tibia behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if the one I posted above is enough.

@soul4soul
Copy link
Contributor

soul4soul commented Apr 23, 2023

I understand the value in having a table with bestiary data because there are only a few combination of values but personally I'd rather all bestiary data live directly in the creature files as it is before the PR. On top of that I have additional bias to have it in the creature files to make it easier for my monster converter to work.

@MillhioreBT
Copy link
Contributor Author

I understand the value in having a table with bestiary data because there are only a few combination of values but personally I'd rather all bestiary data live directly in the creature files as it is before the PR. On top of that I have additional bias to have it in the creature files to make it easier for my monster converter to work.

I don't know who in their right mind would customize over 800 monster files XD. That's what the table is for, so that only 4 lines can control those 800 files.

But to be honest, I'm not sure if it's worth having these configurations in each file, or if it's better to use Lua for this. There are many ways to get monsters with customized kills.

I hope other people can suggest or give ideas...

@ranisalt
Copy link
Member

On top of that I have additional bias to have it in the creature files to make it easier for my monster converter to work.

How does it work with monsters created in Lua?

@soul4soul
Copy link
Contributor

On top of that I have additional bias to have it in the creature files to make it easier for my monster converter to work.

How does it work with monsters created in Lua?

I created lua binding that match TFS monsters revsctiptsys soul4soul/ot-monster-converter#84. For all the formats I support the converter is generally only able to look directly at the monster files not any of the supporting files.

I understand the value in having a table with bestiary data because there are only a few combination of values but personally I'd rather all bestiary data live directly in the creature files as it is before the PR. On top of that I have additional bias to have it in the creature files to make it easier for my monster converter to work.

I don't know who in their right mind would customize over 800 monster files XD. That's what the table is for, so that only 4 lines can control those 800 files.

But to be honest, I'm not sure if it's worth having these configurations in each file, or if it's better to use Lua for this. There are many ways to get monsters with customized kills.

I hope other people can suggest or give ideas...

True, it will be rare that an OT owner will customize each monster. I suspect people will be less likely to touch the default monsters and instead have custom values for their custom creatures. Still, as of now all data about a creature is defined directly in the creature file I'd prefer to keep it that way.

@omarcopires
Copy link
Contributor

I agree with what @MillhioreBT says, it doesn't make sense to manipulate more than 800 files to configure 4 or 5 different behaviors if we can simply customize some desired monster just by adding a few extra lines to the code. Maybe just leaving an example script will be enough.

As for the changes to this pull request, everything works as it should and unless someone has any suggestions or code hints it's ready to be merged.

@EPuncker
Copy link
Contributor

yeah please let push that in, there is no need to delay things more

@soul4soul
Copy link
Contributor

I agree with what @MillhioreBT says, it doesn't make sense to manipulate more than 800 files to configure 4 or 5 different behaviors if we can simply customize some desired monster just by adding a few extra lines to the code. Maybe just leaving an example script will be enough.

As for the changes to this pull request, everything works as it should and unless someone has any suggestions or code hints it's ready to be merged.

Either way you need to touch 800 files to add the difficulty and occurrence. Another PR that was opened already had to work done, making the changes isn't a problem. I won't reiterate my reasons I already mentioned above.

@omarcopires

This comment was marked as off-topic.

@soul4soul

This comment was marked as off-topic.

@otland otland locked as too heated and limited conversation to collaborators May 28, 2023
@MillhioreBT MillhioreBT dismissed stale reviews from EPuncker and omarcopires via 3a7747a June 1, 2023 03:02
@@ -97,7 +97,11 @@ struct BestiaryInfo
std::string className = "";
uint8_t difficulty = 0;
uint8_t occurrence = 0;
std::tuple<uint32_t, uint32_t, uint32_t> totalKills;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you see any advantages on using a tuple vs three separate uint32_ts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it has any advantage other than looking prettier 😊

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Increase or improvement in quality, value, or extent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants