Sunday, March 23, 2025

Nay Saga Devlog 12: Revisiting the Digital Game

I came back to the idea of the digital version of my game because I wanted to flesh out my itchio page and really make this playable online after I put all of this work into it.

So I started by revisiting the story. I wanted it to fit in with the new story I had for the board game so I changed some of it up a bit. I started by brainstorming ideas in a Google Doc and then started to split up Eventures into 5 so I could have a set amount per character/mode. I was splitting them up by how many new characters there would be. So there are about ~150-200 characters introduced into the deck for each one, which should give you a lot to start with for each of the following modes. I still have to figure out the overall story and how to fit it all in, but I do want to likely focus on getting the game playable before I even really get into the story of it all.


For saving out the images, I found out how to save them out of nanDECK as the character's name instead of a number so they're easier to sort through. I can also use that same code to save them as different sizes, which will be useful for the digital version of the game.


I took a little bit of a side track to create a Google Sheet program so that players can access a database to view the main stats about characters and it could pull everything from my existing spreadsheets. So you can click the drop-down menu and choose a character, then their information will populate. I haven’t added the images for the characters yet, but I have a couple. You can view it yourself here!


Then I started to plan out the layout of the screen for the digital version of the game. I took the size I had saved out from nanDECK to ensure they would fit on the screen. Some of them I had to resize a bit, so will have to do some resizing in RPG Maker when I’m actually laying things out. I also planned out the order you’ll click certain buttons or cards so I could think through how I’m going to program it.

I started to plan out everything I’ll need for the digital game from now until the end, and looking ahead, I’m not so sure I’ll have enough time to do it all. So it’ll have to be either pretty rough or I’ll have to scope down the original idea.

So then I hopped back into the digital game! It had been a long time since I looked at any of this, so I had to remember what I was doing with all of the code. Once I reoriented myself, I started to figure out how the hands would work for the other modes. I started with the Channel 6 Get Together (Mode 2), but most of what I was doing there would apply to the others. I started with 1 hand, then used the same knowledge to make 3 hands total (since it’s intended to be 3 players maximum). So I basically made an array for each of the hands, the deck, and the discard pile. It was a lot of loops and arrays.

I started in p5 as usual and then transferred these over to RPG Maker. After the initial arrays, I made the code for what happens when you draw a card from the face down deck. I realized the order would differ a little from my original thought and you’d have to draw a card before you could actually play a card. So I planned to have the card off to the side so it’s technically not added to your hand until you discard something. So I made this code in a way where you first have to check if there are any cards in the deck, and if not, it shuffles the discard pile into the deck. If there is, then it puts it off to the side.

Then I made the code for when you discard your card, after you’ve drawn one. This one required a lot of work with arrays. I had to slice the player’s hand so it would pull the card you’re discarding out into its own temporary array, then it adds the card you picked from the deck into the location you just discarded from using splicing. And finally, it pushes the discarded card to the top of the discard pile. So this was a lot of work with arrays, but I did it!

Then I started to organize the cards on the screen to match my initial sketch. I mostly just got the hand down at the bottom and then set up the onscreen text for the turn order on the left. I made icons for all of the characters and traits so they could be referenced in text as well. I made a system where when you hover over a card, it moves them slightly upwards and when you’re currently moused over, it turns them slightly lighter as well. They also are sent back down when you select a different card.

To show the correct icon next to the character’s name, I made some big if statements that basically just check if the current player’s name matches a string and then if it does, it sets the icon number that’s associated with the character. And then it shows this on the screen in the Extra Windows plugin.

From there, I created the code for what happens when the player clicks the selected card. Basically it stores all of the traits from the hand array into variables that indicate what the current selections are. This way, it can compare against the active card and do a specific action based on that. This feature will be needed for a lot of the game types, so I wanted to store this somewhere. It’s pretty standard and what I had done previously for hands and figuring out which image to show.

Then I made a lot of progress on the visual progression and game loop! I added clickable buttons where you confirm after each selection, and it prevents you from clicking anything else on the screen that you shouldn’t be able to on the active turn. When you select a card, it adds it to your hand on the side so you can choose which card to discard while comparing everything.

Though not entirely visible in the video above, I created a mechanic that if you go through all of the cards in the deck, it shuffles the discard pile into the deck so you can keep playing. It checks the length of the deck array, and if it’s empty, then it shuffles.

I also added the action text that appears when you hover over a card (and select it). It detects if there’s a type match-up and then prints the text based on that. It also detects if there’s no trait matches, and then otherwise states there are no actions.

Then I added the win conditions on if a player has one of all matching traits for the specific traits. And from there, I started to track turns. So the current player’s hand is stored in a new array and it can pull from that each turn.

I set up the CPUs to play against the player too (as you can see above). I used a lot of the same code as I had from Mode 1 for finding the most frequent variables. And from there, I would have them discard whichever card doesn’t have that value. They also choose between the active card or the deck depending on if the active card has the one they’re currently collecting.

Then I spent a lot of time working on the Type advantages. When you play a card that relates to the type of the active card, an action sometimes happens. I created an opponent’s hand that pops up when you have an action to take a card from their hand. I also created a system where it’ll determine which trait the CPU is collecting, and from there, it’ll search your hand for anything with that trait and take that card so it’s not just random which ones are swapped. And then I also made an action that reverses the playing order.

So I only have a couple more Type matchups to code and then Mode 2 will be done! This one ended up being fairly complex, but I’m happy with how it’s coming out. My goal for next time is to finish this mode and then maybe even start on the next mode! Or potentially some of the general menus. I only have about 2-3 more blog posts at most until the due date, so I’m hoping to wrap things up soon!

No comments:

Post a Comment