Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2620 closed task (fixed)

Define "Advanced" and "Elite" bonuses as technologies

Reported by: sanderd17 Owned by: sanderd17
Priority: Should Have Milestone: Alpha 19
Component: UI & Simulation Keywords:
Cc: alpha123, scythetwirler Patch:

Description (last modified by sanderd17)

Currently, Soldiers have a template where they're based on (like template_unit_infantry_ranged_javelinist.xml for units/athen_infantry_jevelinist_b.xml).

But all CitizenSoldiers have a Basic version, an Advanced and an Elite. Those always redefine a whole lot of the stats.

Every Advanced unit has -25% gather speed for example. But if you want to buff or nerf that, you have to edit over 100 files.

Also, sometimes, only the base template is edited, and Elite or Advanced units end up with worse stats than their Basic versions.

Basically, there should be a few global technologies that add modify stats of Advanced and Elite units. So the Advanced and Elite templates would be pretty much empty, apart from the Identity component (to overwrite the rank), the Promotion component (to overwrite the next upgrade) and the visual actor.

So we only have to edit those 200-ish files once, and be done with it.

The technologies would be quite simple, like

{
	"genericName": "Advanced stats",
	"autoResearch": true,
	"description": "Modifications for the advanced units",
	"modifications": [
		{"value": "Health/Max", "add": 10},
                {"value": "Attack/Ranged/MaxRange", "multiply": 1.1},
		{"value": "ResourceGather/BaseSpeed", "multiply": 0.75},
                ...
	],
	"affects": ["Advanced Unit"]
}

As for modifying the files, a simple script would do. For every file ending in *_a.xml and *_e.xml, remove every line that doesn't contain

xml, Entity, Identity, Rank, Promotion, Actor

So as a oneliner (should be checked for corectness):

find *_[ae].xml -type f -exec sed -i '/xml\|Entity\|Identity\|Rank\|Promotion\|Actor/!d' {} \;

Attachments (1)

bonuses.diff (2.2 KB ) - added by sanderd17 10 years ago.
Example tech files, values got from some averaging of normal bonuses given to Advanced and Elite units

Download all attachments as: .zip

Change History (13)

comment:1 by sanderd17, 10 years ago

Type: defecttask

comment:2 by sanderd17, 10 years ago

Description: modified (diff)

comment:3 by agentx, 10 years ago

Just a proposal, wouldn't it be more helpful to have the data in a table like file and a script which renders the XML? That would eliminate editing hundreds of files in any case and also helps reasoning balance issues by using spreadsheet methods like sorting. May be three files: units, structures and others. I believe, I've seen similar (old/xls) files somewhere in trac. Also consistency issues pop up earlier if data is structured and in one place.

by sanderd17, 10 years ago

Attachment: bonuses.diff added

Example tech files, values got from some averaging of normal bonuses given to Advanced and Elite units

comment:4 by sanderd17, 10 years ago

I doubt any spreadsheet with 600 columns and some 30(?) columns would be very readable (that's for the units only).

And not all info is easy to put into columns. Like units can have a number of bonuses against arbitrary classes.

And not all stats are set by the templates. Some come from civilisation bonuses, some units (like heroes) influence each others stats.

If there's anything possible, we could have a GUI for sorting and filtering entities based on certain stats or requirements. But creating the templates from a table will be very hard to do.

comment:5 by Radagast, 10 years ago

I must say, this is exactly what I was looking for and leper miraculously knew of your patch.

Is it correct how I understand it: promotion techs would be the base changes, while the templates could be used to subtract or add to these base changes.

i.e. if a certain unit type really needed a subtler improvement on promotion then in the template a small malus could be defined that would - if combined with the promotion tech - result in exactly what we wanted: a subtler stat improvement. The same works the other way round to make a promotion more significant. Both cases should be the exxception and thus Sander's patch reduces redundancy significantly.

Footprint changes still had to be defined in the template XML, e.g. if a promoted unit suddenly had a bigger actor or if its horse is being upgraded to a chariot in the process.

In future I will create new unit templates following this scheme and hopefully the promotion techs have a chance to can be committed soon.

The interesting part is that the Identity.Rank now really is very significant while I at first thought of this as unnecessary metadata.

I will try to distinguish between veteran and elite in future. i.e. soldiers then could be veterans but may not have been appointed/called into an elite unit (by the queen/king/leader/commander).

Generally I think: Base -> Advanced -> Veteran Veteran units then could be called into an elite unit. (that would basically be new functionality)

Elite units could be promoted or appointed into champions (depending on which happens first: enough xp or selected by the leaders or elected by the people, e.g. via huge popularity. Though the popularity thingy better fits heroes.).

In any case excellent work and surprisingly hidden for that awesomeness (just like other team member's recent changes that hardly anyone notices but are really huge). Thanks leper for the Austrians never losing overview.

comment:6 by Stan, 10 years ago

Maybe not heroes but legendary units. So that there is still a difference between them and heros. In scenarios heroes will be sort of NPC while legendary units stays units. I am thinking of legendaries as general heroes (With all the same aura) that depends on their types and if possible of the kind of enemies they killed (<- This is just a dream)

comment:7 by Radagast, 10 years ago

Legends are those heroes that have reached so much that their aura spreads and is kept up in stories which children tell their children.

Heroes are mostly heroes for their civilization but contrary to legends it won't have any influence on enemies, as they might not be known to the enemy people (in contrary to legends because legends are told by merchants and storytellers and easily while heroes are remembered a smaller timespan).

e.g. the soldiers that tried to defend your city to the last stand, are heroes for their people.

while a unit that could deal with twenty elephants or a person that saved the king from falling down into a deep might become a legend as this story might spread and still fascinate people later on.

While many soldiers might have become heroes but those generally are too many to be rememberd individually for a longer timeframe.

comment:8 by Radagast, 10 years ago

Sander, I think your "affects": is mixed up. In bonus_elite.json you affect "Advanced" and the other way round.

comment:9 by sanderd17, 10 years ago

You're right (at least for a part). The Elite stats are supposed to be extra for the Advanced. So the advanced changes should also apply to Elite units, but the Elite stats should only apply to elite units (instead of advanced).

comment:10 by Radagast, 10 years ago

of course you are right: the advanced rank boni should apply to elite units too.

Allow me one more note: For me I need find -name '*_[ae][.]xml' -type f #... but that may be os or version dependent.

What do you think about defining the boni in a relative way? The prob is, that the base units differ and should differ in stats. A general rank-up bonus should therefore always be relative, e.g. add 10% to unit health, et alia instead of defining it as absolute. (consider a unit with 5 hp and one with 500hp being upgraded and both get 5hp added on rank up. stronger base units, should become even stronger when promoted. One should be able to notice that the opponent is an elite unit.)

comment:11 by sanderd17, 9 years ago

Owner: set to sanderd17
Resolution: fixed
Status: newclosed

In 16744:

Clean up advanced and elite templates by defining the modifications as technologies. This will not alter gameplay for now, as the advanced and elite units are disabled in game. Fixes #2620

comment:12 by sanderd17, 9 years ago

Milestone: BacklogAlpha 19
Note: See TracTickets for help on using tickets.