Closed elmokki closed 9 years ago
That all sounds about right. One minor thing I'd (probably needlessly) point out is that when you're doing commanders it would be nice if Special Commanders got worked in, though that's obviously not core functionality.
For linking related poses, do we want to just do it manually by adding tags of "human_infantry" and suchlike to the appropriate poses? It would be theoretically nice if e.g. the engine could pick out poses behaving similarly made up of units of the same size and/or race, but it might not be worth the effort it would take to do this well when we can manually encode that given how little data we're really working with for poses (plus e.g. this lets us remain aware that size-2 zotz infantry of any sort is fundamentally different from size-2 Abysians even if they're both wearing scale and carrying axes or whatever).
There's the option of very simple subraces.
Races define available subraces. Poses define which subraces can have them. Subrace may essentially just be a tag, but it could also be used like a theme for unit related things. This is because I would assume that if something is of the same subrace it has approximately the same armor and weapons available. I don't know. Subraces like that would allow some cool stuff, but it's something that can be implemented later. Rewriting this stuff takes a good chunk of motivation already and I won't be able to code too much for a week starting next Thursday.
Other than that it'd probably be #type "human_infantry" or something like that.
Special commanders would be a fairly easy feature. The reason I originally did no work apart from the filters on them was my lack of motivation for suitable civilian and specifically also herder graphics. I think we could allow filters in general to have theme-like chanceincs (which actually solves the sacred generation order problem - we can just make reinvig filter increase probability of heavy armor and stuff like that) and make their filters heavily chanceinc gear tagged as say, "herder" or "civilian" and add tags that define whether mage or priest generation should be used to generate the sprite. Obviously not all races would have suitable gear, but hey, whatever.
I think we should release 0.6.0 after this rewrite if I can manage to finish it in a week or two and otherwise just release it anyway. We could release 0.5.2 or something sooner though if you don't feel like you have something, especially something theme related, in mind.
As I said, my milestoning for releases typically tends to be more of a retroactive "oh, I guess that's (more than) enough" rather than meeting fixed goals. So I can wrap up everything I'm working on to a "good enough to release" state any time now; since minotaurs are done-ish I don't have any major cohesive chunk of content partially complete, even if I'm vaguely chipping away at 3-5 things. I don't have a problem waiting to try to get the re-write done first if it looks feasible in the short-term, though - it'd definitely give me more time to pick away at the long task of incorporating themes into all the existing content. I've actually managed to be good and work on that instead of resuming my (fairly preliminary) work on barbarians, or starting in on the other big risk that crops up every time I open the graphics directory, trolls.
Okay, I'm gonna scrap removing TroopGenerator. It works, but it can use tweaks. That's better than just killing it it seems.
So, here's a very very very simple design document:
Currently mages and troops (and sacreds) are generated very separately:
First of all we see pretty clear counterparts on things. Both mages and sacreds prioritize on certain things (and so do normal troops if we consider NOT picking elite/sacred stuff priotizing). Both mages and troops select an unit and vary it.
Now, we want to concentrate the code as much as we can. For sacred generation I think we could scrap the rolling for set limitations and just go for making items rolled with built in chanceincs that just increase the probability of #elite and #sacred very strongly (exact strength dependant on how powerful the sacred is and stuff like that). Mage generation can be done with the same by making items without tag "tier x" impossible. Obviously we'd have a failsafe of picking all possible items. I don't think we need a multi-tiered failsafe of picking tier 2 items if tier 3 is unavailable for mages. Tier 3 mage items should be assigned if you care about the looks.
As for varying items, hey, making it properly customizable will easily let us use same code for mages and troops.
For mages and sacreds unit equipment is fully determined (apart from sacred magic weapon upgrades) before filters are considered. Troops gain their "filters", ie abilitytemplates, before more than the weapons are rolled, but after armor. I believe troops and mages should have filters considered before gear. For troops it's better to allow the program to choose to make militia and then generate suitably cheap unit than to designate suitable units militia afterwards. More control. For mages gearing based on magic paths and filters is great.
For sacreds there are filters such as reinvigoration which are easier to make common for high encumberance than vice versa, but on the other hand some animal themed stuff could benefit from filters for being chosen. Later is better since then it can be done at the same time with gear updates. I don't know. We could, maybe, give one filter before equipment generation provided filters are given and consider that a defining filter and then give more later if need be.
A huge question is obviously also how the whole troop roster is done. I think in general the process should be to generate an unit with given abilitytemplate and roll all nations at least one, often more, abilitytemplates so units get all sorts of interesting variation. Ability templates should be rewritten based on this as they're supposed to be more influental now and can contain chanceincs.
Some plan needs to be hatched for roster consistency. I think same armor and weapons should appear between units, but not too strictly. There are a few ways to do it. One is just relying on built in chanceincs. The other is storing equipment in the class that does the generation and giving probabilities on reusing gear instead of rolling new gear. I think that may be the way to go.
I think poses need to be linkable somehow, since for example for humans all poses have mostly the same armor options. Especially the twohanded and 1h/pole infantry need to be linked so that the program can consider them the same type of units.
All in all I think the equipUnit()-method (or probably armorUnit() and armUnit()) need to be switchable for mage and troop generation either by pose (defaulting to the most likely one in each case) or in case of armUnit() the main hand weapon. A mage doesn't care if his helmet is massively more heavy than his robes, but a troop should generally not get a leather cap and a set of full plate. A troop will not be able to fight by dual wielding spears, but a mage might get an offhand (especially since many mage offhands are cosmetic) even with a long weapon in main hand, or in some cases even with a twohander since for mages what matters is graphics, not plausibility of fighting with say, battle axe in one hand and some useless orb in offhand.
So, for very short:
I'm also scrapping troopgenerator.java and moving all the functionality to unitgen.java