
So first question; is there a way to get the actual cargo production a station will receive, based on the formula in the wiki?
As far as I can tell there is no way to derive this with the API, because you cannot evaluate other companies stations.
Moderator: OpenTTD Developers
Yes and noR2dical wrote:Firstly, can the AI buy land?
It looks like per station result of : http://wiki.openttd.org/Game_mechanics# ... o_stationsI noticed recently that stations have a monthly supply amount next to cargo and rating (I assume this is a recent addition, or else I never noticed before AI developing). Is there a way to get this value in API? It seems an accurate monthly cargo amount and I am struggling quite a bit to get a good estimate for AI to decide how many vehicles will be optimal for a route, mainly for town to town passengers transport with buses.
yep, without a good resultLastly, has anyone been testing AI's with the new cargodist? Seems like its going to be very difficult to get good numbers for cargo estimates, especially for towns, when networks and competition become more complex.
I haven't tested it yet actually, but I suppose cargodist simply doesn't affect SimpleAI with its point-to-point connectionsLastly, has anyone been testing AI's with the new cargodist? Seems like its going to be very difficult to get good numbers for cargo estimates, especially for towns, when networks and competition become more complex.
The problem with this is for towns, where as far as I can tell production is dependant on the number of houses you cover (couldn’t find much info on this). I know a lot of the AIs build a small number of initial vehicles, then modify count based on a few rules and heuristics. Why I avoid this is because I want a competitive AI able to start with and keep high ratings. Building too many on the other hand can cause major traffic jams if the town is big and the overestimate largekrinn wrote:a rought GetLastMonthProduction * station_rating
Hmm, I'm interested to see what will happen when this goes live with the stable, because I'm seeing problems with some multi-connection town networks even on my very basic AI. Maybe a push for other developers to update AI's from older APIs and mechanics
You can't really accurately predict/calculate cargo flow, only react to it and its fluctuations(even for industries btw). Hence the runtime vehicles amount approximation. In the end this method works very well, that's why most AIs are using it I think.R2dical wrote: The problem with this is for towns, where as far as I can tell production is dependant on the number of houses you cover (couldn’t find much info on this). I know a lot of the AIs build a small number of initial vehicles, then modify count based on a few rules and heuristics. Why I avoid this is because I want a competitive AI able to start with and keep high ratings. Building too many on the other hand can cause major traffic jams if the town is big and the overestimate large![]()
Uhmm, thanks?carl_06 wrote:Nice post !
love to quote myself wrote:- You shouldn't do it to not hurt player nerves and get your AI blackilist to play against.
building.R2dical wrote:What generally takes longer data building or data transfer?
- You can use datas in a compatible format with the save table : https://wiki.openttd.org/AI:Save/LoadMaybe it can work if you preprocess and prepare a data table to save?
Code: Select all
function Save()
{
return {save_document = Terron.memento[0]};
}
function Load(v, data)
{
this.save_data = data.rawget("save_document");
}
Was totally worth it, IMO.R2dical wrote:Maybe it can work if you preprocess and prepare a data table to save?...
...It would be a bit of a pain as it would require updating every time a saveable class objects variables are changed, also slowing these down a bit...maybe worth it though.
Signs as in AISign.BuildSign are a bit unsafe, as players of opponent companies can remove your signs if they wish. If you want to make it permanent, it has to be a waypoint, station, vehicle etc. I believe you could (ab)use some empty vehicle groups and use their name for storage.R2dical wrote:I also read about using game names to store AI data, like vehicle, stations and group names. I think this would be well suited to the "physical" AI parts relating to the obvious, maybe a VERY limited number of signs can store things like path finding data and the player wont mind...I think a number of AIs do this already.
Using the point of naming these would divide the point of importance, so on load all unidentifiable vehicles are sold without issue for example...
Code: Select all
this.master_table.vehicle_data = ManageVehicles();
Code: Select all
local data = ManageVehicles();
this.master_table.vehicle_data = data;
Users browsing this forum: No registered users and 17 guests