Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

How to make a casino lobby wrapper with downloadable games

Discussion in 'Scripting' started by d3x7er, Jan 16, 2020.

  1. d3x7er

    d3x7er

    Joined:
    Jun 23, 2018
    Posts:
    36
    Not sure if I phrased the title correctly but here is what i mean by that. I am fairly new to Unity but have a lot of experience in the field of programming, so if you can give me some pointers I would be grateful.

    I am in the progress of creating a casino with different type of games inside. But what i will struggle with or at least don't know how to do it the right way is firstly creating the lobby.

    Let's use this for example. I am not sure how should I approach creating the "Top Bar" with the "Coins/Buy Chips etc..". This bar will be existing in every game, it wont be changed. So i have no idea how i should structure the whole thing. Everything else, the middle and bottom part will be changed for every slot.
    Also how does it work, all the games to be downloadable separately from the main casino game. Let's say i have a casino with 50 type of games but when you install it you have only one of them installed and by "clicking" on the games you don't have they start downloading.

    Not sure if i explained what I struggle with, but this is the bone of the project so I would like to make it the right way so I wont have to struggle with problems later on, because the structure and they way i wrote it is not correct. I would be glad if you can point me to tutorials or examples.
     
  2. WallaceT_MFM

    WallaceT_MFM

    Joined:
    Sep 25, 2017
    Posts:
    364
    My studio had to overcome a similar problem. We have many different simulations that a user might want, but usually any given user wouldn't want all of them. The first problem you will run into is that you may not download code after installing the app (assuming you are using Apple or Android app stores). This is a limitation of those stores, not Unity. So, to solve that, we just include all of the code for all of our sims with the initial install, using Unity's package manager to import the scripts and using C# namespaces to keep the projects silos. Then, the assets for each course are built into AssetBundles and placed on a remote server (Amazon S3, in our case). Our app then knows where to download the assets from, so when a user clicks on one of the sims, we prompt them for permission to download the assets. Note that Apple requires you to ask permission from the user before downloading anything, and will reject your app if you do not.
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    10,990
    Yes, AssetBundles for the win, as @WallaceT_MFM says above. Or more modernly the Addressibles but I haven't used them so I cannot recommend them.

    Specifically, using Asset Bundles, do NOT put individual assets into the scenes. That's a long hairy dark road to tears and frustration because you have to write code to pluck it all out... absolute nightmare to do it that way.

    Instead, ONLY put scenes into your Asset Bundles. If you only put scenes in and load the entire Scene, it's like all of Unity's massively-scaleable content delivery is unlocked for you, and you don't have to manage the individual bits. It really is beautiful. You download the AB with the scene in it, you load the scene, you run the scene, you discard it. Glorious. Engineering angels will shine down from on high and you will rejoice.

    But also as noted above, you must have all your compiled and signed code built into the game. You can use something like a LUA scripting language to do lightweight light-bound scripting (LUA scripts can be referred to as text files in your downloaded scenes, making them come with the scene), but some folks even say that runs afoul of Apple or Google EULAs. I don't know, IANAL. But if you wanna LUA, I recommend MoonSharpLUA. Solid package.
     
    Joe-Censored likes this.
  4. d3x7er

    d3x7er

    Joined:
    Jun 23, 2018
    Posts:
    36
    Thank you so much for the info guys! That's what I needed.

    When I was researching about how should i build the project I looked into real time code generation if you are reffering to that about "LUA". And yes it is not allowed for Apple Store, only for google play.

    Will be posting more in the forum for help in the future probably if I encounter some wall that i can't overcome. But at least now i know how to start with that. Thanks again!
     
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    10,990
    My reading of Section 3.3.2 of the Apple developer agreement says you can use LUA, as long as three conditions are met, which seem reasonable for most game needs.

    Check your agreement, section 3.3.2, which I highlight here:

    Screen Shot 2020-01-17 at 11.23.24 AM.png
     
  6. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    2,549
    Compiled code should be minuscule in size compared to other assets like textures and sound effects. It may be feasible to simply include the code for all of your games in the main build.
     
  7. d3x7er

    d3x7er

    Joined:
    Jun 23, 2018
    Posts:
    36
    Well in the end we switched many ideas but due to the lack of time, we will release it as a full game with everything installed in the beginning because the team is not that big and time forces us to do so. But in the future we will migrate it to asset bundles or expansions depending on what we decide is better.

    We are only focused for online casino without real money and etc.. Even in the beginning we are not adding a shop for users to spend money and we are not forcing any ads on the user. From the moment you start playing you can just play without watching a single ad or pay a single dollar for the game. In the future we will be adding shop with real money to buy coins and in game goods but that's a topic we are still thinking on, because we want the user to feel rewarded and not just spend money for something that they won't enjoy.
     
  8. d3x7er

    d3x7er

    Joined:
    Jun 23, 2018
    Posts:
    36
    What @Joe-Censored pointed out. You have to have discipline to play casino no matter what you play you have to know when to stop.

    And yes if you are playing trusted casinos with licenses and etc.. then the algorithm should be something around 90-99% win percentage, but that doesn't mean anything when you play. Because even if it's 99% win, you can have 100 spins without any profit. The percentage is calculated based on millions of spins, depends on what is required by law. Every company can have different algorithms for generating the spin but overall it should be random or you wont get your license. In short that's some info that i have from researching the subject. But again just keep in mind be patient and don't be greedy, know when to stop.
     
    Joe-Censored likes this.
  9. d3x7er

    d3x7er

    Joined:
    Jun 23, 2018
    Posts:
    36
  10. Cocojambo123

    Cocojambo123

    Joined:
    Jan 14, 2021
    Posts:
    1
    Hey, playing casino may be dangerous :D. Creating lobby is very important in terms of the starting the game. Also making players to switch between different bars without long load is crucial. Any casino has this opportuinity online, like this one https://www.syndicateaus.com/
     
    Last edited: Jan 16, 2021 at 1:44 PM
unityunity