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

Bug with monsters appearance #914

Open
3 of 5 tasks
TheLionEscanor opened this issue Oct 9, 2024 · 5 comments
Open
3 of 5 tasks

Bug with monsters appearance #914

TheLionEscanor opened this issue Oct 9, 2024 · 5 comments
Labels
Priority: Medium This issue may be impactful and needs some attention. Status: Pending Test This PR or Issue requires more testing Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@TheLionEscanor
Copy link

TheLionEscanor commented Oct 9, 2024

Priority

Medium

Area

  • Data
  • Source
  • Docker
  • Other

What happened?

https://www.dropbox.com/scl/fi/uao61aeuva7watd24cbm1/2024-10-08-20-09-46.mkv?rlkey=jo80wuqd0bssxntb1t76g6bd8&st=sj1upprf&dl=0]
No throwing errors, the console logs are another issue

What OS are you seeing the problem on?

Windows

Code of Conduct

  • I agree to follow this project's Code of Conduct
@TheLionEscanor TheLionEscanor added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Oct 9, 2024
@github-actions github-actions bot added Priority: Medium This issue may be impactful and needs some attention. Status: Pending Test This PR or Issue requires more testing labels Oct 9, 2024
@leoddias
Copy link
Contributor

leoddias commented Oct 9, 2024

Also reported in
#828

@dgprado-80
Copy link

There is a problem with the Demon Skeleton
Captura de tela 2024-10-09 224725

@kojimhojo
Copy link

note that this occurs only in 13.40
at 13.32 the monsters are fine.

so the protobuf is misinterpreting at 13.40.

@dgprado-80
Copy link

In remeres the demon skeleton looks like this too.

@kokekanon
Copy link
Collaborator

kokekanon commented Nov 13, 2024

maybe new things are missing in the protobuf

message SpriteInfo {
	optional uint32 pattern_width = 1;
	optional uint32 pattern_height = 2;
	optional uint32 pattern_depth = 3;
	optional uint32 layers = 4;
	repeated uint32 sprite_id = 5;
	optional uint32 bounding_square = 7;
	optional SpriteAnimation animation = 6;
	optional bool is_opaque = 8;
	repeated Box bounding_box_per_direction = 9;
+  optional uint32 pattern_size = 10;
+  optional uint32 pattern_layers = 11;
+  optional uint32 pattern_x = 12;
+  optional uint32 pattern_y = 13;
+  optional uint32 pattern_z = 14;
+  optional uint32 pattern_frames = 15;
+  optional bool is_animation  = 16;
}

image

Example outfit : demon skeleton[id = 37] 13.32( good) vs 13.40 ( bad)

image

m_numPatternX = spriteInfo.pattern_width();
m_numPatternY = spriteInfo.pattern_height();
m_numPatternZ = spriteInfo.pattern_depth();
m_layers = spriteInfo.layers();
m_opaque = spriteInfo.is_opaque();

in: otclient/src/client/thingtype.cpp
fx: void ThingType::unserializeAppearance

13.40 check box is 64 + variable bounding box per direction
image
vs
13.32 check box is 32
image

I think this is the problem, variant values + square >32 :
asdasd

For Example :
if I delete this, it's a little better

  • walking work
  • idler no work

Without if:

if (sizes.size() > 1) {
// correction for some sprites
for (const auto& s : sizes) {
m_size.setWidth(std::max<int>(m_size.width(), s.width()));
m_size.setHeight(std::max<int>(m_size.height(), s.height()));
}
const size_t expectedSize = m_size.area() * m_layers * m_numPatternX * m_numPatternY * m_numPatternZ * m_animationPhases;
if (expectedSize != m_spritesIndex.size()) {
const std::vector sprites(std::move(m_spritesIndex));
m_spritesIndex.clear();
m_spritesIndex.reserve(expectedSize);
for (size_t i = 0, idx = 0; i < sizes.size(); ++i) {
const int totalSprites = total_sprites[i];
if (m_size == sizes[i]) {
for (int j = 0; j < totalSprites; ++j) {
m_spritesIndex.push_back(sprites[idx++]);
}
continue;
}
const size_t patterns = (totalSprites / sizes[i].area());
for (size_t p = 0; p < patterns; ++p) {
for (int x = 0; x < m_size.width(); ++x) {
for (int y = 0; y < m_size.height(); ++y) {
if (x < sizes[i].width() && y < sizes[i].height()) {
m_spritesIndex.push_back(sprites[idx++]);
continue;
}
m_spritesIndex.push_back(0);
}
}
}
}
}

caca

With if; looktype invisible

336

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium This issue may be impactful and needs some attention. Status: Pending Test This PR or Issue requires more testing Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

5 participants