[i][url=https://factorio.com/blog/post/fff-345]Read this post on our website.[/url][/i] [h1]Unit group collision mask[/h1] Last weekend, a [url=https://forums.factorio.com/viewtopic.php?f=11&t=84204]bug report[/url] came in on our forum. The issue was that the groups of biters were trying to path over the water, but the bugs can't swim. [img]https://clan.cloudflare.steamstatic.com/images//12002589/235a18019fdd8fc7d11ce2d51b6be1d988f65941.jpg[/img] It seemed like something quite typical of a mod being funky. I looked into it, and it seems the [url=https://mods.factorio.com/mod/Hovercraft]Hovercraft[/url] mod was playing monkey business with water collision masks to make his vehicles ride over water. One thing involved setting water tiles to be walkable, and then adding an additional collision layer to all players and biters. What this modder didn't realise though, is that unit groups have a fixed collision mask. It used to be hardcoded, but a while ago it was added to the utility constants. So we just say "hey its a mod problem, here's a quarter, call someone who cares"... right? Well it didn't sit right with me, because deep inside I knew that the unit groups shouldn't have a fixed collision mask, it doesn't make sense really. Lets say you add flying units to the game. If you give individual commands to the flyers to go attack the base, they will happily fly over the water and attack without issue. However if you put them in a group together, a group of flying units, the group will path around the water, because the unit group still has a fixed ground collision mask. So this week I decided to fix it once and for all. It turns out it wasn't so hard in the end. As we mentioned somewhat in [url=https://factorio.com/blog/post/fff-340]FFF-340[/url], unit groups already have logic in place to recalculate their properties based on their members. I hooked into that logic to also make them recalculate their collision mask. The way that made sense to me, is that they should add the masks together, so that they only path where all of the units can path. https://cdn.factorio.com/assets/img/blog/fff-345-small-biters.mp4 [i]A group of only small biters, they can't walk on water, so they walk around it.[/i] https://cdn.factorio.com/assets/img/blog/fff-345-water-biters.mp4 [i]A group of 'water biters'. They can walk right over water, so they go straight through.[/i] https://cdn.factorio.com/assets/img/blog/fff-345-mixed-biters.mp4 [i]A mixed group of small biters and water biters. They add their masks together, so only go where all the units can go.[/i] You can imagine it quite intuitively I think, the group will try to stick together, and that will mean the group can only path to places that all the members can reach. It feels quite nice to make fixes like this, as they are relatively small in scope and risk, but cleanup a lot of potential problems, and open a lot of interesting possibilities. [h3]Artillery shell particle effect[/h3] Another nice small finishing touch for you all this week. Adding a shell being ejected from the Artillery cannons was suggested back when we showed the new sounds integrated into the game ([url=https://factorio.com/blog/post/fff-341]FFF-341[/url]). While we can't get too fancy with it, we think the relatively straightforward effect that we've added fills in the detail nicely. https://cdn.factorio.com/assets/img/blog/fff-345-artillery-shell.mp4 It is just a particle with a nice spritesheet that Dom rendered from the original shell models. With a bit of engine tweaking here and there, we had it ready in quite short order. Just another small bit of polishing that characterises this stage of development.