boformer / BuildingThemes

Mod for Cities:Skylines
http://steamcommunity.com/sharedfiles/filedetails/?id=466158459
MIT License
13 stars 11 forks source link

[WIP] custom implementation of ZoneBlock.SimulationStep #25

Closed boformer closed 9 years ago

boformer commented 9 years ago

Trying to implement https://github.com/boformer/BuildingThemes/issues/13

For now this adds a few logger calls to analyse how this monster works (especially the while (num28 < 6) part).

boformer commented 9 years ago

I tested a few zoning layouts (with a theme that only contains 2x4 buildings):

Result: http://imgur.com/a/EKhjc

The algorithm reduces the width in some cases if no asset was found. It never reduces the depth.

boformer commented 9 years ago

The goal: Make all of these themes usable:

Assets used: http://steamcommunity.com/sharedfiles/filedetails/?id=452704398 http://steamcommunity.com/sharedfiles/filedetails/?id=455727807

<?xml version="1.0" encoding="utf-8"?>
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Themes>
    <Theme name="Edinburgh">
      <Buildings>
        <Building name="455335791.ERHL1A_Data" />
        <Building name="455719510.ERHL1B_Data" />
        <Building name="456227170.ERHL1C_Data" />
        <Building name="457264872.ERHL1Cnr1_Data" />
        <Building name="458977545.ERHL1Cnr Pub_Data" />
      </Buildings>
    </Theme>
    <Theme name="1x1">
      <Buildings>
        <Building name="H1_1x1_Blockhouse" />
      </Buildings>
    </Theme>
    <Theme name="UK Terraced Housing">
      <Buildings>
        <Building name="452688457.Terraced House 1_Data" />
        <Building name="452693614.Terraced House 2_Data" />
        <Building name="452694147.Terraced House 3_Data" />
        <Building name="452698364.Terraced House 4_Data" />
        <Building name="452699199.Terraced House 5_Data" />
        <Building name="452811044.Terraced House 6_Data" />
        <Building name="452932057.Terraced House 7_Data" />
        <Building name="453553786.Terraced House 8_Data" />
        <Building name="454103592.Terraced House - Corner 1_Data" />
        <Building name="454569456.Terraced House - Corner 2_Data" />
        <Building name="455711566.UK Corner Pub - The Vic_Data" />
        <Building name="455845254.UK Corner Pub - The Tappers_Data" />
        <Building name="456271993.UK Corner Pub - The Crown_Data" />
        <Building name="456534883.Terraced Shop - Londis_Data" />
        <Building name="456877661.Terraced Shop - Tesco Express_Data" />
        <Building name="457089522.Terraced Shop - Sainsburys Local_Data" />
        <Building name="457722555.Terraced Shop - Post Office_Data" />
        <Building name="457806606.Terraced Shop - Subway_Data" />
        <Building name="458227957.Terraced Shop - Coral_Data" />
        <Building name="461456668.Terraced Shop - KFC_Data" />
        <Building name="462018064.Terraced Shop - Greggs_Data" />
        <Building name="462586718.Terraced Shop - Poundland_Data" />
        <Building name="462731956.Terraced Shop - Bargain Booze_Data" />
        <Building name="463995315.Terraced Shop - Premier Stores_Data" />
        <Building name="464726117.Terraced Shop - Olivers Fish Bar_Data" />
        <Building name="465122960.Terraced Shop - Lloyds Pharmacy_Data" />
        <Building name="466230548.Terraced House - Modern 1_Data" />
      </Buildings>
    </Theme>
  </Themes>
</Configuration>
boformer commented 9 years ago

Aiming for this algorithm:

width x depth

4 x 4 = 16
3 x 4 = 12
2 x 4 =  8
1 x 4 =  4
4 x 3 = 12
3 x 3 =  9
2 x 3 =  6
1 x 3 =  3
4 x 2 =  8
3 x 2 =  6
2 x 2 =  4
1 x 2 =  2
4 x 1 =  4
3 x 1 =  3
2 x 1 =  2
1 x 1 =  1
boformer commented 9 years ago

This needs further testing. Right now this seems to work beautifully.