Skip to content

Commit d4b4410

Browse files
committed
One last README fix (hopefully)
1 parent 1fb0032 commit d4b4410

File tree

1 file changed

+40
-28
lines changed

1 file changed

+40
-28
lines changed

README.md

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ Within this readme is a quick overview of each piece of code that we have put in
88

99
## Getting Started
1010

11-
Just download the project and open the Unity scene. Everything should work out of the box
11+
Just download the project and open the Unity scene. Everything should work out of the box.
1212

1313
### Prerequisities
1414

15-
The only necessary component is Unity3D, available at [their website](https://unity3d.com/get-unity/download)
15+
The only necessary component is Unity3D, available at [their website](https://unity3d.com/get-unity/download).
1616

1717

1818
## OpenRelativity Limitations and Usage
@@ -41,7 +41,7 @@ At the second level, we have the Player gameobject, which is where we keep the c
4141

4242
Finally, we have the camera. The camera does not have any scripts on it, but is affected by Movement Scripts and must be attached to the player or else the perspective will be off.
4343

44-
###Other Objects and adding them to the scene
44+
###Other Objects
4545

4646
By a few simple steps, any object can be added to the scene of Open Relativity. These steps mostly consist of adding the following components to your new object.
4747

@@ -62,80 +62,92 @@ With these components added to your new object, they will deform and change colo
6262

6363
### Relativistic Object / Relativistic Parent
6464

65-
Relativistic Object is the base code for all the non-player objects in the scene. Combined with the Relativity shader, it keeps track of relatvistic effects,moves the object if needed, and performs necessary actions for the shader to work. It first forces the object to have a unique material, so that the object's shader uses variables specific to that object, and not across all objects using the relativity shader (which is what would happen if we did nothing). It also keeps track of when the object was created and when it is supposed to disappear, so that the time-distorting effects of special relativity do not accidentally force the object to appear before its start location or after its disappearance.
65+
Relativistic Object is the base code for all the non-player objects in the scene. Combined with the Relativity shader, it keeps track of relatvistic effects,moves the object if needed, and performs necessary actions for the shader to work. It first forces the object to have a unique material, so that the object's shader uses variables specific to that object, and not across all objects using the relativity shader (which is what would happen if we did nothing). It also keeps track of when the object was created and when it is supposed to disappear, so that the time-distorting effects of special relativity do not accidentally force the object to appear before its start location or after its disappearance.
6666

67-
Relativistic Parent is much the same as Relativistic Object. However, for complex parented objects with many smaller parts, each with their own materials, it vastly increases the speed of the engine if they are all kept on a single object. This code takes all the meshes of the parent object's children and combines them with its own, attaching the materials and textures necessary to the correct submeshes. There is one important problem: I do not combine the colliders of the child objects, so it is important that the parent object's collider contains within it all of the child objects, or else the player will be able to clip through their meshes as only the parent's collider remains after the combining of all the meshes.
67+
Relativistic Parent is much the same as Relativistic Object. However, for complex parented objects with many smaller parts, each with their own materials, it vastly increases the speed of the engine if they are all kept on a single object. This code takes all the meshes of the parent object's children and combines them with its own, attaching the materials and textures necessary to the correct submeshes. There is one important problem: I do not combine the colliders of the child objects, so it is important that the parent object's collider contains within it all of the child objects, or else the player will be able to clip through their meshes as only the parent's collider remains after the combining of all the meshes.
6868
### Firework
69-
Firework is identical to Relativistic Object except that there is also a timer on the object. When it dies, it releases a cloud of particles. This behaviour is mostly to show the possibilites of working with timers. As you lower the speed of light and the fireworks travel closer to the speed of light, you will notice they last longer (as will their particles) due to time dilation.
69+
Firework is identical to Relativistic Object except that there is also a timer on the object. When it dies, it releases a cloud of particles. This behaviour is mostly to show the possibilites of working with timers. As you lower the speed of light and the fireworks travel closer to the speed of light, you will notice they last longer (as will their particles) due to time dilation.
7070
### Movement Scripts
7171

72-
Movement Scripts is what takes player input for the mouse and keyboard and moves the player accordingly. This code covers player movement, camera movement, and change in the speed of light. The movement follows a formula for relativistic velocity addition, which is included in the comments before the movement code. It is also currently set for free movement in three dimensions. If you wish to constrain the player to a flat ground plane (the X-Z plane, in Unity) then there are a couple lines of code that are marked for easy change.
72+
Movement Scripts is what takes player input for the mouse and keyboard and moves the player accordingly. This code covers player movement, camera movement, and change in the speed of light. The movement follows a formula for relativistic velocity addition, which is included in the comments before the movement code. It is also currently set for free movement in three dimensions. If you wish to constrain the player to a flat ground plane (the X-Z plane, in Unity) then there are a couple lines of code that are marked for easy change.
7373

7474
### Info Script
7575

76-
This just displays the two text boxes in the upper left hand corner, using info from Game State.
76+
This just displays the two text boxes in the upper left hand corner, using info from Game State.
7777

7878
### Game State
7979

80-
Game State is the brain of the Open Relativity code. It stores important variables for relativistic effects and keeps track of changes in the player's status. Relativistic Object and Movement Scripts rely on being able to find Game State and access its information. It also keeps track of the pause state of the game, letting all other objects query game state rather than keeping track of it themselves.
80+
Game State is the brain of the Open Relativity code. It stores important variables for relativistic effects and keeps track of changes in the player's status. Relativistic Object and Movement Scripts rely on being able to find Game State and access its information. It also keeps track of the pause state of the game, letting all other objects query game state rather than keeping track of it themselves.
8181

8282
### Object Mesh Density
8383

84-
Object Mesh density takes a constant value (named constant). It searches over the triangles on the mesh of the object that it is attached to. If it finds a triangle with area greater than the constant value, it splits that triangle into four smaller triangles, in a way that still works effectively with the relativistic code. The reason for this code is that the lorenz contraction looks better with a higher concentration of vertices (since it is a vertex shader). Using this will slow down your startup, as the code is (currently) fairly inefficient because we never used it in the game. I hope to make this faster soon.
84+
Object Mesh density takes a constant value (named constant). It searches over the triangles on the mesh of the object that it is attached to. If it finds a triangle with area greater than the constant value, it splits that triangle into four smaller triangles, in a way that still works effectively with the relativistic code. The reason for this code is that the lorenz contraction looks better with a higher concentration of vertices (since it is a vertex shader). Using this will slow down your startup, as the code is (currently) fairly inefficient because we never used it in the game. I hope to make this faster soon.
8585

8686
### Relativity Shader
8787

88-
This shader implements a vertex shader that runs the Lorenz contraction, and a fragment shader that implements the relativistic doppler shift. More detail is available in the comments of the code, in a line-by-line explanation.
88+
This shader implements a vertex shader that runs the Lorenz contraction, and a fragment shader that implements the relativistic doppler shift. More detail is available in the comments of the code, in a line-by-line explanation.
8989

9090
### Skybox Shader
9191

92-
This shader implements relativistic doppler shift on the skybox, because the lorenz contraction does not work (and should not really be used) on the very low-vertex skybox.
92+
This shader implements relativistic doppler shift on the skybox, because the lorenz contraction does not work (and should not really be used) on the very low-vertex skybox.
9393

9494
### Receiver and Receiver2 Script
9595

96-
This is the receiver side of the objects that create new moving characters. The receiver has to be given the transform of the sender object so that it knows where to face. Within the receiver object itself is the receiver2 object, whose only purpose is to know when the Moving Person object has entered its collider, and register a time for the Moving Person to delete itself. The receiver script simply takes a sender object's transform and points in that object's direction. The receiver2 script just has a collision modifier on it that causes any objects that collide with it to register a death time.
96+
This is the receiver side of the objects that create new moving characters. The receiver has to be given the transform of the sender object so that it knows where to face. Within the receiver object itself is the receiver2 object, whose only purpose is to know when the Moving Person object has entered its collider, and register a time for the Moving Person to delete itself. The receiver script simply takes a sender object's transform and points in that object's direction. The receiver2 script just has a collision modifier on it that causes any objects that collide with it to register a death time.
9797

9898
### Sender Script
9999

100-
The Sender script is the other half of the objects that create moving characters. It takes the name of a prefab in the Resources/Gameobjects folder, time interval, a velocity, and a receiver's transform. On start up it will point the object to look at the receiver, and at every interval specified will create a new Moving Person object. The Moving Person object will then move with a velocity specified in the Sender Script until it hits the Receiver2 object.
100+
The Sender script is the other half of the objects that create moving characters. It takes the name of a prefab in the Resources/Gameobjects folder, time interval, a velocity, and a receiver's transform. On start up it will point the object to look at the receiver, and at every interval specified will create a new Moving Person object. The Moving Person object will then move with a velocity specified in the Sender Script until it hits the Receiver2 object.
101101

102102
##Prefabs
103103

104104
### Receiver
105105

106-
The Receiver object is made up of two separate objects. It has the Receiver as the parent object, and the Receiver2 as the child object. The meshes on this prefab can be changed without worry, as can the colliders. Be warned, however, that the collider for the Receiver2 object must be small enough that the Moving Person objects can enter the receiver before they disappear on colliding with the receiver2 object. In order to make the Receiver object work, it must be given a Sender object's transform, and the Sender must have the Receiver's transform. Also, the Receiver2 object and the Moving Person must collide with each other, while the Receiver object should not collide with the Moving Person object. This can be done by editing the layers of the Receiver2 and Receiver object.
106+
The Receiver object is made up of two separate objects. It has the Receiver as the parent object, and the Receiver2 as the child object. The meshes on this prefab can be changed without worry, as can the colliders. Be warned, however, that the collider for the Receiver2 object must be small enough that the Moving Person objects can enter the receiver before they disappear on colliding with the receiver2 object. In order to make the Receiver object work, it must be given a Sender object's transform, and the Sender must have the Receiver's transform. Also, the Receiver2 object and the Moving Person must collide with each other, while the Receiver object should not collide with the Moving Person object. This can be done by editing the layers of the Receiver2 and Receiver object.
107107

108108
### Sender
109109

110-
The Sender object is much simpler than the Receiver object. It just requires the Sender script and the transform of a Receiver. The mesh on this object can also be changed to anything else, as can its collider as there are no restrictions on the size of the collider or the mesh.
110+
The Sender object is much simpler than the Receiver object. It just requires the Sender script and the transform of a Receiver. The mesh on this object can also be changed to anything else, as can its collider as there are no restrictions on the size of the collider or the mesh.
111111

112-
If you choose to leave the receiver transform blank and point it to a prefab with the firework script, it will launch self-deleting objects.
112+
If you choose to leave the receiver transform blank and point it to a prefab with the firework script, it will launch self-deleting objects.
113113

114114

115115
### Moving Person
116116

117-
This is the object that will be created at a Sender and move towards a Receiver. There is nothing to change on the scripts in the Moving Person object, as everything is specified by the Sender that creates the Moving Person. The mesh and collider on the Moving Person can also be modified without changing the function of the Moving Person.
117+
This is the object that will be created at a Sender and move towards a Receiver. There is nothing to change on the scripts in the Moving Person object, as everything is specified by the Sender that creates the Moving Person. The mesh and collider on the Moving Person can also be modified without changing the function of the Moving Person.
118+
119+
### Firework Launcher
120+
121+
Essentially a sender object that specifically references the Firework instead of a Moving Person.
122+
123+
### Firework
124+
125+
This object uses the Firework script and is referenced by the Firework Launcher prefab. Its timer and number of launched particles are set to reasonable numbers for the scene, but can be tweaked at will.
126+
127+
### Particle
128+
129+
A simple cube to be used as the "explosion" effect of a Firework.
118130

119131
## Materials
120132

121-
The materials that come provided with Open Relativity are built to work with the relativity shader. If you have an object that you want to create a new material for, you must make sure the material has the following properties. It must use the relativity shader, and if you want it to have IR or UV spectrum wavelengths on it, the IR/UV textures in the material must have a grayscale image.
133+
The materials that come provided with Open Relativity are built to work with the relativity shader. If you have an object that you want to create a new material for, you must make sure the material has the following properties. It must use the relativity shader, and if you want it to have IR or UV spectrum wavelengths on it, the IR/UV textures in the material must have a grayscale image.
122134

123135
## Controller Support
136+
OpenRelativity has two separate InputManager.asset files that should be switched out depending on your target platform. The standard one (that is already in the project) is designed to work on Windows with an Xbox 360 controller. The file labeled InputManager - OSXPS3 is built to use a PS3 controller on OSX platforms. Simply rename the file "InputManager.asset" and replace the existing InputManager.asset file in the Project Settings folder to change which configuration you use. Again, these configurations are for both separate platforms and separate controllers.
124137

125-
OpenRelativity has two separate InputManager.asset files that should be switched out depending on your target platform. The standard one (that is already in the project) is designed to work on Windows with an Xbox 360 controller. The file labeled InputManager - OSXPS3 is built to use a PS3 controller on OSX platforms. Simply rename the file "InputManager.asset" and replace the existing InputManager.asset file in the Project Settings folder to change which configuration you use. Again, these configurations are for both separate platforms and separate controllers.
138+
The controls are as follows:
126139

127-
The controls are as follows:
128-
Movement: left analog stick
129-
Camera Movement: right analog stick
130-
Invert Camera Y Axis: Y/Triangle button
131-
Toggle Color Effects: B/Circle Button
132-
Pause/Unpause Game: Start Button
133-
Change C: Left/Right D-Pad keys
140+
- Movement: left analog stick
141+
- Camera Movement: right analog stick
142+
- Invert Camera Y Axis: Y/Triangle button
143+
- Toggle Color Effects: B/Circle Button
144+
- Pause/Unpause Game: Start Button
145+
- Change C: Left/Right D-Pad keys
134146

135147
## License
136148

137149
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
138150

139151
## Acknowledgments
140152

141-
Thank you to Gerd Kortemeyer and the MIT Game Lab for inspiration and instruction on this project
153+
Thank you to Gerd Kortemeyer and the MIT Game Lab for their contribution and instruction on this project

0 commit comments

Comments
 (0)