Map Database  •  FAQ  •  RSS  •  Login

AI city planner

<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 05 Jul 2012, 12:09

Re: AI city planner

Well I'm convinced Lewin and Krom can write a much better AI. :)
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 05 Jul 2012, 13:47

Re: AI city planner

Well, given infinite time we surely can come up with something :)
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 05 Jul 2012, 15:14

Re: AI city planner

So you're basically saying the AI would be useless? That's too bad.
I'm not exactly sure what you mean. What I'm saying is that we can't reuse any of the original AI because we don't have the source code of the game. The AI is only in the source code so nobody has ever tried to mod it either. The original AI wouldn't be much use to us anyway, it wasn't very smart. If you kill just 1 labourer they don't rebuild the road so they stop building altogether.
<<

HellRacer

Lance Carrier

Posts: 60

Joined: 13 Mar 2012, 21:58

Post 18 Jul 2012, 17:09

Re: AI city planner

Image
This is what I found when testing a map, not sure if someone already pointed this out, just felt like posting it :)

When I destroyed that building, the AI happily rebuilded it on the very same spot, without even trying to connect it to the road! (Although this was not possible due to the mountain)
<<

stijn263

Woodcutter

Posts: 16

Joined: 28 Jul 2012, 10:23

Location: Netherlands

Post 28 Jul 2012, 12:35

Re: AI city planner

Is it possible to do the AI city planning largely before the game starts (making it map specific)? You could even use multiplayer save games for some good build plans.
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 28 Jul 2012, 18:05

Re: AI city planner

Thanks HellRacer, it's good for us to know about issues like this so we can refer to this topic when we next work on the AI city builder.
Is it possible to do the AI city planning largely before the game starts (making it map specific)? You could even use multiplayer save games for some good build plans.
We'd like to make the AI builder generic, otherwise someone has to design a village for every map in every position, and also that only allows for 1 style of AI, and there would be no random factor when playing against the AI. (once you'd played them on that map, you'd know exactly what they were going to do) We want the AI builder to work on any map (because people are constantly making new maps) with different AI styles, e.g. one could make mainly iron troops, one could make mainly leather troops, etc. We'll probably design these styles by looking at replays and seeing what kinds of villages work well. (so we can make a list of what to build at what time, but not where to build it)

Please be aware that our city builder is in very early stages, it's not supposed to be good yet. We are aware that it does stupid stuff but we wanted to show everyone our progress so far. We are still planning to do a lot of work on it before we call it finished :)

Of course you would get better results from exact planning for each map, and maybe we can support this somehow as an extra feature through the script or event files of the mission (it would be especially useful for coop and campaign missions where you want more control over what/where the AI builds)
Cheers,
Lewin.
<<

pawel95

Castle Guard Swordsman

Posts: 1912

Joined: 03 Oct 2008, 22:00

KaM Skill Level: Skilled

Location: "Pawel95" on Youtube.com

Post 13 Sep 2012, 13:19

Re: AI city planner

So for me the AI testing were a good thing in RC2, as well (Different maps). I know that there is no so big progress, i think. However I want only to post here some "idiot" pictures (I hope, that maybe my pictures will help you maybe, by improve the AI):

This was big FAIL, because the labours have done big road in the south, but havent finished the road a little bit in north. So this player is Lost.
Image

This is nice player, but making a indirect road to the woodcutter in the South.
Image

This is a good City, as well. However maybe making the 3th carpenter later, because he will have no job at the start.
Image

Here only one idea, like human player, that those labours could make about 3-5 roadfield, before the labour finished the inn-planing
Image

I have seen this "360°road" over the warehouse very often, and its nice for speeding up traffic. However i think that at the start like in picture it does not make sence!?
Image

At this picture we can see one GOOD point and one not so good point. Good point, that the labours make the 2nd/3th/4th carpenter, after the woodcutters/1st carpenter... is finished. Bad i think is, that there are about 6 Woodcutters nearly at ONE position.
Image


"More pictures on the way"

pawel95
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 13 Sep 2012, 14:00

Re: AI city planner

Thanks Pawel, I keep on working on AI city planner.

Recently I had changed the way it's AI works from queue pattern (altered with Wooden/Strong flags that make it build more houses) to an economist pattern - houses are grouped into big chunks (Core, Gold, Food, Weaponry, Defence) and each chunk has a Production and Consumption forming up a Balance. If certain Balance gets below 0 the AI will build more of that chunk (picking house that will be most useful). For that I had to measure exact house production speeds. Do you know who's fastest - Stonecutter or SausageMaker? ;-) Anyway, now with this approach I hope to resolve some of house building order mistakes (e.g. 4 woodcutters would need only 2 sawmills, possibly affected by trunks reserve in Store). Also food economy should become much more precise (knowing exact food production and demand). Maybe I can make core houses to be built in more sensible way using same approach, but so far they are just hardcoded (School-Inn-Quary-Quary-Wood-Quary-Wood-Sawmill)

The second part - choosing places for houses remains pretty much unchanged, except for that it places houses with regard to enemies influence (avoiding it when possible) and some tweaks (woodcutters will have more free space around them).
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

pawel95

Castle Guard Swordsman

Posts: 1912

Joined: 03 Oct 2008, 22:00

KaM Skill Level: Skilled

Location: "Pawel95" on Youtube.com

Post 13 Sep 2012, 14:19

Re: AI city planner

Stonecutter or SausageMaker?
Sausagemaker is faster, but no plan how much faster :P
yeah. only a idea from me, maybe a silly idea.Maybe it would be better to finish all houses. (iron/coal/barraks/towers) and than fix all things. If you now fix some things with woodcutters, maybe there will be later some problems, if e.g. there is no place for barracks, because of to much trees, the AI will build the barracks near the enemy :D in the worst case.

Should I do sth/test sth. I would you help by programming the AI, but like I told one/two years ago, I have only skills in java and C++/C#. Delphi is nothing for me :D So maybe other things? If yes, you can send me a Pm or post it here.
<<

thunder

User avatar

Moorbach's Guard

Posts: 1044

Joined: 15 Apr 2012, 12:11

KaM Skill Level: Fair

Location: In the Market

Post 04 Oct 2012, 06:40

Re: AI city planner

Hey!

Sometimes AI knock out himself any kind of way under 10mins. The problem was always same. The stone is empty from storehouse.
An replay to the demostrate it:
http://www.mediafire.com/?75y4o6dti0im0p0
[RC4]
(right up had stonemason but the school didnt build up->no masoner
right down didnt have stonemason. And left up worked fine.)
-Stonemason and woodcutter are buildable before Inn on this map-if this parameter is needly.
Have a good work!
t
<<

thunder

User avatar

Moorbach's Guard

Posts: 1044

Joined: 15 Apr 2012, 12:11

KaM Skill Level: Fair

Location: In the Market

Post 15 Nov 2012, 16:13

Re: AI city planner

Hey!

I caught a photo. AiNNs:)
How much citizens need to AI to build 2nd 3rd and 4th inn? And necessary the 4th inn?
t

PS: its a prebuild city, not AI made. AI just built more building to it. (vineyards, storehouse, inns...)
You do not have the required permissions to view the files attached to this post.
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 15 Nov 2012, 20:16

Re: AI city planner

I'm really, really excited and impressed by this AI. It's already outstanding how far you guys have gotten :)
I'm wondering what holds in store for random maps for the Remake? Maybe in a few years if the project is still going? With city building AI like this, single player could be so much better if we could play random maps against the computer.
But that can't happen for a long time, huh? :P
I used to spam this forum so much...
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 15 Nov 2012, 20:25

Re: AI city planner

@Thunder: as far as I know the "old" AI in the recent releases doesn't take into account stuff that's already built (so it rebuilds stuff it was given at the start of the mission) but the "new" AI for the next version will do that better.

@Ben: Playing multiplayer maps against the AI will hopefully be possible in the not too distant future :) But "random maps" (meaning randomly generated terrain) will probably never happen. It takes years to learn how to be a good map maker as a human, it would be a huge amount of work to teach the computer :P
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 16 Nov 2012, 16:39

Re: AI city planner

@Ben: Playing multiplayer maps against the AI will hopefully be possible in the not too distant future :) But "random maps" (meaning randomly generated terrain) will probably never happen. It takes years to learn how to be a good map maker as a human, it would be a huge amount of work to teach the computer :P
Obviously, maps in Knights and Merchants are much, much more complicated then in Age of Kings. Still, Age of Kings used text files that had code describing the layout of resources and terrain for a map. If the Remake did something like this, it would probably have to work like a jigsaw puzzle. It would randomly take "pieces" of terrain that have already been created. It would then put all these pieces together to make a starting location, which would then be mirrored across the map so each play's location is (somewhat) balanced. Obviously (if this even is possible) this wouldn't look near as great as a hand-made map, but it still would be quite interesting.
I used to spam this forum so much...
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 17 Nov 2012, 08:11

Re: AI city planner

Obviously, maps in Knights and Merchants are much, much more complicated then in Age of Kings. Still, Age of Kings used text files that had code describing the layout of resources and terrain for a map. If the Remake did something like this, it would probably have to work like a jigsaw puzzle. It would randomly take "pieces" of terrain that have already been created. It would then put all these pieces together to make a starting location, which would then be mirrored across the map so each play's location is (somewhat) balanced. Obviously (if this even is possible) this wouldn't look near as great as a hand-made map, but it still would be quite interesting.
Yes it would be possible, but even getting it to make quite ugly maps with no elevation would be a huge amount of work. And making it balance them would also be hard. I don't think it's worthwhile giving the amount of time it would take, and also the fact that we have over 120 official multiplayer maps, many of which have only been played a dozen times or so.

Return to “Feedback / Discussion”

Who is online

Users browsing this forum: Semrush [Bot] and 26 guests