Organize view layer for card game

I’m working on my card game which is just turn-based game in general. Whole simulation layer works using UniTask + R3 (UniRx). I divide project on 3 layers: simulation (model) - where business logic happens (in case of turn base game it is mostly c# app which is independent from unity), view layer is where all my animations / VFX / sounds / etc. are going to happen. Presentation layer is where I bind simulation and view layers together.

I’m looking for a good approach to organize view layer, ideally to be able to run view sequences as something awaitable. Like when I play card I want to run some animations + sound, then I want to react to effects happen when card played which have it’s own animations / sounds / post-effects / etc.

Long story short I want to be pointed to possibly right direction where I can read and learn about modern unity features to better organize view layer.

I see that there is Timeline package which is pretty handy today, but I also see that this was designed mainly for cut-scenes. Though most of cases can be solved with just having Playable Director component per card view object running needed playable. It is also seems to be extendable so that I can implement own tracks and things to run my own playable logic in timeline.

I also see that we have some Playable graph. If I understand it correctly it is more fundamental thing Timeline is built on and can be constructed from code so I can run all “playables” from graph sequentially.

Both Timeline and Playable graph seems little bit unclear to me in a way I want to use them. So please give me some enlightenment. Thanks in advance.

you need something like this asset here, which is intended to add these type of visual and effects to your game. So it will play various effects you can customize when stuff happens in the game. Lets say you add card to table, well then you can create a set of rules to make it scale, bounce, add effects whatever.

1 Like

Yes, I need something which can let me assign a list of something “Feel” calling “feedback”. But in my practice I try to avoid using this kind of assets because authors often limit functionality in a way they think it should be limited which I often not agree with. That is because I looking for built-in solution even if I need to invent bicycle which is already can be bought on asset store. Though unity sometimes limit theirs solutions just like assets authors do.

then I suggest using this free asset which helps having smooth animations. It doesn’t do any game logic or stuff like that so you are free to experiment

Yep, I already use DoTween, and think it is an industry standard library. In this particular project I use it to tween card’s transforms. DoTween can tween few more types but it always about tweening.

I’m asking about solution that will let me assign actions like Feel do with it’s feedbacks in a list manner and then play it. Like any card have common DoTween driven animation but few of them also wants to play VFX Graph effects and sounds on actions like “play card” / “discard card” / etc.

I’ve found out that it is possible to change bindings through PlaybleDirector component so timeline asset could be reused procedurally. Maybe it is a best way to go for me, because it is very handy to be able to compose presentation events in time.