Quantcast
Viewing latest article 8
Browse Latest Browse All 147

Contribution • Bugs with custom road types

I am implementing "pack ice" as an extra "road" type for sea terrain. In doing this, I have come across some bugs.
I use a "road extra" so I won't need another terrain type, and with a hex tileset I need only 7 sprites. They combine to form a great variety of icy scenes, for very little drawing effort. Also, a "road extra" allows modification of tile move cost, food and trade. And this is where I see the bugs:

1. Ice gets in the way, therefore I set -1 for food and -1 for trade. Looking at city production when working such an icy tile, I do indeed get only 1 food and one trade (1 0 1) instead of the usual (2 0 2) I get when the city has a port. I confirmed this by looking at city production, while micromanaging which tiles the city works. So the game accounting seems fine, but the display gets all wrong: I set tile production to be visible, so a (1 0 1) tile, should have a little green 1 (food), a little white 0 (no shields), and a little yellow 1 (gold). Instead I see (9 0 9) as if there were a huge food and gold bonus. Apparently, the display code do not like a "road" with negative bonuses, and gives me those weird nines.
Also, right-clicking the tile shows food/prod/trade 65536/0/65537, instead of the expected 1/0/1. There is also an error message: "Trying to put -1 into 16 bits; it will result 65535 at receiving side." Well, negative numbers works for city production; it'd be nice if the display was correct too. -1 is indeed 65535 when expressed in 16 bit, but please interpret that as a signed 16-bit number, which is -1.

2. Ice gets in the way, so I set "move_cost = 18". "move_fragments" is the usual 6, so I expected a ship or trireme to spend 3 full move points going through an icy tile. The idea is that ships can navigate through pack ice, but it will be much slower than open seas. The bug: There were no punishment at all. Ships and triremes move through icy seas as if they were normal seas. Entering ice, exiting ice, or moving from one icy tile to the next, no punishment. I can only guess, the "road" system was only meant for making movement faster, not slower? Or it doesn't work at sea? I can imagine many more use cases for extras that slow down movement: minefields (on land or sea), tank traps, border fences etc. All meant to slow down fast enemy units. I tried making the ice extra "native" to Sea and Trireme, that did not change anything.

Statistics: Posted by Hafting — Tue Jul 01, 2025 12:03 pm — Replies 1 — Views 148



Viewing latest article 8
Browse Latest Browse All 147

Trending Articles