[DISC] Planned update to in-style trigger area handling

Started by WillLem, Today at 01:58:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WillLem

At present, the Lemmini codebase relies on 2 things to know the relative position and size of an object's trigger area:

1) A separate image (with an "om" suffix, which stands for "object mask") with solid pixels giving the size of the trigger area

2) "maskOffsetX" and "maskOffsetY" values in the style's .ini to specify the final position

One of these, then, is completely redundant.

The separate image can give position as well (offsets would be 0, 0) by being the same size as the object, and having the solid pixels in the exact position that the trigger should be.

Meanwhile, if we're using offset values to 'correct' the position anyway, we might as well just specify width and height whilst we're at it and get rid of the separate image altogether.

Given that the separate image inflates the size of the style on disk unnecessarily, this is what should be eliminated. We can then specify trigger area position and size in the following way:


maskX_n = x
maskY_n = y
maskWidth_n = w
maskHeight_n = h


For the above, "n" is the object's ID, whilst the values on the right of the "=" would be the correct figures required to position the trigger relative to the top left of the object, and then size it accordingly.

No need for unnecessary loading and handling of a separate image, just one easy set of values for style creators (and dev!) to maintain.

Previously, the separate image was likely useful for visualising the trigger area; this is the only reason I can think of as to why it might have initially be done this way. But now that we have visible trigger areas in the Editor, we can easily use this to ensure that trigger areas are located and scaled correctly.

So - it's very likely that the next RetroLemmini update will have this system implemented.

All styles will need to be updated accordingly - there will be no backwards-compatibility handling in either RetroLemmini or the Editor. I'll most likely create a handy tool that can output the correct values quickly and automatically, ready for dropping in to the style's .ini. Since I know of only a small handful of Lemmini style creators, and basically all styles are managed by ericderkovits and I, it's unlikely anybody else will be affected by this change.

To be absolutely clear: levels and replays will NOT be affected by the proposed update, only styles. And, they will become smaller and easier to maintain as a result!

Discussion welcome. If you have any comments or suggestions, now's the time to speak up.