Rule Simulator v0.8.94.0
Blah blah blah I just want to jump in: here if UI installed
Sample deployments:
What it does
This loads in card text at parses it at startup to determine effects. Custom or brand-new cards can work as long
as the parsing is effective.
Advantages
- Doesn't need cards individually implemented
- No proprietary cards embedded in source
- Browser-based so useable from mobile
- Can possibly understand new cards it's never seen before, if the syntax is clear. This means both brand new
cards and your custom cards.
- Just needs new verbs implemented
- Open source so you can take this and run it yourself
Shortcoming
- There's still lots of parsing and verbs left to implement
How functional is it?
Parsing and verb implementation are sufficient to get through recent starter decks
Medium-turn design goal is educational
- Precise scenarios can be created on board. Wonder what a set of cards can do? In theory this lets you run
through them all
- The ability to create situations lets one create challenges to give to others
- It's very easy to switch to the other player. Great for testing but also means competitive PvP isn't there
yet. (This isn't a fundamental design flaw; it just needs better session management.)
- The API is easy to control, so if you want to try training an AI you have an interface for that.
- There's a creative mode if you're comfortable with text
Not present
- Laddering, matchmaking, fancy UI
- A lot of parsing has yet to be imeplemented.
- Several verbs are left to do
- DNA evolving and Xros are not implemented at all
- Mulligan
Technical Details Below
API
The game state is sent with JSON that looks mostly like you would expect, each player having a region and each
region having the entitites within it listed.
A player nominally doesn't see private information intended for the other player only.
At all times the game will be expecting input from exactly one person (not necessarily the turn player). That
player will have their choices enumerated in a JSON object.
There are two ways of interacting:
- A synchronous POST to an endpoint with the next statement. Game logic will be executed and the next game
state returned. This method is less friendly but very batchable, essentiall for automated test cases.
- A websocket. Messages are similar except that asynchronous updates of game state and log messages will be
received as they are processed.
Known bugs
- "For each X" may not fire.
- Search is flaky, and may depend on you being honest in the cards you select
- When you "switch targets", when you have to switch you could choose to keep it the same
How to write a test case
An example test case is in tests/once-per-turn-2.in.
Indicate what card DB you're including. Writing custom cards for test cases is fine, and in many cases makes
testing easier if you can isolate weird effects.
Your test case and custom cards can be included.
Card database
The game will read cards in a few different formats, with more being added.
- Wiki text2html output. Samples are in the db/ directory.
- Two different JSON formats. Examples are in starters.json
Contributing / Technical Details
Card effects are parsed from text into a SolidEffect object. This object is then processed by the game
engine.
Adding new effects will mostly just be getting the parsing to use already existing verbs. In some cases new
verbs
may be needed but the verbs are very low-level so this really won't be needed very much.
Other high-value contributions are:
- user interfaces. There's one UI project already but the API is clean enough that totally different UIs
can
be dropped in
- custom cards
- understanding Azure, like why does it sometimes take 4 minutes to serve a static file
- writing fun scenarios
- testing things that are already implemented, particularly in weird ways
- card parser to read text
- writing test cases
- implementing verbs
Other stuff
Design decisions you may or may not notice
- You are prompted to activate an event where the cost can't be paid. For example, suspending Matt to
gain
a
memory, even if Matt is already suspended. This should be changed to not being able to choose at
all,
although right now it's helping to test the tried-to-pay-the-cost-but-failed logic.
- You can also choose effects that have used up their once-per-turn, but the effect immediately fails.
These
shouldn't even trigger but the effect on gameplay is nil
- The game gives away if your opponent could choose to blast digivolve. It's easy to make it
just
always pause. Maybe I'll do that.
- There is a similar issue for any effect that might play from hand.
- If an effect has 0 or 1 targets, the game will autochoose and continue. This was a design choice and
it
might be wrong if people want to notice what's going on.
- Something that chooses a target when there's only one acts the same as something that has a forced
target (think Matt suspending itself). This is probably confusing and should be remdeiated.
Your option card is in the trash immediately after activation. It should actually hang around
null
space
until it's done.
- Retaliation might activate on mutual battle death. It won't do anything, you won't notice unless you
watch closely. But it shouldn't activate at all, per rulings
- 'Choose up to' for devolve asks even if your only choice has 1 or less cards to be devolved. Is
there any effect that could possibly interrupt here? If not, this is a good quality-of-life fix.
- If you have 2 separate <Security A +1> effects, it will show as <Security A +2> although
the
rules dictate it's not SA+2, it's specifically two SA+1's.
- If you're on phone the logs are probably not visible because they're on the right. Landscape will
show
them
but you'll end up scrolling a lot.
What's next?
We need feedback on what should be worked on. Like, do you want..
- bugs fixed in current cards?
- more cards implemented?
- text showing which explicit effect is being activated (not just the mon doing it)?
make sure cards that can't trigger aren't even put into the trigger list? Maybe everything that
triggers should trigger, if we need cleanup it takes place later.
- fewer extraneous popup messages?
- more descriptive text during game play?
- auto-skipping non-activatable effects?
- make logging on mobile be better
- YOLO and dump in all the cards in the game to see what happens?
- better creative mode without needing to write text?
- write your own cards?