Giter Club home page Giter Club logo

itl_houses's Introduction

ITL Houses

Photo credit: Kale on Discord Photo credit: Kale on Discord

A house replacement set using default graphics with new rules and features, for Temperate, Subarctic, and Subtropic.

Formerly known as Improved Town Layouts.

Subarctic & Subtropic Features

Better downtowns and suburbs

  • Flats are capped at 1 per every 10 houses
  • Each office building requires 1000 population
  • Office buildings cluster together into a commercial district
  • Landmarks (theatre, cinema, etc) and office buildings added from other climates for greater variety

Houses selected by land value

  • Land value is added by:
    • Water nearby
    • Being close to a town center
    • Being in a city
    • Not being in desert
    • Having a fountain or statue nearby
    • Being in the catchment of a station receiving passengers, mail, goods, water, food, or vehicles (FIRS)
  • Houses with accent colours are recoloured based on the land value:
    • 4..6: Red
    • 7..9: Yellow
    • 10..12: Green
    • 13-15: Blue
    • 16-18: Purple
    • 19+: Pink

Temperate Features

(Legacy features, to be changed to match Subarctic and Subtropic)

Better downtowns and suburbs

  • High-density residential and commercial buildings only grow within the coverage area of a passenger station
  • Downtown buildings cluster together
    • Pre-skyscraper brick buildings cluster separately from skyscrapers, so some cities have a separate "Old" and "New Town"
    • Note: A gap in passenger station coverage will block the cluster from expanding in that direction, since buildings may only grow within 2 tiles of another in its cluster
  • Downtowns stay proportional to the town
    • Each office building requires houses for its workers, so the towers won't overrun the suburbs

Historic Preservation

  • All buildings have longer lifespans to reduce the churn of constant rebuilding
  • Historic downtown buildings are kept in some towns, but demolished in others
  • Landmark buildings last forever

Landmark buildings

  • Landmarks lend character to your city and often generate increased passenger traffic
  • Some landmarks only grow in Cities (Hotel, Spa)
  • Some landmarks only grow when the town has enough population (Stadium, University, Courthouse)
  • All landmarks are kept from appearing too often, either some distance apart or only one per town

Start as early as 1700

  • Introduction dates range from 1700 to 2000, allowing a slow progression over time
  • Old houses accept Wood (until 1850) and Coal (until 1945) for fuel
  • Early buildings have reduced population to allow older, slower vehicles to keep up with demand
    • 1700-1850: 1/4 population
    • 1850-1950: 1/2 population

Compatibilities

  • Compatible with all industry sets and GameScripts (please report any problems)
  • Uses only base game sprites, thus compatible with any base graphics set including Original TTD, OpenGFX, aBase, zBase, and NightGFX
  • Requires OpenTTD version 1.10.0, JGR version 0.34, or better.

Parameters

Use additional sprites. Default off.

  • Use Bank sprites
    • Adds the Bank sprites as a University (temperate bank sprite) and a Courthouse (sub-arctic bank sprite)
    • Not recommended if playing with an industry set which includes banks
  • Use FIRS Hotel sprites
    • Adds the sub-arctic Hotel sprite as a Spa
    • Not recommended if playing with FIRS, which also uses this sprite
  • Use sub-tropical sprites (Temperate climate)
    • Adds the sub-tropical church sprite as an additional Church type
    • Adds one of the flats sprites as a random sprite of the Warehouse

Code Reference

All code is commented and is organized into several .nml files which are combined by a simple Python script into a merged .nml file for compiling into the .grf. All of these files are in /src/.

If you have any questions, please feel free to contact me and I will do my best to help.

Translations

Currently available in:

  • English
  • Simplified Chinese (SuperCirno)
  • Traditional Chinese (jjyao88)
  • Czech (adpro)
  • French (arikover)
  • German (WoelfiVW)
  • Japanese (fmang)

Please feel free to translate into your language and submit a Pull Request.

Limitations / Not in Scope

  • This is a house replacement set. It does not improve the behavior of other NewGRF houses, how towns build roads, or town growth.

itl_houses's People

Contributors

2talltyler avatar adpro avatar arikover avatar fmang avatar jcranendonk avatar jjyao88 avatar jrook1445 avatar supercirno avatar woelfivw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

itl_houses's Issues

Improve: README gameplay guide

In OpenTTD, the NewGRF description says to see the website for more information. This links to the README here on GitHub, which needs more screenshots and a rewrite to better communicate the ideas of Improved Town Layouts rather than simply listing detailed rules.

This should be completed before releasing 1.2.0.

Buildings share switch blocks and file grouping is too complex

This completes what PR #5 began.

Version

1.1.1

Expected result

  • Each building has its own set of switch blocks, following an easy-to-understand naming convention
  • Each building, plus its spritelayouts, switches, etc., live in their own file

Actual result

  • Switch blocks are shared by many different buildings, with an inconsistent naming scheme
  • Buildings are merged by type of building, with sprites and switches in their own files

Steps to reproduce

Look at the repository

Suggested fix

  • Copy each building to its own file
  • Copy switches and spritelayouts to the new file and rename them to match the building
  • Update Python and Batch makefiles

Commercial building era change is too abrupt in 1945

Version

1.1.1

Expected result

Commercial buildings transition smoothly from brick buildings to skyscrapers

Actual result

Brick commercial buildings all cease being available in 1945 and only a few skyscrapers become available

Steps to reproduce

Start a game in 1940, build a bus network to grow the city, and fast-forward

Suggested fix:

Stagger the ending dates of brick buildings and create new historic preservation switches using each end date

Refactor switches

  • Use ternary operators when possible to eliminate switches
  • Replace strings of deny/continue switches with a single switch checking multiple things (yes, &&)
  • Use better names!

Remove unnecessary and broken parameters

Two parameters were broken by the move to the cargo_production loop in the Waste & Recycling update. They are unnecessary as I intend for them to always be used, and should be removed.

  • Improved Mail
  • Improved Early Population

Note: This will also require removing ternary operators on individual houses.

Add: Greenbelt / Large Park

Graphics

  • Random tree sprites on ground tile
    • May need sub-randomizers to avoid identical x/y coordinates when placed in a straight line
  • Ground tile depends on terrain - use example code on spritelayout wiki page

Placement

  • May only build 1 tile from another park tile (unless no other park tiles exist in town) OR a river tile
  • Protected if 1 tile from another park tile (2 adjacent tiles are permanent)
  • Don't build in TOWNZONE_CENTRE

Lifespan

  • Experiment with lifespan and probability to determine optimal values. How long should it take for two tiles to spawn adjacent to each other and become protected?

Removing post-war houses from appearing before their time in temperate climate (Culprit inside!)

image

Here is a town created without ITL in 1860. There appear to be six housing sprites in total...

  • Small cottage
  • Medium cottage
  • Large cottage
  • Double thatched roof house A
  • Double thatched roof house B (w/ pond)
  • Townhouse triplets A ("two-up, two-down")
  • Townhouse triplets B

image

Here is a town created with ITL in 1860. There are four housing sprites that better fit in a post-war timeperiod. They are...

  • South-facing doubles w/ garages
  • South-facing single bungalow w/ garage
  • East-facing 2-story doubles
  • East-facing 1-story doubles

The good news is that the previously listed historical houses (cottages and townhouses) still spawn, but in far fewer number than the aforementioned homes which seem to be the primary type of house that spawns. There's also a single sub-arctic housing sprite that appears in these towns. Maybe intentional?

image

Upon digging and experimenting in the scenario editor, I believe I have found the 'culprit'...

image

All of the circled houses are 'dynamic', with the red/orange set cycling between those 4 sprites previously listed, and the blue/green set cycling between two townhouse triplets. It seems the red and blue houses were added with fractional cargo requirements to support the early game, but with the perhaps unintentional issue of introducing housing sprites designed to be post-automobile into the 19th century.

In the vanilla game, the red/orange set are coded to appear in 1931 (the orange set in ITL appears in 1945. suggesting how the red set was added later and thus 'broke' the timeline). The blue/green set (the two-up/two-downs as they're actually called) appear from the year 0 in vanilla game, but 1945 in ITL. I would concur with the vanilla game's interpretation; the two-up/two-downs were built well before the 20th century. They would be most appropriate in the inner city/town area, rather than suburb.

Really want to do a historical run with ITL temperate, so hopefully this can get fixed! :D

Change: Goods/Food service protection should check both this month and last

Many landmarks and commercial buildings are protected if they are within the catchment area of a station which received Goods, Food, or Passengers last month.

One month isn't quite long enough for many delivery chains, particularly when using trains. Checking whether said cargo was delivered either last month or this month would make the check more reliable, on average extending the period by 15 days.

Use:
cargo_accepted_nearby_last_month(FOOD) == 1 || cargo_accepted_this_month(FOOD) == 1

Reformat NML code

Fix tabbing and colon placement (why did I format this like a lang file?)

Can't lower land under parks/statues/fountains

Version

1.1.0

Expected result

Attempting to lower the land underneath a park, statue, or fountain follows the behavior of lowering land underneath other town buildings.

Actual result

The land is not lowered and an error is produced.

Steps to reproduce

Attempt to lower the land underneath a park, statue, or fountain.

Suggested fix:

Parks, statues, and fountains currently have the HOUSE_FLAG_NOT_SLOPED flag. This was intended to keep them from building on sloped tiles, but not to prevent the player from modifying the terrain. Suggest adding this logic to the construction_check instead. Yes, I'm talking to you, future me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.