WormAIDev  Worm SELF_VERSION
 All Classes Files Functions Variables Pages
Todo List
Group Reasons for selling vehicles
Maybe convert to enum.
Member WormAI::Load (version, data)

load data in temp values then later unpack it because load has limited time available

This should call air_manager.LoadData for air related SaveGame data.

This should call air_manager.LoadData for air related SaveGame data.

Member WormAI::Save ()
This should be moved to a AirManager.SaveData function.
Member WormAirManager::CheckForAirportsNeedingToBeUpgraded ()

Maybe set a max amount of upgrades at one time?

Maybe order by highest amount of waiting cargo to choose the station to be converted first.

Maybe order by highest amount of waiting cargo to choose the station to be converted first.

Member WormAirManager::FindSuitableAirportSpot (airport_type, center_tile)
In early games with low maximum speeds we may need to adjust maximum and maybe even minimum distance to get a round trip within a year.
Member WormAirManager::IsWithinNoiseLimit (tile, airport_type)
Maybe we should account for wanting to remove an old smaller airport first which presumably would decrease the noise level.
Member WormAirManager::ManageAirRoutes ()

Refactor the parts of this function into separate functions.

Refactor the parts of this function into separate functions.

  1. Make groups for each route
  2. When we have max aircraft/airports:
    • Evaluate total profit per group, remove bad groups/airports or reduce # planes
    • Favor bigger/faster aircraft over cost more when high amount waiting passengers
  3. Upgrade aircraft when they are old or when newer ones would be more profitable
  4. Upgrade airports only when it's needed
  5. Check reliability when breakdowns are on

When maintenance costs are on we should set low profit limit too at least the yearly costs.

Don't sell all aircraft from the same route all at once, try selling 1 per year?

Refactor the parts of this function into separate functions.

  1. Make groups for each route
  2. When we have max aircraft/airports:
    • Evaluate total profit per group, remove bad groups/airports or reduce # planes
    • Favor bigger/faster aircraft over cost more when high amount waiting passengers
  3. Upgrade aircraft when they are old or when newer ones would be more profitable
  4. Upgrade airports only when it's needed
  5. Check reliability when breakdowns are on

When maintenance costs are on we should set low profit limit too at least the yearly costs.

Don't sell all aircraft from the same route all at once, try selling 1 per year?

Member WormAirManager::SellAirports (airport_1_tile, airport_2_tile)
Make a list of removed airports/tiles so that we don't build a new airport in the same spot soon after we have removed it!
Member WormMoney::GetMinimumCashNeeded ()

Think of a better computation than stationcount * 50 since I think maintenance costs don't increase linearly.

Maybe also use InflationCorrection on GetLoanInterval or is that already corrected for inflation?

Maybe also use InflationCorrection on GetLoanInterval or is that already corrected for inflation?

Member WormPlanner::GetRoute (planned_route)

!!

adapt this value (40) move it to a constant or var

change to const

Member WormPlanner::GetSubsidizedRoute (planned_route)

Instead of GetSetting we should define a value for ourselves...

define a var/const instead of the fixed value we now use...

Member WormPlanner::PlanRailRoute ()
replace number by a definied constant
Member WormRailBuilder::BuildDoubleRailStation (is_source, route, station_data)
RemoveRailLine
Member WormRailBuilder::BuildPassingLaneSection (near_source, station_data)
RemoveRailLine
Member WormRailBuilder::BuildSingleRailStation (is_source, platform_length, route, station_data)
RemoveRailLine
Member WormRailBuilder::TrainEngineValuator (engine, weight, max_speed, money)

the money parameter seems not to be used.

the money parameter seems not to be used.

Member WormRailManager::BuildRailway ()

replace number by a definied constant or variable depending on date and other factors

If building trains fails because of lack of money we should try again after a little wait... BuildAndStartTrains should return a status code instead of True/False [OK, NOMONEY, BADTRAIN, ...]

check first if we are below max no. of trains...

if we're short on money we should'nt try but wait longer before trying again.

Member WormRailManager::CheckRoutes ()

if vehicle count = 0 because we didn't have enough money to buy trains then

we should (try to) add trains or wait until we have more money

Maybe add a status to routes like [nomoneyfortrains, unprofitable, ...]

Member WormRailManager::CheckTrainProfits ()

possible duplicate code with profit checking in air manager. Maybe combine in 1 function?

When maintenance costs are on we should set low profit limit too at least the yearly costs.

When maintenance costs are on we should set low profit limit too at least the yearly costs.

Don't sell all trans from the same route all at once, try selling 1 per year?

Member WormRailManager::IsRectangleWithinTownInfluence (tile, town_id, width, height)
Needs to be moved to a different unit. (Town?)
Member WormRailManager::RegisterRoute (route_data, station_data, vehtype, group)
Also save IsSubsidy, ...
Member WormRailManager::SetGroupName (group, crg, stasrc)
Move to a different unit, should be accessible from other managers too.
Member WormRailManager::SetRailType ()
Possible better evaluation what rail type is the most profitable.