LittleBigForum Archive
LittleBigForum
LittleBigPlanet 3
Brainstorm & Projects

artifical computer or AI

Archive: 5 posts
2015-03-16 23:29:00 / Author: samuasp
Working on a computer that players can vs in my card game i will try to uploads pictures Soon but was just wondering on any tips you guys may have i currently have these setups and conditions that need to be met when the computer runs a test here they are in order

1. Is it the computers turn? If true then activate step 2, if not then keep the system on standby ready for activation

2. Run through a two system setup to randomly select the first choice, 1. The computer will make a move 2. The computer will not make a move, end turn

3. Randomly flick through the cards in the hand and pick one after a certain time has passed. Once a card is selected run a test to check the conditions for summoning or casting can be met

4. Run a test to check that the computer has enough mana to use the card or if it is a spell card does it meet the conditions needed to use the card e.g does a creature card need to be discarded?

5. If it is a spell card and the computer has the correct conditions for thethe spell casting it however if it is a creature then check the feild started for a few feild for the correct weekend e.g. if it is a fire creature then check for a
Free fire feild if there is no Free feild then look for a feild that is not a watching feild however if there are only watching feilds availible then check the health of the card and make sure it wont die if it is summoned to the water feild if it will die then check for a new card to use

This is just a basic idea would be good to here feedback sorry for the grammer this sure does work properly on my phone (uses good choice on xperia z3)
2015-03-16 23:29:00
Author:
samuasp
Posts: 73

2015-03-16 23:30:00 / Author: samuasp
*google chrome
2015-03-16 23:30:00
Author:
samuasp
Posts: 73

2015-03-21 13:23:00 / Author: Ayneh
How a computer opponent makes a move in a game like chess is to iterate over every possible move and assign a score to it. The highest score wins.

For instance, the queen has a big score attached to her, so if the queen can be captured the program will select that move.

In reality chess programs look 30 moves ahead and stuff but that's the basic idea. You may be able to apply a similar scoring method to your game if you want the opponent to select the best move to make.
2015-03-21 13:23:00
Author:
Ayneh
Posts: 152

2015-03-22 03:15:00 / Author: Blacksackman
When I was working on a similar card game AI-opponent I used a tag name for every single condition. For example, when I played a 3-3 card with 3 attack and 3 health and the computer had a 3-4 already on the board it would receive the information from the card you played. I programmed the computer so that it knew the basics of math and the rules.

A signal went trough each options that were available and the computer quickly came to the conclusion that the 3-4 would survive if it attacked the 3-3. Attacking would be the best option. Things such as ending the turn or playing cards are more automated compared to the thinking part. To make things easier for the computer I gave the cards you played transmitters to send information about what the best possible move would be. This makes things a lot easier for the computer instead of letting it cycle trough every possible move available, as that would take a long time.
2015-03-22 03:15:00
Author:
Blacksackman
Posts: 84

2015-03-23 02:30:00 / Author: samuasp
thanks for the feedback guys. the computer will need to be able to detect the cards it currently has, the status of the feild and if it has any effects currently active against it or working for it such as the alujhan spellsheild which stops spells. i dont think a point system would work for this as for this game or if u would could you prehaps show me the setup for it ? little big planet 3 runs in 30fps so deducting this i can have 3 conditions checked using a sequencer set to 0.1 so for every stripe it passes it checks 3 diffrent conditions, this can be done by setting the sequencer to possitional, having a timer hooked up to it and as the timer increases the sequencer moves along once it detects a met condition it can resolve the effects of that condition and reset the timer to rerun the sequencer but the condition wont happen again because when a condition is activated it sets a counter to count up that is set to 1 so disabling that effect and to reset the counter there is a tag at the end of the sequencer. there are around 10 conditions that are checked during a players resolution which are 1. is there 5 createres on the board, if yes end game with a winner 2. check feild status, has any feild been quaked or exchanged, if yes resolve effects with the cards 3. are there any spells active, if yes what do they do 4. is a player in check (4 creatures on the board) if yes run the animation for check 5. is there 4 or more creatures on the board owned by either the player of the comp, if yes unlock the summoning lock 6. if there are less than 4 creatures, lock the summoning lock 7. are there any creatures with resolution effects such as mana gain, feild quake ect, if yes run the tests for these effects using the feild order number which goes from 1-9 as it is a 3x3 grid the top left being number 1 and the bottom right being 9 8. do any players need to discard any cards because they are over the limit ( maximum number of cards in your hand at the end of your turn is 7) so if there are any more force the player to discard cards of there own choice 9. has either player run of of cards in their libary if yes then end the game by a libary deafeat 10. set up for the next players move by reseting mana systems to 0, randomly select a card for them to draw, and reset all previous conditons to 0 so they are ready for the end of the next turn. all of this can be processed by lbp in around second as a condition value of true or false can be detected in around 0.1 of a second so for all 10 it can do in 1 second however if condtions are met it can take up to a maximum of 7 seconds as some of the conditions end the game so the system wont reach the end so this is a fairly fast computer setup in lbp however the logic for the creatures, the artwork and the battle animations still need to be done so it could take a while but i have managed to import around 20 cards in terms of artwork into the game and now just need to make them into 2d and 3d physical models, the 2d version being the one on the board that you see and the 3d version is what will attack as when n attack action is declared it moves to a battle scene showing the attack also need to have the partical effects for each of the spell cards and was thinking of using the layer glitch for the background as some of the 2d cards can be quite big such as the guardian watchtower which takes up around 13 layers so ill have the board at layer 16 then use the glitch to make the background behind it

sorry this is a long post and for the bad grammer in places been up all night doing university work and in much need of sleep so i thought id get this out to you lot before i went for a nap and give you guys time to take in this infomation and work on a solution or ideas for improving the design or logic setup

thanks, sam
2015-03-23 02:30:00
Author:
samuasp
Posts: 73
LittleBigForum Archive Statistics
Posts: 37945 • Threads: 4847 • Members: 3878  • Archive-Date: 2019-04-15

Datenschutz

Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.