unity-technologies / fpssample Goto Github PK
View Code? Open in Web Editor NEWA first person multiplayer shooter example project in Unity
Home Page: https://unity.com/fps-sample
License: Other
A first person multiplayer shooter example project in Unity
Home Page: https://unity.com/fps-sample
License: Other
Hi
I am trying to clone the FSPSample from Git LFS ( according to Readme file I have to do it of this way)
I install the both Git and Git lFS and I initialized it by Git Bash and I used git lfs clone and git clone commands but I have this error
First I used the Git Lfs clone command
Castana@DESKTOP-DG5LS3H MINGW64 ~
$ git lfs install
Git LFS initialized.
Castana@DESKTOP-DG5LS3H MINGW64 ~
$ git lfs clone [email protected]:Unity-Technologies/FPSSample.git
WARNING: 'git lfs clone' is deprecated and will not be updated
with new flags from 'git clone'
'git clone' has been updated in upstream Git to have comparable
speeds to 'git lfs clone'.
Cloning into 'FPSSample'...
Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Error(s) during clone:
git clone failed: exit status 128
Then I used the git clone command I get the following error
Castana@DESKTOP-DG5LS3H MINGW64 ~
$ Git clone [email protected]:Unity-Technologies/FPSSample.git
Cloning into 'FPSSample'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
For it, Could anybody help me to fix it? Thanks
Alejandro Castan
Garry Newman (@garrynewman) of Garry's Mod fame had some thoughts on this project over at https://garry.tv/2018/10/24/unity-fpssample/
He's a pretty sharp guy and he had this to say in the summary:
The ECS stuff I could live without. That might be my ignorance of it speaking, but to me it feels like I’d like to see the performance of 16 player models with it vs without it before I add 30 new classes to seemingly just animate the model.
I realize that ECS is new and part of the reason for this project is to help mature the new feature. But, the perf benefit doesn't seem valid for a 16 player game and if it adds complications, should it be cut? Could you please justify the complexity?
Is the purpose of this project to illustrate best practices and be a starting point that we can build on, as described at https://www.youtube.com/watch?v=42Hc4IsGDqs? Or is it more just to help mature new systems?
Will it be shipping as a game that will get some usage and thus real maturity? Or is it always going to be a little half baked?
I am overall very pleased with the project. It has very good coding style and is clearly a product of great talent. Thank you!
Whenever I try to build the levels using project tools I get 4 errors of the same type, two of which are duplicates.
Error1: Serialized file size of 7.93 GB (8514840556 bytes) exceeds maximum. File name: 'Q:/Git/FPSSample/Temp/StagingArea/Data/BuildPlayer-Level_01_Background.sharedAssets'. Serialized files over 4.00 GB (4294967295 bytes) cannot be loaded by the player. Some likely ways to reduce this are utilizing asset bundles, re-balancing asset locations, or limiting their serialized size e.g. limiting the maximum texture sizes...
Error2: Serialized file size of 4.20 GB (4513320508 bytes) exceeds maximum. File name: 'Q:/Git/FPSSample/Temp/StagingArea/Data/BuildPlayer-Level_Menu_Background.sharedAssets'. Serialized files over 4.00 GB (4294967295 bytes) cannot be loaded by the player. Some likely ways to reduce this are utilizing asset bundles, re-balancing asset locations, or limiting their serialized size e.g. limiting the maximum texture sizes...
Tried opening the project and got a bunch of errors saying "Maximum number (256) of shader keywords exceeded ". Not sure why this is happening.
Hello - I am interested in running a dockerized FPSSample as a game-server on EKS. How one build the binaries for running the server in a linux instance? That will enable me to formulate the docker build steps.
I opened the project however the scene is empty and the Project does not show the level. I am using the 2018 .3 bo7 btw
Thank you for the great project. I've shipped the console, command, debuglog and configvar system in my Never Split the Party game.
It's really great but the AddCommand call was bugging me a bit so I added an attribute based system.
public class ConsoleCommandAttribute: Attribute
{
public string Name;
public string Description = "";
}
internal static void AddCommands(Type _class)
{
foreach (var method in _class.GetMethods(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public))
{
if (!method.IsDefined(typeof(ConsoleCommandAttribute), false))
continue;
if (!method.IsStatic)
{
GameDebug.LogError("Cannot use ConsoleCommandAttribute attribute on non-static method");
continue;
}
// TODO: safety check method signature
var attr = method.GetCustomAttributes(typeof(ConsoleCommandAttribute), false)[0] as ConsoleCommandAttribute;
var name = String.IsNullOrEmpty(attr.Name) ? method.Name : attr.Name;
name = name.ToLower();
if (name.StartsWith("cmd"))
name = name.Substring(3);
AddCommand(name, (MethodDelegate)Delegate.CreateDelegate(typeof(MethodDelegate), method), attr.Description);
}
}
// Example usage
[ConsoleCommand(Description = "Dance emote.")]
static void Dance(string[] arguments)
{
if (Player.Instance != null && !Player.Instance.Health.IsDead)
Player.Instance.Visual.SetTemporaryAnimation(CharacterAnimation.Swing, 3);
}
No sound at all.
I opened the project however the scene is empty and the Project does not show the level. I am using the 2019 .1 0a7
Hey, is there a way to put it in TPS ?
TPS view could be great also
There seem to bee too many shader keywords in the project as I am getting alot of these errors:
Maximum number (256) of shader keywords exceeded, keyword _DISTORTIONDEPTHTEST_OFF will be ignored.
Also everything is white when starting Level_01 in editor playmode.
I assume this could be a result of failed shader compilation?
Hello everyone,
My problem might sound stupid but even tho i do believe my english is okay, it isnt my main language and i don't seem to understand how to "clone" the project, download it, and open it with git LFS.
It says that the project should weight around 18GB. All i've done is download the zip file (250MB).
So if anyone would be willing to be give me a easy step by step i would be very grateful.
Thx everyone
Hello,
i am trying to figure out how to:
or at lasts how to change AutoBuild to use only my new blank level
but still can't figure it out
anyone who know or have any idea, how i can achieve such thing, or point me docs i missed where i can read about this (tried current documentations but it look very "empty"... only Documentation/SourceCode.md have some value for me topic i guess)
i tried to load - Assets/Scenes/Level_01/Level_01_Main.unity, and cut it down to minimum which initially worked (i got empty level with just flat terrain and spawns) when i hit play it spawns my character and was able to walk/run around and shoot (in editor) but once i had to close editor, when open my scene it no longer works - i guess it is something with this bundling and this tools as it say no camera etc. Project Tools - "Levels: Bootstrapper", "Quick Start is disabled. No Scenes defined"
Thanks in advance!
Hi,
I'm using your system, and found a typo, please update immediately:
Under Scripts/Utilities/interpolator
change
public float Direction()
{
return Mathf.Sign(m_TargetTime - m_StartValue);
}
to
public float Direction()
{
return Mathf.Sign(m_TargetValue- m_StartValue);
}
Also, you could improve speed by changing
public float Direction()
{
return Mathf.Sign(m_TargetValue- m_StartValue);
}
into
public float Direction()
{
return m_TargetValue- m_StartValue;
}
Running the client or the server through the editor (via Project Tools -> Quick Start -> Use Editor as) causes a connected client to throw an exception and fail. The exception is always some form of type mismatch (e.g. "ApplicationException: GAME ASSERT FAILED : Property: has unexpected field type:String Expected:Int"). Please see the full stack trace below.
After doing some digging I've found what is happening but I'm still not sure why it happens. The problem appears to be that the "typeId" for replicated entities gets offset when sending from server to client. This can be seen in NetworkClient.cs:623 and NetworkClient.cs:654 where ClientConnection.ReadSnapshot reads in values for NetworkConfig.schemaTypeIdContext and NetworkConfig.spawnTypeIdContext respectively. As far as I've seen, when the server writes these values they are correct but when the client receives the update the number is offset by 1. As a result, the type mismatch occurs and the client is stuck in the water. For example, when replicating the PlayerState the server sends a "typeId" of 23 (which is correct) but the client receives a "typeId" of 22 (which is actually MovableCube). One more interesting note is that when the server is run in the editor the offset is +1 whereas if the client is run in the editor the offset is -1. Hopefully, this is helpful information. I've reached a point where it's looking like network serialization issue and I'm unfortunately not sure where to start debugging there.
[Full Stack Trace]
ApplicationException: GAME ASSERT FAILED : Property: has unexpected field type:String Expected:Int
GameDebug.Assert[T1,T2,T3] (System.Boolean condition, System.String format, T1 arg1, T2 arg2, T3 arg3) (at Assets/Scripts/Core/GameDebug.cs:144)
NetworkReader.ValidateSchema (NetworkSchema+FieldType type, System.Int32 bits, System.Boolean delta, System.Int32 arraySize) (at Assets/Scripts/Networking/NetworkReader.cs:169)
NetworkReader.ReadString (System.Int32 maxLength) (at Assets/Scripts/Networking/NetworkReader.cs:66)
CapturePoint.Deserialize (NetworkReader& reader, IEntityReferenceSerializer refSerializer, System.Int32 tick) (at Assets/Scripts/Game/Systems/GameMode/Components/CapturePoint.cs:41)
ReplicatedEntityCollection.ProcessEntityUpdate (System.Int32 serverTick, System.Int32 id, NetworkReader& reader) (at Assets/Scripts/Game/Modules/ReplicatedEntity/ReplicatedEntityCollection.cs:68)
ReplicatedEntityModuleClient.ProcessEntityUpdate (System.Int32 serverTick, System.Int32 id, NetworkReader& reader) (at Assets/Scripts/Game/Modules/ReplicatedEntity/ReplicatedEntityModuleClient.cs:126)
NetworkClient+ClientConnection.ProcessSnapshot (ISnapshotConsumer consumer) (at Assets/Scripts/Networking/NetworkClient.cs:398)
NetworkClient.ProcessSnapshot (ISnapshotConsumer consumer) (at Assets/Scripts/Networking/NetworkClient.cs:1031)
ClientGameWorld.ProcessSnapshot (System.Int32 serverTick) (at Assets/Scripts/Game/Main/ClientGameLoop.cs:316)
ClientGameLoop.ProcessSnapshot (System.Int32 serverTime) (at Assets/Scripts/Game/Main/ClientGameLoop.cs:1023)
NetworkClient+ClientConnection.ReadPackage[TInputStream] (System.Byte[] packageData, System.Int32 packageSize, NetworkCompression.NetworkCompressionModel compressionModel, INetworkClientCallbacks loop) (at Assets/Scripts/Networking/NetworkClient.cs:440)
NetworkClient.OnData (System.Int32 connectionId, System.Byte[] data, System.Int32 size, INetworkClientCallbacks loop) (at Assets/Scripts/Networking/NetworkClient.cs:302)
NetworkClient.Update (INetworkClientCallbacks loop) (at Assets/Scripts/Networking/NetworkClient.cs:220)
ClientGameLoop.Update () (at Assets/Scripts/Game/Main/ClientGameLoop.cs:602)
Game.Update () (at Assets/Scripts/Game/Main/Game.cs:609)
Just downloaded the project yesterday, on 2018.3.0b6 after finishing the open project process there is an error with the serialization of some assets that says it was serialized on a newer version of Unity.
'ShaderIncludePathAttribute' is obsolete: '[ShaderIncludePath] attribute is being obsoleted. Your shader library should be under the Assets folder or in a package. To include shader headers directly from a package, use #include "Packages//"'
Can not build. Any fix here?
i got error
Clone: external filter 'git-lfs filter-process' failed Assets/Textures/Weapons/Terraformer_Weapon_A/Terraformer_Weapon_A_Container_A_Height.tif: smudge filter lfs failed
I'm having this error every time I try to start the game. And I have no clue of how can I get this x86 version.
Here is the full log:
`0: GameDebug initialized. Logging to ./game.log
0: cmd: exec user.cfg
0: cmd: exec game.cfg
0: SoundSystem using mixer: DefaultMixer
0: Mounted soundbank: Bank with 0 sounds
0: fps.sample initialized
0: Build type: release
0: BuildID: AutoBuild
0: Cwd: C:\Users\Usuario\Documents\GitHub\FPSSample\AutoBuild
0: SimpleBundleManager initialized
0: LevelManager initialized
0: InputSystem initialized
0: Loaded game config
0: cmd: client 127.0.0.1
1: Game loop ClientGameLoop requested
2: Network client initialized
2: Switching state: null -> Connecting
2: Client initialized
[ERR] Failed to load 'C:/Users/Usuario/Documents/GitHub/FPSSample/AutoBuild/AutoBuild_Data/Plugins/network.bindings.dll', expected x86 architecture, but was x64 architecture. You must recompile your plugin for x86 architecture.
[ERR] Failed to load 'C:/Users/Usuario/Documents/GitHub/FPSSample/AutoBuild/AutoBuild_Data/Plugins/network.bindings.dll', expected x86 architecture, but was x64 architecture. You must recompile your plugin for x86 architecture.
2: EXCEPTION network.bindings
at (wrapper managed-to-native) Experimental.Multiplayer.NativeBindings.network_recvmsg(intptr,void*,int,Experimental.Multiplayer.network_address&)
at Experimental.Multiplayer.SocketExtension.ReceiveMessageEx (System.IntPtr socket, System.Void* iov, System.Int32 iov_len, Experimental.Multiplayer.network_address& remote) [0x00000] in <610aaba902b642afa58ef8aff65ef5b9>:0
at Experimental.Multiplayer.IPv4UDPSocket.ReceiveMessage (System.Void* iov, System.Int32 iov_len, Experimental.Multiplayer.network_address& address) [0x00000] in <610aaba902b642afa58ef8aff65ef5b9>:0
at Experimental.Multiplayer.BasicNetworkDriver1[T].NativeReceive (Experimental.Multiplayer.Protocols.UdpCHeader& header, System.Void* data, System.Int32 length, Experimental.Multiplayer.network_address& address) [0x00058] in <610aaba902b642afa58ef8aff65ef5b9>:0 at Experimental.Multiplayer.BasicNetworkDriver
1[T].ProcessPackets (Experimental.Multiplayer.BitStream bs) [0x0004e] in <610aaba902b642afa58ef8aff65ef5b9>:0
at Experimental.Multiplayer.BasicNetworkDriver`1[T].Update () [0x000a9] in <610aaba902b642afa58ef8aff65ef5b9>:0
at SocketTransport.Update () [0x00000] in :0
at NetworkClient.Update (INetworkClientCallbacks loop) [0x00000] in :0
at ClientGameLoop.Update () [0x00000] in :0
at Game.Update () [0x0021e] in :0
2: DllNotFoundException: network.bindings
`
On Linux mint Unity will always crash on import (tested with 2018.3.0b4, 2018.3.0b5, 2018.3.0b6, 2018.3.0b7)
Is the official version supported or we need to stick to the beta still?
can you fix full errors o it ?
its not work fine always errors
Hello,
Is it me or other people also getting clone more then 30 GB.
Yesterday i put the git to clone with git lfs. I added this commands in sequence
git lfs install - which initialized lfs
git clone https://github.com/Unity-Technologies/FPSSample.git
Above command started the cloning of project on my local desktop. So i went for sleep, after i woke up, i saw a error that my disk have no space and so clone stopped. So look the properties of folder and its more than 30 GB.
Can anybody explain this ? or do i made any mistake in above commands ?
Hello !
After many attempts, I still have the same error :
9: Stripping code for Default (DevBuild)
9: Stripping 0 game object(s) and 0 behavior(s)
9: Scene Level_00 loaded
10: Switching state: Loading -> Active
10: [ERR] Unable to open archive file: AssetBundles/BundledResources/Client_Assets/d811c3d504a867742b1ea3d7ad8610ad
10: EXCEPTION Object reference not set to an instance of an object
at BundledResourceManager.LoadSingleAssetResource (System.String guid) [0x000a5] in <ed82e513e29b43619c8a69ea07bbed4c>:0
at CharacterModulePreview..ctor (GameWorld world, BundledResourceManager resourceSystem) [0x002a3] in <ed82e513e29b43619c8a69ea07bbed4c>:0
at PreviewGameLoop.EnterActiveState () [0x0001b] in <ed82e513e29b43619c8a69ea07bbed4c>:0
at StateMachine`1[T].SwitchTo (T state) [0x000f3] in <ed82e513e29b43619c8a69ea07bbed4c>:0
at PreviewGameLoop.UpdateLoadingState () [0x00011] in <ed82e513e29b43619c8a69ea07bbed4c>:0
at StateMachine`1[T].Update () [0x00000] in <ed82e513e29b43619c8a69ea07bbed4c>:0
at PreviewGameLoop.Update () [0x00000] in <ed82e513e29b43619c8a69ea07bbed4c>:0
at Game.Update () [0x0021e] in <ed82e513e29b43619c8a69ea07bbed4c>:0
10: NullReferenceException: Object reference not set to an instance of an object
that seem linked to the following error
213: Update tick invalid. Game tick:294 but current state is at tick:0
I tried following the guide multiple times, recloning the repository a few times already but still have the error.
I made sure to have git-lfs installed, which seem to be working.
I'm running with Unity 2018.30b12 and Windows 10.
Thanks !
Hi All
I am trying the FPS Sample project in Unity 2018.3.0b7 and when I play the bootstrapper Scene, I got the following in the game tab:
Exec failed : Could not find file D:\FPSSample\game.cfg
I guess that maybe when I clone the project, I could not download this game.cfg file, for it, Could anybody help me to fix it?
Thanks for your time
Alejandro
Hi everybody !
When I run the game with FPSSample.exe I have this error in consol
Console ready
0: GameDebug initialized. Logging to ./game_20181125_080614_373.log
0: cmd: exec -s user.cfg
0: cmd: exec -s boot.cfg
0: fps.sample initialized
0: Build type: release
0: BuildID: 20181124.Dev.0
0: Cwd: C:\Users\Kenny\Desktop\FPSSample_git_O\FPSSample\Builds\StandaloneWindows64\FPSSample_StandaloneWindows64_20181124.Dev.0
0: SimpleBundleManager initialized
0: LevelManager initialized
0: InputSystem initialized
0: Loaded game config
ProcessCommandLineArguments: C:\Users\Kenny\Desktop\FPSSample_git_O\FPSSample\Builds\StandaloneWindows64\FPSSample_StandaloneWindows64_20181124.Dev.0\FPSSample.exe
-batchmode -nographics -consolerestorefocus +serve Level_00
+game.modename assault +servername Samplegame
0: cmd: serve Level_00
0: cmd: game.modename assault
0: cmd: servername Samplegame
>exec -s user.cfg
>client.playername "Noname"
>config.fov "60"
>config.mousesensitivity "1.5"
>config.inverty "0"
>r.quality "Ultra"
>r.vsync "1"
>r.fullscreen "3"
>r.aamode "taa"
>r.aaquality "high"
>r.bloom "1"
>r.motionblur "1"
>r.ssao "1"
>r.grain "1"
>r.ssr "1"
>r.sss "1"
>r.roughrefraction "1"
>r.distortion "1"
>r.shadowdistmult "1.0"
>r.decaldist "200"
>r.gamma "1"
>r.resolution "1280x720@60"
>exec -s boot.cfg
>client
1: Game loop ClientGameLoop requested
2: Network client initialized
2: Switching state: null -> Browsing
2: Client initialized
2: EXCEPTION Object reference not set to an instance of an object
at ClientGameLoop.UpdateIdleScreen () [0x00006] in <667be820a9284a1396c44ca32488ca96>:0
at ClientGameLoop.UpdateBrowsingState () [0x00019] in <667be820a9284a1396c44ca32488ca96>:0
at StateMachine`1[T].Update () [0x00000] in <667be820a9284a1396c44ca32488ca96>:0
at ClientGameLoop.Update () [0x00011] in <667be820a9284a1396c44ca32488ca96>:0
at Game.Update () [0x0021e] in <667be820a9284a1396c44ca32488ca96>:0
2: NullReferenceException: Object reference not set to an instance of an object
>load level_menu
3: loading:AssetBundles/level_menu
3: loading:AssetBundles/level_menu
3: Loading Assets/Scenes/Level_Menu/Level_Menu_Background.unity
>serve Level_00
3: Game loop ServerGameLoop requested
4: ClientGameLoop shutdown
4: Switching state: null -> Idle
4: Listening on 192.168.1.13, 192.168.27.1, 192.168.121.1 on port 7913
4: Network server initialized
Cannot add command load twice
4: loading:AssetBundles/Level_00
4: Game loop initialization threw exception : (TODO : Implement unload during load)
at LevelManager.UnloadLevel () [0x00016] in <667be820a9284a1396c44ca32488ca96>:0
at LevelManager.LoadLevel (System.String name) [0x00008] in <667be820a9284a1396c44ca32488ca96>:0
at ServerGameLoop.LoadLevel (System.String levelname, System.String gamemode) [0x0002a] in <667be820a9284a1396c44ca32488ca96>:0
at ServerGameLoop.CmdLoad (System.String[] args) [0x00006] in <667be820a9284a1396c44ca32488ca96>:0
at ServerGameLoop.Init (System.String[] args) [0x0037f] in <667be820a9284a1396c44ca32488ca96>:0
at Game.Update () [0x00189] in <667be820a9284a1396c44ca32488ca96>:0
4: Game loop initialization failed ... reverting to boot loop
>game.modename assault
>servername Samplegame
249: cmd: menu 1 3
>menu 1 3
250: NullReferenceException: Object reference not set to an instance of an object
I think the server is running too late,
because when I run the game with start
the server is running first and I do not have an error
That's the difference I found in the console
left is when it bug when I run with the FPSSample.exe,
right when I run with the command start in unity and everything works well
Do you have an idea why the server is run after the client (in 2nd) when I use FPSSample.exe
or how to fix this problem ?
Thank you in advance for your help !
Local network is stable, but open internet is not, especially for mobile environment. So if there is a variable to set, and simulate the package loss would be good.
Are there plans to get this project working on macOS?
We realize this project is to showcase what is possible at the time it is released using the latest alpha/beta code bases. Would it be possible for folks to provide guidance to strip this project down to just a main menu, level loader, level with just a simple plane, and all the mechanics (1st/3rd person camera, animation, etc)?
While the new levels look amazing, we would like to see the steps to slim this down to the bare essentials while keeping all the features. So dropping the assets, custom editor forms, etc.
What are we trying to accomplish? Well to be frank, we are trying to figure out how to strip down all the excellent networking code. Sure we could use the new MultiPlayer code on GitHub, but it doesn't highlight all the additional features added by this project such as client predictions, etc.
Thanks for the help from anyone.
Hi!
After following all the build steps and launching the game, I don't seem to be able to run it. Here's the log:
0: GameDebug initialized. Logging to ./game.log
0: cmd: exec user.cfg
0: cmd: exec game.cfg
0: SoundSystem using mixer: DefaultMixer
0: Mounted soundbank: Bank with 0 sounds
0: fps.sample initialized
0: Build type: release
0: BuildID: AutoBuild
0: Cwd: E:\FPSSample\AutoBuild
0: SimpleBundleManager initialized
0: LevelManager initialized
0: InputSystem initialized
0: Loaded game config
0: cmd: client 127.0.0.1
1: Game loop ClientGameLoop requested
2: Network client initialized
2: Switching state: null -> Connecting
2: Client initialized
2: Trying to connect to 127.0.0.1 (attempt #1)...
3577: Server never replied when trying to connect ... disconnecting
3577: Trying to connect to 127.0.0.1 (attempt #2)...
7177: Server never replied when trying to connect ... disconnecting
7177: Failed to connect to server
7177: Switching state: Connecting -> Browsing
I tried disabling the firewall and the antivirus just in case, but nope, it just doesn't work.
Greetings!
this is error 👍
FPSSample-master/FPSSample-master/Packages/com.unity.render-pipelines.core/Runtime/Volume/Volume.cs(5,6): error CS0246: The type or namespace name
ExecuteAlways' could not be found. Are you missing an assembly reference?`
this is code
using System.Collections.Generic;
namespace UnityEngine.Experimental.Rendering
{
[ExecuteAlways]
public class Volume : MonoBehaviour
{
[Tooltip("A global volume is applied to the whole scene.")]
public bool isGlobal = false;
[Tooltip("Volume priority in the stack. Higher number means higher priority. Negative values are supported.")]
public float priority = 0f;
[Tooltip("Outer distance to start blending from. A value of 0 means no blending and the volume overrides will be applied immediately upon entry.")]
public float blendDistance = 0f;
[Range(0f, 1f), Tooltip("Total weight of this volume in the scene. 0 means it won't do anything, 1 means full effect.")]
public float weight = 1f;
// Modifying sharedProfile will change the behavior of all volumes using this profile, and
// change profile settings that are stored in the project too
public VolumeProfile sharedProfile;
// This property automatically instantiates the profile and makes it unique to this volume
// so you can safely edit it via scripting at runtime without changing the original asset
// in the project.
// Note that if you pass in your own profile, it is your responsability to destroy it once
// it's not in use anymore.
public VolumeProfile profile
{
get
{
if (m_InternalProfile == null)
{
m_InternalProfile = ScriptableObject.CreateInstance<VolumeProfile>();
if (sharedProfile != null)
{
foreach (var item in sharedProfile.components)
{
var itemCopy = Instantiate(item);
m_InternalProfile.components.Add(itemCopy);
}
}
}
return m_InternalProfile;
}
set
{
m_InternalProfile = value;
}
}
internal VolumeProfile profileRef
{
get
{
return m_InternalProfile == null
? sharedProfile
: m_InternalProfile;
}
}
public bool HasInstantiatedProfile()
{
return m_InternalProfile != null;
}
// Needed for state tracking (see the comments in Update)
int m_PreviousLayer;
float m_PreviousPriority;
VolumeProfile m_InternalProfile;
void OnEnable()
{
m_PreviousLayer = gameObject.layer;
VolumeManager.instance.Register(this, m_PreviousLayer);
}
void OnDisable()
{
VolumeManager.instance.Unregister(this, gameObject.layer);
}
void Update()
{
// Unfortunately we need to track the current layer to update the volume manager in
// real-time as the user could change it at any time in the editor or at runtime.
// Because no event is raised when the layer changes, we have to track it on every
// frame :/
int layer = gameObject.layer;
if (layer != m_PreviousLayer)
{
VolumeManager.instance.UpdateVolumeLayer(this, m_PreviousLayer, layer);
m_PreviousLayer = layer;
}
// Same for priority. We could use a property instead, but it doesn't play nice with the
// serialization system. Using a custom Attribute/PropertyDrawer for a property is
// possible but it doesn't work with Undo/Redo in the editor, which makes it useless for
// our case.
if (priority != m_PreviousPriority)
{
VolumeManager.instance.SetLayerDirty(layer);
m_PreviousPriority = priority;
}
}
#if UNITY_EDITOR
// TODO: Look into a better volume previsualization system
List<Collider> m_TempColliders;
void OnDrawGizmos()
{
if (m_TempColliders == null)
m_TempColliders = new List<Collider>();
var colliders = m_TempColliders;
GetComponents(colliders);
if (isGlobal || colliders == null)
return;
var scale = transform.localScale;
var invScale = new Vector3(1f / scale.x, 1f / scale.y, 1f / scale.z);
Gizmos.matrix = Matrix4x4.TRS(transform.position, transform.rotation, scale);
Gizmos.color = new Color(0f, 1f, 0.1f, 0.35f);
// Draw a separate gizmo for each collider
foreach (var collider in colliders)
{
if (!collider.enabled)
continue;
// We'll just use scaling as an approximation for volume skin. It's far from being
// correct (and is completely wrong in some cases). Ultimately we'd use a distance
// field or at least a tesselate + push modifier on the collider's mesh to get a
// better approximation, but the current Gizmo system is a bit limited and because
// everything is dynamic in Unity and can be changed at anytime, it's hard to keep
// track of changes in an elegant way (which we'd need to implement a nice cache
// system for generated volume meshes).
var type = collider.GetType();
if (type == typeof(BoxCollider))
{
var c = (BoxCollider)collider;
Gizmos.DrawCube(c.center, c.size);
Gizmos.DrawWireCube(c.center, c.size + invScale * blendDistance * 2f);
}
else if (type == typeof(SphereCollider))
{
var c = (SphereCollider)collider;
Gizmos.DrawSphere(c.center, c.radius);
Gizmos.DrawWireSphere(c.center, c.radius + invScale.x * blendDistance);
}
else if (type == typeof(MeshCollider))
{
var c = (MeshCollider)collider;
// Only convex mesh colliders are allowed
if (!c.convex)
c.convex = true;
// Mesh pivot should be centered or this won't work
Gizmos.DrawMesh(c.sharedMesh);
Gizmos.DrawWireMesh(c.sharedMesh, Vector3.zero, Quaternion.identity, Vector3.one + invScale * blendDistance * 2f);
}
// Nothing for capsule (DrawCapsule isn't exposed in Gizmo), terrain, wheel and
// other colliders...
}
colliders.Clear();
}
#endif
}
}
error on first
[ExecuteAlways]
Hi guys,
This project looks great and I would like to set up. Unfortunately, README example is not working for Linux. I tried everything as specified (installed the newest stable Unity for Linux, opened the project and waited for it to parse, reimported needed stuff, opened level 00, started preview), and still don't even get the preview to work - I can hear the sound but it doesn't render anything. Console says ArgumentException: Kernel 'KSapleCopy4_1_x_8' not found
.
I even tried to get it in the most reproducible state so I synced the branch to v0.0.0, and installed Unity 2018.3.0b4 (as that was the last one being used for developing Unity). Still, the issue is the same.
I would like to use this game, but I don't even get to start it... I'm just trying to execute the basic example in the README, am I doing something wrong?
I can't create a server ingame. What do i need to do?
In Unity it worked fine, but in the build it didn‘t work at all.
It says, that a process isn‘t running.
Platforms : Windows (client and server) and Linux (server only)
I assume Linux client support will be coming too?
Hi all,
There is the potential for this to act as a hub for implementations of PvP community standards, such as
I certainly would be interested in contributing and would gain benefit from it.
Is there any internal interest in Unity for creating a hub that allows for community contributions of implementations for these various systems?
329: EXCEPTION Exception has been thrown by the target of an invocation.
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0
at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <00000000000000000000000000000000>:0
at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) [0x00000] in <00000000000000000000000000000000>:0
at System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <00000000000000000000000000000000>:0
at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0
at ReplicatedEntityCollection.FindSerializers (Unity.Entities.EntityManager entityManager, Unity.Entities.Entity entity) [0x00000] in <00000000000000000000000000000000>:0
at ReplicatedEntityCollection.Register (Unity.Entities.EntityManager entityManager, System.Int32 entityId, Unity.Entities.Entity entity) [0x00000] in <00000000000000000000000000000000>:0
at HandleReplicatedEntitySpawn.Initialize (Unity.Entities.Entity entity, ReplicatedEntity spawned) [0x00000] in <00000000000000000000000000000000>:0
at InitializeComponentSystem`1[T].OnUpdate () [0x00000] in <00000000000000000000000000000000>:0
at Unity.Entities.ComponentSystem.InternalUpdate () [0x00000] in <00000000000000000000000000000000>:0
at ReplicatedEntityModuleServer.HandleSpawning () [0x00000] in <00000000000000000000000000000000>:0
at ServerGameWorld.ServerTickUpdate () [0x00000] in <00000000000000000000000000000000>:0
at ServerGameLoop.UpdateActiveState () [0x00000] in <00000000000000000000000000000000>:0
at Game+UpdateDelegate.Invoke () [0x00000] in <00000000000000000000000000000000>:0
at ServerGameLoop.Update () [0x00000] in <00000000000000000000000000000000>:0
at Game.Update () [0x00000] in <00000000000000000000000000000000>:0
329: ExecutionEngineException: Attempting to call method 'NetworkPredictedDataHandler`1[[CharPredictedStateData, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::.ctor' for which no ahead of time (AOT) code was generated.```
After running through the read me file step by step. I begin to build the project. Near the end of compiling the game and error appears: http://prntscr.com/lawm9x
I've checked and UnityPlayer.png does exist in the Resources folder. Clicking "Try Again" has no effect. I'm forced to hit Cancel, or Force Quit.
I have:
I am trying to build FPSSample for StandAloneLinux64 from Win10.
However I receive error message bcl.exe did not run properly.
Has anybody succeeded to build game for Linux?
Or maybe has some idea about what may be causing this error, where to get more info about the error, or even know solution.
Full Error:
Exception: D:\repo\UnityFPS\Library\PackageCache\[email protected]\bcl.exe did not run properly!
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:130)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
Unity.Burst.Editor.BurstAotCompiler.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/[email protected]/Editor/BurstAotCompiler.cs:220)
UnityEditor.Build.BuildPipelineInterfaces.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:452)
UnityEditor.BuildPipeline:BuildPlayer(String[], String, BuildTarget, BuildOptions)
BuildTools:BuildGame(String, String, BuildTarget, BuildOptions, String, Boolean) (at Assets/Scripts/EditorTools/Editor/BuildTools.cs:113)
BuildWindow:DrawBuildTools() (at Assets/Scripts/EditorTools/Editor/BuildWindow.cs:334)
BuildWindow:OnGUI() (at Assets/Scripts/EditorTools/Editor/BuildWindow.cs:132)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Everytime I try to play the game with the windows binaries, I keep getting game assert failed
Excellent project! Does it include the new Input System? If not, can it be added?
Also, please add a paragraph on server frame rates to support VR.
When I try to build using : FPS Sample > BuildSystem. Use CreateBuildWindows64 or the "Build game" button of the projet tools windows, I have this message :
Maximum number (256) of shader keywords exceeded, keyword MASK_OFF will be ignored. You will have to delete some shaders or make them use less keywords. Keywords used in project now: APPLY_FORWARD_FOG AUTO_EXPOSURE BEVEL_ON BILLBOARD_FACE_CAMERA_POS ... (lot of things) UnityEditor.BuildPipeline:BuildPlayer(String[], String, BuildTarget, BuildOptions) BuildTools:BuildGame(String, String, BuildTarget, BuildOptions, String, Boolean) (at Assets/Scripts/EditorTools/Editor/BuildTools.cs:112) BuildTools:CreateBuildWindows64(Boolean) (at Assets/Scripts/EditorTools/Editor/BuildTools.cs:427) BuildTools:CreateBuildWindows64() (at Assets/Scripts/EditorTools/Editor/BuildTools.cs:407)
Restarting unity don't change anything
Edit : I'm using v 2018.3.0b9
Typing past the width of the screen crashes the server with continuous exceptions.
Parameter name: count
System.String.CreateString (Char c, Int32 count)
(wrapper managed-to-managed) string:.ctor (char,int)
ConsoleTextWin.DrawInputline ()
ConsoleTextWin.ConsoleUpdate ()
Console.ConsoleUpdate ()
Thrown from this new String call with, I'm guessing, a negative value.
void DrawInputline()
{
System.Console.CursorLeft = 0;
System.Console.CursorTop = System.Console.BufferHeight - 1;
System.Console.BackgroundColor = System.ConsoleColor.Blue;
System.Console.Write(m_CurrentLine + new string(' ', System.Console.BufferWidth - m_CurrentLine.Length - 1));
System.Console.CursorLeft = m_CurrentLine.Length;
}
Hello. Thank you for this great example project. Sadly the Start-button in the "project tools"-Window doesn't work. It throws the following error:
Win32Exception: ApplicationName='C:/Users/michi/Programming/Unity/FPSSample/Assets/../AutoBuild/AutoBuild.exe', CommandLine=' +serve Level_01 -batchmode -nographics ', CurrentDirectory='AutoBuild', Native error= The system cannot find the file specified.
Cheers,
Michael
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.