Pyra Magic the Gathering Deckbuilder and AI Decktester


rohezal

Advanced Member
Joined
Oct 18, 2009
Messages
1,712
I wrote a magic the gathering deckbuilder and a deck tester. You can play against a (stupid) ai, create your own decks, print proxies and filter by color, type, string, not string and rule set (commander, modern, etc). It is opensource but yet unreleased. I could use beta tester, bug hunter for a nasty deck builder bug and maybe co developers for replacing the AI with network code for team play.

Is there interest in this software from the pyra community?

It is written in pure qt/c++/qml and has only qt as dependency.
 

Attachments

  • Bildschirmfoto von 2022-01-29 13-04-28.png
    Bildschirmfoto von 2022-01-29 13-04-28.png
    626.3 KB · Views: 219
  • Bildschirmfoto von 2022-01-29 13-02-48.png
    Bildschirmfoto von 2022-01-29 13-02-48.png
    330.3 KB · Views: 210
Last edited:
Here are the files. Thank you for testing :). I could realy need someone who can design UIs. I won't be able to look in this thread until monday.

Instructions are: build the project files with qtcreator. Just open the project file of each zipfile. It needs qt5 and wifi (to download card images).
testproject: Deckbuild
qml-master: Decktest

I don't have a pyra and my pandora broke (in a rain storm in brazil, while i was crashing on a couch of a lesbian english teacher whose girl friend had cheated).
So I could not test if it works on a tiny screen. It is optimized for full hd, so you might have to use a HMDI cabel for this beta version (does hdmi output work for pyras yet?).

Controlls:
Left click: play card, tap card (on field)
Shift Left click: return card to your hand
Right click: discard card
Middle Mouse Button: Put card to library

GR Button: means group automaticly
Sort: Sort by name
Type: Sort by type

After building:
unpack cards.7z into the build directory of testproject.

Create a deck for you.
Create a deck for the ai and call it exactly: aigobo.deck

Start the deckbuilder from qtcreator or via:
cd ~/projects/build-cute_magic-Desktop-Debug/; ./cute_magic

Start the Decktester with:

~/projects/magicnet/build-magicnet-Desktop-Debug/magicnet ~/build-cute_magic-Desktop-Debug/name_of_your.deck

Optional:
If you want to start the deck tester from the deck builder change the path in:

void MainWindow::testDeck()
{
system(( QString("/home/rohezal/projects/magicnet/build-magicnet-Desktop-Debug/magicnet ") + lastLoadedDeck + " &").toStdString().c_str());
}

to the path of your decktester build
Post automatically merged:

If you want to use premade decks, you can use my decks:
 

Attachments

  • qml-master.zip
    53.5 KB · Views: 197
  • testproject-master.zip
    8.3 MB · Views: 200
  • decks.zip
    17.2 KB · Views: 205
Last edited:
  • Like
Reactions: rSl
Okay, I've finally found the time now to install qtcreator. Building it was pretty straightforward, and having built it I'm able to run it. Unfortunately, running it gives me a window that's far too wide for my screen, and the following is spat out on my terminal:
Code:
Couldn't open save file.
Cards which should be displayed:  0
"No such file or directory"
cd /home/rohezal/projects/magicnet/build-magicnet-Desktop-Debug; ./magicnet `pwd`/ &
sh: line 1: /home/rohezal/projects/magicnet/build-magicnet-Desktop-Debug/magicnet: No such file or directory
Couldn't open save file.
Cards which should be displayed:  0
Seems you have some paths hardcoded in there.
 
Okay, I've finally found the time now to install qtcreator. Building it was pretty straightforward, and having built it I'm able to run it. Unfortunately, running it gives me a window that's far too wide for my screen, and the following is spat out on my terminal:
Code:
Couldn't open save file.
Cards which should be displayed:  0
"No such file or directory"
cd /home/rohezal/projects/magicnet/build-magicnet-Desktop-Debug; ./magicnet `pwd`/ &
sh: line 1: /home/rohezal/projects/magicnet/build-magicnet-Desktop-Debug/magicnet: No such file or directory
Couldn't open save file.
Cards which should be displayed:  0
Seems you have some paths hardcoded in there.
Thank you for testing. I was afraid the window was to big for the Pyra. The line appears if you want to start the deck tester from the deck builder.

Optional:
If you want to start the deck tester from the deck builder change the path in:

void MainWindow::testDeck()
{
system(( QString("/home/rohezal/projects/magicnet/build-magicnet-Desktop-Debug/magicnet ") + lastLoadedDeck + " &").toStdString().c_str());
}

Alternatively you can start the decktester (magicnet) via

./magicnet PATH/TO/YOUR/DECK


For the size of the screen, I have to come up with something. Is someone good with QT Guis in the board? It should stretch depending on the resulotion of the screen. Maybe even change from a one row layout to a two row layout.

Can you post a screenshot how it looks like on the Pyra?
 
I don't have a Pyra, but I'm testing this on my eeePC which has a slighly lower resolution than the Pyra does, (1024x600 versus 1280x720).

I had previously unpackaged and built testproject-master since that looked the more promising name, however that builds a project called cute_magic. Qml_master builds magicnet, but that doesn't run for me, and debugging in qtcreator leaves with a debugger exits code 377.

But in any case, cute_magic looks like this:
 

Attachments

  • Untitled.jpeg
    Untitled.jpeg
    30 KB · Views: 171
Cutemagic is a deck the building software. You need to download cards.7z and unpack it into the build directory of the cute_magic
Magicnet is the decktester. It needs as first argument the path and name of the player deck. It uses for the AI aigobo.deck, which needs to be in the same folder as the player deck. You download premade decks from the post. Sorry for making it so hard to install and test.

./magicnet /path/to/playerdeck.deck
 
Code:
build-magicnet-Desktop-Debug 06:33$ ./magicnet ../build-cute_magic-Desktop-Debug/big_commander.deck 
QML debugging is enabled. Only use this in a safe environment.
argv[0]  ./magicnet  | argv[1]  ../build-cute_magic-Desktop-Debug/big_commander.deck
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
After that point it appeared to stall, using no appreciable cpu, so I ended up SIGQUITting it.

Edit: It did populate the folder with lots of *.cache files, so it is doing something.
 
I was able to replicate this. Looks like a strange caching bug behaviour. Can you try to start it a few time? This is something I need to fix in the future. And thank you a lot for debugging.
 
This latest time when starting it, it worked as before but with the following message on the end:
Code:
QQmlApplicationEngine failed to load component
qrc:/main.qml:5:1: module "QtMultimedia" is not installed
I think that means it got futher, but fell over because my qt install is not complete enough.

Okay, I've installed that package, and now it presents a window. I've little idea what I'm doing, and the window is only about twice as wide as my screen this time round. But I can make it display cards, and I got a lot of these errors while playing with it:
Code:
qrc:/main.qml:402: TypeError: Cannot read property 'width' of null
 
Thank you for testing, the QtMultimedia will be added to a readme. I will have a look with the type error.

Controlls:

Hand:
Left mouse button: play card
Right: discard card
Middle: put card into library

Field:
Left: tap card
Right: send card to graveyard
Middle: send card to library

The problem with the window size sounds bad. Looks like I need an UI guy to help with a resolution indendend interface. Thank you for testing :).
 
Back
Top