Skip to content

Fix subcells imported from Gen1 maps - #21397

Merged
PunkPun merged 1 commit into
OpenRA:bleedfrom
JovialFeline:import-gen1-subcells
Apr 30, 2024
Merged

Fix subcells imported from Gen1 maps#21397
PunkPun merged 1 commit into
OpenRA:bleedfrom
JovialFeline:import-gen1-subcells

Conversation

@JovialFeline

@JovialFeline JovialFeline commented Apr 11, 2024

Copy link
Copy Markdown
Contributor

This should correct a minor issue with RA/CnC imports of infantry. The subcell number is copied as-is, though ORA's assignment for them is different.

new(0, 0, 0), // full cell - index 0
new(-299, -256, 0), // top left - index 1
new(256, -256, 0), // top right - index 2
new(0, 0, 0), // center - index 3
new(-299, 256, 0), // bottom left - index 4
new(256, 256, 0), // bottom right - index 5

Below, each number is the original subcell index. The SW corner becomes the center and a possible duplicate, while the SE corner replaces the SW one.

 Gen 1      Bleed Import

1     2      1       2
   0            0+3
3     4      4       _

The Gen2 importer has its own adjustments.

var subcell = 0;
switch (Exts.ParseByteInvariant(entries[5]))
{
case 2: subcell = 3; break;
case 3: subcell = 1; break;
case 4: subcell = 2; break;
}
if (subcell != 0)
ar.Add(new SubCellInit((SubCell)subcell));


I had seen odd subcells on occasion but hadn't dug into it until I noticed Soviets in allies-03 were less likely to be hidden by trees. That is something the enemy does fairly often in Tiberian Dawn as well.

allies-03-ra96

@JovialFeline
JovialFeline force-pushed the import-gen1-subcells branch from a408688 to cd7ae5d Compare April 12, 2024 01:48

@PunkPun PunkPun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM untested

@anvilvapre anvilvapre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps use an enum to indicate the direction/index. To avoid similar issues in future.

@JovialFeline

Copy link
Copy Markdown
Contributor Author

Perhaps use an enum to indicate the direction/index. To avoid similar issues in future.

Would you prefer that to a comment?

@PunkPun
PunkPun merged commit 6c9e33b into OpenRA:bleed Apr 30, 2024
@PunkPun

PunkPun commented Apr 30, 2024

Copy link
Copy Markdown
Member

changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants