Home » MODDING HQ 1.13 » Flugente's Magika Workshop » In-development feature: Individual militia
In-development feature: Individual militia[message #338230] Fri, 12 December 2014 17:14 Go to previous message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Raw, not thought-through concept: Individual militia

When playing a campaign in JA2, I noticed that I display utter disregard for militia. They are absolutely replacable, as their primary role is that of a bullet sponge. In fact, I even prefer them to not be good in combat, as to allow my mercs to get more kills instead. I only care for their survival insofar as training their replacements costs money and time.
Furthermore, the individual militia soldiers are created anew whenever we load a sector. One cannot get attached to that, they are purely faceless throwaway soldiers.

This is a bit sad. Considering we're leading a popular rebellion here, the militia are the ones taking up arms (and the ones sacrificing their lives, my mercs sure as hell don't ). Having some individuality there - being able to distinguish militia, or feeling sorry for individual deaths apart from a pure 'resource' view - would be positive for the game, I think.

So I'll outline a brief concept of how to do that here. Note: At the moment, this is purely a concept, no coding has been done in this regard. I am currently lacking time to code much, so this is purely theoretical at the moment. Still, talking doesn't harm - and perhaps nobody apart from me would see any benefit in this anyway - I would like to know that too. While this isn't a 'Feature request' (the only thing I'm requesting is feedback), I think it fits this part of the forum best.

The core points of this feature are written in black.
Optional additions that might be positive, but likely just cosmetics, are outlined in blue.
Unsolved problems or drawbacks are outlined in red.

The basic idea is an expanded enemy and militia profiles feature. What I want is for militia to be as persistent as player mercs. This means that if a militia is in a sector, he'll be there whenever we visit that sector, unless he moves to another sector or is killed. You might know that in JA2, only members of the player team ( = the people we directly control) behave that way. Soldiers, militia, creatures and civilians (even NPCs with a profile!) are only 'created' when loading a sector. There is a very good reasons for this which I won't go into here.
So, what information should an individual militia retain?




  • his/her name
  • rank (green/veteran/elite)
  • very obvious: visuals. This means bodytype (which also controls gender), skin and hair colour
  • traits. This currently depends on items, we obviously need to change that.
  • stats. It would be odd if a master marksman would suddenly lose 40 MRK the next time we meet him, no?
  • health points. This would be really neat: If you won the battle with your militia all but wiped out, those guys won't be back to full strength so soon. Currently cities with full militia are impenetrable fortresses for the AI. If militia keep their health losses, and they have to heal in a lengthy process, this would allow the AI to wear them down over time - thereby defending would be harder, which is good!
  • very important: their items. Which is very odd, as I said in the equippable militia feature that this would not be possible. Have I solved that? Weeeell... kinda Smile
  • some sort of service record. I like world building. I like it even more when the game tells me how I shaped the world. See campaign history. Imagine:
    having a militiawoman that was among the very first batch of militia you trained on Day 1 in Drassen. She was one of only three survivors off the infamous Drassen Counter Attack that night. For her actions, you promoted her to veteran. She was among the platoon you took along to take Cambria. She marked her 5th confirmed kill there. She barely survived the brutal raid in Tixa. When Alma fell, she was already an Elite and a distinguished Squadleader. Her actions throughout the war are commendable.
    Which makes the fact that she is now bleeding out in a field north of Balime regrettable. You could try to save her... Do you feel more inclined to, know that you know all of this?



What we need to do is to create a new structure that contains all this data. When we create a militia in tactical (and autoresolve, but that's splitting hairs), we need to determine which militia are in this sector, obtain this data, and create a soldier with this data. When we leave a sector and thus destroy a soldier, we create data from him, and save this data.

This would be the data (pseudocode):
typedef struct
{
	UINT16	item;			// item id, refers to the ones in Items.xml
	UINT16	status;			// status of item. In case of ammo items, this instead refers to the ammo count. No bullets lost here.
} MILITIA_ITEM;

typedef struct
{
	UINT16	id;				// id of battle militia took part in. Ties to campaign history, thus we know with more detail what happened there.
	UINT16	flagmask;		// we can note up to 16 different properties here - perhaps wether we were a reinforcement, or were wounded and such
} MILITIA_BATTLEREPORT;

typedef struct
{
	UINT32	id;				// number of militia. Tied with one or more separate tables of names, this gives us a name
	UINT32	group;			// strategic group militia is a part of
	
	// visuals
	UINT8	soldierclass;	// green/veteran/elite
	UINT8	bodytype;		// female/male/bigmale1/bigmale2
	UINT8	skin;
	UINT8	hair;
	
	UINT16	stats[10];		// AGI/DEX/STR/LDR/WIS/MRK/MEC/EXP/MED/LVL.
	UINT8	traits[3];		// out traits
	
	std::vector<MILITIA_ITEM>	inv;		// militia inventory in a very condensed form
	
	UINT8	kills;
	std::vector<MILITIA_BATTLEREPORT>	history;	// reports on all battles this militia took part in
} MILITIA;

This is a lot smaller than saving SOLDIERTYPE directly.
Note that for the inventory, we only save the items that we really possess. You will notice that we don't save any attachments or such... idea is simply save all items on a heap. When we recreate them and one of them is an attachment, we assume it was attached to a gun or piece of armour, so we try to attach that. Unlike mercs, militia only need one gun and armour, so this should be easy.
This method of saving objects should not be used for mercs - we lose any additional data on objects! This is all under the assumption that no additional data is required for militia's objects.
Of course, saving inventory is only necessary if we use the 'equip militia' feature in the first place.

In the above structure, all stats are saved as UINT16, even though stats are always in [0; 100], which can be done via UINT8. The reason for this is that we want militia to be able to improve just like mercs - in or out of combat. The idea is to save stats in [0;, 10000] - this way we could save 53,47 MRK, and thus store stat progress, somewhat similar to mercs.
As an individual militia won't even get near the amount of combat experience our mercs get, we could alter the speed with which they earn stats.
We train green militia just like before. Once new ones are created, we tie a new MILITIA to them. Stats are randomized within a certain range for each stat. Thus some of them might be more promising than others.
We no longer allow training of veteran militia, or even elite ones. Any improvements must be earned... however one can continue to train green militia in sector, but this doesn't automatically promote them.
People love deciding on skills and such. For this reason, we can select which traits a militia has - we choose for them. If you have a bunch of rookies and a bunch of shotguns, it would be smart to assign the 'Ranger' trait to some of them, no?
Each militia rank grants additional traits (that's also how it works currently). So a green militia can only have 1 trait, an elite can have 3.
Traits are only selectable if a militia has sufficient stats. So, for example, only those with MRK >= 75 can be given 'Marksman'. This way you can't create hordes of similar militia, and you have to plan whom to give what.
If we were to allow to train militia in specific stats, we could expand this muh more. Imagine this: After training a platoon of fresh rookies in Drassen, we transfer the best marksmen of them to training at the Alma shooting range. A few with good medical skills are transferred to advanced training in Cambria Hospital, the rest is off to garrison duty.
Certain traits are only available on higher ranks - so 'Deputy 1' is only open to veterans, and 'Deputy 2' requires 'Deputy 1' and is only available to elites.
'Doctor' could be a viable trait for militia now. We could allow them to be medics, like in medics & officers. Perhaps militia doctors should need special training, and should cost even more? Special care should be taken as to not let this be exploitable - merc doctors must not be replacable.
When militia has amassed enough experience, the player can promote them. For this and for other data (info on stats, visuals, item overview) we need a small window displaying that data. There we need to be able to promote them, select traits, and add and remove items. We need this in strategic and tactical. We need to be able to call this by selecting a militia in an easy way.
We need a working, easily understandable overview over all militia both in a sector and globally. We need to be able to sort militia according to their data (who are our best marksmen, and where are they now?) and even search (=filter) for them.
If we do not play with 'equip militia', what items do they get? Currently the traits are selected fitting to the items they get, this is no longer possible. We'd thus need new tables that determine what traits grant what items (so that Rangers would get either shotguns or rifles etc.).
If we do play with 'equip militia', they will pick up gear from the sector if they don't have any. Using the above described, yet-to-code interface, we need to be able to add and remove items to them - we can then finetune their inventory to an absurd degree. How finetuned depends on how much time one wants to waste on this, really.
A problem in this case is ammunition. Even if we allow them to restock after battle, it could happen that a gun runs dry. We then either need to warn the player of this, or have them drop the gun and select a new one - but this could then be an override to the player specifically giving them that gun.
A bonus would be that loading/moving militia with 'equip militia' turned on would be much faster, as we don't have to loop over sector inventories all the time.
Have a webpage that lists details of all militia, current and dead, along with their service record. Perhaps with a hall of fame?

The 'UINT32 group' member of the struct is for determining what strategic group the militia is a part of. Currently, militia are not part of any groups. They thus cannot travel the way the player and the army does. The travelling Headrock introduced with mobile militia and I expanded in Militia command is a rather ugly workaround. We need to expand groups - especially if, at some point in the future, we want to have different factions that can move on the map.

You might have noticed that we do not store info on which sector a militia is based in. Idea here is to store a std::vector<MILITIA> for each sector of the map. Then it's trivial to know where someone is, and travelling from A to B merely involves erasing a struct from A and inserting it in B.

The militia redistribution in cities won't be useable any more. We need to come up with an easy way to order masses of individuals to different sectors - easy to use for lots of people, while still allowing to select what each individual does.
When we order a squad of militia to move, we need to be able to select who from a sector moves and who stays behind - selecting all of them is not good enough.

Edit: Ugh. That looks atrocious. Pictures would be helpful

[Updated on: Tue, 01 March 2016 14:47] by Moderator

Report message to a moderator

Captain

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New feature: militia resources
Next Topic: New feature: strategic militia command
Goto Forum:
  


Current Time: Sat Nov 30 23:51:58 GMT+2 2024

Total time taken to generate the page: 0.01309 seconds