Questions tagged [multithreading]
Multithreading allows multiple threads to exist within the context of a single process sharing same resources but are able to execute independently.
279 questions
1
vote
0
answers
126
views
Correctly handling input in case of frame drop
My game loop looks roughly like this:
...
0
votes
0
answers
85
views
Splitting world data between multiple threads in C++
I'm currently working on world management system for my multi-threaded game engine in C++. The problem I'm facing right now is synchronizing world data between main and render thread. The current ...
0
votes
0
answers
161
views
Multithreading Chunkbuilding - Thread.Start() acts as it is on the main thread
I'm building a game from scratch using OpenTK, in C#. It is in its base form a mesh-based voxel engine. I have a decent startup on the chunk building algorithm, multiple blocks, block data, etc, but ...
1
vote
0
answers
97
views
Physics interpolation given an asynchronous physics thread
I've followed https://gafferongames.com/post/fix_your_timestep/ to do interpolated physics. I have a separate thread entirely from my graphics thread. I use vulkan which allows me to do asynchronous ...
0
votes
1
answer
744
views
Should networking and rendering be separated in multiple threads?
I've been trying to code a multiplayer client/server prototype game using SFML's networking.
My server and client use TcpSelectors to wait for a certain amount of time for incoming packets without ...
1
vote
1
answer
566
views
How would you write a multithreaded gameloop in C++20 (+) or C++/WinRT?
What are the pros/cons of using either C++20 std:async or C++/WinRT's asynchronous thread and messaging support?
What would the code look like when implementing multithreaded game-loops that ...
1
vote
1
answer
288
views
Multithreading in extra large MMO worlds
How is a gameworld of super large size handled? I was always wondering how games handle large MMO worlds. Until now I thought that separation of areas was the key for games like World of Warcraft. In ...
0
votes
1
answer
2k
views
How to use Unity job system to do background work spanning multiple frames?
I have a slow level generation algorithm that freezes the main thread when it runs.
I found this post which is exactly the same problem, but predates the Jobs system.
All the jobs examples I found are ...
1
vote
1
answer
2k
views
Using Unity Jobs to encode file to PNG and then save it on Main Thread
I have a following code , and i can not retrive encoded Output from Job.
If I Use JOB :
The result is not a valid png file. What I get is a 67,2 MB file which can not be opened with any image editor ...
0
votes
0
answers
250
views
What is the most performant way for a game engine to poll gamecontrollers?
I am working on a game engine, and currently I hesitate on this decision.
I developed a library that allows Dualsense and Dualshock4 devices to be used in the engine. XBox Support is made possible via ...
1
vote
1
answer
432
views
Wait for a function to return value without impacting framerate
I'm looking to do some possibly heavy calculation in my game. An agent in my game needs to evaluate up to 1000 objects while performing heavy calculations to select his next job.
I want to either ...
1
vote
0
answers
140
views
Advice on Multi-Threading Vertex Buffers in Vulkan (or any api)
I have managed to multithread everything in my voxel engine besides two vkCmdCopyBuffer() calls that constantly update a single massive vertex and index buffer using an array of thousands of regions, ...
1
vote
1
answer
713
views
Multithreading vs Asynchronous game loop for multiplayer online game?
I'm trying to create a turn based multiplayer online game where players can be grouped in a room/lobby and play (similar to Ludo but number of players can be more than 4). There can be multiple such ...
-1
votes
1
answer
206
views
Parallel transformations tree update
I create my own pet-project graphics engine for the learning and research purposes.
Now I'm trying to create a more efficient scene transformations update technique. My current approach is the linear ...
0
votes
1
answer
288
views
Should a server run all maps in one loop, or a thread/game loop per map?
I'm working on a real time multiplayer browser-based game.
The game is top down on variable size tile based maps. There is no central map where all players come together, the entire game plays out in ...
0
votes
2
answers
603
views
Running multiple game servers on single host
I want to use a vps/dedicated server for game hosting. I expect hosting a lot of servers on that. For the connection, should I assign a unique port for every server or change IPs for every server. And ...
0
votes
2
answers
592
views
is unity DOTS mature enough to build a whole project on it? [closed]
maybe you assume this question opinion based but its not. please read the whole question.
the question has 2 aspects.
are all features implemented? just better say, can i do everything or any ...
1
vote
2
answers
1k
views
How would I optimize that piece of code using Unity?
I'm doing filtering on a depth image and I would like to convert that piece of code into job system of unity, because it's so slow. The image update is called each frame
...
11
votes
2
answers
16k
views
Should I use Async & Await, instead of Coroutines, in Unity?
Should I use Async & Await in Unity? Or should I keep using Coroutines? If I should use Async & Await, how can I do so in a manner comparable to Coroutines?
1
vote
0
answers
116
views
Binding Lua Function to Perform tasks using std::async
I am trying to load a bunch of mesh resources in the format of .obj files. Some of the files are very high in poly count so when loading using the below method It takes more than 10 seconds. I would ...
2
votes
1
answer
3k
views
Multithreaded design for a game server
I would like to start developing my own game. Basically, the game has a "world" that players can travel around and modify. Think of it as a much more realistic version of Minecraft or an open world ...
0
votes
1
answer
388
views
Worker threads are not being utilized in Time rewind system, is this job system really multi-threaded?
I am trying to make a simple time rewind mechanic. It's working but it becomes slower as number of game objects increases. I decided to give Job System a shot. My idea is to interpolate between ...
0
votes
1
answer
193
views
Managing large amounts of data and processes for an economy management game
I'm making a management game in the vein of Anno or Stellaris, but I'm unsure how to manage all my data efficiently.
Short example: the player controls multiple islands. Each island has factories on ...
0
votes
2
answers
1k
views
Should I create thread for both UDP and TCP?
So I have TCP connection for stuff like leveing, player info, etc..And I have UDP datagram for stuff like player position, rotation, etc..Should I create new thread for both TCP and UDP on both client ...
1
vote
1
answer
2k
views
Multithreading: Each system on a different thread or a thread pool?
I'm building a fairly involved game using OpenGL and C++. I've been thinking about how to implement multithreading, and the two options are:
1) Each system (Graphics, Audio, Physics, et cetera) gets ...