Перейти к содержимому

Griffins Behind Mountains: rendering bugs | Rebuilding Heroes of Might & Magic 1 [Episode 106]

Первый герой меча и магии

0:00 / 0:00

Griffins Behind Mountains: rendering bugs | Rebuilding Heroes of Might & Magic 1 [Episode 106]

87 просмотров · 1 месяц назад
Первый герой меча и магии
234 подписчика
87 просмотров · 1 месяц назад
In this episode of my Heroes of Might and Magic 1 engine rebuild, I work through three separate issues in the map rendering and save systems. First up is a monster rendering order bug where griffins were being drawn behind mountains instead of on top of them, with similar problems affecting centaurs and pikemen near trees. What initially looked like a layer 1 / layer 2 depth problem turned out to be an intra-column ordering issue: because the mountain sprite is taller and wider than its 32×32 cell, creatures needed a dedicated overlay pass rendered after adjacent columns are laid down but before layer 2 objects. I walk through how I landed on the fix, including a detour where fixing griffins accidentally made dwarves and other creatures disappear entirely, and how I restored them while keeping the occlusion working. I also explain the difference between fixed creature types like these griffins (specified directly in the scenario data) and creatures generated randomly at runtime. Second, I chase down a sprite offset bug that left goblins, wolves, dwarves, and other creatures sitting too low on their tiles, sometimes clipping onto the map border. The root cause was the code applying the Y offset from the top of the tile rather than the bottom. After a lot of tinkering with the minimon spec data and comparing guarded vs. unguarded anchoring, I get the creatures positioned much closer to the original game's behavior. Finally, I add an autosave feature that writes an "autosave" file at the end of each player's turn, right before the AI opponents move, toggleable from the control panel and working for both standard and campaign games.