Unreal Engine 4 multiplayer LAN - Second player not spawning - networking

I am trying to set up a basic LAN two player game on UE4, I have been able to do the following:
Host a game
Search for games being hosted
Join the hosted game (partly)
I need help with the following:
Spawning the second players character.
Second player to control the second spawned character.
At the moment when my second game instance joins the hosted instance however the camera stays fixed in the starting spot with no spawned character to move. It has joined the hosted game because I can see the first player moving around from player two's screen.
The picture of the blueprints are below. Let me know if you need more info, thanks for the help!! :)
https://s30.postimg.org/opxn89pgh/2.png
https://s30.postimg.org/km19tiiw1/6.png

I found the error in the game mode. i needed to change default pawn class to thirdpersoncharactor.

Related

Skype or Zoom without mouse

I am trying to set up a simple video-call device for a senior that has absolutely no idea of technology.
The plan:
An old Laptop connected to a monitor and a USB keypad. The laptop boots up (win 7 or 10) and starts skype or zoom ( some form of Kiosk). The senior can only accept a call with on big green button. The senior can call people with a push of a button.
The Problem:
I could not find any way to make a call (zoom or skype... this would be widely accepted from other not very tech-friendly relatives) with just a key combination/ shortcut that does not include a mouse.
The solution so far (not the road I want to continue):
I made a video call device with a pi, an old monitor, just one button, and a jitsi-meet (browser)
my current setup does not enable the senior in question to actively make calls and is generally too unreliable
I am looking forward to someone pointing me in the right direction

Unity Networking - Rigidbody2D

I'm working on a multiplayer soccer game (1 vs 1).
- There is a ball in scene and a rigidbody2D is attached to it.
- Player1(rigidbody2D) is instantiating with Network.Instantiated when server is registered.
- Player2(rigidbody2D) is instantiating with Network.Instantiated when client is connected to server.
Player1 sends its position with RPC in Update function.
Player2 sends its position with RPC in Update function.
Server sends ball's position and rotation with RPC in Update function.
In this case there is jittering problem in opposite side (I mean, while controlling Player1, which is server, on client side Player1's movement is not smooth and while controlling Player2, which is client, on server side Player2's movement is not smooth)
This is my first problem, i'm not sure it will continue when i build and run it on phones.
My second and the biggest problem is Player2's rigidbody2D is NOT working well, i mean, when he hits the ball, OnCollisionEnter2D function is WORKING (there is an AddForce line in there), but the standard rigidbody2D behavior is not working, when i walk to ball, Player2 and the ball just stops when i delete the OnCollisionEnter2D function! ---- But Player1's rigidbody2D works pretty well. So, i couldn't figure why it is not working well, the ball isn't being instantiated on server or client side, there is no reason to act different to each player for ball...
Please help me with this two problems. In addition, if you have any better idea to build this type of game's network structure please tell me.

Unity Multiplayer player synchronization

I am working on a unity mobile game. Which is like a multiplayer version of temple run. Because this game is meant for mobile there is a fluctuating latency generally in the range of 200ms - 500ms.
Since the path is predetermined and actions the user can perform are limited (jump,slide, use powerup etc) , the remote player keep running on the path until it receives the updated state from its local player.
This strategy generally works pretty well since I only need to send limited amount of data over the network but there is a specific case in which I am having issues.
In the game, players die on the specific positions (obstacles).
I want remote players to die on the same obstacle/position as local player but due to latency in sending message, the remote player crosses the obstacle by the time it receives the death message.
Is there a way to sync the players on the deaths.
One of the things I tried was moving the remote player back to the local players death position but not only does it look awkward visually but can also raise other syncing issues.
Is there some other better way to do this ?
One way I may recommend is to make one player acts like server (not real server). The server-player will do all the computation like moving, jumping, creating scenes, etc. Then the server-player will send all the data to sync with the client-player. The client-player get the data and process game state. The client-player can also send his action (left-right-jump-slide) to the server-player. This way both player will have the same state of the game like position, die. You also need to deal with latency by adding some prediction.
So the solution I implemented was I spawned all the remote player behind enough so they can have some time to receive the information that local player was died on specific obstacle. And in the end there is a straight path where I just sync players again. So that result is displayed correctly.

IMediaControl::Run followed by IMediaControl::Stop followed by IMeidaControl::Run doesn't switch on certain Onboard cameras

I have a DirectShow webcam application. I make use of Sample Grabber to get the buffer callbacks and IVideoWindow to control the display co-ordinates for the Preview. I have Preview and Capture Streams which I run as below.
g_pBuild->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,cam,g_pGrabberF,pNullRenderer2); g_pBuild->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video,cam,NULL,NULL);
On certain On board cameras, IMediaControl::Run followed by IMediaControl::Stop followed by IMediaCOntrol::Run doesn't switch on the camera.
Extenal USB cameras work properly here. How can I diagnose more on this? Any pointers, please help.
Maybe its specific to a certain hardware issue in the unit.
Do a quick test by adding sleep of 1 sec between calls.
If it does help than you need to find a way to know when to unit state in idle or not.
There are two important parts of the question which you did not provide:
Filter graph topologies
HRESULTs of the method calls
A problem you might be having is that one of the filters in the topology does not handle well state transitions and fails somewhere between states. Supposedly your second Run meets it still trying to complete Stop. You might get a HRESULT there which indicates the issue (better for you) or the filter fails silently.
The filter graph's is the unlikely source of the bug itself. Chances are high that it does everything flawlessly, however since internally it distributes the calls between filters, one of the filter is letting you down.

Smooth MultiPlayer movement

i am developing a multiplayer roleplaying game, (No, its not a mmorpg. ;)
My current setup is like this.
Client tells the server "I want to move forward"/"I want to move backwards", the server then updates your entity, and informs all clients in the area about the change. The server is also updating each entity every 20ms and sending updates every 100ms to the clients, these updates contains position, velocity, rotation etc.
So far so good, however i have nothing in store for smoothing the movement between the packets on the client side, and i must say, i can not get it working. I have been reading up on prediction, interpolation, deadreackoning but its all a big mess for me.
So right now i am just doing something like "Position = Packet.Position", which causes a very stuttering movement.
So, what i want help with is, how do i get a more smooth movement? Have been looking at the XNA Prediction Sample, but i could not get it right.
Thanks //F
Read Valve's description of their multiplayer protocol. It should be instructive, and gives a very clear example on how you do the prediction/interpolation.
I'd suggest the idea from another question (see the accepted answer)
Here the client calculates its position itself as if its not a network game. Client regularly sends his current position to the server. And if client cheats or can't continue moving in the chosen direction, server just sends the client his correct position.
The same algorithm was used in Ultima Online (at least when I was playing it 10 years ago)
I solved it by running a ghost entity alongside with my main one.
The ghost will get updated every frame aswell, but whenever a packet comes in, his values are set to the values of the packet.
I then gradually tweak the real entity to where the ghost is.

Resources