Author Topic: Worker animation doesn't match the resource  (Read 4328 times)

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Worker animation doesn't match the resource
« on: 16 March 2011, 07:53:26 »
There is a bug I've noticed generally that, when you move a worker that has harvested something, and then you tell them to harvest something else, they first return to the castle with the wrong type of resource animation.

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Worker animation doesn't match the resource
« Reply #1 on: 16 March 2011, 08:01:55 »
There is a bug I've noticed generally that, when you move a worker that has harvested something, and then you tell them to harvest something else, they first return to the castle with the wrong type of resource animation.
Yes, that bug is very old...Glest and MG has it too. Maybe that could be fixed during the merge.

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Worker animation doesn't match the resource
« Reply #2 on: 16 March 2011, 08:20:35 »
I split this off since it should really be a separate topic but I'm not sure how to move it out of feature requests.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: Worker animation doesn't match the resource
« Reply #3 on: 16 March 2011, 08:30:15 »
OK, I moved it to the general bug report; since this bug applies to all versions of Glest.

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Worker animation doesn't match the resource
« Reply #4 on: 16 March 2011, 08:32:20 »
It should use a loaded animation based on what resource the worker is carrying not on what skill is active. I think that should fix it. ;D
Egypt Remastered!

Proof: Owner of glest@mail.com

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: Worker animation doesn't match the resource
« Reply #5 on: 16 March 2011, 08:47:46 »
also consider what's the right thing to do - you have a worker who is carrying some amount of some harvested resource.

You explicitly move them.  They do not show visually that they are carrying any resource, they show a normal walking and then idle animation.  You then ask them to continue harvesting something else, and suddenly they are shown carrying a resource again!  Its a bit inconsistent?

What should the proper behaviour be?

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Worker animation doesn't match the resource
« Reply #6 on: 16 March 2011, 10:12:21 »
Quote from: Will
What should the proper behaviour be?

It should use a loaded animation based on what resource the worker is carrying not on what skill is active. I think that should fix it. ;D

 :| I believe that would carry on to affect ALL the workers movement?
Egypt Remastered!

Proof: Owner of glest@mail.com

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: Worker animation doesn't match the resource
« Reply #7 on: 16 March 2011, 22:13:06 »
It should use a loaded animation based on what resource the worker is carrying not on what skill is active. I think that should fix it. ;D
Sounds good, although if it was that easy...why wasn't this fixed when GAE and MG was first released?  :-X
I mean, this happens in almost every game I play for me...

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Worker animation doesn't match the resource
« Reply #8 on: 16 March 2011, 22:19:07 »
It's probably just an oversight that nobody bothered to write down and fix.

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Worker animation doesn't match the resource
« Reply #9 on: 16 March 2011, 22:38:20 »
I'm (almost) certain I fixed this.

This was done in GAE when an exploit that -Archmage- hinted at was fixed. The exploit fix made it into MG and I think I added comments stating where the animation selection is wrong, but didn't add the code as it was/is a bit clumsy.

relevant clumsy code (from cmd_types_worker.cpp, belong in unit_updater.cpp for MG):
Code: [Select]
// hacky helper for !HarvestCommandType::canHarvest(u->getLoadType()) animation issue
const MoveSkillType* getMoveLoadedSkill(Unit *u) {
const MoveSkillType *mst = 0;
for (int i=0; i < u->getType()->getCommandTypeCount<HarvestCommandType>(); ++i) {
const HarvestCommandType *t = u->getType()->getCommandType<HarvestCommandType>(i);
if (t->canHarvest(u->getLoadType())) {
mst = t->getMoveLoadedSkillType();
break;
}
}
return mst;
}

// hacky helper for !HarvestCommandType::canHarvest(u->getLoadType()) animation issue
const StopSkillType* getStopLoadedSkill(Unit *u) {
const StopSkillType *sst = 0;
for (int i=0; i < u->getType()->getCommandTypeCount<HarvestCommandType>(); ++i) {
const HarvestCommandType *t = u->getType()->getCommandType<HarvestCommandType>(i);
if (t->canHarvest(u->getLoadType())) {
sst = t->getStopLoadedSkillType();
break;
}
}
return sst;
}
« Last Edit: 18 March 2011, 23:49:40 by silnarm »
Glest Advanced Engine - Code Monkey

Timeline | Downloads

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Worker animation doesn't match the resource
« Reply #10 on: 18 March 2011, 00:05:58 »
I'm (almost) certain I fixed this.
I thought you did too. I think several fixes have been lost somehow.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Worker animation doesn't match the resource
« Reply #11 on: 17 April 2011, 05:29:43 »
Fixed now in megaglest, thanks silnarm

 

anything