Author Topic: Status of Pets code?  (Read 2544 times)

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Status of Pets code?
« on: 19 August 2013, 21:49:59 »
So in my recent re-exploration of GAE I have tried to make a unit which creates pets.

AFAIK the only tag needed to create pets in the master units XML file is <pet value="true" max="2"/> in the produce skill (i also tried in the command as well).

It doesn't seem to be working  :(
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Status of Pets code?
« Reply #1 on: 20 August 2013, 06:16:20 »
It doesn't seem to be working
Can you elaborate on that? It certainly worked in past versions of GAE.

The only noticeable thing the pets feature does is the production restriction. It also assigns pets and masters, which can be used as the target for effects and emanations (which is the real useful part of pets).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: Status of Pets code?
« Reply #2 on: 20 August 2013, 12:06:46 »
Oh, I assumed that the pets code made the pets auto follow the master. Probably working correctly then.

Is there any way this is possible? I know about the guard mode but I want it to happen automatically without having to click.
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Status of Pets code?
« Reply #3 on: 27 August 2013, 02:43:57 »
I was aware the limit is not enforced, and will get that fixed soon, as to what else it is meant to do (master/pet behaviours) I was never really aware of what was implemented, if anything.

Certainly the behaviour you suggest seems reasonable.  Maybe best to implement as instead of a default stop command (when it has no other commands) the pet gets a guard command (on the master) instead of stop (or a follow, or a move, whatever is available). Will have to think on this one a bit more.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: Status of Pets code?
« Reply #4 on: 27 August 2013, 03:00:16 »
When I was implementing the code for my Majesty-like project I needed behaviors where units could detect units attacking them or their owners. Its actually really similar to the pet system in a sense.

Orders own their members so the member will know if its Motherhouse or Chapterhouse is being attacked and run to defend it. This behavior is functioning. Since Orderhouses aren't mobile there is no follow behavior but that would be trivial to implement. The hierarchy code already implements group orders. A slight modification because you don't need a concrete formation would allow that to add following behavior to the defending one. In fact adventuring parties pretty much function exactly like pets, especially if they are following the sovereign on a mission.

If you still haven't implemented anything in a week or so and I've managed to keep focus I will post basically how my implementation works. I can't do a direct patch since Mandate is already far too divergent from GAE. According to the contributors tab on github I have added 120000 and removed 70000 lines of code. A lot of that is just reworks of mandate specific code though I think. I'm not really sure how Git calculates that.

The profiler hasn't displayed any problems with what I've done so hopefully it is sufficiently performant.

 

anything