Hire crusader... is it worth it?

Put here any ideas, suggestions about unit or structure properties.
Post Reply
User avatar
phoenixffyrnig
Posts: 774
Joined: Fri Nov 29, 2019 1:07 pm
Location: It changes, frequently.

Hire crusader... is it worth it?

Post by phoenixffyrnig »

Talking about the Crusade Leader's ability similar to Condottiero's merc recruitment. Comparing one to the other, Crusaders seem to get the rough end of the deal, very rough.

For mercs : writing (cost 3), Condottiero (4), plus valuables.
Crusaders : Hire Crusader (4) that is only available from a mega building (16), and a Crusade leader (6) of significantly less availability than Condottiero, then plus valuables.

Condottiero can pick one of 4 units, each with cool down of 4, essentially allowing one unit per turn. Crusade Leader cannot choose, just has random hire with a cool down of 3 so can only do one unit every 3 turns. This seems like a poor pay off for the extra leg work. Admittedly, crusaders come in cheaper than mercs regarding valuables, but that difference is also shown in unit quality.

All in all, not worth the effort imo. Couple of suggestions, as always I'm open to feedback and other ideas
a) Only hire the higher level crusader units from this ability (I had assumed this was the case, but I got a bog standard crusade warrior in my test run).
b) Allow separate choice of units, à la Condottiero
c) reduce cool down of ability

d) (off topic but related) maybe remove Condottiero from TC roster. It's a 4 turn unit with full fighting capabilities, special abilities, and morale boost - is that a bit too effective, versatile and cheap to be available everywhere?

Related Points
1) There is a Call Crusade Pricier production choice in the help menu of the priory, but this does not seem to show up anywhere in game. Anyone know how that works?
2) Do a money courier and a salt cart both count the same in value, ie 1? And can salt carts work for Crusaders or only Mercs
3) Cancelling the hiring of a crusader sometimes uses up valuables regardless. I will look into this in further detail if I can.
I also play an RTS game called Life 8-)
And I also like drinking beer! :D
User avatar
makazuwr32
Posts: 7830
Joined: Tue Oct 17, 2017 9:29 am
Location: Moscow, Russia

Re: Hire crusader... is it worth it?

Post by makazuwr32 »

Can answer onto point 3:
It is related to summon ability that requires sacrifices.

Right now sacrifices are used firstly and unit is summoned after that. We already asked code change for stratego to update this to "you summon a unit and after sacrifices are killed" variant. When it will be done alas depends on stratego.
makazuwr32 wrote: Mon Sep 16, 2019 7:54 amWhen you ask to change something argument why...
Put some numbers, compare to what other races have and so on...
© by Makazuwr32™.
AoF Dev Co-Leader
Image
User avatar
b2198
Posts: 798
Joined: Mon Aug 30, 2021 5:48 pm
Location: Brazil

Re: Hire crusader... is it worth it?

Post by b2198 »

phoenixffyrnig wrote: Wed Nov 03, 2021 1:15 pm Talking about the Crusade Leader's ability similar to Condottiero's merc recruitment. Comparing one to the other, Crusaders seem to get the rough end of the deal, very rough.

For mercs : writing (cost 3), Condottiero (4), plus valuables.
Crusaders : Hire Crusader (4) that is only available from a mega building (16), and a Crusade leader (6) of significantly less availability than Condottiero, then plus valuables.

Condottiero can pick one of 4 units, each with cool down of 4, essentially allowing one unit per turn. Crusade Leader cannot choose, just has random hire with a cool down of 3 so can only do one unit every 3 turns. This seems like a poor pay off for the extra leg work. Admittedly, crusaders come in cheaper than mercs regarding valuables, but that difference is also shown in unit quality.

All in all, not worth the effort imo. Couple of suggestions, as always I'm open to feedback and other ideas
a) Only hire the higher level crusader units from this ability (I had assumed this was the case, but I got a bog standard crusade warrior in my test run).
b) Allow separate choice of units, à la Condottiero
c) reduce cool down of ability
Well, IMO hire crusader scale better than mercenary recruitment from Condottieros, because of the lower valuable cost and the fact that you don't need to keep spending valuables just to keep them from being deleted ("abandoning"), also, if you make 3 crusade leaders you can use it every turn. On top of that, crusaders can receive a morale boost from other sources plus the crusade leader aura buff, and some of the crusaders spawned are better than any of those 4 mercenaries, like the crusader crossbowman or crusader knight, but yeah, when you get a crusader swordsman for the third time against a cavalry heavy enemy you really start to want it being something you can choose.

Maybe we should have 4 abilities in crusade leader too, for crusader spearmen, swordsmen, archers and cavalry, with something like 10 turns cooldown for each (so slightly lower overall cooldown than current 3*4 = 12 turns, or 10/4 = 2.5 turns for each unit) and let the RNG decide only the quality of the units?
phoenixffyrnig wrote: Wed Nov 03, 2021 1:15 pm 2) Do a money courier and a salt cart both count the same in value, ie 1? And can salt carts work for Crusaders or only Mercs
That's something I was experimenting a lot with, and the conclusion I had was:
salt cart < money courier = mineral cart = silver cart < gold cart < gem cart
because crusade leaders require only 1 money courier/mineral cart/silver cart to hire a crusader, but require 2 salt carts to do the same, and condottiero needs 3 salt carts to recruit a mercenary, but still 1 money courier/mineral cart/silver cart.
phoenixffyrnig wrote: Wed Nov 03, 2021 1:15 pm 3) Cancelling the hiring of a crusader sometimes uses up valuables regardless. I will look into this in further detail if I can.
Also something to keep in mind is that the ability can and will actually use more valuables than necessary if they are nearby, for example, if you have a salt cart and a silver cart next to the crusade leader, it will use both with hire crusader, despite needing only the silver cart for it, and it will eat your gem carts whole for possibly just a swordsman, so keep that in mind.

And I just did some more tests while writing this, and it seems that its priority order for consuming valuables is:
gem cart... -> gold cart -> money courier -> silver cart -> mineral cart -> salt cart
IMO the priority order should be the opposite of this, because this wastes a lot more valuables if not used properly
Green is the correct color, other colors are "less correct".
User avatar
Endru1241
Posts: 2717
Joined: Fri Sep 11, 2015 8:43 am
Location: Poland

Re: Hire crusader... is it worth it?

Post by Endru1241 »

a) b) impossible in current engine.
I tried and unfortunately if unit is part of random production it is always random.
c) I have to check, but there is some possibility, that 3 turn cooldown was meant for my planned variant - 4 abilities choosing unit among 4 basic ones (cheaper).
d) there is a topic for TC roster change - mention it there
As for other points:
1. It was meant for priory/monastery distinction, meaning priory would have had pricier one, but I dropped idea. Maybe I'll reuse it for something later on.
2. Their value is equal to their cost shown on property sheet.
So salt is 1, money courier, silver, half gold and 1/3 gems - 2, gold and 2/3 gems 4, full gems 6.
Hire crusader requires 3, while all four mercs - 4.
3. Already answered by makazuwr32.


As for exact algorithm for taking units.
To make it 100% optimal is - mathematicians would use term "non trivial".
Which means it's complicated as hell.
Currently it should :
-sort units from priciest to cheapest
- take any unit with cost lower, than required (end if perfect fit)
- if perfect fit not found sort from cheapest to priciest and add first unit with cost equal or higher than left from previous search
- if perfect fit not found go through all units trying to find a pair making cost1+cost2 >= required and use pair with lowest combined cost found.

As far as I know it should be optimal as long as there is 1 or 2 units with perfectly fitting cost.
It should only be worse if combination of 3 or more units is better and there is much more units to choose from.
To make it fully optimal recurrence methods should be used, which could create much more problems with engine.
Age of Strategy design leader
User avatar
b2198
Posts: 798
Joined: Mon Aug 30, 2021 5:48 pm
Location: Brazil

Re: Hire crusader... is it worth it?

Post by b2198 »

Endru1241 wrote: Wed Nov 03, 2021 11:59 pm 2. Their value is equal to their cost shown on property sheet.
So salt is 1, money courier, silver, half gold and 1/3 gems - 2, gold and 2/3 gems 4, full gems 6.
Hire crusader requires 3, while all four mercs - 4.
There must be something else or a bug then, because 2 salt carts are enough for hire crusader and 3 are enough for the mercs, while money courier, 1/2 gold, 1/3 gems, silver and minerals are enough on their own for both

Endru1241 wrote: Wed Nov 03, 2021 11:59 pm As for exact algorithm for taking units.
To make it 100% optimal is - mathematicians would use term "non trivial".
Which means it's complicated as hell.
Currently it should :
-sort units from priciest to cheapest
- take any unit with cost lower, than required (end if perfect fit)
- if perfect fit not found sort from cheapest to priciest and add first unit with cost equal or higher than left from previous search
- if perfect fit not found go through all units trying to find a pair making cost1+cost2 >= required and use pair with lowest combined cost found.

As far as I know it should be optimal as long as there is 1 or 2 units with perfectly fitting cost.
It should only be worse if combination of 3 or more units is better and there is much more units to choose from.
this, along with what I wrote above, should explain it being worse even in simple cases with 2 units, because it thinks the cost is higher than it really is
Endru1241 wrote: Wed Nov 03, 2021 11:59 pm To make it fully optimal recurrence methods should be used, which could create much more problems with engine.
Which problems?

Code: Select all

class ExampleUnitClass implements Comparable<ExampleUnitClass>{
	int cost;
	
	@Override
	int compareTo(ExampleUnitClass other){
		return this.cost - other.cost;
	}
}
...
// code that I TOTALLY DIDN'T COPY AND PASTE FROM THE WEB
void helper(List<int[]> combinations, int data[], int start, int end, int index) {
    if (index == data.length) {
        int[] combination = data.clone();
        combinations.add(combination);
    } else if (start <= end) {
        data[index] = start;
        helper(combinations, data, start + 1, end, index + 1);
        helper(combinations, data, start + 1, end, index);
    }
}

List<int[]> generate(int n, int r) {
    List<int[]> combinations = new ArrayList<>();
    helper(combinations, new int[r], 0, n-1, 0);
    return combinations;
}
// end of code that I TOTALLY DIDN'T COPY AND PASTE FROM THE WEB

LinkedList<ExampleUnitClass> findOptimalValuables(ArrayList<ExampleUnitClass> valuables, int requiredCost){
		Collections.sort(valuables);// sorts from cheapest to priciest
		LinkedList<ExampleUnitClass> res = new LinkedList<>();
		int lowestSum = Integer.MAX_VALUE;
		int startingPoint;
		boolean found = false;
		int size = valuables.size();
		for(int i = size - 1; i >= 0; i--){// iterating backwards, so from priciest to cheapest, to reduce search area
			startingPoint = i;
			if(valuables.get(i).cost == requiredCost){
				lowestSum = requiredCost;
				res.add(valuables.get(i));
				found = true;
				break;
			} else if(valuables.get(i).cost < requiredCost){
				found = true;
				break;
			}
		}
		if(lowestSum != requiredCost && found){
			for(int i = 2; i <= size; i++){// starting from 2 to get all the pairs, since single elements were checked already
				List<int[]> combinationIndexesList = generate(startingPoint + 1, i);
				for(int[] combinationIndexes : combinationIndexesList){
					int sum = 0;
					for(int j = 0; j < combinationIndexes.length; j++){
						sum += valuables.get(combinationIndexes[j]);
					}
					if(sum >= requiredSum && sum < lowestSum){
						lowestSum = sum;
						res.clear();
						for(int j = 0; j < combinationIndexes.length; j++){
							res.add(valuables.get(combinationIndexes[j]);
						}
						if(sum == requiredSum){
							break;
						}
					}
					if(lowestSum == requiredSum){
						break;
					}
				}
			}
		}
		if(startingPoint < size - 1){// if there's any element with a higher cost than required
			if(lowestSum > valuables.get(startingPoint + 1).cost){
				res.clear();
				res.add(valuables.get(startingPoint + 1);
			}
		}
		return res;
	}
}
worst case cenario in the combinations is 2^x (row sum in Pascal's Triangle), with x being the amount of valuables to check, so, with 8 valuables around that are ALL lower cost than required, and no combination of them being a perfect fit, it would take 256 cost comparisons

here's are some examples of how it should work:
a skill requiring 3 cost and with 2 salt carts, 1 mineral cart, 1 gold cart and 1 gem cart around:
1) it would sort the carts by cost, so [1, 1, 2, 4, 6]
2) from right to left, it would find the first cost that is below or equal the required (jump to step 5 if found), so the third one
3) it would get all the possible combinations of 2 or more units from start up until the third one (which was found in step 2), so
{[1,1], [1,2], [1,2], [1,1,2]}
4) it would go through each of them, storing the lowest sum that passes or reaches the required sum and its tuple (jump to step 5 if reached), so [1,2], with 3 as sum
5) it would check if that sum is higher than the one to the right of the one found in step 2, and would switch set the stored tuple to have only that unit, if that's the case, so still [1,2] (1+2 = 3 < 4)
6) it would return the optimal tuple of valuables, so [1,2]

now with 2 mineral carts, 1 gold cart and 1 gem cart around:
1) it would sort the carts by cost, so [2, 2, 4, 6]
2) from right to left, it would find the first cost that is belowor equal the required (jump to step 5 if found), so the second one
3) it would get all the possible combinations of 2 or more units from start up until the second one (which was found in step 2), so
{[2,2]}
4) it would go through each of them, storing the lowest sum that passes or reaches the required sum (jump to step 5 if reached), so [2,2], with 4 as sum
5) it would check if that sum is higher than the one to the right of the one found in step 2, and would switch set the stored tuple to have only that unit, if that's the case, so still [2,2] (2+2 = 4 = 4)
6) it would return the optimal tuple of valuables, so [2,2]

now with required cost of 5, and with 2 gold carts and 2 gem carts:
1) it would sort the carts by cost, so [4, 4, 6, 6]
2) from right to left, it would find the first cost that is belowor equal the required (jump to step 5 if found), so the second one
3) it would get all the possible combinations of 2 or more units from start up until the second one (which was found in step 2), so
{[4,4]}
4) it would go through each of them, storing the lowest sum that passes or reaches the required sum (jump to step 5 if reached), so [4,4], with 8 as sum
5) it would check if that sum is higher than the one to the right of the one found in step 2, and would switch set the stored tuple to have only that unit, if that's the case, so it changed to [6] (4+4 = 8 > 6)
6) it would return the optimal tuple of valuables, so [6] (wastes only 1 cost, compared to wasting 3 cost with both gold carts)

Edit: fixing code for cases where no valuables have a lower cost than required
Last edited by b2198 on Thu Nov 04, 2021 5:52 am, edited 1 time in total.
Green is the correct color, other colors are "less correct".
User avatar
b2198
Posts: 798
Joined: Mon Aug 30, 2021 5:48 pm
Location: Brazil

Re: Hire crusader... is it worth it?

Post by b2198 »

Also sorry for making you read all that, Endru :sweat_smile:
Green is the correct color, other colors are "less correct".
Post Reply

Return to “Unit balancing”