Convert Figma logo to code with AI

UnityTechnologies logoopen-project-1

Unity Open Project #1: Chop Chop

5,686
2,037
5,686
59

Top Related Projects

A first person multiplayer shooter example project in Unity

Example content for Unity projects based on AR Foundation

16,887

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.

A small-scale cooperative game sample built on the new, Unity networking framework to teach developers about creating a similar multiplayer game.

Quick Overview

Open Project 1 is a Unity-based game development project created by Unity Technologies as a learning resource for the community. It's an open-source, sci-fi themed first-person shooter (FPS) game that demonstrates best practices in Unity game development, including gameplay mechanics, graphics, and performance optimization.

Pros

  • Provides a comprehensive example of professional game development in Unity
  • Offers valuable insights into industry-standard practices and techniques
  • Serves as an excellent learning resource for both beginners and experienced developers
  • Includes well-documented code and project structure

Cons

  • May be overwhelming for absolute beginners due to its complexity
  • Requires a relatively powerful computer to run smoothly, especially when editing
  • Some aspects of the project may become outdated as Unity evolves
  • Limited to a specific game genre (FPS), which may not appeal to all developers

Code Examples

// Example of player movement using the new Input System
public class PlayerMovement : MonoBehaviour
{
    public float moveSpeed = 5f;
    private Vector2 movement;
    private Rigidbody2D rb;

    private void Start()
    {
        rb = GetComponent<Rigidbody2D>();
    }

    private void Update()
    {
        movement = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical")).normalized;
    }

    private void FixedUpdate()
    {
        rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime);
    }
}
// Example of using Unity's new UI Toolkit
public class UIManager : MonoBehaviour
{
    [SerializeField] private UIDocument uiDocument;
    private Button startButton;

    private void OnEnable()
    {
        var root = uiDocument.rootVisualElement;
        startButton = root.Q<Button>("start-button");
        startButton.clicked += StartGame;
    }

    private void StartGame()
    {
        Debug.Log("Game started!");
        // Add game start logic here
    }
}
// Example of using Unity's new Universal Render Pipeline (URP)
[RequireComponent(typeof(Camera))]
public class PostProcessingController : MonoBehaviour
{
    public Volume postProcessVolume;
    private Vignette vignette;

    private void Start()
    {
        if (postProcessVolume.profile.TryGet(out vignette))
        {
            vignette.intensity.value = 0.5f;
        }
    }

    public void SetVignetteIntensity(float intensity)
    {
        if (vignette != null)
        {
            vignette.intensity.value = intensity;
        }
    }
}

Getting Started

  1. Clone the repository: git clone https://github.com/UnityTechnologies/open-project-1.git
  2. Open the project in Unity 2020.3 or later
  3. Open the main scene: Assets/Scenes/MainScene.unity
  4. Press Play in the Unity Editor to run the game
  5. Explore the project structure, scripts, and assets to learn about Unity game development best practices

Competitor Comparisons

A first person multiplayer shooter example project in Unity

Pros of FPSSample

  • More focused on a specific genre (FPS), providing deeper insights into FPS game development
  • Includes networking and multiplayer functionality, demonstrating advanced Unity features
  • Offers a complete game loop with UI, weapons, and character systems

Cons of FPSSample

  • Less frequently updated, potentially outdated for newer Unity versions
  • More complex codebase, which may be challenging for beginners
  • Limited to FPS genre, less versatile for other game types

Code Comparison

FPSSample (PlayerCharacterController.cs):

public void Move(Vector3 move, bool sprint)
{
    if (move.magnitude > 1f)
        move.Normalize();

    move = transform.InverseTransformDirection(move);
    CheckGroundStatus();

open-project-1 (PlayerController.cs):

void Update()
{
    if (m_IsGrounded && m_PlayerInput.jump)
    {
        m_Velocity.y += Mathf.Sqrt(m_JumpHeight * -2f * Physics.gravity.y);
    }

Both repositories showcase player movement, but FPSSample's implementation is more detailed, handling normalization and ground status explicitly. open-project-1's code is simpler, focusing on basic jump mechanics.

Example content for Unity projects based on AR Foundation

Pros of arfoundation-samples

  • Focused specifically on AR development, providing targeted examples and use cases
  • More frequently updated, with recent commits and active maintenance
  • Includes a wider range of AR-specific features and functionalities

Cons of arfoundation-samples

  • Less comprehensive in terms of overall game development concepts
  • May be more challenging for beginners not familiar with AR development
  • Limited to AR-specific scenarios, potentially less versatile for general Unity projects

Code Comparison

arfoundation-samples:

public class ARFeatheredPlaneMeshVisualizer : MonoBehaviour
{
    [Tooltip("The ARPlane to visualize.")]
    [SerializeField]
    ARPlane m_ARPlane;

    void OnEnable()
    {
        m_ARPlane.boundaryChanged += ARPlane_boundaryChanged;
    }
}

open-project-1:

public class PlayerController : MonoBehaviour
{
    [SerializeField] private float m_MovementSpeed = 5f;
    [SerializeField] private float m_RotationSpeed = 10f;

    private void Update()
    {
        HandleMovement();
        HandleRotation();
    }
}

The code snippets demonstrate the different focus areas of each repository. arfoundation-samples deals with AR-specific components like ARPlane, while open-project-1 showcases more general game development concepts like player movement and rotation.

16,887

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.

Pros of ml-agents

  • Focused on machine learning and AI in Unity, providing a powerful toolkit for developing intelligent agents
  • Extensive documentation and tutorials, making it accessible for both beginners and advanced users
  • Active community and regular updates, ensuring ongoing support and improvements

Cons of ml-agents

  • Steeper learning curve for those new to machine learning concepts
  • May require more computational resources for training complex agents
  • Limited to AI and machine learning applications, less versatile for general game development

Code Comparison

ml-agents:

public class RollerAgent : Agent
{
    public override void OnEpisodeBegin()
    {
        // Reset agent position and state
    }
}

open-project-1:

public class PlayerController : MonoBehaviour
{
    void Update()
    {
        // Handle player input and movement
    }
}

The code snippets highlight the different focus areas of the two projects. ml-agents emphasizes AI agent behavior, while open-project-1 is more centered on traditional game development concepts like player control.

A small-scale cooperative game sample built on the new, Unity networking framework to teach developers about creating a similar multiplayer game.

Pros of com.unity.multiplayer.samples.coop

  • Focused specifically on multiplayer gameplay, providing in-depth examples and best practices
  • Includes a complete game sample (Boss Room) demonstrating networked gameplay mechanics
  • Regularly updated with the latest Unity Netcode for GameObjects features

Cons of com.unity.multiplayer.samples.coop

  • More complex and potentially overwhelming for beginners compared to open-project-1
  • Limited to multiplayer-specific features, lacking examples of other game development aspects
  • Requires more setup and configuration to get started

Code Comparison

open-project-1:

public class PlayerController : MonoBehaviour
{
    public float moveSpeed = 5f;
    void Update()
    {
        Vector3 movement = new Vector3(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical"));
        transform.Translate(movement * moveSpeed * Time.deltaTime, Space.World);
    }
}

com.unity.multiplayer.samples.coop:

[NetworkBehaviour]
public class PlayerMovement : NetworkBehaviour
{
    [SerializeField] private float moveSpeed = 5f;
    void Update()
    {
        if (IsOwner)
        {
            Vector3 movement = new Vector3(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical"));
            transform.Translate(movement * moveSpeed * Time.deltaTime, Space.World);
        }
    }
}

The com.unity.multiplayer.samples.coop example includes networking-specific attributes and checks, demonstrating its focus on multiplayer functionality.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

⚠ Note: As of December 2021, Open Projects and Chop Chop are not in development anymore. For more information, read here. The information below is kept as legacy.

Unity Open Project #1: Chop Chop

Unity Open Projects

Welcome! This is the repository for the first Unity Open Project, an initiative where Unity and the community collaborate together to create a small open-source game demo.

The first game, which is currently under development, is an action-adventure titled Chop Chop (more info).

Follow the progress

  • The dedicated sub-forum on the Unity forums is where the Unity team and the whole community discuss and brainstorm ideas.
  • The roadmap is the central location to know what's coming to the game. Also a great way to find tasks to contribute on!
  • The Unity team does bi-weekly livestreams on Unity's YouTube channel (subscribe to be notified). Find the past ones in this playlist.
  • The #open-projects channel on the Official Unity Discord is where collaborators can meet for a quick chat and non-threaded discussion.

Contribute

We would love to get your contributions into the game! Whether you create code, art, narrative, sounds; whether you feel you are experienced enough or not; there is probably something you can add to it.

To learn all about contributing, we have a series of short videos to get you started with Git and with this project in general.
In addition to that, make sure you read the Contribution Guidelines. For code style, scene hierarchy, and project organisation standards, read the Conventions document. And for art contributions, we have the Art Guidelines.
⚠ Please post on the forums and check the roadmap before starting to work on big contributions!

If you feel like taking on some bugs, check out the Issues page on this very repo. In fact, another thing you could help with is by doing some QA testing: download the latest release of the game, play it, and report issues in the appropriate page. That's also a great way to be part of this project!

This project is built on Unity 2020.3 LTS, whatever latest patch is available (you can see exactly which version here).

OP1 WIP Screenshot A work in progress screenshot

Play the game

Just want to try the game out? Head to the release page and grab the latest version.

We are looking forward to see what you will create ❤
- the Unity Creator Advocacy team