Difference between revisions of "100 Units Bug"
(→Avoiding the 100 unit bug (by DCoder)) |
m (Reverted edit of 81.240.110.181, changed back to last version by DCoder) |
||
Line 1: | Line 1: | ||
[[RA2]] and [[YR]] (and probably [[TS]] and [[FS]] as well) are coded in a way that limits the number of total buildable [[VehicleTypes]], [[InfantryTypes]], and probably [[AircraftTypes]] as well, to 100 units each. If you have a buildable object on a place after 100, the AI will think that is the only unit buildable and create it over and over again. Literally. It will continue building until there is no money left or you stop it. This bug can partly be avoided, see below for details. | [[RA2]] and [[YR]] (and probably [[TS]] and [[FS]] as well) are coded in a way that limits the number of total buildable [[VehicleTypes]], [[InfantryTypes]], and probably [[AircraftTypes]] as well, to 100 units each. If you have a buildable object on a place after 100, the AI will think that is the only unit buildable and create it over and over again. Literally. It will continue building until there is no money left or you stop it. This bug can partly be avoided, see below for details. | ||
+ | |||
+ | == Avoiding the 100 unit bug (by DCoder) == | ||
+ | |||
+ | Look at your [InfantryTypes] and [VehicleTypes]. How many entries do they have? If there's more than 101 buildable units (those without TechLevel=-1) and the're not all in the first 101 lines of the list, the AI will go nuts - it'll build the last unit in the list non-stop, and won't attack. To avoid it, you'll need to rearrange these lists, put buildable units first and the civilian and dummy units in the very end. I personally sorted it like this: | ||
+ | [VehicleTypes] | ||
+ | 1=AEGIS | ||
+ | 2=AMCV | ||
+ | 3=BFRT | ||
+ | 4=CARRIER | ||
+ | 5=CMIN | ||
+ | 6=DEST | ||
+ | 7=DLPH | ||
+ | 8=FV | ||
+ | 9=LCRF | ||
+ | 10=MGTK | ||
+ | 11=MTNK | ||
+ | 12=ROBO | ||
+ | 13=SHAD | ||
+ | 14=SREF | ||
+ | 15=TNKD | ||
+ | |||
+ | 16=APOC | ||
+ | 17=DISK | ||
+ | 18=DRED | ||
+ | 19=DRON | ||
+ | 20=DTRUCK | ||
+ | 21=HARV | ||
+ | 22=HYD | ||
+ | 23=HTK | ||
+ | 24=HTNK | ||
+ | 25=SAPC | ||
+ | 26=SCHP | ||
+ | 27=SMCV | ||
+ | 28=SQD | ||
+ | 29=SUB | ||
+ | 30=TTNK | ||
+ | 31=V3 | ||
+ | 32=ZEP | ||
+ | |||
+ | 33=BSUB | ||
+ | 34=CAOS | ||
+ | 35=YHVR | ||
+ | 36=YTNK | ||
+ | 37=LTNK | ||
+ | 38=MIND | ||
+ | 39=PCV | ||
+ | 40=SMIN | ||
+ | 41=TELE | ||
+ | |||
+ | '';notice the gap here'' | ||
+ | 102=AMBU | ||
+ | 103=BCAB | ||
+ | 104=BUS | ||
+ | 105=CAR | ||
+ | 106=CBLC | ||
+ | 107=CDEST | ||
+ | 108=CIVP | ||
+ | 109=CMON | ||
+ | 110=CONA | ||
+ | 111=COP | ||
+ | 112=CRUISE | ||
+ | 113=DDBX | ||
+ | 114=DeathDummy | ||
+ | 115=DOLY | ||
+ | 116=EUROC | ||
+ | 117=FTRK | ||
+ | 118=HORV | ||
+ | 119=HOWI | ||
+ | 120=YCAB | ||
+ | 121=YDUM | ||
+ | 122=JEEP | ||
+ | 123=LIMO | ||
+ | 124=PICK | ||
+ | 125=PROPA | ||
+ | 126=PTRUCK | ||
+ | 127=SCHD | ||
+ | 128=STANG | ||
+ | 129=SUVB | ||
+ | 130=SUVW | ||
+ | 131=TAXI | ||
+ | 132=TRUCKA | ||
+ | 133=TRUCKB | ||
+ | 134=TUG | ||
+ | 135=UTNK | ||
+ | 136=VLAD | ||
+ | 137=WINI | ||
+ | 138=XCOMET | ||
+ | Note the allied stuff is first, next soviet and yuri, then there's a gap between 41 and 101 before civilian units are listed. The numbers don't really matter, only the order of the list does. Now I see that I have 41 buildable units, and can still make 60 extra ones without screwing up. [[Category:Bugs_and_Errors]] |
Revision as of 08:34, 19 August 2005
RA2 and YR (and probably TS and FS as well) are coded in a way that limits the number of total buildable VehicleTypes, InfantryTypes, and probably AircraftTypes as well, to 100 units each. If you have a buildable object on a place after 100, the AI will think that is the only unit buildable and create it over and over again. Literally. It will continue building until there is no money left or you stop it. This bug can partly be avoided, see below for details.
Avoiding the 100 unit bug (by DCoder)
Look at your [InfantryTypes] and [VehicleTypes]. How many entries do they have? If there's more than 101 buildable units (those without TechLevel=-1) and the're not all in the first 101 lines of the list, the AI will go nuts - it'll build the last unit in the list non-stop, and won't attack. To avoid it, you'll need to rearrange these lists, put buildable units first and the civilian and dummy units in the very end. I personally sorted it like this:
[VehicleTypes] 1=AEGIS 2=AMCV 3=BFRT 4=CARRIER 5=CMIN 6=DEST 7=DLPH 8=FV 9=LCRF 10=MGTK 11=MTNK 12=ROBO 13=SHAD 14=SREF 15=TNKD 16=APOC 17=DISK 18=DRED 19=DRON 20=DTRUCK 21=HARV 22=HYD 23=HTK 24=HTNK 25=SAPC 26=SCHP 27=SMCV 28=SQD 29=SUB 30=TTNK 31=V3 32=ZEP 33=BSUB 34=CAOS 35=YHVR 36=YTNK 37=LTNK 38=MIND 39=PCV 40=SMIN 41=TELE ;notice the gap here 102=AMBU 103=BCAB 104=BUS 105=CAR 106=CBLC 107=CDEST 108=CIVP 109=CMON 110=CONA 111=COP 112=CRUISE 113=DDBX 114=DeathDummy 115=DOLY 116=EUROC 117=FTRK 118=HORV 119=HOWI 120=YCAB 121=YDUM 122=JEEP 123=LIMO 124=PICK 125=PROPA 126=PTRUCK 127=SCHD 128=STANG 129=SUVB 130=SUVW 131=TAXI 132=TRUCKA 133=TRUCKB 134=TUG 135=UTNK 136=VLAD 137=WINI 138=XCOMET
Note the allied stuff is first, next soviet and yuri, then there's a gap between 41 and 101 before civilian units are listed. The numbers don't really matter, only the order of the list does. Now I see that I have 41 buildable units, and can still make 60 extra ones without screwing up.