Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Managment ai: an epic tale  (Read 1499 times)

lucusLoC

  • Bay Watcher
    • View Profile
Managment ai: an epic tale
« on: August 03, 2009, 07:48:53 pm »

IT IS FINISHED! (not really)

rough outline of management ai decision tree:

A. The initial prep work for a site

1. town/settlement
       
Spoiler (click to show/hide)



        2. Combat

   remember that combat ai does not have to actual be smart, it just has to fake it well enough to pass

a. siege site
      
Spoiler (click to show/hide)


b. military encampment
      
Spoiler (click to show/hide)
3. trade

a. trade camp
      
Spoiler (click to show/hide)

b. trade outpost
      
Spoiler (click to show/hide)
B. expansion

   1. town/settlement expansion

   town and settlement expansion will be largely based off what kind of settlement it is. is it a settlement formed by people fleeing overpopulated cities? is it founded to be a fortified outpost on a trade route? is it founded to claim and gather resources? a combination of the above or even something entirely different? each one of these scenarios will require its own tweaks to the management ai. i will try to list most of the basic types here. please expand on these.

      
Spoiler (click to show/hide)

      
Spoiler (click to show/hide)
      
Spoiler (click to show/hide)
2. military

   
Spoiler (click to show/hide)
3. trade

   
Spoiler (click to show/hide)



this whole spiel make several large assumptions about units in the future. on is that they will require food, of course. 2 is that each ai will have knowledge of its own units and resources, and be able to assign jobs that only its faction will be able to see. resource conflicts need to be solved in an intelligent way: does that stone in the middle of the field get blocked when one side assigns it to a job? or can both sides assign a job for it  and whoever gets their first wins? how does the other side deal with that if they are friendly or hostile?

also i know the format is horrid, i defined things as i needed them, so there is no real template to the outline. things ar nested funny. maybe i will clean it up later, but if someone wants to go and reorder it in a more logical way i wont complain :-)

i did a quick and dirty spell check, if there is anything that makes no sence quote it and i will correct it.

edited for readability, sort of. still looks horrid. . .

edit: link to unit ai thread: http://www.bay12games.com/forum/index.php?topic=41382.0
« Last Edit: September 03, 2009, 06:34:26 pm by lucusLoC »
Logged
Quantum dumps are proof of "memory" being a perfectly normal dimension in DF. ~Gazz

lucusLoC

  • Bay Watcher
    • View Profile
Re: Managment ai: an epic tale
« Reply #1 on: August 03, 2009, 09:13:05 pm »

reserved, in case that monstrosity gets longer.

and some relevant threads:


The formation of makeshift towns by invaders.
http://www.bay12games.com/forum/index.php?topic=39289.0

got me thinking about management ai, some useful discussion there.


another on of my horridly spelled and formatted threads, this one on building template storage:
http://www.bay12games.com/forum/index.php?topic=39304.0

add other relavent threads and ill post them here.
« Last Edit: August 03, 2009, 09:25:56 pm by lucusLoC »
Logged
Quantum dumps are proof of "memory" being a perfectly normal dimension in DF. ~Gazz

QuakeIV

  • Bay Watcher
  • Cant resist... must edit post.
    • View Profile
Re: Managment ai: an epic tale
« Reply #2 on: August 03, 2009, 10:54:26 pm »

There being so many ideas, i couldnt list all of them, but i can say i got the overview, and it seems awesome to me.

Im all for it.
Logged
GENERATION 9: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.
I wish my grass was emo, then it would cut itself.
Quote from: Jesus
Quote from: The Big Fat Carp
Jesus, you broke the site!
Sorry, Bro.
link to quote

lucusLoC

  • Bay Watcher
    • View Profile
Re: Managment ai: an epic tale
« Reply #3 on: August 05, 2009, 03:07:45 pm »

Was this a TLDR post? I know there is a lot of stuff in there, but it is a framework for a managment ai, so it is supposed to be detailed. I was hoping you guys could look it over and help flesh out more of the details, and then i can add them in. Anything that is too general or makes assumption about things is not going to do the computer any good. We need to get down to the nitty gritty. How does the computer decide where to place a building, for example. We dont need the actual code, but we can use the details as to how that code should be structured. The more we do the less Toady has too. If someone wants to do one subsection, and it works, i will post it up top.

Dont forget to read the other 2 posts mentioned above.

Edit: spelling and grammer that was so bad it hurt my eyes.
« Last Edit: August 05, 2009, 05:23:23 pm by lucusLoC »
Logged
Quantum dumps are proof of "memory" being a perfectly normal dimension in DF. ~Gazz

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: Managment ai: an epic tale
« Reply #4 on: August 05, 2009, 03:14:25 pm »

I missed this initially. Haven't had time to read it all yet, but when I do I'll post my thoughts. (Work is being busy today)
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: Managment ai: an epic tale
« Reply #5 on: August 05, 2009, 06:38:38 pm »

      a. siege site

         i. site location is easy, your enemy picked it for you.

         ii. the first buildings will most definitely be tents, followed by simple walls.

         iii. first building location will be a tricky thing to figure out, as it will be based off of local site map data. i think that it is obvious that the first few "Sieges" will be nothing more than raiding parties, which can be used to build up a general idea of the map. i rather like the idea of the computer watching traffic patterns on the map to get an idea where entrances are located. i would like to expand it to include "kill zones" that the manager will forbid, so that areas around towers will be pathed around instead of through. the problem with this is that it will take quite a few casualties for the manager to get an idea of where not to go, where not to build and where not to station troops. it also does nothing to prevent the ai from building around an obvious, but unoccupied tower (accessed from the underground perhaps, and used to wipe out the camp once it is set up), nor does it really help with unused choke points, such as a map perimeter wall that is never pathed out of save for caravans. i also do not know what to do about the artificial boundary created by the map edge. what about the case where that one guy flooded the entire edge of the map with magma? will a true siege in this scenario simply be impossible? should the map be expanded by one or more local squares during a siege, then shrink back down afterward?

         unfortunately building locations are going to have to be based heavily on pathing information. we can probably cheat a little and have the ai prefer to build away from things like built or smoothed walls, fortifications, ballista and catapults etc. and also prefer to fortify around roads and doors, but once those mechanics are identified they lend themselves easily to abuses. we will also have to teach the ai which constructions belong to it, which may be extremely simple, or extremely hard.

         iv. Resources are going to be primarily brought from off map, and will be composed mostly of finished goods. building materials like wood and stone will have to designated to be collected on site, and the ai should not designate in the "kill zone." the ai should also be able to identify the materials it has gathered, and be able to differentiate between its resources, stockpiles and structures from that of the current site owner. this will prevent such stupidity as queuing up jobs in hostile workshops. a mechanism for claiming unguarded resources and workshops could be implemented, but an easy way to do so escapes me.


Ok, now that I've had a chance to look at it, I've got an idea on how to deal with the issue of enemy fortifications and kill zones.

Provided that the game can figure out who made/owns what, I think this solution can work. The Ai should avoid camping within bow range of fortifications, and probably within ~10-20 squares of doors or other gates. To avoid the problem of players rigging the map with tons of useless fortifications, two things can be done.
    1) The AI can remember which fortifications have been used, and any which have not been used in a prior siege can be ignored. Yes, this allows the player to set up traps, but honestly that would probably work in real life, so I'm ok with that.
    2) Once Catapults can destroy constructions and fortifications, any lone structures can be pulverized as part of the pre-camp preparations. That'll make lone archer towers much less effective a defense, and a random fortification sitting around unused can just be smashed and ignored.


Overall, I like your thoughts. You've got a lot of good stuff there.
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

lucusLoC

  • Bay Watcher
    • View Profile
Re: Managment ai: an epic tale
« Reply #6 on: August 05, 2009, 07:22:28 pm »

updated in main post:


            a). based on previous scouting missions, choose a location x spaces away from used fortifications, doors and floodgates (used fortifications defined as fortifications that were occupied by ammunition of some sort, and used doors and floodgates defined as being pathed over). the computer should also prefer to set up on unguarded but heavily trafficked areas, to maximize the chance of blocking access to resources and caravans.

            b). when possible destroy surrounding unused fortifications, doors and floodgates. light siege equipment can be quickly set up for this, also see other threads regarding door/wall strength and damage.

               1). if destroyed buildings allow access to dorfs, attack, otherwise continue with camp set up.
Logged
Quantum dumps are proof of "memory" being a perfectly normal dimension in DF. ~Gazz

lucusLoC

  • Bay Watcher
    • View Profile
Re: Managment ai: an epic tale
« Reply #7 on: August 06, 2009, 08:32:24 pm »

should this post be broken down into smaller bits?
Logged
Quantum dumps are proof of "memory" being a perfectly normal dimension in DF. ~Gazz

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: Managment ai: an epic tale
« Reply #8 on: August 06, 2009, 09:22:57 pm »

Might make it easier. Maybe put each major section under spoiler tags?
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

lucusLoC

  • Bay Watcher
    • View Profile
Re: Managment ai: an epic tale
« Reply #9 on: August 11, 2009, 08:01:30 pm »

i kinda suck at formatting text, but hopefully this will make it easier to read.
Logged
Quantum dumps are proof of "memory" being a perfectly normal dimension in DF. ~Gazz