The best practice of doing this Rival Poker view?

Hello Every Experts,

I am trying to develop a simple poker game with PUN2. Please check the very bottom link first to ease of your understating the question. The game looks like attached link shows (Sorry, first time to use this system, and it seems the system does not allow me to attach image, so kindly click below link to see the game view, it's a simple google image share link). The game is as simple as player A used computer A to login and player B used computer B to login to play 2-cards poker card. They were both matched in a same room, and I want in Computer A where player A used to login system is sitting at bottom region, same as Computer B where player B used to login is sitting also at bottom. In each computer A, B screen, their top view is always their opponent. When they get into the matched room, each player has their own card deck, and each player was dealt with 2 cards and reveal. However, the player's card can only be seen by player but not by their opponent which means in their opponent's computer, the player's card (always show on top) was covered. The card's front side or back side was controlled by displaying frontspirte image or back sprite image to achieve card's covered or showing its content.

My question or discussion point would be, what's the best practice to achieve above scenario?

1. If I let player A's 2 cards a network game object, how can I let this network game object showing in player A's computer at the bottom while show same network game object with covered status in player's B computer top region? Isn't same network game object should be exists in same coordinate in same network world scene view? I know maybe using camera can resolve such things, but how to at the same time let one same card instance is in flipped status seen from player's A computer and one is showing covered seen from player's B computer?

2. If there is not solution for above, does that imply that I need to maintain two worlds, in computer A view world, I need to manage player's A local card data and Player B's card data, and when showing Player'B card data, I need to use PUN to let computer B's Player'B data synced to computer A and show them either revealed or covered? So in this way, seems like I need to maintains 4 game object groups, player's A game object in screen A, player'B game objects in screen A, player'B object in screen B, player's A object in screen B? And make sync of them depends on game need.

3. Even 2's solution works, the animation seems difficult that when dealing player's A card by moving the card from player's A card deck and flip the cards when in position in bottom view, and how such animation synchronized in Computer's B screen at the top while after dealt the cards did not flip? How to achieve this?

Thank you for reading through this lengthy question/discussion point, hope any one can see that below link view to easily understand my questions and shed some lights. Many thanks in advanced.


  • weynhuns

    What style for the cards did you choose?

  • juliasiren
    edited February 2023

    That's a great question and I'm sure a lot of people can relate. I think the best practice for this scenario is to have two separate game objects and use PUN2 to sync the data between the two. That way, you can show one card revealed in one computer and covered in the other. As for animating the cards, I'm not sure if that's possible but it could be worth looking into. If not, you could always just have the cards appear in the right spot without any animation. I'm sure you'll find the right solution for your game! Good luck and if you need any more help, just ask here or at any of the nettikasinoita websites.