Skip to content

Add enhanced animations support for outfits/Fix issue #642#736

Closed
sebekkx wants to merge 5 commits into
edubart:masterfrom
sebekkx:master
Closed

Add enhanced animations support for outfits/Fix issue #642#736
sebekkx wants to merge 5 commits into
edubart:masterfrom
sebekkx:master

Conversation

@sebekkx
Copy link
Copy Markdown

@sebekkx sebekkx commented Jun 9, 2016

Finally managed to do a little. Enjoy, folks ;)

@sebekkx
Copy link
Copy Markdown
Author

sebekkx commented Jun 9, 2016

Fixed backwards compatibility (Protocols without enhanced animations had only Idle outfit position) in commit db24490
The code is tested on protocols: 7.6, 10.41, 10.93.

@diath
Copy link
Copy Markdown
Collaborator

diath commented Jun 9, 2016

Good job. It would be nice though if you could replace tabs with spaces in your changes to keep it consistent with the rest of the files you've modified. Also I don't think the cast to LightView * is necessary, you can simply pass nullptr.

@sebekkx
Copy link
Copy Markdown
Author

sebekkx commented Jun 9, 2016

@diath Done.

@totolol123
Copy link
Copy Markdown

Nice 👍

@HeavenIsLost
Copy link
Copy Markdown

I did not review the code, but thanks for fixing that issue 👍

@Mignari

@sebekkx
Copy link
Copy Markdown
Author

sebekkx commented Jun 11, 2016

Small note to the function Creature::updateWalkAnimation. The thing is footDelay is, by default, set to getStepDuration(true) / 3, so basically animation speed is hardcoded for outfits with 3 animations - hence creatures walk in slow motion. I tried to fix it, but every way I tried I get visible "frameskips". If someone would be willing to fix this issue, it would be great.

…tity" outfits aswell) and change braces style.
@sebekkx
Copy link
Copy Markdown
Author

sebekkx commented Jun 12, 2016

I couldn't resist ;>

@conde2
Copy link
Copy Markdown
Contributor

conde2 commented Jun 20, 2016

Does it break compatibility with other versions ?

@sebekkx
Copy link
Copy Markdown
Author

sebekkx commented Jun 20, 2016

@conde2 No. In fact all other versions are still compatible with new ThingType loading scheme. Old scheme for new outfits was just skipping FrameGroupIdle and loading only FrameGroupMoving, so I adjusted ThingType class to contain a vector of (new) FrameGroup class' objects', containing all the textures and properties of certain framegroup - so if you load a Thing (outfit), that has only one FrameGroup, then loading functions creates only one object of FrameGroup class, therefore it can still load it properly.

@edubart
Copy link
Copy Markdown
Owner

edubart commented Jun 20, 2016

Don't change the code style of other unrelated code if you want it merged, makes hard to review and also diverges from the standard style.

@sebekkx
Copy link
Copy Markdown
Author

sebekkx commented Jun 21, 2016

@edubart Since I made a little mess with commits in this pull request, maybe I should create another containing all of changes/additions in the code?

@hrsantiago
Copy link
Copy Markdown
Collaborator

Yes, and only with the actual changes that matters.
Do not change stuff like if() to if ()
Pay attention to tabs and spaces. Otc uses 4 spaces

@diath
Copy link
Copy Markdown
Collaborator

diath commented Jul 18, 2016

It seems that this change breaks outfit image exportng. You can reproduce it by opening the client terminal (^T) and typing in the following:

g_things.getThingType(128, ThingCategoryCreature):exportImage('test.png')

Prior to applying this patch, this would export the outfit sprites into test.png, after applying the patch it does nothing. It seems that it does not pass this check in ThingType::exportImage function:

if (m_frameGroups[i]->m_spritesIndex.size() == 0) {

I think that you're also introducing a memory leak by not deleting the contents of m_frameGroups in ThingType's destructor, either iterate over the container and delete the contents in the destructor or use a smart pointer.

@belizariogr
Copy link
Copy Markdown

i found a bug... if you are near of a creature that have animations when is idle (like wyvern), you get a crash. Debuging, i found the wrong line.

int ticksPerFrame = 1000 / getAnimationPhases();

function getAnimationPhases() returns zero, and raise an error.

@belizariogr
Copy link
Copy Markdown

belizariogr commented Jul 21, 2016

I managed the problem changing code a little bit...

if (isAnimateAlways() && animateIdle) { type = FrameGroupMoving; int ticksPerFrame = 1000 / getAnimationPhases(type); animationPhase = (g_clock.millis() % (ticksPerFrame * getAnimationPhases(type))) / ticksPerFrame;

for (int yPattern = 0; yPattern < getNumPatternY(type); yPattern++) {

@BARBA-N3GR4
Copy link
Copy Markdown

Belizario jr can pass me your creature.cpp ??

As he said above, Bat, Wyvern, Fire Elemental etc ... creatures that do not stop animation, makes the client crashing.

@belizariogr
Copy link
Copy Markdown

creatures.zip

@BARBA-N3GR4
Copy link
Copy Markdown

thank you dude, more is creature.cpp xD not creatures.cpp

in which you applied the fix

if (isAnimateAlways () && animateIdle) {type = FrameGroupMoving; ticksPerFrame int = 1000 / getAnimationPhases (type); animationPhase = (g_clock.millis ()% (* ticksPerFrame getAnimationPhases (type))) / ticksPerFrame;

  for (int yPattern = 0; yPattern <getNumPatternY (type); yPattern ++) {

@belizariogr
Copy link
Copy Markdown

ahhh.... sorry, my bad...
creature.zip

@BARBA-N3GR4
Copy link
Copy Markdown

Thanks man xD,
It worked

@totolol123
Copy link
Copy Markdown

Any news?

@sebekkx
Copy link
Copy Markdown
Author

sebekkx commented Nov 6, 2016

@totolol123 Since I started uni this September (not related to programming) I pretty much don't have time to resolve issues in this PR or do any programming, so if any dev would be willing to fix these issues, feel free to do it, just give me credits if you'll start from my work. If no one takes this case, then most likely I will start to work on it on spring break.

@Crownn
Copy link
Copy Markdown

Crownn commented Nov 8, 2016

when you walk with spells like "utani hur" the speed of the animation its more faster than the needed to walk :/

@sebekkx sebekkx closed this Jul 26, 2017
tornadia pushed a commit to tornadia/otclient that referenced this pull request May 31, 2024
…edubart#736)

* fix: crash game_entergame if httpLoginBox is boolean ( edubart#647 )

* fix: game_entergame if host nil  windows is hidden

* temp fix: game_entergame windows is not centered

the original bug is in
I don't have how to test I don't use token
  EnterGame.toggleAuthenticatorToken
  EnterGame.toggleStayLoggedBox
tornadia pushed a commit to tornadia/otclient that referenced this pull request May 31, 2024
* fix: [game_entergame] loadBox in old protocol

The modification made to edubart#736 of loadBox was in the wrong place in the code. causes display loadBox in old protocols.

* fix: If you try to login without assets.

* fix: indentation Reviewer: luanluciano93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants