hpdvs2

Formal name for a Weighted List AI

Recommended Posts

I remember seeing a name for this, but I can't find it anywhere now.

In one of my courses, I use a weighted list to decide the choices for an AI.

Basically, each AI class has 2 standard functions:  Value and Do.

[Value] returns a float, a percentage of how imperative it believes it is that it does this.  I.e. when your base is under attack, sending troops to defend returns a high value.

[Do] executes the AI.

Then an AI Manager gets the value for each AI choice, and chooses to do the one with the highest value.

I've seen a more formal name for this, but I don't recall what it was.

 

Share this post


Link to post
Share on other sites

Technically, when we talk about 'weighting' we usually mean some system that takes all the options into account, but factors the weights together to make a choice.

For example, if you could choose any of the options, but are more likely to choose the high-scoring ones, this is technically known as 'fitness proportional selection' or 'roulette wheel selection' in some circles, but is often just called 'weighted random': https://en.wikipedia.org/wiki/Fitness_proportionate_selection

But if you're just picking the highest-scoring option each time, that's not really a 'weight'. It's basically a score which yields a rank. The simple act of making a choice based on a score or ranking is known as a utility system, based on the game theory concept of utility as being an abstract score for how important or useful something is. Some utility systems will actually use roulette-wheel selection rather than just picking the top-scoring action.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Announcements

  • Forum Statistics

    • Total Topics
      628354
    • Total Posts
      2982236
  • Similar Content

    • By Madolite
      (Note to Mods: Could "Input" or "Peripherals" be a good Tag to add to the tag list? Just a thought.)

      Hey, I'm currently working on which keys on a keyboard that a user can rebind their actions to. The trick is that I use a Norwegian keyboard, so it's not obvious which keys correspond to the actual C#/XNA Keys enum values.

      Are there any keys from the XNA Keys enum that, in your opinion, I've neglected to add? I don't need all Keys to be bindable, only the "most commonly used keys on a keyboard". Thanks.
      https://pastebin.com/n1cz8Y0u
    • By aejt
      I recently started getting into graphics programming (2nd try, first try was many years ago) and I'm working on a 3d rendering engine which I hope to be able to make a 3D game with sooner or later. I have plenty of C++ experience, but not a lot when it comes to graphics, and while it's definitely going much better this time, I'm having trouble figuring out how assets are usually handled by engines.
      I'm not having trouble with handling the GPU resources, but more so with how the resources should be defined and used in the system (materials, models, etc).
      This is my plan now, I've implemented most of it except for the XML parts and factories and those are the ones I'm not sure of at all:
      I have these classes:
      For GPU resources:
      Geometry: holds and manages everything needed to render a geometry: VAO, VBO, EBO. Texture: holds and manages a texture which is loaded into the GPU. Shader: holds and manages a shader which is loaded into the GPU. For assets relying on GPU resources:
      Material: holds a shader resource, multiple texture resources, as well as uniform settings. Mesh: holds a geometry and a material. Model: holds multiple meshes, possibly in a tree structure to more easily support skinning later on? For handling GPU resources:
      ResourceCache<T>: T can be any resource loaded into the GPU. It owns these resources and only hands out handles to them on request (currently string identifiers are used when requesting handles, but all resources are stored in a vector and each handle only contains resource's index in that vector) Resource<T>: The handles given out from ResourceCache. The handles are reference counted and to get the underlying resource you simply deference like with pointers (*handle).  
      And my plan is to define everything into these XML documents to abstract away files:
      Resources.xml for ref-counted GPU resources (geometry, shaders, textures) Resources are assigned names/ids and resource files, and possibly some attributes (what vertex attributes does this geometry have? what vertex attributes does this shader expect? what uniforms does this shader use? and so on) Are reference counted using ResourceCache<T> Assets.xml for assets using the GPU resources (materials, meshes, models) Assets are not reference counted, but they hold handles to ref-counted resources. References the resources defined in Resources.xml by names/ids. The XMLs are loaded into some structure in memory which is then used for loading the resources/assets using factory classes:
      Factory classes for resources:
      For example, a texture factory could contain the texture definitions from the XML containing data about textures in the game, as well as a cache containing all loaded textures. This means it has mappings from each name/id to a file and when asked to load a texture with a name/id, it can look up its path and use a "BinaryLoader" to either load the file and create the resource directly, or asynchronously load the file's data into a queue which then can be read from later to create the resources synchronously in the GL context. These factories only return handles.
      Factory classes for assets:
      Much like for resources, these classes contain the definitions for the assets they can load. For example, with the definition the MaterialFactory will know which shader, textures and possibly uniform a certain material has, and with the help of TextureFactory and ShaderFactory, it can retrieve handles to the resources it needs (Shader + Textures), setup itself from XML data (uniform values), and return a created instance of requested material. These factories return actual instances, not handles (but the instances contain handles).
       
       
      Is this a good or commonly used approach? Is this going to bite me in the ass later on? Are there other more preferable approaches? Is this outside of the scope of a 3d renderer and should be on the engine side? I'd love to receive and kind of advice or suggestions!
      Thanks!
    • By deltaKshatriya
      Hey all,
      As some of you may know, I do have a Computer Science background, but either by chance/design/fate/insert stupid excuse here, I didn't take any graphics courses in my undergraduate degree, but now I'd be very interested in at least learning the basics of graphics and potentially pursuing more in graphics. I'm interested in all sorts of graphics in general, so everything from real-time engines to rendering engines like Arnold, Octane, etc. Can anyone point me in the right directions for books/tutorials?
      Thanks in advance!
      EDIT: Apologies in advance if I missed the proper channels for this as well
    • By ConsolaLarry
      After my first thread and some painful deleting AND some lengthy drive resizing, I now have Unity and Visual Studio Enterprise
      As the hype of me finally being able to make a game that I've always dreamed of faded away because of school schedule being a douchebag, I came to a painful realization that I basically don't know anything about Unity (making progress at least, with the tutorial, the rest....well....I don't have a credit card yet, and my age is 2^4 + 1 (don't wanna be too....public)) nor C# (hopefully dotnetcademy.net's C# course for complete beginners can somehow help me with this).
      At least I know what I am doing (I guess) with my game: 2D, Top down, Isometric, Pixel Art (because I'm on my own and I can't draw like an artist and I'm too broke), RPG with EXP, Class Advancement system and probably some sort of a seeding mechanism for randomized gameplay
      So, as a complete greenhorn stepping into the field with a completely wrong set of equipments, I'd love some advices from the pros and the experienced (all advices are welcomed OwO)/ ), esp to these questions:
      - Should I take on regular C# and then learn Unity C# or skip regular C# and straight to Unity C#?
      - Is pixel art really a way out for me on the visual part? Sprites, maps, items, effects, etc......
      - Is my idea okay? Is there anything I can add in or cross out?
      - Should I do this alone? Or should I get some accomplices? I'm not planning to rush it anyway.
       
      Thank you in advance. Sorry, no potato this time
  • Popular Now