WormAIDev  Worm SELF_VERSION
 All Classes Files Functions Variables Pages
Todo List
Group Reasons for selling vehicles
Maybe convert to enum.
Member WormAirManager::BuildAircraft (tile_1, tile_2, start_tile)

We need to revise depot orders: both should probably go to depot on same airport as the order before it!

But this will have implications in several other places that depend on the order of the orders.

But this will have implications in several other places that depend on the order of the orders.

Member WormAirManager::CheckForAirportsNeedingToBeUpgraded ()

Should probably be moved somewhere elese (main.nut?)

Maybe only upgrade if we have enought money

CLOSED airports should not be checked once a month but as often as possible because we don't want them to be closed for a long time, loosing profits.

Maybe only upgrade if we have enought money

CLOSED airports should not be checked once a month but as often as possible because we don't want them to be closed for a long time, loosing profits.

Member WormAirManager::distance_of_route
Change distance_of_route to not register distance PER VEHICLE but only once PER ROUTE
Member WormAirManager::FindAirportSpotInTown (town, airport_type, airport_width, airport_height, coverage_radius, center_tile, minimum_acceptance, add_to_blacklist=true, old_airport_type=AIAirport.AT_INVALID)

Is this really useful. Does it matter what tile we build on in same town?

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::LoadFromScratch ()

code from AdmiralAI Aircraftmanager suggests that airport_id may be same as airport_tile!

What to do if multiple airports have the same nearest town?

Add vehicles if there are airports available.

figure out what to do if there are more stations in orders...

If problems.Count() > 0 then randomly add them over the available routes. Since it's not that likely we will leave that for another time.

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

Do this on a per group basis (each route a group).

That way we can decide to not check a group wich was created less than x years ago.

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

Do this on a per group basis (each route a group).

That way we can decide to not check a group wich was created less than x years ago.

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 WormAirManager::UpgradeLargeToMetropolitan (nearest_town, station_id, station_tile)
Can we use RemoveAirport too or does that make it impossible to reuse station_id?
Member WormAirManager::UpgradeSmall (nearest_town, station_id, station_tile, airport_type, other_station_tile)

Ideally we should include the tiles of the current airport in our search for a new spot!

Maybe add as an extra parameter an optional list (default null) with the tiles of the airport

Set acceptance to maybe 50 lower than acceptance of current airport? On the other hand it will already go for the highest acceptance spot, maybe do acceptance = 50?

Can we use RemoveAirport too or does that make it impossible to reuse station_id?

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)
!!
Member WormPlanner::GetSubsidizedRoute (planned_route)

Check if this gets sorted furthest or nearest expire date first. I think the highest value (thus furthest expire date) comes fist

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::BuildRailStation (is_source, lanes, platform_length, route_data, station_data, rail_manager)
Support more than 2 lanes.
Member WormRailBuilder::CanBuildRailStation (tile, lanes, direction, platform_length, station_data)

Support more than 2 lanes.

Why is this different in CanBuildSingleRailStation?

Why is this different in CanBuildSingleRailStation?

part of these can be merged, to be done after we know it's working

generalize the different lanes so it will be easier to extend.

Member WormRailBuilder::InternalBuildRail (head1, head2, railbridges, recursiondepth)

Can we determine bridge/tunnel costs in advance here (e.g. expensive bridge newgrf) Maybe also depend on railtype?

Maybe also valuate on price of the bridge and depend on the max speed we need maybe + a little extra for when we upgrade trains...

Member WormRailBuilder::TrainEngineValuator (engine, weight, max_speed, money)
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

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

Member WormRailManager::CheckAddTrainToGroup (route, vehicle_count, first_vehicle)
remove profit check? What if first vehicle is an older type and the others are making a profit?
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, ...]

Don't use platform length but compute optimal length for this group!

maybe do this for all trains in one go instead of per group probably more efficient

Member WormRailManager::CheckTrainProfits ()

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

Do this on a per group basis (each route a group).

That way we can decide to not check a group wich was created less than x years ago.

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::GetOptimalTrainLength (route)
We should get the amount of cargo our average wagon can carry. Assume 25 for now.
Member WormRailManager::IsRectangleWithinTownInfluence (tile, town_id, width, height)
Needs to be moved to a different unit. (Town?)
Member WormRailManager::LoadData (table, worm_save_version)
Should we load this?
Member WormRailManager::RegisterRoute (route_data, station_data, vehtype, group, train_length)
Also save IsSubsidy, ...
Member WormRailManager::SaveData (table)

Should we save this?

save building state! if (builder != null) { toremove.vehtype = builder.vehtype; toremove.stasrc = builder.stasrc; toremove.stadst = builder.stadst; toremove.list = [builder.ps1_entry[1], builder.ps2_entry[1]]; } else { AILog.Error("Invalid save state, probably the game is being saved right after loading"); table.buildingstage = BS_NOTHING; }

EventQueue, bridgesupgraded?, inauguration?, bs_building building stage

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.
Member WormRailManager::WormRailManager ()
: Needs to be initialized when loading a Save!