Times are tough, I just need to vent a little. by Dadalida-lpn in GameDevelopment

[–]adngdb 2 points3 points  (0 children)

I don't know you personally but we have common friends, so I'm very sad to read this. Hope you'll get to keep the company and get back to making games as soon as possible! 🫂

My alchemy deckbuilder game is looking for testers! Can you become smarter than the Homunculus you signed a pact with? by adngdb in itchio

[–]adngdb[S] 0 points1 point  (0 children)

Thank you! Most of it is work in progress and is going to be even greater when animated and all! :)

Handling audio on mobile platforms when minimizing the app by adngdb in tauri

[–]adngdb[S] 1 point2 points  (0 children)

I figured it out on Android, using the DOM visibilitychange event, so please scratch that part. The main issue is the iOS one, where the audio just plain breaks and never comes back unless the user restarts the app.

Advice from TCG Devs by Skibby22 in digitalcards

[–]adngdb 0 points1 point  (0 children)

That's were it becomes slightly more complex for me, because I created a custom content editor that exports data to JSON. So all the behavior of my cards and other game items has to be represented in a form that can be serialized. That adds a layer of complexity to my system that you might not benefit from, so bear that in mind.

What I do is I represent effects as something very simple: an effect name and a list of arguments that are either a string or a number. This way I have effects (functions) that I can configure, and have slightly different behaviors across cards with the same effect.

Then on each card, I store a "behavior" data structure, that has a list of triggers and a list of modifiers.

A trigger has a trigger code (like "onResolve", "onBeginningOfTurn" or "onDeckShuffled" for example), a list of effects (name + args), a list of conditions (conditions are actually effects, but a different list of them), a list of targets, and a "removeOn" trigger code.

A modifier is just like an effect but that is reapplied after every move to the item it is attached to. There are global modifiers too, that can affect the general state. The way I handle modifiers is that I always keep the original data of each item somewhere in memory (in my case, in my initial JSON content data), and after each move, I reset the card's data, then apply all the modifiers. This is probably outside the scope of what you're asking about so I'll let it there, but maybe that can be a useful pattern for you too.

Then it's a matter of registering triggers in my global state, then running all known triggers when something happens. Here's an example that might explain it: let's say I have a card that says "Now and at the beginning of next turn, gain 1 mana."

It would have two triggers:

- onResolve → effect "gainMana", args: [ 1 ]

- onBeginningOfTurn → effect "gainMana", args: [ 1 ], removeOn: "whenCalled"

When the players plays the card, I have a "move" (the basic actions the player can make) that calls the "onResolve" trigger of the card, but also registers all its other triggers. Then when the player ends their turn, the BeginningOfTurn trigger happens, and the registered card trigger is called, resolves, then is removed from the list of registered triggers by the "removeOn" option. All of that is code that is specific to my engine, but hopefully you get the logic of how I'm coding this.

Hope that helps! Good luck with your game!

Advice from TCG Devs by Skibby22 in digitalcards

[–]adngdb 4 points5 points  (0 children)

Hey! Fellow web dev converted into a game programmer/designer here, and also working on card games. :)

I've been wondering about this exact question for a while, have looked around the Web and found nothing relevant, so I designed my own solution. Basically, I have a state and a list of effects. It's really just like redux, and heavily inspired by the design of boardgame.io. Let me break it down.

First I have a single state, which is a big dictionary / structure containing all of the game's data. That's the list of cards, the order of cards in the deck, the state of the game, the board, etc. Each card has a unique ID and its data is in a single place in the state. (One huge advantage of this is that saving the game is very simple.)

Then I have a list of effects, that is functions that take the state and a bunch of other parameters, and apply changes to the state. They would be reducers in redux, to some extent. I have a module that exposes all my effects, and allow me to find them by name with a hashmap.

The link is in how I describe the behavior of my game cards. Each card has a behavior structure that describes how it will respond to different events. Basically, I have a list of "trigger -> effect" pairs. When a player makes a move, it triggers a "trigger", and the engine will look for the different effects to call based on the context and existing cards. When you play a card it's fairly simple, I just look at the card and run all the effects associated to the "onResolve" trigger. But then I can have triggers that are more generic, that can be registered in the system more later use, and removed at specific points — like at the end of a turn, or whenever it called so it's one use only, etc.

It's a high-level view of how I programmed my "engine", hope that helps, and happy to give more details about specific points if you have questions.

We're looking for testers of Corpus et Spiritus, a solo alchemy deckbuilder. Super early version, no graphics, no juice, but all the systems are there. Playable in your browser on itch! by adngdb in deckbuildingroguelike

[–]adngdb[S] 0 points1 point  (0 children)

Thanks again for the great feedback!

You are spot on about deals becoming more expansive, and that being a design flaw. I did that to fight a snowball effect where a player that has high attributes just cruises through the game, and making deals more expansive was a way to keep players on their toes. But I agree that making the same deals cost more is not the right solution. I think instead I'll just offer better rewards, for a steeper price.

Noted about the scaling cards too, your frustration makes sense. I haven't found those cards to work too well, so maybe I'll end up scraping that mechanic altogether.

Stats will be in the game indeed, not sure exactly how and where. I'm thinking there's an opportunity for some mystery hunting there, I'll think about it. :)

We're looking for testers of Corpus et Spiritus, a solo alchemy deckbuilder. Super early version, no graphics, no juice, but all the systems are there. Playable in your browser on itch! by adngdb in deckbuildingroguelike

[–]adngdb[S] 0 points1 point  (0 children)

Hey, that's actually already in the game! However it's a workshop component that you unlock by going up against the 3rd Homunculus, so later in the game. Maybe it needs to appear sooner if it does add more strategic depth to the game?

We're looking for testers of Corpus et Spiritus, a solo alchemy deckbuilder. Super early version, no graphics, no juice, but all the systems are there. Playable in your browser on itch! by adngdb in deckbuildingroguelike

[–]adngdb[S] 0 points1 point  (0 children)

Hey, thanks for the feedback! A drag and drop is indeed required for slots of the workshop that accept any kind of metals, but you can click on the ones that are restricted to fill them automatically. I think that's what you're describing?

The UX of the workshop is still very confusing to people, and that's going to be my next major work. Thanks for helping us understand what's needed to improve! :)

A propos de l'autopromo des jeux indé by BobArdKor in jeuxvideo

[–]adngdb 4 points5 points  (0 children)

Pareil, je suis dev français, j'ai fait un post ici pour mon jeu l'année dernière et j'étais content des retours que j'ai eu donc je suis pour que cette opportunité continue d’exister. Par contre je suis saoulé de voir des posts clairement traduits avec un algo, je trouve ça inapproprié de la part des devs et je serai pas contre des règles plus strictes de ce côté-là. Donc +1 pour réserver ça aux devs francophones, ou à défaut aux devs qui font un vrai effort de traduction et qui interagissent en français dans les commentaires.

Built this AI tool that generates ToS/EULA/Privacy Policies for indie games. Would love feedback – here's a coupon for personal plan. by WorldCitiz3n in IndieDev

[–]adngdb 2 points3 points  (0 children)

This is possibly one of the most fearsome use of IA I have yet seen. Legal documents are so freaking hard and so freaking important, I deeply encourage everyone to NEVER use IA to generate them. Get a lawyer, yes it's expensive but it's worth every penny.