stwe/MDCII

Cod-Reader writes wrong gfx values in the json

Closed this issue · 6 comments

stwe commented

I think the GFX value 112 here is wrong.

cod

In my opinion is 3064 correct.

stwe commented

eventually the expression "+112" will be misinterpreted

codplus

Can you search the cod file for the constant IDWOHN and check if it was defined (and what value it hast) and how often this is used?

I checked with a NINA version of Anno 1602.
The constant IDWOHN is defined as IDWOHN = 20601

This means that the value for IDWOHN+20 is correct (20621).

How do you calculate the value of 3064?

stwe commented

Sorry, I mean the GFX value. That should be 3064. The reader writes the wrong GFX value. But it's also good to know that IDWOHN fits. What GFX do you have for the ID?

This issue is potentially fixed in siredmar/mdcii-engine@520762b

The problem was, that relative constant increments (and decrements) were not handled by the cod_parser.
Constant assignments are in this format: CONSTANT =
The "@" is a marker for a relative assignment followed by the increment (+|-)(number).
So they are completely rewriting the value of that constant. Don't know why they didn't use a variable in the first place.

Relative constant assignment:
@GFXNR = +112

Relative variable assignment:
@GFXNR: +112

Well, this should be fixed. I'd be nice if you tested this if the change has some side effects i didn't see.

stwe commented

@siredmar It looks like the problem has been fixed. Thanks for the support. What is new is that the GFX values for rotated public buildings (e.g. Tavern, Market-Place) are not correct. But this can have many other reasons. Otherwise everything looks very good.