Card game - mini game - for NWN2 - how to do it?

I found this. Seems that according to this blog that this is public domain, but I don’t know:

What do you make of it?

1 Like

Flemish deck is not bad. And since it’s at the Metro in NY there’d very probly be no issues with using it … especially if you included a note in your ReadMe that says what it is and where it’s from.*

perhaps try “fantasy playing cards” then add “free” or “public domain” or smthg

 
* admission of guilt can be taken either way by the owner

1 Like

I’ve searched for a while now, but everything that looks pretty good is not for free sadly.
Maybe one should go with Flemish Deck. According to Bona Ludo at least the picture is public domain, and I highly doubt anyone associated with the museum would download my module.

@kevL_s

To accommodate more randomness, you could spread an entire 52 card deck over two alphabets (a-z), I suppose. Then do a check to ensure a card was still correctly drawn if one string checked was empty. That would avoid any potential eternal loop. However, that is for complete random drawing. If, like in Blackjack, you are simply taking the next card from the top, you could simply go down a step at a time and always get a random card after the first shuffle.

And there was I was trying to avoid thinking about this too much, but it is interesting :wink:

In case the logic above did not make much sense, here is the concept …

Two alphabet strings … “abcdefghijklmnopqrstuvwxyz”, with a card allocated to each letter … So you need two alphabet strings for a complete deck. Now randomise the order of the alphabet strings and then start picking the letters off one by one from the top and translating them back to cards. The only point to recognise is that the first encountered letter (being the same as the second encountered letter in the second group), needs to be distinguished.

Now you can draw a new card every time, randomised after a first shuffle only … Or, you can add a shuffle routine for all remaining cards if you wanted to.

@andgalf

I like those Flemish cards! Now you have me thinking … :wink:

@Lance_Botelle - If you get inspired and manage to somehow edit those xml files already in place for card-game-persistent-worlds for a “two rows of 5 cards” Black Jack game, with the PC against an NPC, let me know. :wink:

The wood background in the card-game-persistent-worlds already looks nice and all, I think.

@kevL_s - I really like the look of your scripts. They seem quite simple to follow, considering the complexity of it all. I would never have been able to come up/write something like that.

@andgalf

Yes, I would do that if I get around to it … and I would ask the same of you if you decide to try to put some XML together too. As you know, its often a lot of trial and error to get the look right with XML, but I reckon both of us could eventually get something that looks reasonable.

I may take a look at this sooner than later, just because it’s a “mountain” that looks like an interesting walk.

I’ll download and take a closer look at the first file only …

3 Likes

I have been able to edit already finished xml files, but to create something like this from scratch when you are to show different cards at different times. Gaah! That seems way too hard for me. I mean, the card-game-persistent-worlds is totally different from Black Jack, and since I couldn’t even view it ingame to get a feel for how it works…well…I could maybe try and look at the xml files and script files again and get totally confused, I guess. If I had some framework to go by, something that was quite similar to what we’re trying to achieve here, I think I could manage by doing a lot of trial and error.

kevL_s scripts are a great start however.

Thank you guys for putting time looking into this! I was prepared to give this up completely. Now…it seems that it may be achievable…I don’t know.

EDIT: I guess what I could do is take the picture of the Flemish cards and cut them into separate cards for us to use. That is a simple enough task for me, I believe. :smile:

This is what I mean … Forgive the rough edit, but it shows what I think you need … It may vary a bit nearer the end, like a side deck to click on, but these would be the places the cards appear when drawn.

We would also need a “STICK” button.

I think we could probably adapt the XML to our needs … I’ll take a look too.

1 Like

Yep, something like this would be great.

EDIT: I’m about to make lunch now, but after I’ve eaten I’ll get right into cutting cards.

1 Like

@andgalf

I note that the author of this card game kindly gave me credit for the GUI info he used … that was a pleasant surprise.

I need to spend some time going over the code to see what does what, and then see if it is something that can be adapted. (I think it can be very much streamlined for our own needs here.) Also, @kevL_s may well have put together another version of a script, so I don’t want to double the work if he has already revised his initial work. Although, for my own understanding, I would need to consider the alphabet approach, just because that’s how I figure it in my head. :sweat_smile: I will focus on just the XML layout for now.

EDIT: OK, I now have the basic GUI in game to start editing … @andgalf I will need all the cards from the Flemish set “cut” into individual card images. I am considering keeping the rounded shape to them to add a little “fantasy difference” look. Therefore, each card would need to have an “alpha” background around its rounded format within the rectangle. (I’ll see if I can do one as an example.)

Here is the sort of thing, but I will see how it looks in game, as I hope to make the surrounding black transparent when on the table. NB: All cards need to fit one size rectangle, so I would copy and paste the round image over the existing original and resave.

image

Oh…I’ve already made the first set for the first “color”. I thoought it looked ok. I hope I don’t have to redo all this. Here’s a file:

https://drive.google.com/file/d/1MwRa-Dd25U51IflefpZQmFQ-8v6jV0BC/view?usp=sharing

I don’t have an alpha background to them since I don’t know how to do stuff like that in Gimp. As I said, I still hope this is ok.

EDIT: Every card is 280x550.

1 Like

@andgalf

They look fine to me! :slight_smile:

That’s the important bit, that they are all the same size.

I’ll use what you upload for me. Let me know when you have them all.

Ok. As I said, they don’t have an alpha background.

I’ll continue with the rest then.

EDIT: I called the first set “diamonds” even if it’s different with hearts and spades and whatnot in this old card set.

I think “black” may do that anyway, but if not, I’ll look at it later.

Maybe we can call them by the actual image … “Horns” … even that sounds a little more “fantasy”. Now just to decide what the other objects displayed are.

Latest … Here is the first card drawn for the player, based on 1 of Horns. NB: I am not sure whether to leave the frames as a ref for the player to potentially “fill”, or remove them completely and just say in the rules they can have up to five cards.

Slightly bigger cards …

Here are all the cards now. You can rename them as you wish:

https://drive.google.com/file/d/139kpq9zsIoXsxiGb4dqI6fkkePxHxaxk/view?usp=sharing

EDIT: You don’t think it would look better with the black behind the cards? I’m not sure myself, but have you checked both variations?

EDIT2: I need to go and take a walk now before I go to sleep in front of the computer. Be back in a bit.

@andgalf

Thanks … Now can you start thinking of the aesthetics you may like to have … or “options” … Like do you want to be able to rename the suits?

Eg: I intend to place a “DECK” on the left from which the player clicks on until they either have what they want and “STICK” or bust!

The more details (with any supporting images) that you give, the more I may be able to design around your “requirements”.

By default, I am going with suits … Horns (a), Chains (b), Tethers (c) and Nooses (d) then.

EDIT: I had to edit the size of one of your images (2 Tethers/Loops) … Can you double check if I missed any other potential image sizes?

Showing with and without “frame” … My preference is without the frame … feels more authentic.

I am probably going to move the “Operations feedback” to between the two sets of cards … New image coming soon.

FEEDBACK BAR MOVED.

I could find no mistakes regarding sizes of the pictures, but since these are tga files it’s a bit hard to check easily.

The name of the suits (is that what it’s called the different spades, hearts etc.?) is fine. You can choose the names. It doesn’t matter to me.

When it comes to aesthetics: I’m thinking, like you have in your picture above, 2 rows with 5 card slots. Then somewhere to the side perhaps the backside of a card (maybe one can use one of the images in the card-game-persistent-worlds) that you click on when you want a new card. Then somewhere a button where you click that you want to stick with what you’ve got.

Maybe the lower row should be the players cards and the upper the companions cards. I don’t remember in black jack if you see the other persons cards or not. I would bet that you don’t see them? Maybe for each card you want there’s another that is placed on the upper row until the companion sticks with what they’ve got.

Then maybe the game could be the best of three rounds?

I have no real strong opinions about this as long as it looks decent graphically.

EDIT: Maybe one should state the sum to the player of his current deck of cards, so that it is more obvious what he has? I’m still thinking that maybe the cards should have their black background to them. At least I would want to see what that looks like. It looks a bit odd at the moment with the round cards I think.

EDIT2: Maybe you could replace Player 2 in the picture with Companion? Maybe that’s something I can change myself even.

EDIT3: I think it looks quite good with the black “row” in the middle in your latest version of the picture.

EDIT4: Maybe we should have a new name for the game like “Black Knight” or “Black Bob” or something?

Yes, I am going to use a “blank” version of the style we have.

This is where things may get a little awkward, as the “rules” need to be clear before we script them. Also, I will have to assume only the player manually “twists” or “sticks”, and the companion will be the computer AI decision.

Sounds about right … With option to replace and shuffle cards in between rounds?

Yes, I hope to supply easy to read final score for the player too.

I am strictly writing for player vs an NPC (or companion) that the player is not yet controlling. i.e. This is not for two players but for one player and AI.

I suppose whatever it is named, I can set in a variable so the builder can choose what to call it. :slight_smile:

Ok. Sounds good.