• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

ApocDev

Private
14 Badges
Mar 18, 2015
24
2
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Prison Architect
Working on some stuff that will add neighboring building interactions (such as fire spread), but currently banging my head against the wall trying to figure out how to pull a building's neighbors.

Checked through a bunch of the mods in the Workshop, and none seem to have a need for neighboring information.

The closest I can get is BuildingManager.FindBuilding. I've already checked using a RayCast to project in the 8 cardinal directions of the building to see if we just simply "hit" another building, but that seems awfully hackish, and slow to do on a "grand scale" with thousands of buildings to iterate through. It's also not so great on cities that don't use a pure grid system.

Any suggestions/ideas? In the meantime, I'll continue looking through the assemblies and see if I find anything.
 
I can't help you, but i think that what you are going for is great. It's much needed that fires could turn into a huge disaster, not just one lousy building catching on fire (oh so sad)
 
I can't help you, but i think that what you are going for is great. It's much needed that fires could turn into a huge disaster, not just one lousy building catching on fire (oh so sad)

I already have the basic calcs for fire spread done (e.g. higher chance if you have no water connection, slightly higher if you have uneducated workers, etc). But that's all pretty useless if I don't know which buildings to set on fire afterwards :(

Hopefully, this won't be locked simply to fire spread, but other things as well. (Once I can think of them)
 
What about a circle of influence at the building?
Anything within that has a chance to catch fire, you could also have say 3, each one smaller, with the smallest having the highest
chance and the largest having the least chance, then let RNG do its work. Of course taking into account the stuff you already mentioned.

Whilst I don't know the specifics, I imagine all it would then come down to is a collision test between a 2D circle and a cuboid assuming that the buildings also have a collision mesh.

Wish I knew more, would love to make some mods.
 
What about a circle of influence at the building?
Anything within that has a chance to catch fire, you could also have say 3, each one smaller, with the smallest having the highest
chance and the largest having the least chance, then let RNG do its work. Of course taking into account the stuff you already mentioned.

Whilst I don't know the specifics, I imagine all it would then come down to is a collision test between a 2D circle and a cuboid assuming that the buildings also have a collision mesh.

Wish I knew more, would love to make some mods.

Great idea! That should work fantastically. I'll just do some quick bounding+distance checks instead (faster, and less instructions to carry out).

Edit: So I just found out, the game does in fact have a fire spread mechanism built in. However, it is incredibly weak.

Edit 2: https://db.tt/lTo4lBAZ Fire spread!
 
Last edited: