[Community Puzzle] Legends of Code & Magic: Constructed

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @aCat,validated by @MonkeyFeathers and @field3.
If you have any issues, feel free to ping them.

1 Like

LOCM: Constructed is a competition for the IEEE COG conference.

Winning prize for the first place is 500 USD.
Submission deadline: 1st August 2022, 23:59 GMT

More info at the competition webpage: Strategy Card Game AI Competition - COG 2021

Every CodinGamer welcomed :-).

1 Like

Ok, Iā€™ve been seeing player 0 (me) have 2 consecutive turns where the playerMana is the same. Which should only happen to player 1 when they use all their mana. Now I get itā€™s tricky with how actions are performed and data is displayed, etc. In one part of your code you use currentplayer=(cp+1)%2; and another you use cp=1-cp; which is fineā€¦ but I think all instances of Gamer are setting the bonusManaTurns=1 because it was last called with player 1. So I think you are missing a ā€˜this.ā€™ on line 44 of Gamer.java And the handlimit is always 8 because the const for the second player max card bonus is 0. But if it was enabled, it would do the same thingā€¦both player would have 9 instead of 8. Player 1 is getting the extra card, so it looks fine as-is. When I switch my bot to player 1, the mana goes up correctly as if i was player 0. But itā€™s basically when either player uses all their mana, they normalize. Let me know if Iā€™m wrong, but I donā€™t think each instance of player[] has their own bonusmana.

1 Like

Ok, hello again. I canā€™t resolve the card count summary next to the graphic to what I actually picked. So Iā€™m guessing that the counter array for creatures,red,grn,blue is looking at the wrong cardcollector or using the wrong index. So thereā€™s 3 ids for every cardā€¦like where they come from (out of 160), then the ā€˜chosenā€™ 120, and finally the deck uid. So i couldnā€™t resolve the Player ### chose cards: and Iā€™m guessing they might be showing the baseids? So, okā€¦I pick a card it is definitely a Shadowbiterā€¦base id of 54, but then it shows up as a 15 w/ a uid of 1 , but the original PICK 109 ; is what I used to get it. Thatā€™s like 4 ids? I mean I only care about the last one. But the card type counter has got to be showing the wrong counts. Am i wrong, again? refer to Strategy-Card-Game-AI-Competition/ConstructPhase.java at 092d99f38a62dec4d8f68dce74d6bf1c0eb560b5 Ā· acatai/Strategy-Card-Game-AI-Competition Ā· GitHub Iā€™m guessing line 113 is using choice.baseid ā€¦ but something is getting screwed up. I choose 20 creatures ā€¦ looks like i get themā€¦but the graphic text shows 16 ā€¦ or something differentā€¦every time. So I think a choice.id is being confused with a c.baseid., the mana curve looks correct, but the chosen types have got to be looking at the wrong c.type in whatever collector. i donā€™t know how itā€™s possible ā€¦ it seems to be giving me the right deck.

aCat thanksā€¦I should have been using CHOOSE id instead of PICKā€¦I was trying to PICK id. Which pick is PICK nb. my bad.

changeMana
this.mana = this.mana * prop.getMultCost() - prop.getAddCost();

is it really meant to work like this, improved cards having even lowered manacost with the usual multcost=1 and addcost=1 in cardweights.json? (or am i missing something)

Yes, itā€™s correct. We save actual cost as ā€œmanaā€ in dictionaty ā€œpropertiesā€, and our budget in field ā€œmanaā€. Then we use field as budget to spend on different properties, and reminder is used as base for attack and defense. Final cost to construct card is taken from ā€œpropertiesā€, not from field.
But I must admit that names could have been chosen better.