Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Kethis Celebes · Jun 21, 2010 at 05:43 AM · aigame-state-management

Regarding implementation details of MonteCarlo AI playout.

Hello, I am making a game similar to Final Fantasy Tactics (gameplay video, skip to 0:30). I asked around at gamedev.net and got some very helpful advice that has allowed me to decide on a good AI approach. One of my last posts in that thread is a detailed breakdown of how I plan to implement the AI and may be crucial in addressing my question.

My only concern now is how to do it in Unity. The AI, a Monte Carlo Tree Search, requires me to basically run semi-random potential moves until the game reaches a win/loss state (called a playout).

I would have to run thousands of playouts every time the AI considers what to do this turn. Ideally, I would simply call a function that 'remembers' the game state before the playouts. After the playout I would then call another function to restore the state for the next one, and so on. Once a move was chosen, I would restore the game state to how it was before the AI... with the obvious exception that the AI Game Object would now know what move it was going to make.

However, all the time the player is still looking at the board. So.. I dont want the player SEES to change while the AI is running its playout simulations.

How can I achieve this?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Khas · Jun 21, 2010 at 02:20 PM

I use Unity3D for running population based AI techniques, so I've faced a similar problem, but from the aspect of increasing efficiency whilst running experiments. There are two ways that you can do this: the first is as Tetrad mentioned above, where you abstract the game into something like the extensive form of the game and encode that mathematically, embed that game model into the control structure of the AI, and let it churn away itself (you'd obviously have to write an interpretation method from the move the AI chooses to make in the internal model to how that move is carried out in the actual game.)

The second option is to create a complete second copy of the game, but just turn rending on those game objects off. This could actually provide some good debugging information, as you can then just turn it on again to see what the AI is up to (this has proven invaluable for me in my experiments).

I chose the second method because the state of the game was held within Unity, I didn't have to model it myself. Less complication is better :-)

Hope that helps.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kethis Celebes · Jun 21, 2010 at 09:39 PM 0
Share

The second object is definitely what I want to do. Is there an easy way to create this second copy of the game, and an easy way to turn rendering off for them? How do you do it?

avatar image
0

Answer by Tetrad · Jun 21, 2010 at 07:00 AM

Well you don't have to actually run your simulation using the renderable objects in the world. Just have some internal structures that represent your game state, and when things need to change you just modify the pieces to do what you need them to do.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kethis Celebes · Jun 22, 2010 at 10:00 PM 0
Share

I know, but Game Objects make up some of the structure of my internal code. Id have to abstract all that away and that sounds painful, honestly.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

Unity AI FPS problem 0 Answers

Heatmap for tracking enemy threat. 0 Answers

Simple AI Question 1 Answer

Enemy to move out of way of player 1 Answer

Raycasting crashing Unity? 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges