Home » MODDING HQ 1.13 » Flugente's Magika Workshop » Expanded Feature: Move militia in strategic map, part 2
Expanded Feature: Move militia in strategic map, part 2[message #339332] Sun, 08 February 2015 23:57 Go to next message
Flugente

 
Messages:3339
Registered:April 2009
Location: Germany
Expanded Feature: Move militia in strategic map, part 2

While we already could move militia clumsily, this was rather tedious. I have now improved that - we can order our militia around in strategic view just like our mercs or the helicopter. A little demo:



Things you should know:




  • For internal reasons, there can only be up to 30 militia groups traveling at a time.
  • Militia requires someone nearby to tell them to move. For simplicity, we require the mercs simply to not be in a coma, asleep is okay (otherwise we have to wake them up, give the order, set them asleep again - tedious!).
    This can be achieved in several ways:
    1. they are in the same sector
    2. they are in the same town (otherwise we'd have to do tedious town-internal travel)
    3. they are a radio operator in an adjacent sector
    4. they are a radio operator in a sector adjacent to the militia's town
    5. they are a radio operator in a town adjacent to the militia's sector
  • If, however, we control the Alma military HQ, and if someone capable enough - an experienced merc with enough wisdom and leadership (lvl 5, WIS 70, LDR 70) - staffs it, then we can order militia around the entire country. Because, uhm, the HQ has maps and plans and radio equipment and.. stuff.

    http://i57.tinypic.com/1q1lpz.png
  • Militia travels as fast as mercs do (without any ranger or background boni). Note, however, that they travel slower at night, because they need their sleep. You might not now that, but army patrols also do that.
  • Militia travel is similar to enemy travel. This means that during the travel, it stays in its origin sector, an once the travel is completed, it is transferred to the target sector. So this is different from mercs, who are in between sectors while traveling.
  • Traveling militia can not be redistributed in the militia redistribution screen, because duh, they are traveling.
  • Militia will engage any hostile force it encounters.
  • If your militia has gear equipped, it will move with them of course.
  • Militia will not move out of a sector if there is currently a fight in that sector.
  • The facility assignment trains leadership and wisdom a tiny bit.
  • While the HQ is staffed, mobile militia does not wander around randomly on its own. Because why should it?
  • This is incompatible with mobile militia - while this is active, mobile militia won't, because its pretty pointless in that case.
  • The previous feature is not active anymore.




Ini settings:
[Militia Strategic Movement Settings]

;------------------------------------------------------------------------------------------------------------------------------
; If ALLOW_MILITIA_STRATEGIC_COMMAND is TRUE, we can plot paths for militia jut like for merc groups or the heli.
; To command militia, display militia in the strategic map, then leftclick on a sector with militia in it.
; This requires either control and staffing of a military HQ, a merc in the same sector/town, or a radio operator in an adjacent sector.
; 
; : If ALLOW_MILITIA_STRATEGIC_COMMAND is TRUE, ALLOW_MOBILE_MILITIA and its subsequent settings are IGNORED!
;------------------------------------------------------------------------------------------------------------------------------

ALLOW_MILITIA_STRATEGIC_COMMAND = FALSE


This actually was a lot harder then I expected. While I know now how to make essentially any faction (civs, zombies...) travel, I don't currently plan so...
Updating this for individual militia will be a bloody nightmare.

Does not break savegame compatibility.

Requires exe r7727 and GameDir r2204.

[Updated on: Mon, 09 February 2015 13:07]




“What are you doing?” Joffrey interrupted him.

“… can’t a man give a few last words for his son to carry?”

“…Who told you your son was making it out of this field alive?”

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Expanded Feature: Move militia in strategic map, part 2[message #339335 is a reply to message #339332] Mon, 09 February 2015 00:58 Go to previous messageGo to next message
Sargeno

 
Messages:71
Registered:December 2001
Location: Oregon, USA
Simply sweet, you the man happy
Re: Expanded Feature: Move militia in strategic map, part 2[message #339342 is a reply to message #339335] Mon, 09 February 2015 07:10 Go to previous messageGo to next message
M16AMachinegun

 
Messages:307
Registered:September 2013
Does this apply to ALL militia or only "Mobile" militia, which i assume this replaces?
Re: Expanded Feature: Move militia in strategic map, part 2[message #339347 is a reply to message #339342] Mon, 09 February 2015 13:10 Go to previous messageGo to next message
Flugente

 
Messages:3339
Registered:April 2009
Location: Germany
This applies to ALL militia. There never was a difference between static and mobile militia to begin with - militia outside of town was simply allowed to occasionally move, which made it somewhat mobile.



“What are you doing?” Joffrey interrupted him.

“… can’t a man give a few last words for his son to carry?”

“…Who told you your son was making it out of this field alive?”

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Expanded Feature: Move militia in strategic map, part 2[message #339356 is a reply to message #339347] Mon, 09 February 2015 16:33 Go to previous messageGo to next message
M16AMachinegun

 
Messages:307
Registered:September 2013
Excellent!

This gives me more of an incentive to move all of a town's items into one sector and then train from there, but that's okay, it makes it more like a HQ for the town.

[Updated on: Mon, 09 February 2015 16:35]

Re: Expanded Feature: Move militia in strategic map, part 2[message #339361 is a reply to message #339356] Mon, 09 February 2015 20:44 Go to previous messageGo to next message
Nasenbaer

 
Messages:36
Registered:July 2013
Location: Germany
WOW! REALLY COOL - Thanks Flug!
Re: Expanded Feature: Move militia in strategic map, part 2[message #339418 is a reply to message #339361] Thu, 12 February 2015 23:49 Go to previous messageGo to next message
Flugente

 
Messages:3339
Registered:April 2009
Location: Germany
As of r7731, the nighttime movement penalty to militia groups no longer applies for movement inside a town. I figured the player might just want to rotate his troops, no need to punish him for that

As simultaneous attack of mercs and militia are a good thing in my book, arrival in an enemy-occupied sector can now be coordinated, like it can be for merc squads. If multiple groups are inbound for the same location, the usual prompt will show up and allow to wait until all groups are in place (r7733).



“What are you doing?” Joffrey interrupted him.

“… can’t a man give a few last words for his son to carry?”

“…Who told you your son was making it out of this field alive?”

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Expanded Feature: Move militia in strategic map, part 2[message #339426 is a reply to message #339418] Fri, 13 February 2015 21:20 Go to previous messageGo to next message
cpt.Shen

 
Messages:8
Registered:January 2015
Perhaps I shouldn't ask about that, but I just can't wait to play with all those great options: When do you plan to release a stable (r7733?) version with all this great stuff?
Re: Expanded Feature: Move militia in strategic map, part 2[message #339427 is a reply to message #339426] Fri, 13 February 2015 21:50 Go to previous messageGo to next message
Flugente

 
Messages:3339
Registered:April 2009
Location: Germany
Stable? I hope not in the next few years, because the last stable was lots of additional work.

These new features are in the unstable, however, which DepressivesBrot regularly updates. The only difference between 2014 stable and unstable is that the stable does not receive any new features created after Jan 1st 2014. And we don't update that thing anymore, because there is no reason to update a branch that wont get any more releases anyway.



“What are you doing?” Joffrey interrupted him.

“… can’t a man give a few last words for his son to carry?”

“…Who told you your son was making it out of this field alive?”

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Expanded Feature: Move militia in strategic map, part 2[message #339429 is a reply to message #339418] Sat, 14 February 2015 05:11 Go to previous messageGo to next message
edmortimer

 
Messages:1058
Registered:January 2015
Location: Home Free
Sounds great! Can you make it so the militia can be ordered to retreat in the same manner as Mercs?




Arulco Vacations Blog

Arulco Vacations Bears Pit Forum


Re: Expanded Feature: Move militia in strategic map, part 2[message #339489 is a reply to message #339429] Wed, 18 February 2015 10:11 Go to previous messageGo to next message
Uriens

 
Messages:330
Registered:July 2006
This is awesome change. Thanks flug.
Re: Expanded Feature: Move militia in strategic map, part 2[message #339495 is a reply to message #339427] Wed, 18 February 2015 13:02 Go to previous messageGo to next message
cpt.Shen

 
Messages:8
Registered:January 2015
I'm relatively new here, where can I download your latest version then, Flugente?
Re: Expanded Feature: Move militia in strategic map, part 2[message #339496 is a reply to message #339495] Wed, 18 February 2015 13:15 Go to previous messageGo to next message
Flugente

 
Messages:3339
Registered:April 2009
Location: Germany
This feature will be in the newest SCIs from DepressivesBrot, linked above. I don't know the exact date he released the last one, so the newest code from 1 or 2 days ago might not be in, but this is the easiest way to get up-to-date exes.



“What are you doing?” Joffrey interrupted him.

“… can’t a man give a few last words for his son to carry?”

“…Who told you your son was making it out of this field alive?”

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Expanded Feature: Move militia in strategic map, part 2[message #339550 is a reply to message #339496] Sat, 21 February 2015 01:39 Go to previous messageGo to next message
Flugente

 
Messages:3339
Registered:April 2009
Location: Germany
Update, r7743:

  • When clicking on a sector to start militia pathing, and the sector does not have static militia but militia groups, select the last militia group instead of creating a new empty one. This removes the issue where clicking on a sector whose militia are all in movement groups creates a new, empty group. Now the last group of the list is selected (realistically, that's what you want in over 90% of the times anyway).
  • The final sector in a militia group's path is shown while plotting in the strategic map. Usefulin case you forgot where you sent your team to...
  • Militia can now retreat from autoresolve if one clicks the 'retreat' button. However, this command needs to be given to them by our mercs, thereby fitting in with the rest of the feature. Like stated in the first post, a merc can order militia if any of the following are true:
    • they are in the same sector
    • they are in the same town (otherwise we'd have to do tedious town-internal travel)
    • they are a radio operator in an adjacent sector
    • they are a radio operator in a sector adjacent to the militia's town
    • they are a radio operator in a town adjacent to the militia's sector
    • the military HQ is staffed by qualified personnel
    If the militia was in a group, they will retreat to the sector they came from. If they were static (like, say, in a city) they will retreat to the closest (in regards to travel-time) non-hostile adjacent sector. If no such sector exists, they will stay in the sector of the battle, 'cause what else am I gonna do?
    Note that, as to keep this in line with the general enemy and militia movement behaviour, they will move to this sector instantly.

[Updated on: Sat, 21 February 2015 01:40]




“What are you doing?” Joffrey interrupted him.

“… can’t a man give a few last words for his son to carry?”

“…Who told you your son was making it out of this field alive?”

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Expanded Feature: Move militia in strategic map, part 2[message #340909 is a reply to message #339332] Thu, 07 May 2015 23:24 Go to previous messageGo to next message
navaroe

 
Messages:78
Registered:August 2012
I love this features - and found a bug angel

Now I think I already noticed bug like this one mentioned around, but couldn't find the post and I possibly got another one, so here we go:

In this saved game, for build 7835, if you try to issue order to militia in C5 sector, you'll get assertion failure on line 606 in Strategic Movement.cpp, Invalid IDENTICAL waypoint being added for group ID4. AM 0
There was similar problem in E13, you know.

Also, when you enter tactical in E13, you will notice some stuff got moved into unreachable location. In case of this sector its just Brenda's wardrobe, so no big problem. But I think same problem caused lots of unreachable things in C13 Drassen and this stuff is gonna be there for ever now. This happens even after I move all militia away (using radio), so may be it's a different bug.

Saved game, ja2_options.ini included>
http://ulozto.net/xpJtHiVd/militiamovementbug-zip

Re: Expanded Feature: Move militia in strategic map, part 2[message #341087 is a reply to message #340909] Thu, 21 May 2015 22:28 Go to previous messageGo to next message
navaroe

 
Messages:78
Registered:August 2012
Should it help you somehow, in this saved game for build 7866 http://ulozto.net/xRzqNtRH/movementbugeverywhere-zip
you get assertion error on line 2935 in Strategic Movement.cpp when you try to issue order to any militia.

This happened after I called reinforcement from neighboring sector to a farm in B8, when enemy entered sector. Before battle, trying to give order to that group already meant assertion error.
Here is a saved game http://ulozto.net/xZ8eBMuP/movementbug-zip
The error you get in this one is Assertion Failure on 3314 in Strategic Movement.cpp, Group 65 (AI) attempting illegal move from sector 16, dir 3 (EDGEOFWORLD).


Re: Expanded Feature: Move militia in strategic map, part 2[message #341137 is a reply to message #341087] Sun, 24 May 2015 18:02 Go to previous messageGo to next message
Flugente

 
Messages:3339
Registered:April 2009
Location: Germany
Hmm. Fixed a number of possible bugs from these saves in r7876. However, the problem remains that movement is yucky. There are several instances where past waypoints aren't properly erased, thereby possible screwing up future movements. You can remove that yourself, by selecting a group and then right-clicking, thereby erasing the previous movement plans. Afterwards, issue the movement order as normal.
However, the entire strategic movement code (whether for mercs, enemy or militia) is relatively volatile. There are parts of the code that are unsafe or even wrong, and the game simply works because those functions are never called in a certain way (e.g. I fixed an issue where a pointer was NULLed and then used immediately afterwards again). SirTech's method of error handling - 'if there is an error, crash the game' - isn't exactly helping.
For no, upgrade to this exe if possible, and clear militia movement orders before issuing new ones.

The inaccessible gear does not seem militia-related (considering that lots of that gear is LBE). Not sure how to fix that though.



“What are you doing?” Joffrey interrupted him.

“… can’t a man give a few last words for his son to carry?”

“…Who told you your son was making it out of this field alive?”

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Expanded Feature: Move militia in strategic map, part 2[message #341147 is a reply to message #341137] Sun, 24 May 2015 23:48 Go to previous messageGo to next message
navaroe

 
Messages:78
Registered:August 2012
Thanks. I already solved the problem the way you suggest - seems to be ok now.

And yes, the problem with stuff is probably unrelated - it has manifested now in my saved game in more harsh way and it seems to have appeared during a battle where there was not even militia reinforcement. Before it there was like 5000 items in sector and after it 10 000, many inaccessible, way to many kits, and later on things multiplied in neighboring sector...If I figure out any reasonable cause I post in proper thread, but I guess I wont spot the actual point, where the bug occurs in this case.

Thanks again for the militia fix.

[Updated on: Sun, 24 May 2015 23:49]

Re: Expanded Feature: Move militia in strategic map, part 2[message #341892 is a reply to message #341147] Wed, 29 July 2015 05:33 Go to previous messageGo to next message
NewAgeOfPower

 
Messages:111
Registered:June 2010
I haven't issued any orders to militia, but this is happening to me.

http://i.imgur.com/lQHygat.png

This is on a R 7898 build.

[Updated on: Wed, 29 July 2015 06:13]

Re: Expanded Feature: Move militia in strategic map, part 2[message #344819 is a reply to message #341892] Thu, 31 March 2016 22:18 Go to previous messageGo to next message
Anthropoid

 
Messages:145
Registered:February 2014
I'm getting a bug that sounds similar to the one described above: a CTD when you attempt to move a militia unit in the strategic map. The militia are in C9 and they are being led across country to reinforce Chit Mine. I could've just gone to Chit mine and trained them there, but I wanted to fiddle with these features and see how they work.

This problem seems a bit different though and I'm not sure your explanation for why it was happening up above would apply. Reason being: militia movement into three of the adjacent sectors causes CTD (C8, B9 or C10), but movement to D9 is legal and functional and causes no errors.

That was in fact how I got around it. I just moved them to D9, then took them west along the D-sector path.

https://onedrive.live.com/redir?resid=AF1D2F11D047BA67!1024&authkey=!AG2FFOKSy1u5Jj0&ithint=folder%2csav
Re: Expanded Feature: Move militia in strategic map, part 2[message #345712 is a reply to message #344819] Sat, 28 May 2016 17:57 Go to previous messageGo to next message
Flugente

 
Messages:3339
Registered:April 2009
Location: Germany
I fixed a bug in r8243: If a sector had more than MAX_STRATEGIC_ENEMY_GROUP_SIZE militia (as in, not already moving), then attempting to plot a path with those militia caused the militia count to be cut to MAX_STRATEGIC_ENEMY_GROUP_SIZE, thereby removing militia.

Theoretically this could also happen to the AI, but as troops in groups are always created out of thin air, this likely never happens.



“What are you doing?” Joffrey interrupted him.

“… can’t a man give a few last words for his son to carry?”

“…Who told you your son was making it out of this field alive?”

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Expanded Feature: Move militia in strategic map, part 2[message #352694 is a reply to message #345712] Wed, 14 March 2018 22:21 Go to previous messageGo to next message
Flugente

 
Messages:3339
Registered:April 2009
Location: Germany
As you might now, the old mobile militia feature has been deleted, so this is now the only way to move the green guys. In case someone is now heartbroken that they need to take Alma in order to swamp the country with militia, fear not: as of r8548 & GameDir r2415, if MILITIA_STRATEGIC_COMMAND_REQUIRES_MERC is FALSE (default TRUE), militia can always be commanded from strategic screen, regardless of whether you control the HQ or mercs are nearby.

Also useful if one were to test militia autoresolve behaviour without constantly teleporting mercs around shy



“What are you doing?” Joffrey interrupted him.

“… can’t a man give a few last words for his son to carry?”

“…Who told you your son was making it out of this field alive?”

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Expanded Feature: Move militia in strategic map, part 2[message #352710 is a reply to message #352694] Tue, 20 March 2018 07:56 Go to previous messageGo to next message
az75

 
Messages:40
Registered:June 2012
Location: Romania
nevermind

[Updated on: Tue, 20 March 2018 17:24]

Re: Expanded Feature: Move militia in strategic map, part 2[message #353756 is a reply to message #339332] Mon, 11 June 2018 23:12 Go to previous message
sob1

 
Messages:12
Registered:June 2018
And I thought Mobile Militia was groundbreaking! This is really something else. Thanks!



Dr. Phil as a playable comedy IMP: http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=353751&#msg_353751

Lawrence of Arabia as an IMP:

http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=353801&#msg_353801
Previous Topic: Not a feature: roleplay facts
Next Topic: New feature: Covert operations
Goto Forum:
  


Current Time: Sat Jun 23 01:55:18 EEST 2018

Total time taken to generate the page: 0.01641 seconds