How to balanced card game with scriptable cards?

So, I was making this super cool card game where there is a custom card, you can script it with some custom API, and I was thinking, how exactly would I balance this?

Given the fact that you can change the stats and effect of the card, you can make some pretty overpowered stuff right?

Well, in an effort to prevent this, I decided to add some alghorithm that could somehow read every line of custom code in this card and predict it’s effect’s usefulness, synergy with other cards, consistency to bring out, and stats to give me some kind of data that i could use to balance the card. At least with the stats that are easy to modify (Attack , health, stuff like that).

And before I got started with that I wanted to see if i could get some help on how to implement this.

Maybe you need to level up to be able to increase the cap of health and stuff?
You can level up by defeating AI (they get harder as you level up)
OR
Its like fallout
you put 5 into health
and 5 into damage
you have limited points to put into stuff

yeah, There is already a fixed stat cap, I meant what alghorithm could i use to determine the utility of a card’s effect.
Since most, if not all of the changes you can make to a card (power , health, cost, etc.) are handled by functions, I was thinking of using string.find(), but then that wouldn’t take conditions into account.
This is necessary so broken effects can be justified by awful stats / very high costs.

So far, this is what i have:

  • function on(TriggerNameString , ConditionFunction , FunctionToTrigger) runs code when the predefined trigger is activaded, if ConditionFunction returns true.

From this I made a list of properties and their associated cost, i.e (lowering a specific card’s power every time that card’s power is lowered is given a ridiculous cost, so players don’t use it with that specific trigger, this works but it is waay to time consuming and there must be a better, less intensive alternative

My idea is
instead of scripting, you use block codes
aka like scratch stuff
cause majority of roblox players are players, not developers
and they probaby dont know lua
so maybe an option to use block codes OR lua.
block codes would be easier to balance

1 Like

Good point, maybe structuring stuff that tway makes it easier to determine and balance automatically, thank you :pray:

1 Like

I feel like it’s not going to be possible to entirely balance or even make this type of game. Given that you let the player make their own cards with custom code (which not a lot of people are going to understand in the first place), you’re essentially removing all the creativity, flexibility and fun by limiting the choice in order to balance the game.

1 Like

Well, that seems to depend on me being able to identify what a player is doing with a card, the more i can identify about potential uses for cards, the more balanced the game would be, I can identify what each card does (i.e “Draw an extra card”).

I am having trouble determining potential synergies that would break the gamel (i.e “Whenever you draw a card, draw another card”).

Starting out with code blocks makes it easier for me, because is less variety in data management, but that doesn’t necessarily mean the game is simple, take this game for example:

At some point in the game, you unlock a little feature where you can make an “ai” with code blocks, it is pretty simple and yet people have used it to automate several time consuming parts of the game.

The point is, a system like that doesn’t mean it’s limited, or at least that the limits match our own in terms of creativity, so i should be able to make a simple enough system that is balanced enough to permit multiple strategies to succeed, I am only lacking an alghoritm to balance the cards.