Community:Intro to Programming: Difference between revisions

From VRChat Wiki
(Added Community noticebox. Added WIP Noticebox (feel free to remove, if the wip box is wrong))
No edit summary
Line 4: Line 4:
== About this guide ==
== About this guide ==


⚠WIP⚠
[[Udon]] is a programming language for adding interactivity to VRChat worlds. UdonSharp is a tool for creating Udon scripts by writing in C#, which is the programming language most Unity games are made in. This guide aims to teach the basics of programming so that someone who has never programmed before can create their own Udon scripts with UdonSharp.


[[Udon]] is a programming language for adding interactivity to VRChat worlds. UdonSharp is a tool for creating Udon scripts, but by writing C#, which is the programming language most Unity games are made in. This guide aims to teach the basics of programming so that someone who has never programmed before is able to create their own Udon scripts with UdonSharp.
This is not meant to be a comprehensive programming guide; its aim is to just teach enough to help people create interactive VRChat worlds.
 
== Computer Science 101 ==
=== Hardware ===
==== Transistors ====
Silicon is a '''semi-conductor''' -- a material that isn't a conductor and isn't an insulator, but somewhere on the fence. We can nudge the conductivity of silicon one way or another by mixing it with other materials (known as doping<ref>https://en.wikipedia.org/wiki/Doping_(semiconductor)</ref>) or by placing it in the electric field of a nearby charged piece of metal (known as the field effect<ref>https://en.wikipedia.org/wiki/Field_effect_(semiconductor)</ref>).
 
A transistor is a tiny microscopic device made from semi-conductors that utilize doping and the field effect to turn circuits on and off within your CPU. For example, you can dope the silicon within a transistor to make it not conductive so that it blocks the flow of electricity through a circuit. Then when you want to use that circuit, you would use the field effect to make the silicon conductive again. Here is a diagram showing how that'd work:
 
[[File:Transistor-diagram-with-rats.gif|1920x1080px|frameless|Diagram of a transistor using the field effect to change its conductivity. The charges in the diagram are represented with rats.]]


This is not meant to be a comprehensive guide on all things programming, it's aim is to just teach enough to help people create interactive VRChat worlds.


== Computer Science 101 ==
=== How computers work ===
Silicon is a semi-conductor which basically means it's a material that can't quite make up it's mind on whether or not it wants to conduct electricity. We can nudge the conductivity of silicon one way or another by mixing it with other materials or by placing it in an electrical field such as that generated by a charged piece of metal. Here's a very scientific diagram on how that works.


<TODO>
=== Software ===
There are a bunch of pins on the back of your CPU that plug into your motherboard. Some are input pins, and some are output. Each CPU cycle, a specific pattern of input pins lights up, opening and closing different circuits inside the CPU. The electric current then races through the CPU, eventually exiting on a specific pattern of output pins.


=== Programming ===
The input is known as the instruction and usually has two parts: the opcode and the operand. The opcode, short for operation code, tells the CPU what kind of operation to perform. The operand is the data that the opcode works with. For example, if the opcode is for adding two numbers and saving the result to a CPU register, the transistors that control the addition circuit will activate, as well as the circuit that leads to saving the output to the specified register. The operand is then routed through the pathway that just opened up.
<TODO>
<TODO>
binary -> assembly -> code -> natural language
binary -> assembly -> code -> natural language

Revision as of 02:05, 11 September 2024

IconOnly CL Portal.png
V · ECommunity-written content
The following was created by the community. It may contain material not directly endorsed by the VRChat team. To learn more, consider reading Contributing to the VRChat Wiki.
Tools.png
V · EThis page is a work in progress
This page is actively being worked on, information may be incomplete or out of date. You can help the VRChat Wiki by editing it.
[Reason: No reason provided.]

About this guide

Udon is a programming language for adding interactivity to VRChat worlds. UdonSharp is a tool for creating Udon scripts by writing in C#, which is the programming language most Unity games are made in. This guide aims to teach the basics of programming so that someone who has never programmed before can create their own Udon scripts with UdonSharp.

This is not meant to be a comprehensive programming guide; its aim is to just teach enough to help people create interactive VRChat worlds.

Computer Science 101

Hardware

Transistors

Silicon is a semi-conductor -- a material that isn't a conductor and isn't an insulator, but somewhere on the fence. We can nudge the conductivity of silicon one way or another by mixing it with other materials (known as doping[1]) or by placing it in the electric field of a nearby charged piece of metal (known as the field effect[2]).

A transistor is a tiny microscopic device made from semi-conductors that utilize doping and the field effect to turn circuits on and off within your CPU. For example, you can dope the silicon within a transistor to make it not conductive so that it blocks the flow of electricity through a circuit. Then when you want to use that circuit, you would use the field effect to make the silicon conductive again. Here is a diagram showing how that'd work:

Diagram of a transistor using the field effect to change its conductivity. The charges in the diagram are represented with rats.


Software

There are a bunch of pins on the back of your CPU that plug into your motherboard. Some are input pins, and some are output. Each CPU cycle, a specific pattern of input pins lights up, opening and closing different circuits inside the CPU. The electric current then races through the CPU, eventually exiting on a specific pattern of output pins.

The input is known as the instruction and usually has two parts: the opcode and the operand. The opcode, short for operation code, tells the CPU what kind of operation to perform. The operand is the data that the opcode works with. For example, if the opcode is for adding two numbers and saving the result to a CPU register, the transistors that control the addition circuit will activate, as well as the circuit that leads to saving the output to the specified register. The operand is then routed through the pathway that just opened up. <TODO> binary -> assembly -> code -> natural language

Compiling and Running code

<TODO>

Structure of an UdonSharp script

Namespaces

<TODO>

Classes

<TODO>

Functions

<TODO>

Variables

<TODO>

Unity SDK

Events

<TODO>

VRChat SDKs

Players

<TODO>

Coding Tutorial

<TODO>

Advanced Concepts

Networking

Optimization

<TODO>