ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Difference between revisions of "Cameo Sorting"

From ModEnc
Jump to: navigation, search
m (Added to category)
(Rewriting from sourcecode)
Line 1: Line 1:
== Cameo Sorting Order ==
+
[[Cameo]]s on the sidebar are sorted according to several factors. Whenever a cameo is added to the tab, the game iterates over all the existing cameos comparing each of them with the new cameo in turn.
  
The order in which the cameos on the sidebar are organized, is determined by these factors in RA2/YR (Credit to ImmoMan, who posted them originally):
+
In the examples below, {{Tt|OldCameo}} stands for the cameo that was already there, {{Tt|NewCameo}} is the cameo the game is trying to insert.
  
[[TechLevel]] - increasing from top to bottom, in other words TechLevel=0 (yes, TechLevel=0 works just fine) at the top, TechLevel=10 at the bottom.
+
== Superweapon Cameos ==
 +
If both OldCameo and NewCameo are Superweapons (the actual superweapons, not buildings with a SuperWeapon attached):
 +
; Compare {{TTL|RechargeTime}}
 +
: The on which recharges faster gets priority. If they're equal...
 +
; Compare their {{TTL|UIName}} strings
 +
: If, comparing alphabetically (lexicographically), OldCameo comes first, it gets priority, otherwise NewCameo does.
  
[[Cost]] - If there are two or more objects of the same TechLevel, the cheaper one gets the priority.
+
If one of them is a SuperWeapon and the other one isn't, the SuperWeapon one gets priority.
  
[[ObjectTypes]] order - if two objects of the same TL cost the same, the object that has the lower number in the object list will go first.
+
== TechnoType Cameos ==
 
+
; Compare {{TTL|AIBasePlanningSide}}
These factors are all that determines the cameo order for the infantry/vehicle tabs. The structure/armory tabs have one extra factor:
+
: If one cameo's side is the same as the player house's Side, and the other one's isn't, whichever has the same side gets priority. Otherwise...
 
+
; If both objects are UnitTypes or AircraftTypes
[[AIBasePlanningSide]] - takes priority over all other factors. The buildings with the same AI..Side= as your country's side (Allies - 0, Soviet - 1, Yuri - 2) all go first, depending on the other beforementioned factors. The buildings with other AI..Side= go next (regardless of which side they are, only thing that matters is the side is different from yours), and then the buildings which do not have any AI..Side= set at all.
+
: Objects with {{TTL|Naval|yes}} get priority over objects without it.
 
+
: Objects with {{TTL|ConsideredAircraft|yes}} get priority over objects without it. If they're still equal...
What this means is that when playing as Soviet, for example, and getting both Allied and Yuri tech, all the AIBasePlanningSide=1 structures (which is effectively all the soviet structures) go first, then Allied and Yuri structures go mixed together. Several people find this 'feature' very annoying.
+
; Compare their {{TTL|TechLevel}}
 
+
: Lower TechLevel wins.
Tests of what happens when the AI..Side= tagsare commented out give the following results:
+
; Compare their {{TTL|Cost}} for player's house, taking into account all applicable cost multipliers
*All buildings are sorted the same way infantry and vehicles are.
+
: Lower Cost wins.
*The AI likes to build other sides' powerplants and walls.  
+
; Compare their {{TTL|UIName}} strings
 
+
: If OldCameo alphabetically sorts first, it wins.
This is not desireable either, so an alternative test reenabling AI..Side= on all three powerplants and walls results in the following:
 
*The AI works perfectly (''it obeys the Prerequisite= on buildings'' ! )
 
*The cameos are all sorted mixed in completely (all powerplants first, then all three refineries, barracks, etc..)
 
*you can have TechLevel=s 5-10 unused. (Though there should be at least one structure of each TechLevel, for AI triggers in the default Yuri's Revenge)
 
 
 
 
 
The AI behaviour should be tested further with these types of modification to ensure there are no additional problems, does anybody know what other problems arise when you remove AIBasePlanningSide=, besides all sides building the object ''if the Prerequisite=s are met''?
 
  
 
[[Category:General_Editing_Information]]
 
[[Category:General_Editing_Information]]

Revision as of 10:50, 27 July 2008

Cameos on the sidebar are sorted according to several factors. Whenever a cameo is added to the tab, the game iterates over all the existing cameos comparing each of them with the new cameo in turn.

In the examples below, OldCameo stands for the cameo that was already there, NewCameo is the cameo the game is trying to insert.

Superweapon Cameos

If both OldCameo and NewCameo are Superweapons (the actual superweapons, not buildings with a SuperWeapon attached):

Compare Template:TTL
The on which recharges faster gets priority. If they're equal...
Compare their Template:TTL strings
If, comparing alphabetically (lexicographically), OldCameo comes first, it gets priority, otherwise NewCameo does.

If one of them is a SuperWeapon and the other one isn't, the SuperWeapon one gets priority.

TechnoType Cameos

Compare Template:TTL
If one cameo's side is the same as the player house's Side, and the other one's isn't, whichever has the same side gets priority. Otherwise...
If both objects are UnitTypes or AircraftTypes
Objects with Template:TTL get priority over objects without it.
Objects with Template:TTL get priority over objects without it. If they're still equal...
Compare their Template:TTL
Lower TechLevel wins.
Compare their Template:TTL for player's house, taking into account all applicable cost multipliers
Lower Cost wins.
Compare their Template:TTL strings
If OldCameo alphabetically sorts first, it wins.