Comments (16)
from ecs.example.
- Yes, initially I tried it. I add
// Create new state
this.world.SetState<TState>(WorldUtilities.CreateState<TState>());
ComponentsInitializer.DoInit();
this.Initialize(this.world);
world.SetSeed(1u);
// Add your custom systems here
But on Join to Room I have error
OutOfStateException: [ME.ECS] Could not perform action because current step is out of state (None). This could cause out of sync state. LogicTick state is required. You can disable this check by turning off WORLD_STATE_CHECK define.
ME.ECS.OutOfStateException.ThrowWorldStateCheck () (at Assets/Plugins/ecs/ECS/Core/Exceptions.cs:96)
ME.ECS.World.SetSeed (System.UInt32 seed) (at Assets/Plugins/ecs/ECS/Core/World/World.cs:714)
Example.Modules.PhotonReceiver.OnJoinedRoom () (at Assets/Example/Modules/NetworkModule.cs:185)
Photon.Realtime.MatchMakingCallbacksContainer.OnJoinedRoom () (at Assets/Example/Extra/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:3536)
Photon.Realtime.LoadBalancingClient.OnEvent (ExitGames.Client.Photon.EventData photonEvent) (at Assets/Example/Extra/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2718)
ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (ExitGames.Client.Photon.StreamBuffer stream) (at <7c99d57ff1b84df1ab45b8023b1063e2>:0)
ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands () (at <7c99d57ff1b84df1ab45b8023b1063e2>:0)
ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands () (at <7c99d57ff1b84df1ab45b8023b1063e2>:0)
Photon.Pun.PhotonHandler.Dispatch () (at Assets/Example/Extra/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:205)
Photon.Pun.PhotonHandler.FixedUpdate () (at Assets/Example/Extra/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:139)
I have rewritten some initialization and networking module. Made that the world is simulated only when you have already entered the room.
from ecs.example.
from ecs.example.
In what cases is it necessary to change the seed?
from ecs.example.
from ecs.example.
Can you tell why this might happen:
I created a little stress test.
void IUpdate.Update(in float deltaTime)
{
// this code for prevent input markers from non exist player entity
var playersFeature = world.GetFeature<PlayersFeature>();
var playerEntity = playersFeature.GetEntityByActorId(playersFeature.GetActivePlayerId());
if (playerEntity == Entity.Empty) return;
var dir = UnityEngine.Vector3.zero;
var r = UnityEngine.Random.Range(0, 100);
if (r > 50)
{
r = UnityEngine.Random.Range(0, 5);
switch (r)
{
case 0:
world.AddMarker(new InputDir(UnityEngine.Vector3.left));
break;
case 1:
world.AddMarker(new InputDir(UnityEngine.Vector3.right));
break;
case 2:
world.AddMarker(new InputDir(UnityEngine.Vector3.forward));
break;
case 3:
world.AddMarker(new InputDir(UnityEngine.Vector3.back));
break;
case 4:
world.AddMarker(new InputFire());
break;
}
}
}
At the moment one of the clients logs in, this error occurs. At the same time, it looks random. It happens at the 3 or at 5 client join.
from ecs.example.
from ecs.example.
I haven't done anything specific. I took an example, updated all staff and added an autoinput.
So I created a repository:
https://github.com/echeg/ecs.example
from ecs.example.
https://youtu.be/gWGj2rbNpGo
I recorded a video. Maybe this is due to the reconnection?
At the moments when it works, new cubes appear in scene. after reconnection the player is considered as new.
from ecs.example.
from ecs.example.
ok )
Another test:
With 2 players I simulate 10-20 mins - all ok (with out reconnection and same machine)
I change echeg@7180623
And with 3 players i have desync after 2-4 min
What to do in this case?
from ecs.example.
from ecs.example.
the error counter grows simultaneously on two out of 3 clients.
from ecs.example.
I record small video.
https://youtu.be/7zFCxhk4oBs
from ecs.example.
from ecs.example.
3 copies:
https://youtu.be/OjyOWOIV_T0
from ecs.example.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecs.example.