Author Topic: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)  (Read 14281 times)

0 Members and 1 Guest are viewing this topic.

Godarcher

  • Sergeant at Arms
  • *
  • How far will you go For Rome?
    • View Profile
    • Moddb site
  • Faction: Khergit
  • MP nick: Godarcher
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #45 on: November 26, 2016, 07:35:24 PM »

typo?


Code: [Select]
common_check_message_time = ( #checks if messages are allowed to display
   ti_before_mission_start, 0, 0, [],
   [
(assign, "$g_message", 0),
(assign, "$g_message1", 0),
   ]))

Yes stupid thx

(click to show/hide)
How far will you go For Rome?color]

Namakan

  • Sergeant Knight
  • *
  • How did I get here?
    • Steam - NamakanZ
    • View Profile
  • Faction: Bandit
  • MP nick: Krex, Tenebrae
  • WF&SNWWBVC
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #46 on: November 27, 2016, 01:52:23 PM »

typo?


Code: [Select]
common_check_message_time = ( #checks if messages are allowed to display
   ti_before_mission_start, 0, 0, [],
   [
      (assign, "$g_message", 0),
      (assign, "$g_message1", 0),
   ]))

Yes stupid thx

(click to show/hide)


I think he was talking about the variables (?)
Playing for DoF

Godarcher

  • Sergeant at Arms
  • *
  • How far will you go For Rome?
    • View Profile
    • Moddb site
  • Faction: Khergit
  • MP nick: Godarcher
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #47 on: November 29, 2016, 05:16:03 PM »

typo?


Code: [Select]
common_check_message_time = ( #checks if messages are allowed to display
   ti_before_mission_start, 0, 0, [],
   [
      (assign, "$g_message", 0),
      (assign, "$g_message1", 0),
   ]))

Yes stupid thx

(click to show/hide)


I think he was talking about the variables (?)
Yes just make it $ sry
How far will you go For Rome?color]

NUQAR'S Kentucky "Nuqar" James XXL

  • BioAfrikaner
  • Duke
  • *
  • 🖕IF YOUR EASILY OFFENDED...GROW SOME BALLS...!!🖕
    • Twitter - yaqobhyndes
    • View Profile
    • Artwork Gallery
  • Faction: Khergit
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #48 on: February 03, 2017, 12:15:28 PM »
I've updated the OP (finally). The were a few bugs and oversights in the code which are now fixed.

fladin

  • Baron
  • *
    • Steam - infomatec
    • YouTube - UCJd5LBSuJabHUmwxD1eQe2w
    • View Profile
    • said.ovh
  • Faction: Neutral
  • MP nick: infomatec
  • WBNWVC
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #49 on: February 10, 2017, 09:28:34 AM »
Aren't script_cf_agent_can_rout  and max_morale missing in the OP ?

NUQAR'S Kentucky "Nuqar" James XXL

  • BioAfrikaner
  • Duke
  • *
  • 🖕IF YOUR EASILY OFFENDED...GROW SOME BALLS...!!🖕
    • Twitter - yaqobhyndes
    • View Profile
    • Artwork Gallery
  • Faction: Khergit
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #50 on: February 10, 2017, 09:42:07 AM »
Whoops, thanks for that. Fixed.

Seek n Destroy

  • Marquis
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: SnD
  • WBWF&S
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #51 on: February 10, 2017, 03:59:34 PM »
Hah, thought so when testing the scripts too. At first I declared max_morale as being 100 just to check and the results were rather chaotic  :lol:
I somehow feel like I've gained some frames back with this, I can't be certain without testing two different builds in the same conditions but at the very least I can say is that the routing seems more responsive. Does it take troops levels into account? I haven't noticed much difference between the rate which low level and higher level troops rout but maybe that's just because there's not too much of a level gap in my troops. I might just start paying attention to how routing works and add some more purpose to officer and banner carriers, thanks for the code.

NUQAR'S Kentucky "Nuqar" James XXL

  • BioAfrikaner
  • Duke
  • *
  • 🖕IF YOUR EASILY OFFENDED...GROW SOME BALLS...!!🖕
    • Twitter - yaqobhyndes
    • View Profile
    • Artwork Gallery
  • Faction: Khergit
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #52 on: February 10, 2017, 04:09:16 PM »
The guy working on the module system overhaul noticed significant stutter reduction.

Troop level is taken into account but not by a huge margin. I think the decide_run_away_or_not script handles this.

Seek n Destroy

  • Marquis
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: SnD
  • WBWF&S
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #53 on: February 10, 2017, 04:35:41 PM »
I'm certain someone with a better computer will notice much more of a difference, I'm working on a resource intensive mod and looking into some possible optimization so this certainly comes in handy. Can't wait to see what Xenoargh pulls out too.
script_decide_run_away_or_not seems to take agent hp into account and his courage score which seems to be defined in the lead_charge mission template and is indeed based on troop level. By playing around a bit with those two I should be able to add some more fluctuations to the morale/courage system, higher starting courage when in the presence of officer troops and some significant drops in morale when the player or a lord gets smashed as a nice throwback to the old TW games where the well timed death of an enemy captain or general could turn the tide of battle.

Quote from: script_decide_run_away_or_not
            (agent_is_ally, ":cur_agent"),
            (val_sub, ":agent_hit_points", 100), #ally agents will be more tend to run away, to make game more funnier/harder
So that's another reason why allies always seem more of an hindrance than actual help...

fladin

  • Baron
  • *
    • Steam - infomatec
    • YouTube - UCJd5LBSuJabHUmwxD1eQe2w
    • View Profile
    • said.ovh
  • Faction: Neutral
  • MP nick: infomatec
  • WBNWVC
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #54 on: February 17, 2017, 11:35:06 AM »
and it works !  :D
(click to show/hide)