AI Project Help

This isn’t mine, it’s SPE33’s.

2 Likes

ofc I meant that your reply would help a lot to debug this

4 Likes

@Stylishpoopemoji33 - here’s some things I found:

  • I don’t think the problem is with the AI, I think it has to do with how the player picks a card. Where do you store that code?

  • I actually found more bugs than fixes:

    • Sometimes the computer picks forever. This would have to do with Turn being set to 2 repeatedly.
    • Sometimes the computer gets the card wrong, such as a glowing reverse.
    • There was also this, happened completely on accident:

I like this computer.

I’ll look into the code a bit more.
@Stylishpoopemoji33

4 Likes

That’s not added yet.

2 Likes

The card code is under the item titled “Person’s Card’s Circle Graphics”.

Any idea how to fix any of those bugs?

What do you mean “I like this computer”?

Thanks!

2 Likes

I’m not gonna have any WiFi until Sunday, but I’ll be back then.

2 Likes

-1 is supreme.

2 Likes

By that you mean +2?

3 Likes

Your making Uno? That is one of the things I wanted to make at some point but could never figure out.

If you have time could you @ me in the GDT with an explanation of how you make the cards?

But anyway, what code do you use for it to play cards? What is going wrong? I suspect you have a problem in how you calculate the proper card to play.

4 Likes

Yeah.

Sure! I can’t now, but on Sunday I will.

If you read the above posts, it may give you an idea. I don’t have time right now to tell you, but I can tell you on Sunday if the above posts don’t clear it up.

2 Likes

I suspect that it is failing to change c_n or c_c to -1 which causes it to match the current card.

2 Likes

hmm…

1 Like

@anon19563795 Found anything?

1 Like

Not yet, almost done looking.

1 Like

@Petrichor Can you help?

1 Like

Big reply coming…

I took a look at it a bit ago, I didn’t have enough time to find the problem, but I did notice that you have two variables for each card. You could have more cards and less code to check the codes (and less code is often better) if you used an object as a list of cards, where each clone represents a card. I’d also recommend making the ai seem to every other object to be a second human player with full controls, so that the only ai specific code is in choosing what to do, not in responding to what the ai wants.
For example, when the ai plays a card, have it tell some other object which exists only to play cards to play the card for it. This object will remove it from the list of ai cards and add it to the current card pile. The player controls would tell the same object to do it, and the object would not be able to tell the difference between the ai and an actual player, and it doesn’t need to because to it, they are identical.

If you do this it will make your code more organized and easier to fix, as well as easier to customize the players (2 players? 2 ais? More than 2 players? If you do it right, that wouldn’t be too hard to make)

The main way this relates to the problem you are having is it takes a card from being something that is different but similar for every card in the game to being something that is basically the same but with different values for a few variables. It also reduces the check once ifs needed, which is definitely a plus.

6 Likes

It could be you are setting c1c/c1n back from -1 without realizing it. Or any of the other variables, just c1 is what I saw first.
Edit: Although I think that they are only set in the when game starts so that is probably not it.

3 Likes

What is an Al?

3 Likes

Artificial Intelligence
Wikipedia

2 Likes