Dev insights: some behind-the-scenes about the modular system
As you can imagine, implementing this feature came with its fair challenges – from different points of view. When it comes to Game Design, for example, Markus mentioned that it was crucial to design the system in a way that it as flexible as possible without breaking any logic or visuals, while keeping it simple and intuitive for players to use.
For the art team instead, one of the challenges was to understand how big a ship module should be in order to be compatible with the beloved Anno grid. It might not seem obvious at first, but just like roads and buildings, the grid applies to the ocean too – that means that ships move within the grid. “This required a lot of back and forth: first we prototyped by building simple grey blocks and figuring out if that measure worked in the grid, then we made it work visually.” – Rolf, Expert Artist
Jannis, Gameplay Programmer, told us about the challenges they faced to create a system that is flexible and at the same time easy to maintain. “The placement of modules on the ships is dynamical. As the number of possible combinations is quite high it is not possible to create static files for all combinations, but we have to create the ship dynamically on runtime in the game when a ship is created, as in we calculate on which positions which slot gets installed and place it visually and logically at that slot index.
How this happens is defined by a few rules that we had to iterate on a lot. Furthermore, we had to split the system into a logical part: ‘where and how should modules be linked to?’, and a visual part: ‘which 3D models are used in which situations?’. For example, a mast at the front of the ship has to look different than a mast in the center of it. This allows us to efficiently set up modular ships, validate each possible configuration and create different visual variations e.g. for special participants such as pirates.”
This means that, not only does each module have a different feature, but they also have a different priority in relation to other module types. This priority influences the slot the module will occupy when the ship is configured: each module has a preferred slot to be on; however, if the slot is already occupied by a module with higher or same priority, the module is placed on the next open slot that is further outside. If all slots further outside are occupied, it will move to the next open slot towards the middle of the ship. This is to make sure that placement of the modules will result in a nice, good-looking structure on the ship.