• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Epicghost 505
      Hello,
      We are looking for people to be apart of a team, to help create a horror game we are looking for 3d modelers, coders, artist, animators, fx artist, level designers, and audio design, there will be a payment plan once release of game                                                                                                                                                                                                                                                                                              if your interested come join our discord                                                                                                                                                                                                                                                                         We hope to see you there
      https://discord.gg/6rcc6xr
      -Epicghost505
    • By wobbegong_
      I am taking an absolute beginner's game development course and we have just finished game jams in small groups. Our current assignment is to get feedback from people working in any aspect of game development. I would very much appreciate any feedback! The game is up on itchi.io (sound warning) https://wobbegong.itch.io/zombie-shooter It's essentially a very basic PvE.
      I also have some things I'm wondering about, but you don't necessarily have to answer these. 
      1. Do you have any tips on working with physics? My group wrestled a bit with Rigidbody physics not totally working the way we wanted to -- jumping ended up kind of floaty and inclines seem to mess up movement. Alternatively... how can I build terrains with depth that won't result in wonky physics?
      2. How can I keep up the level of challenge in an interesting way as the player progresses through the waves?
      3. What are some of your personal guidelines for creating title screens?
      Thank you very much in advance!
    • By Ty Typhoon
      ...if you got time to read and answer i would be happy . 
       
      So me and my co try to do a game.
      It should be in unity couse my co do everything in this engine.
       
      We got the rpg package from evila for inventor, but it only runs on pc right now.
       
      I like to make a online store for guns in the game and a multiplayer open world that runs on pc, android, mobile, ps4, xbox one. 
      Somebody told me that you "only" need to program it like so and that its possible in every engine...
       
      So if you are one of the lucky guys who could help me out or programm that, or even if you know a newer better package for maybe unreal which offers that - please let me know now.
    • By ethancodes
      I'm having a weird issue with detecting a collision. I've tried everything I could find online but nothing seems to work. I have a brick object. It has a 2D Collider attached and I have also attached a 2D Rigidbody on it. I also have an EndScreen 2D Collider. The EndScreen 2D collider is tagged with "EndScreen". I am trying to detect when a brick collides with the end screen collider and simply print "game over" in the console. 
      This is my current code for this part of the program, it is attached to the bricks:
      void OnCollisionEnter (Collision2D collision) { if (collision.gameObject.tag == "EndScreen") { Debug.Log("Game over"); } } Several things have happened depending on the set up. If I have the rigidbody 2D set as static, my ball object can still collide with the bricks, but I get no Log message. If I set it to Kinematic or Dynamic, I get absolutely no interaction between the ball and the bricks, and nothing when the bricks pass through the collider. I have tried to set the collider to a trigger and use OnTriggerEnter2D, no change. I have tried to put the rigidbody on the EndScreen object and tried to set it's body type to all 3 settings, no change. The only thing I can think of that I have not done is put the script on the EndScreen object and switch the tag to the bricks. The reason I have not done this is because I will have several types of bricks, some of which will have different tags. 
       
      Please tell me somebody can see what I'm doing wrong here, because I'm losing my mind over something I feel should be ridiculously simple. Thanks.
  • Advertisement
  • Advertisement

Behavior Pure Decision AI...best method to use

Recommended Posts

I'm building an American football simulation(think football manager), and am wondering about the best way of implementing AI based on various inputs which are weighted based on the personality of the NPC...I have a version of Raymond Cattell's16PF model built into the game to be able to use their various personality traits to help guide decisions.

I am going to use this extensively so I need this to be both flexible and able to handle many different scenarios.

For instance, a GM has to be able to decide whether he wants to resign a veteran player for big dollars or try and replace them through the draft. They need to be able to have a coherent system for not only making a decision in a vacuum as a single decision but also making a decision as part of a "plan" as to how to build the team...For instance it makes no sense for a GM to make decisions that don't align with each other in terms of the big picture. I want to be able to have the decisions take in a wide range of variables/personality traits to come up with a decision. 

 

There is no NPC per se...There isn't going to be any animations connected to this, no shooting, following, etc...just decisions which trigger actions. In a situation like a draft, there is one team "on the clock" and 31 other teams behind the scenes working on trying to decide if they want to try and trade up, trade down, etc which can change based on things like who just got picked, the drop off between the highest graded player at their position/group and the next highest graded player in that position/next group, if a player lasts past a certain point, etc...

There needs to be all of these things going on simultaneous for all the teams, obviously the team on the clock is goifn to have to decide whether it wants to make a pick or take any of the offers to move down in the draft from other teams that might want to move up, etc..

So I am planning on making use of something called Behavior Bricks by Padaone Games( bb.padaonegames.com )which is a Behavior Tree but in conversations with others who have worked on AI in major projects like this(EA sports) they said to combine this with a State Machine.

My question is would I be able to do this using just Behavior Bricks or would I need to build the state machine separately?  Is there something else already created for this type of purpose that I could take advantage of?

Edited by codeliftsleep

Share this post


Link to post
Share on other sites
Advertisement
29 minutes ago, IADaveMark said:

Ubiquitous answer for a starting point... 

http://intrinsicalgorithm.com/IAonAI/2012/11/ai-architectures-a-culinary-guide-gdmag-article/

Figure that everything you are going to be doing is weighing and scoring the relative value of different numerical inputs, biased by the personalities of the deciders. Straight up utility system is the way to go.

Awesome link, thanks!

How would I weigh immediate utility versus long term utility...ie, making a move that might make the team worse in the short run but will free up cap space and give them draft picks in return that they hope can make them better 2-3 years down the line?

 

Share this post


Link to post
Share on other sites

 

57 minutes ago, IADaveMark said:

Ubiquitous answer to all "how would I" questions...

If you were doing this in a pen-and-paper game or a board game, how would you make the decision?

Well, now that I think about it, probably I should do it the way real GMs do it...they evaluate the team against expectations at the end of the season and then make decisions as to what direction to take the team in.  I probably need to have a "Team State" which then would control the options the GM would consider while making decisions and would allow these decisions to align properly together...

Share this post


Link to post
Share on other sites

Coming at it from a different angle, there's the concept of 'discounted future rewards', which is a fancy way of saying "the chance of $1000 in a year's time is worth less than the same chance of $1000 today". You typically only want to make a sacrifice in the short term if the long term outcome is significantly better. So if you have some way to numerically measure (or, more likely, estimate) the quality or utility of a certain outcome, you will want to weight future outcomes less positively.

Share this post


Link to post
Share on other sites

Well that is not necessarily true for football. You have many things at play. Let's say you have a good player but you know he is going to demand top dollar and/or has told you he doesn't want to play there or won't resign there.

Will it make you better by trading this player today? No...but you will at least get some assets back in return instead of letting the player walk for nothing if you trade him now. There is no guarantee you will even get fair value(most times you won't) but something is better than nothing.

Sometimes a good player doesn't fit a scheme for a new coach/GM. He is a good player but not in this scheme. Trading him doesn't necessarily make you better short term, but if he can't do what you ask him to well there isn't much reason to keep him.

Maybe the player clashes with the new coach or GM, and he is going to be a problem...

There are also salary cap related decisions...You can't pay all your good players because you only have limited resources to spend or you end up screwing yourself over really badly for future years...For instance...a very good player wants to be paid like a Top 5 player in the league, but his true value isn't worth that...do you bite the bullet and overpay him or let some other team overpay him? Do you resign an aging vet with 1 more good year left to a 4 year contract knowing you are going to probably replace him with a younger cheaper player before the contract is over, and unless you can negotiate a low $ guaranteed money contract, are going to have a bunch of dead cap money floating around in future years or simply replace him now with a rookie who might not be as good this year but is a lot cheaper and who you expect can fill his shoes by year 2?

There are a myriad of reasons why a team will be willing to let a player walk in FA, not resign an FA, or trade a player for future picks and many times they KNOW they aren't getting fair value back, but do it anyway.

Football  reasoning/decision making is far more complex than these simple utility methods that work in shooter games because there are no guarantees you will be able to get more future value but you also have to be mindful of salary cap restrictions in the meantime and many other variables that come into play.

 

 

Edited by codeliftsleep

Share this post


Link to post
Share on other sites

Suggesting that the economic and strategic decision-making in football is different than the decision process used in FPS games is... uh... fairly obvious? I would suggest that it hardly bears mentioning. However, comparing it to something like a TBS game like Civ is more accurate and has plenty of overlap in the mentality and methodology. And yes, Civ-style games are almost entirely utility-based (i.e. mathematical modeling of decisions).

As for uncertainty of the payback, it's pretty easy to apply an estimated success rate of payoffs and multiply the payoff amount by that. e.g. I have a 75% chance of this panning out and if it does, I will net $1000 worth of value. Otherwise, it may be $200 worth of value. So what's your average payoff given those factors? That's why it is called "maximization of expected utility".

I know a book you can read that covers mathematical modeling of behavior in game AI. Can't think of the title right now, though...

Share this post


Link to post
Share on other sites

Replying to the original poster:

I think you misunderstood me. Pretty much any reward, when postponed to the future, has to be somewhat discounted, because it is not as good as the same reward received today. Things can change between now and the future which make the same reward less useful. So that's just an abstract way of weighing "immediate vs long term" utility, which is what was mentioned above.

In your specific example directly above you're actually comparing 2 quite different outcomes, and it's reasonable for them to be scored differently.

Everything you mention can be modelled with a utility-based system. I don't think a behaviour tree system is a good fit for this sort of problem at all, especially not when you want to factor in the personality scores. Behaviour trees are good for situations when there are is a clear hierarchy of prioritised choices and real-time tasks to be performed based on those choices.

A reasonable approach would be to try and model the outcomes from an 'average' point of view, and then to apply different weightings based on the personality factors you mention. For example, when you say "Will it make you better by trading this player today? No...but you will at least get some assets back in return" - you'd model the estimated benefit of those assets, and they would be compared to the estimated benefits of keeping the player. Those estimates can vary based on the personality of the person doing the assessment.

If you need to perform multiple decisions as part of an overall plan, there are a couple of approaches you'll want to consider:

  • actual planners - they are algorithms that run through various permutations of actions and work out which ones to do, and in which order. They usually assume there is a clear definition of success however, which you are unlikely to have.
  • state-space search (such as A*) - these algorithms are similar to planners but try to find the best route through 'state space'; again, this is usually about trying different hypothetical actions and measuring the expected outcomes.

 

Share this post


Link to post
Share on other sites

Well, one of the reasons I brought up state machines combined with Behavior Trees was from a response I got on here from a guy who worked with EA Sports designing AI for NCAA Football among other things, but I have quite a few questions regarding implementation that I'd need to understand before going down a route like that...plus as with anything dealing with programming there are almost always multiple ways to achieve the same end result so I thought I'd get other opinions and see which one would make more sense to me...

https://www.quora.com/What-is-the-best-option-for-a-Pure-Decision-AI-in-Unity

 

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


  • Advertisement