AI in scenario editor
Moderator: OpenTTD Developers
AI in scenario editor
I thought about using AI in scenario editor - as AI can now examine world and construct paths, manage vehicles, etc, AI in scenario editor would be able to construct world. The only difference would be that company-related functions won't make sense and everything is free.
And these "generator" AI's will run and after some while they'll exit when they have done their work.
Basically we would need to disable company functions in the editor and add few specific scenario functions (create/delete/rename town...). Then just let users run these "AI" scripts.
You can have for example improved landscape generator, improved town/industry generator, script that will connect cities with roads .... I think people would come up with many useful scripts, people could have improved scenario generation without having to make patches for code.
Also, on servers, these AIs could be run as "postprocessing" step after generating random map to add some cool features to it.
And these "generator" AI's will run and after some while they'll exit when they have done their work.
Basically we would need to disable company functions in the editor and add few specific scenario functions (create/delete/rename town...). Then just let users run these "AI" scripts.
You can have for example improved landscape generator, improved town/industry generator, script that will connect cities with roads .... I think people would come up with many useful scripts, people could have improved scenario generation without having to make patches for code.
Also, on servers, these AIs could be run as "postprocessing" step after generating random map to add some cool features to it.
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Re: AI in scenario editor
I'm already working on allowing squirrel scripts as map generators, when this works I'll try to expand this to other areas, like town generation, tree generation. Take a look here http://devs.openttd.org/~yexo/mapgen/ for the progress so far. The diff might be a bit outdated, but I think it should still work. Apply the patch, create a directory named "mapgen/" in the dir the config file is in. You can now create a directory in mapgen/ for every map generator script, create a direcotry, place info.nut and main.nut in it and it should work. This is just a sample generator to demonstrate how it works. Feel free to come up with your own.
Re: AI in scenario editor
Wow! That should be nice. It's one of things I'd really like to see.Yexo wrote:I'm already working on allowing squirrel scripts as map generators.
Re: AI in scenario editor
Squirrel script as map generator? So someone though of same idea :)
Though I meant it more general - user will pick one script from list of scenario editor scripts and set some parameters (using same GUI as is used to pick up AI's to play with). User presses execute and the script will do their work, whatever it is. It could be landscape generation (some API call to reset the heights of landscape from some precomputed array would make this faster than having to do this by individual terraforms), building some extra roads, adding some random rivers, do some extra terraforming or other changes on generated landscape (which could be done by current API), or do something with towns (shrink/expand/delete/create new .... which would need few API calls to be added).
Though I meant it more general - user will pick one script from list of scenario editor scripts and set some parameters (using same GUI as is used to pick up AI's to play with). User presses execute and the script will do their work, whatever it is. It could be landscape generation (some API call to reset the heights of landscape from some precomputed array would make this faster than having to do this by individual terraforms), building some extra roads, adding some random rivers, do some extra terraforming or other changes on generated landscape (which could be done by current API), or do something with towns (shrink/expand/delete/create new .... which would need few API calls to be added).
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Re: AI in scenario editor
I'm not so sure on the terrain design AI - I'd be very surprised if someone could do better than TerraGen - but I love the idea of a river AI, that's exactly what the river generator needs!
Re: AI in scenario editor
Not in general case, but if you want some special sort of map (crater in the middle, two large islands, mountains and valleys changing with some special repetitive pattern, whatever ....), script could help. Such script could use call to terragen with some parameters as part of the land generation process.Xander wrote:I'd be very surprised if someone could do better than TerraGen
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Re: AI in scenario editor
Are you familiar with Civ4? They've got great map scripts, and the type of script you play really influences the game, and I imagine it would work the same for OTTD. An archipelago (consisting of small islands) map would require boats or airplanes to start the first long range routes. Pangea maps (the world is one landmass, like most maps are now) would allow early long range trains. Continents would be between the two. And that's just the three basic map types that have been around for ages in Civ, they've got loads more, each having their own character.Xander wrote:I'm not so sure on the terrain design AI - I'd be very surprised if someone could do better than TerraGen - but I love the idea of a river AI, that's exactly what the river generator needs!
Of course Yexo might have something else in mind, in which case I'm just talking nonsense here.
Who is online
Users browsing this forum: No registered users and 16 guests