Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: Equip militia with guns/armour/etc.
Re: New feature: Equip militia with guns/armour/etc.[message #316269] Fri, 15 March 2013 00:53 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
So... what about the militia that remains? Do they have the 2 missing commandos?


Re: New feature: Equip militia with guns/armour/etc.[message #316273] Fri, 15 March 2013 10:20 Go to previous messageGo to next message
jmenya

 
Messages:5
Registered:March 2013
ok, seems we do not understand each other. 10 guns before combat and 8 after - number of guns available in sector inventory if inspect militia or remove from sector. So - before combat i had 10 militia armed with 10 commando, after combat - 9 militia, and one of them is unarmed.
Re: New feature: Equip militia with guns/armour/etc.[message #316319] Sat, 16 March 2013 20:15 Go to previous messageGo to next message
cnagorneac

 
Messages:185
Registered:April 2012
One more strange behavior.
I was defending drasses and decided to retreat and leave any remaining militia to die. After I quit sector all militia became instantly dead and ALL items in sector became deleted AND autobattle window did not show (some militia were still alive).
When writing this report, I decided to replay that situation just to be sure. And what happened: Autobattle wondow did show up, my militia died, BUT ther remained in the strategic view and after I started time another autobattle occurred and my militia finally died.
The bad thing is that I did not reloaded when I lost all my sector inventory =(
Re: New feature: Equip militia with guns/armour/etc.[message #316327] Sun, 17 March 2013 00:41 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
Update:
@Jmenya: I tried to simulate that. Thought I had a missing commando after a militia died - but it simply lay on the corpse. Gear dropped by militia is not automatically revealed after combat (like in the ancient days of pre-1.13). After combat, run to your dead militiamen, and see if you can now find the missing guns.

@cnagorneac: Hopefully fixed in r5926, try it out.


Re: New feature: Equip militia with guns/armour/etc.[message #316681] Thu, 28 March 2013 18:32 Go to previous messageGo to next message
PasHancock

 
Messages:738
Registered:February 2011
Location: Estonia,Tallinn
Would be awesome to see if you could somehow make Militia Generate random equipment + take equipment from sector, because Militia at early stages of the game is useless, because there won't be many weapons, i know this feature increases realism but its kinda annoying sometimes, to get Equipment and drop it in sector

Would love to see something like:
1 - Militia generates their own Equipment
2 - Militia has weapons/equipment from Sector Inventory, but if there is not enough weapons to distrube, generate for the rest
3 - Militia only uses equipment from Sector inventory


OR maybe a Feature where you can equip every Militiamen individually? like Open their Inventory and give Gun, Ammo, Grenades etc. for each of them? and their Equipment is saved til they will die or move from Sector or drop items you gave to them after leaving sector?

[Updated on: Thu, 28 March 2013 18:34] by Moderator

Re: New feature: Equip militia with guns/armour/etc.[message #316682] Thu, 28 March 2013 18:37 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3805
Registered:July 2009
This feature is intended to be played with drop all. If you have taken a sector, you will have enough hardware to garrison that sector with militia. If you have so few enemies, you don't need militia and can simply fight one or two defenses yourself to get enough stuff.
For individual equipment, see the link in the first post on why this was shot down every single time before and still isn't feasible.


Re: New feature: Equip militia with guns/armour/etc.[message #316942] Tue, 02 April 2013 18:57 Go to previous messageGo to next message
PasHancock

 
Messages:738
Registered:February 2011
Location: Estonia,Tallinn
maybe a bit offtopic, but could you do something with Reinforcements? for example, i have Mobile militia of 20 people in sector E6 and D7, but i want to call reinforcements only from D7, not from both sectors, maybe you can make an option for us to choose from what sector(s) they should arrive? and possibly How many Militiamen i want to take from that sector
Re: New feature: Equip militia with guns/armour/etc.[message #316945] Tue, 02 April 2013 21:23 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
I've done something like that which might find its way to the trunk one day... be patient Smile


Re: New feature: Equip militia with guns/armour/etc.[message #317114] Sat, 06 April 2013 14:07 Go to previous messageGo to next message
PasHancock

 
Messages:738
Registered:February 2011
Location: Estonia,Tallinn
is this a bug or what, but you if you attack a sector while your militia ALREADY has weapons/items equipped, all their equipment will be lost in a sector you attack, so in order for Militia to have weapons/items in a sector you want to attack, you must drop all their equipment in a sector they are in, before attacking
Re: New feature: Equip militia with guns/armour/etc.[message #317115] Sat, 06 April 2013 14:17 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
Eh... I am not unsure I understand... you are trying to attack a sector where there's militia in that already has guns? What?


Re: New feature: Equip militia with guns/armour/etc.[message #317116] Sat, 06 April 2013 14:43 Go to previous messageGo to next message
PasHancock

 
Messages:738
Registered:February 2011
Location: Estonia,Tallinn
ok ok, here how it works:

I trained Militia in C13 sector
They Took all Weapons and Items they could take
I decided to attack D13 with my Militia
When we arrived, Militia had no Weapons and no Items

Then, i reloaded game
did Militia inspection ( drop all their items )
attacked D13
Militia had their Weapons and Items

P.S:

after i took D13 sector, i tried to return militia to C13 sector with all their stuff, but when i did that, they had no weapons, they were all gone, and to get their items back, i must do Militia Inspection and drop items in that sector

[Updated on: Sat, 06 April 2013 14:45] by Moderator

Re: New feature: Equip militia with guns/armour/etc.[message #317117] Sat, 06 April 2013 15:01 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
The first one seems like a bug, I'll look at it later.

The second one is normal, when one moves militia between town sectors in strategic, they do not take gear along (Otherwise redistributing militia after combat would result in chaos).


Re: New feature: Equip militia with guns/armour/etc.[message #317118] Sat, 06 April 2013 15:08 Go to previous messageGo to next message
PasHancock

 
Messages:738
Registered:February 2011
Location: Estonia,Tallinn
oh i wanted to ask you, does Miliia pick up a Weapon depending on their Coolness, Traits and Militia Type?

Like, Veteran Militia will pick up weapon with Highest Coolness
or its completely randomized?
Re: New feature: Equip militia with guns/armour/etc.[message #317119] Sat, 06 April 2013 15:17 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
If possible, veteran militia chooses first (this is not always possible due to the weird way in which we load maps).

Militia/Enemy traits are chosen depending on the gear they get, not the other way around (apart from the 2nd handgun for ambidextrous). Has always been so Smile

Item selection is deterministic. We rate every item we find with a simple 'fitness' function. The higher the value, the more we like it:
// determines how good an item is
UINT32 ItemFitness( OBJECTTYPE* pObj, UINT8 idx )
{
	UINT32 value = 0;

	if ( Item[ pObj->usItem ].usItemClass & IC_ARMOUR )
	{
		value = Armour[ Item[ pObj->usItem ].ubClassIndex ].ubProtection * Armour[ Item[ pObj->usItem ].ubClassIndex ].ubCoverage * (*pObj)[idx]->data.objectStatus;
	}
	else if ( Item[ pObj->usItem ].usItemClass & IC_FACE )
	{
		if ( Item[ pObj->usItem ].gasmask )
			value = (*pObj)[idx]->data.objectStatus;
		else if ( Item[ pObj->usItem ].hearingrangebonus )
		{
			value = Item[ pObj->usItem ].hearingrangebonus;
		}
		else
		{
			value += (NightTime() ? Item[ pObj->usItem ].nightvisionrangebonus : Item[ pObj->usItem ].dayvisionrangebonus );
		}
	}
	else if ( Item[ pObj->usItem ].usItemClass & (IC_BLADE|IC_PUNCH) )
	{
		value = (*pObj)[idx]->data.objectStatus * Weapon[ Item[ pObj->usItem ].ubClassIndex ].ubImpact;
	}
	else if ( Item[ pObj->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) )
	{
		// value is damage * range * firing rate, modified by number of attachments and accuracy
		value = GetDamage(pObj) * GunRange(pObj, NULL) * max(1, GetAutofireShotsPerFiveAPs(pObj));

		value = value * (10 + (UINT32)GetGunAccuracy(pObj)) / 10;

		value = value * (10 + (*pObj)[0]->AttachmentListSize()) / 10;

		value *= (*pObj)[idx]->data.objectStatus;
	}
	// default
	else
	{
		value = (*pObj)[idx]->data.objectStatus * Item[pObj->usItem].ubCoolness;
	}

	return value;
}

Guns are a special case, as we multiply their value with the percentage of needed ammo for it we find:
// how much ammo does this item need?
UINT32 GetNeededTotalAmmo( UINT16 usItem )
{
	// determine what amount of ammo is deemed 'enough' for this gun
	return max(gGameExternalOptions.usMilitiaAmmo_Min, min(gGameExternalOptions.usMilitiaAmmo_Max, gGameExternalOptions.usMilitiaAmmo_OptimalMagCount * Weapon[ usItem ].ubMagSize));
}

// special version of ItemFitness() that takes ammo count into consideration
UINT32 ItemFitness_WithAmmo( OBJECTTYPE* pObj, UINT8 idx, UINT32 uiBullets )
{
	return (ItemFitness(pObj, idx) * uiBullets) / max(1, GetNeededTotalAmmo(pObj->usItem));
}
So for guns, we call ItemFitness_WithAmmo() with the number of available bullets. Best rating wins. Coolness is irrelevant for that item category.

Edit: From looking at it, I should propably take object status into account for face vision items, and limit the influence of uiBullets by GetNeededTotalAmmo(pObj->usItem)... will do later.

[Updated on: Sat, 06 April 2013 15:22] by Moderator



Re: New feature: Equip militia with guns/armour/etc.[message #317120] Sat, 06 April 2013 15:25 Go to previous messageGo to next message
PasHancock

 
Messages:738
Registered:February 2011
Location: Estonia,Tallinn
can Militia weapons Jam btw? i remember my Militiaman had a pistol with 50% reliability or whatever, and he had 0 Jams...so can their weapons Jam?

Re: New feature: Equip militia with guns/armour/etc.[message #317121] Sat, 06 April 2013 15:28 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
Nope, never could. They can malfunction spectacular (happen with damaged mortars/RPGs), but they cannot jam. The AI wouldn't know how to handle it, and jamming would make the beginning of the game much more easy - due to the bad status of their guns in the beginning, the AI would experience an epidemic of jams Smile


Re: New feature: Equip militia with guns/armour/etc.[message #317122] Sat, 06 April 2013 15:30 Go to previous messageGo to next message
Sam Hotte

 
Messages:2020
Registered:March 2009
Location: Middle of Germany
IIRC AI never suffers from weapon's jam, no.

[Updated on: Sat, 06 April 2013 15:31] by Moderator

Re: New feature: Equip militia with guns/armour/etc.[message #317127] Sat, 06 April 2013 16:57 Go to previous messageGo to next message
Slax

 
Messages:1446
Registered:July 2006
Location: People riding polar bears...
The IoV exes have enemy weapon jams. That's about it.

Re: New feature: Equip militia with guns/armour/etc.[message #317128] Sat, 06 April 2013 17:21 Go to previous messageGo to next message
PasHancock

 
Messages:738
Registered:February 2011
Location: Estonia,Tallinn
btw, Sandro or someone made an AI improvement long time ago, where they stay away from Tear/Mustard gas, i played few days ago and Militia didnt avoid Gas
Re: New feature: Equip militia with guns/armour/etc.[message #317130] Sat, 06 April 2013 18:40 Go to previous messageGo to next message
PasHancock

 
Messages:738
Registered:February 2011
Location: Estonia,Tallinn
oh, about equipping militia
You know about this, restric Militia from picking up certain items, what if you could make an option, where you can only allow certain type of Militia to pick up a weapon, like, TAB + RMB to choose between Green, Blue and Violet militia, so if i choose Violet, only Veteran militia can pick up such Item(s)
Re: New feature: Equip militia with guns/armour/etc.[message #317132] Sat, 06 April 2013 18:49 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
That would be possible, though I don't see the gain. The most profound difference in militia always was the gear itself - Elites were much better mostly because the gear was better. Would you have your militia go into battle with clearly inferior gear, just because they are below a certain rank?


Re: New feature: Equip militia with guns/armour/etc.[message #317134] Sat, 06 April 2013 18:59 Go to previous messageGo to next message
PasHancock

 
Messages:738
Registered:February 2011
Location: Estonia,Tallinn
Flugente
That would be possible, though I don't see the gain. The most profound difference in militia always was the gear itself - Elites were much better mostly because the gear was better. Would you have your militia go into battle with clearly inferior gear, just because they are below a certain rank?


I just think that sometimes some Militiamen dont deserve weapons they hold, just hard to see Newbie who cant aim with a great weapon and to see Professional with Low weapon

Just saying would be nice idea to restrict some weapons to certain Militia types, so that they dont waste precious ammo ( like i dont want to see Green militia missing all those Mortar shells or Grenades from Gren. Launcher or RPG while Veteran could actually hit and do something )

[Updated on: Sat, 06 April 2013 18:59] by Moderator

Re: New feature: Equip militia with guns/armour/etc.[message #317135] Sat, 06 April 2013 19:31 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
PasHancock
ok ok, here how it works:

I trained Militia in C13 sector
They Took all Weapons and Items they could take
I decided to attack D13 with my Militia
When we arrived, Militia had no Weapons and no Items
Well, I just did that, and it works for me. Both when attacking from strategic and from manully entering the sector from tactical. What is the revision of your exe?

They also avoid tear gas pretty well when I drop it in their path. Need more info.

[Updated on: Sat, 06 April 2013 19:34] by Moderator



Re: New feature: Equip militia with guns/armour/etc.[message #317140] Sat, 06 April 2013 22:36 Go to previous messageGo to next message
PasHancock

 
Messages:738
Registered:February 2011
Location: Estonia,Tallinn
dunno, happened with me tho, playing on latest rev

btw, you should try to find a way to move items between sectors, because its soo annoying to move weapons from sector to sector by yourself Sad
Re: New feature: Equip militia with guns/armour/etc.[message #317141] Sat, 06 April 2013 23:00 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
Mobile militia takes gear along, and static does it on attacking/defending. It does not work on static redistributing however, due to the weirdness this would create (reassigning militia would become a giant inventory migration in the entire city, which would make it very tricky to keep track of stuff).


Re: New feature: Equip militia with guns/armour/etc.[message #317156] Sun, 07 April 2013 03:20 Go to previous messageGo to next message
PasHancock

 
Messages:738
Registered:February 2011
Location: Estonia,Tallinn
ok, try to reproduce this

My merc is in sector C13, in tactical, every Militia has weapons/items
I send 1 merc to pick up something in sector D13 (without entering tactical map), i pick 1 item ( you dont have to pick up item, you simply must enter other sector and return )
Then i go back to sector C13
I go Tactical
Every Militiamen loses their Items

[Updated on: Sun, 07 April 2013 03:27] by Moderator

Re: New feature: Equip militia with guns/armour/etc.[message #317277] Wed, 10 April 2013 15:31 Go to previous messageGo to next message
jmenya

 
Messages:5
Registered:March 2013
hello. confirm bug reported by PasHancock with one remark - i have rev. 5927. Each time i`m opening tactical map with town militia i must make inspection, otherwise all equipment worn on militia will disappear once merks leave sector. Saves available. Before i was playing 5917 and had not such problem.

One more item - re my posts concerning 10 commando etc. Looks like problen hide in number of dead bodies left after battle. If after battle i can find all bodies - i have all equipment, but sometimes part of bodies missing and in such cases equipment "unfoundable".
Re: New feature: Equip militia with guns/armour/etc.[message #317307] Thu, 11 April 2013 00:19 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
A savegame would be good, as I cannot reproduce the error you get.


Re: New feature: Equip militia with guns/armour/etc.[message #317329] Thu, 11 April 2013 20:16 Go to previous messageGo to next message
PasHancock

 
Messages:738
Registered:February 2011
Location: Estonia,Tallinn
hmm, maybe it would be more realistic if you could make something with Militia's health? for example, if Militia was Hurt during a fight, he will have the same HP after battle, so if Militiaman's state was Critical during a battle, and battle is over, that Militiaman's health will still be Critical, and his hp will regenerate faster than Mercs HP for obvious reason, regeneration will be faster if Merc with Doctor trait is in the sector

Same to do with Enemies, if i hurt alot of Enemies during a fight and i retreated, i want to send my Spy back to that sector to finish everyone who he can

Dying Enemies/Militia HP after battle will be changed to Critical


Is this possible to implement? it's just increases Realism and what i like in Equip Your Militia feature, is that you would equip them by yourself, as if it was real war where you must provide soldiers with equipment
Re: New feature: Equip militia with guns/armour/etc.[message #317332] Thu, 11 April 2013 20:45 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
Again, no. The only enemies/militias/civs/creatures whose data we know are those in the current sector. In all other sectors, we only now the number of them, nothing more. When entering a sector, a the fitting amount of soldiers is created randomly (now with the exception of militia gear, which is taken from the sector).


Re: New feature: Equip militia with guns/armour/etc.[message #317400] Sat, 13 April 2013 21:13 Go to previous messageGo to next message
Kafouille

 
Messages:9
Registered:May 2006
Flugente
A savegame would be good, as I cannot reproduce the error you get.


I have reproduced this error, and have savegames : First savegame, merc is in sector, militia get to keep the weapons, second one, the merc has just left the sector, the guns are not back in sector inventory, when you load that savegame and go back in that sector the militia has lost all their guns. This is on exe 5996 from Depri's builds.

Also, a suggestion : Instead of disapearing from sector inventory, weapons in use by militia should get an overlay like the one you get on inacessible items, at "In use by militia" tooltip, and an associated visibility filter, it would be much more user friendly, the current way is rather confusing when you get a lot of militia and can't quite remember just what you gave them.

https://docs.google.com/file/d/0B7ZZcFqBHX1cdi1YM3NONUYzYmM/edit?usp=sharing
Re: New feature: Equip militia with guns/armour/etc.[message #317404] Sat, 13 April 2013 22:53 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
I am unable to load your savegames. The first one crashes, upon loading the second, crash occurs when entering a sector (due to weird placement of corpses).

Do you use other than the vanilla maps? Other tilesets? What ini-changes (would be best to just upload your ini)?

The sector inventory shows what is on the floor in the sector. We cannot display soldier inventories there, and it wouldn't make any sense imho.

[Updated on: Sat, 13 April 2013 22:55] by Moderator



Re: New feature: Equip militia with guns/armour/etc.[message #317405] Sat, 13 April 2013 23:20 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
Mhmm. I think I found what your error might be... oi. This'll be tricky Sad


Re: New feature: Equip militia with guns/armour/etc.[message #317406] Sun, 14 April 2013 00:35 Go to previous messageGo to next message
Kafouille

 
Messages:9
Registered:May 2006
I use what are as far as i know stock maps. This was tested on a current dev SVN folder overlayed on a gold edition JA2, in stock 1.13 VFS, with the only changes to the options to enable the aggressive AI and militia equip. I basically never use the 1.13 profile so it's really stock with not a single changed option beside those.

And i know that my suggestion would be a pain in the ass codewise but it would be a huge useability boost. Else we have to trek to every sector to check if the supplies we have there are good. The militia can give us reports of enemy troops, they can give us status reports of equipment without us undressing them ourselves.
Re: New feature: Equip militia with guns/armour/etc.[message #317407] Sun, 14 April 2013 02:14 Go to previous messageGo to next message
jmenya

 
Messages:5
Registered:March 2013
hello. link to saves is below. i uploaded all, but check latest only. it is easy to reproduce - go to tactical view in sec with mercs and militia, return to strat map and move merc(s) to other sector. return back and find that militia already exchanged all equipment to vodka and women.

https://www.dropbox.com/s/i4wevhty656uyku/SavedGames.zip
Re: New feature: Equip militia with guns/armour/etc.[message #317417] Sun, 14 April 2013 15:22 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
Phew, fixed in r5997. Thanks for your input.


Re: New feature: Equip militia with guns/armour/etc.[message #317419] Sun, 14 April 2013 15:45 Go to previous messageGo to next message
PasHancock

 
Messages:738
Registered:February 2011
Location: Estonia,Tallinn
Flugente
Phew, fixed in r5997. Thanks for your input.


yay, now i dont have to drop Militia equipment each time i leave sector Very Happy

btw, any new improvements for this Feature coming?

[Updated on: Sun, 14 April 2013 15:47] by Moderator

Re: New feature: Equip militia with guns/armour/etc.[message #317422] Sun, 14 April 2013 15:59 Go to previous messageGo to next message
Flugente

 
Messages:3407
Registered:April 2009
Location: Germany
Improvements? The idea to have veteran/elite-specific stuff perhaps, if I'm bored. It should be clear why I don't add the other recent proposals.


Re: New feature: Equip militia with guns/armour/etc.[message #317528] Thu, 18 April 2013 01:50 Go to previous messageGo to next message
Thor

 
Messages:430
Registered:February 2007
Location: Belgium
Thanks, Flugente, works well now... Just replaced the exe, upgrading my savegame from a r5996 to r5997. Smile Didn't know it was possible without starting a new game.

[Updated on: Thu, 18 April 2013 02:15] by Moderator

Re: New feature: Equip militia with guns/armour/etc.[message #317532] Thu, 18 April 2013 08:01 Go to previous messageGo to previous message
Kaerar

 
Messages:2067
Registered:January 2003
Location: Australia :D
I know I've been out of the game for a while, so where can I get the 5997 exe?

Already got SVN up to 1650, couldn't find the exe trunk though XD

[Updated on: Thu, 18 April 2013 08:01] by Moderator



Previous Topic: Not a feature: roleplay facts
Next Topic: New feature: creature raids
Goto Forum:
  


Current Time: Wed Sep 26 06:03:19 EEST 2018

Total time taken to generate the page: 0.02949 seconds