How to design large-scale systems?

System design is a broad topic. There is a vast amount of resources scattered throughout the web on system design principles.

Design Large System

This repo is an organized collection of resources to help you learn how to build systems at scale.

Prep for the system design interview

In addition to coding interviews, system design is a required component of the technical interview process at many tech companies.

Practice common system design interview questions and compare your results with sample solutions: discussions, code, and diagrams.

Additional topics for interview prep:

For details, check out here

Machine Learning Resources

Machine learning overview

Machine learning mastery

Machine learning is fun

Inky Machine Learning

Machine Learning: An In-Depth Guide

Stories and experiences

Machine Learning Algorithms

Beginner Books

Practical Books

Kaggle knowledge competitions

Video Series

MOOC

Resources

Games

Becoming an Open Source Contributor

Podcasts

Communities

Conferences

  • Neural Information Processing Systems (NIPS)
  • International Conference on Learning Representations (ICLR)
  • Association for the Advancement of Artificial Intelligence (AAAI)
  • IEEE Conference on Computational Intelligence and Games (CIG)
  • IEEE International Conference on Machine Learning and Applications (ICMLA)
  • International Conference on Machine Learning (ICML)
  • International Joint Conferences on Artificial Intelligence (IJCAI)
  • Association for Computational Linguistics (ACL)

Interview Questions

[Unity] How to optimize game size 50% in less than 15 minutes?

This is story how I optimized game size Perfect Park – Brain Challenge decreasing size approximate 50%.

1.How much size of game mobile is good?

      In mobile, small size is better, more than download from store. Users do not have the patience to download heavy games, it is crazy for mobile. There are many comments about it, almost developer said that below 50MB is best for game mobile. So your mission is making game below 50MB. How to do it?

2.How to optimize game size

      After you finish all features of game, that is when you need to optimize game size and performance before submitting to store. The following step to decrease game size perfectly and easily:

Step 1: Investigate what make your game heavier

     Default, Unity detect used resources automatically when building the game. Almost is good but Unity sometimes cannot remove unused resources. So Unity have perfect tools to statistic volume of all used resources. That is Build Editor Log. You can find editor log at folder “C:\Users\[Your User]\AppData\Local\Unity\Editor\Editor.log” when finishing built the game.

Build editor log unity

     So take care the following strategies:

  • Remove un-used resources
  • Compress big resources as graphic texture, audio as possible.
Step 2: Optimize graphic 
  • Compress texture: check overrided for Android or Apple Store, choose minimum target max size, choose formats. There is some formats you can choose to optimize size which lose quality of graphic such as RGB Compressed DTX1, RGB Compressed DTX5, RGB Crunched DTX1, …etc. I choose RGB Crunched DTX1 for some big assets and result is smaller than 8 times (decrease from 2.8MB to 300 KB), quality graphic still good on mobile.

Compress FormatCompress Format

  • Using Sprite Packer to combine multiple assets to single texture (use Package Manager to download and install Sprite Packer) by set all assets to same Packing Tag as the following picture as Packing Tag: UI_1.

Sprite PackerSprite Packer Unity

Step 3: Optimize sound

Audio Clip (sound files) which imported to Unity is working very similar to texture importing. Unity supports many different audio formats, but in the end it converts them all to preferred (by the engine) format such as PCM, ADPCM, Vorbis/MP3 and HEVAG. Note that not each platform can handle all of these compression formats, and some platforms have only one format available (e.g. WebGL can work only with AAC audio clips).

Sound Importing Unity

Original audio file size is computed to 35.9 MB and the imported size to 10.7 MB. Choose Quality to 60 – 80% for decreasing size but still good quality.

Here is explanation detail about Audio working on Unity.

Step 4: Optimize Mesh and other animation

You can compress Meshes and imported Animation Clips so that they take up less space in your game file. To enable Mesh compression, select the Mesh, then in the Inspector window set the Mesh Compression to LowMedium or HighMesh and Animation compression uses quantization, which means it takes less space, but the compression can introduce some inaccuracies. Experiment with what level of compression is acceptable for your models.

Step 5: Optimize publishing
  • Unity supports two .NET API compatibility levels.: .NET 4.x and .NET Standard 2.0. The .NET Standard 2.0 restricts you to a smaller subset of the .NET API, which can help keep size down.
  • Choose Google Bundles file can decrease 5 – 10% game size.
  • Release Proguard mode can remove un-used files but should be carefully because sometime your game will be not working properly.

Here is result after optimize game size: decrease from 76MB to 40 MB (approximate 50%)

Optimize game size

If you see this tutorial helpful, please explore at here:

coin fly unity
[Unity] How to create effect “coin fly” in less than 15 minutes

Do you want make beautiful coin fly effect as game Perfect Park – Brain Challenge?

One of basic feature of any game is “collecting coin bonus” to exchange props.  Make game more attractive and full content by adding collision event between player and coin object. A long time, famous games as Candy Crush using coin fly effect. In this articles, I will share step by step to make coin fly effects in Unity.

Prepare:

  • Coin object prefab in .fbx format. Link at here.
  • Coin image in .png or jpg format. Link at here.
  • Using DOTween for moving coin. You can download free at here.

Implementation:

Step 1: Add coin object to your scene

  • Set tag to “Coin”
  • Set Collider to “Mesh Collider” or Box Collider if you want optimize performance

Coin Object TagBox Collider

Step 2: Add coin image to your canvas UI

  • Add image to canvas. Set tag for this image is CoinTargetPos (will be used for flying coin from world scene to canvas)
  • Add coin text to canvas

 

Step 3: Add code to collision event between player and coin object

Add the following code in to Player scripts:

private void OnCollisionEnter(Collision collision)
{
     if (collision.gameObject.CompareTag(“Coin”))
    {
           //play coin sound (please using your code). This is example.

//Add CoinManager to coin object. This is important for moving coin
CoinManager coinManager = collision.gameObject.AddComponent<CoinManager>();
coinManager.Despawn(1f);

//Increase coin and update coin text (please using your code).

     }    

}

Step 4: CoinManager Scripts to moving coin from WorldScene to Canvas

 Important!
– To move object from World Scene to Canvas, you need convert position of canvas object to World Scene.
– Using DOTween for moving coin. You can download free at here.


using DG.Tweening;
using System.Collections;
using UnityEngine;

public class CoinManager : MonoBehaviour
{
public Transform coinPosTrans;
private Transform coinObjectTrans;

private Vector3 firstPosition;
private Vector3 firstScale;
private Quaternion firstRotation;

private Camera mainCamera;
private Vector3 worldPos;
private bool isDespawned = false;

// Start is called before the first frame update
private void Start()
{
mainCamera = Camera.main;

if (coinPosTrans == null)
{
coinPosTrans = GameObject.FindGameObjectWithTag(“CoinTargetPos”).transform;
}

//Convert position of rectangle transform to world point on Scene
Vector3 screenPoint = coinPosTrans.position + new Vector3(0, 0, 5);
worldPos = mainCamera.ScreenToWorldPoint(screenPoint);

firstPosition = this.transform.position;
firstRotation = this.transform.rotation;
firstScale = this.transform.localScale;

}

// Update is called once per frame
private void FixedUpdate()
{
if (!isDespawned)
{
MoveToCoinPos();
}
}

/// <summary>
/// Move coin to text position on canvas UI
/// </summary>
public void MoveToCoinPos()
{
//move towards the world space positio
transform.localScale = this.transform.localScale / 1.05f;
transform.position = Vector3.MoveTowards(transform.position, worldPos, 10 * Time.deltaTime);
}

/// <summary>
/// Move coin to text position on canvas UI using Tween
/// </summary>
/// <param name=”duration”></param>
public void MoveToCoinPos(float duration)
{
Vector3 path1 = new Vector3(transform.position.x + 0.25f, transform.position.y + 0.25f, transform.position.z);
Vector3 path2 = worldPos;

Vector3[] arrPath = new Vector3[2];
arrPath[0] = path1;
arrPath[1] = path2;

transform.DOLocalPath(arrPath, duration);
}

/// <summary>
/// Disable coin object
/// </summary>
/// <param name=”duration”></param>
public void Despawn(float duration)
{
StartCoroutine(ReturnCoinPos(duration));
}

/// <summary>
/// Return coin object to first position
/// </summary>
private void ReturnFirstPos()
{
//coinObjectTrans.position = firstPosition;
//coinObjectTrans.rotation = firstRotation;
isDespawned = true;
this.transform.position = firstPosition;
this.transform.rotation = firstRotation;
this.transform.localScale = firstScale;
}

/// <summary>
/// Coroutine for return coin first position
/// </summary>
/// <param name=”duration”></param>
/// <returns></returns>
private IEnumerator ReturnCoinPos(float duration)
{
yield return new WaitForSeconds(duration);

//coinObjectTrans.gameObject.SetActive(false);
this.gameObject.SetActive(false);
//isDespawned = true;

ReturnFirstPos();
}

}

If you want try perfect car parking using coin flying effect, please explore at here:

Resources for this tutorial at here.

Cheer!