• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums
P

Panagiotis Milios

@Panagiotis Milios
About
Posts
22
Topics
3
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

    Could RTT be used to broadcast player-authoritative movement periodically?
  • P Panagiotis Milios

    @kuabs A few things to keep in mind when using RTT:

    • There's a 2 KB max message size to broadcast to a channel.

    • RTT closes the connection after a couple of hours. The usual scenario that i've noticed is that it shuts down after 2 hours in the first session and upon reconnect sometimes it shutted down after 1 hour. So you'll need to have a fallback mechanism to handle that.

    • RTT has more latency involved than a fully fledged server solution so it wouldn't work for anything fast paced.

    • Api calls count depend on how many players are listening. Don't do that in a global channel where you might have thousands of players listening. Perhaps it's a feasible solution in a channel with <=100 players but it still depends on how often you broadcast it and you should keep in mind that for every broadcast in that case it will count as ~2 API calls.

    In my opinion, this use-case is probably only viable in time-based games where player actions take minutes or hours or turn based games and even then you'll still have to combine it with cloud code.


  • How can we ensure that users data (Entities, Global Entities, Leaderboards, Statistics etc) are *only* writable from cloud-scripts?
  • P Panagiotis Milios

    Use API blocking in the cloud code category to block all apis from client that write your user entities. Then clients can only write their entities using cloud-code and there you have the total control


  • Discord Server
  • P Panagiotis Milios

    Reminder that there's a discord server for Game Devs with official support from many Services including BC. Braincloud seems a bit inactive in that server. Would be great to have some extra staff in there for showcasing.

    Link: https://discord.gg/PZqADA


  • Is profileId returned by auth considered sensitive?
  • P Panagiotis Milios

    It's not. Just knowing a playerId is really not important as it's only a unique identifier for another player and nothing more than that.


  • Unity basic setup
  • P Panagiotis Milios

    Yes, that solved the problem. Thanks for your input Chris. Although, i'm always "scared" of using statics so i ended up doing it in a kindly different way.

    Since the forum is new, i'll post the solution here in case any future newbies like myself get stuck in the same problem. It's more of a Unity problem and less of a BrainCloud problem but thanks to BC support, i understood what i was doing wrong.

    In order to use BrainCloud in multiple scenes you can either use a static variable like Chris said (it's easier doing it like that) or you need to create a GameObject and attach to it the script below.

    using UnityEngine;
    
    public class BCConfig : MonoBehaviour
    {
        private BrainCloudWrapper _bc;
    
        public BrainCloudWrapper GetBrainCloud()
        {
            return _bc;
        }
    
        void Awake()
        {
            
            gameObject.name = "BrainCloud"; // I assign the name Braincloud to my game object to use it in the Find() function
            _bc = gameObject.AddComponent<BrainCloudWrapper>();
            _bc.WrapperName = "MyWrapper"; // optionally set a wrapper-name
            _bc.Init(); // extra data, such as: _appId, _secret and _appVersion, is taken from the brainCloud Unity Plugin. See Installation Guide above
            DontDestroyOnLoad(gameObject);
        }
    
    }
    
    

    In some other scene where you need access to the _bc variable you just simply do the following on the start method:

     _bc = GameObject.Find("BrainCloud").GetComponent<BCConfig>().GetBrainCloud();
    

    edit: small fix made to the example code, by a brainCloud mod (@Jonathan)


  • Cloud code retries, error handling question
  • P Panagiotis Milios

    A good way to handle failure besides retrying in code, is to schedule another script to run 1 minute later that will basically repeat the same action.


  • Don't discourage modulation by charging per in-house calls
  • P Panagiotis Milios

    @Paul-Winterhalder

    My only complaint i have about the cloud-code API policy is that after the first 3 API calls, each extra API call should be charged at a rate of 0.33 instead of 0.5. Basically with the cloud code API policy, Braincloud charges 3.33$ for the first million and 5$ for every extra million API calls in cloud code.

    i.e In a Cloud script with 9 'Pure' API calls that's called 333.333 times within a month (total: ~3 million 'pure' API Calls) the first million is basically charged at 3.33$ and the other 2 millions are charged at 5$. So total charge would be: 13.33$ which is true since this cloud script counts as 4 actual API Calls (total: 1,333,332 API calls).

    But if my use-case allowed, i could break this Cloud Script in 3 different Cloud Scripts (3 api calls each) and call them from the client in order and using the return result as input to the next cloud-script to continue exactly where i left it. Now that would be 999.999 total API calls and i just saved for myself 3.33$ but in reality the backend did a lot more work.

    Please do consider my suggestion of reducing the API count rate at 0.33

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users