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.

Filter by
Sorted by
Tagged with
0
votes
2answers
50 views

How to process events as well as do OpenGL rendering using multithreading?

I am working on a very complicated graphics rendering, using OpenGL, and it is very time consuming, in the sense that it creates a delay in the event handling, of my application to an extend that, the ...
0
votes
1answer
46 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 ...
2
votes
1answer
73 views

Question on parallelizing ECS Systems

Learning & Implementing an ECS system for my game, I'm wondering how I am supposed to parallelize the systems on multiple threads. Different systems can't run at the same time (unless they operate ...
0
votes
1answer
72 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 ...
1
vote
1answer
50 views

Multithreaded callback

I'm making a multiplayer game where players fight in vehicles, and I am doubting my server architecture. As it will be physics, network and AI intensive I would like to split these 3 topics into their ...
0
votes
1answer
44 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
1answer
66 views

How can I handle hundreds of calculation heavy nodes at the same time?

I'm currently trying to implement a basic boids simulation with godot in c#. Currently I managed to implement evasive behavior which works fine for a boid count of roughly 300. Everything beyond that ...
1
vote
2answers
157 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
votes
1answer
83 views

Is Dedicating A Thread To Inputs A Good Idea In Game Design?

Say I design my game targeting a specific PC to run it on 120 frames per second. And say I need to get Input data from the controller at a frequency of 800 times per second, and feed that input data ...
1
vote
2answers
378 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 ...
2
votes
1answer
150 views

How do multiplayer servers handle receiving, handling, and sending packets?

I want to make a fighter jet simulator game. The server (authoritative) and client communicate over udp. The server sends out updates about the gamestate at a fixed rate. Think of plane positions, ...
0
votes
0answers
25 views

Level loading with threads runs sometimes and doesn't run sometimes

I am trying to load a scene in the background while displaying a loading screen till the scene loads and then changing the scene to the loaded scene and I am using threads and ResourceLoader to do so. ...
5
votes
2answers
1k 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?
0
votes
1answer
25 views

Unity: How to connect to server with status in dialog

I am trying to build in unity a basic logon screen. Now I'm building on something if the connection will have delay or so... There will be a dialog, where the progress of connection to server will be ...
1
vote
0answers
44 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
1answer
187 views

In Unreal why is it safe to access a UTexture2D's properties from the render thread despite the documentation stating this is not allowed?

I've been trying to implement something that will update textures on the render thread from a background thread. And from what I've read of the unreal engine documentation you should never access a ...
2
votes
1answer
838 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
1answer
48 views

Box2d: crash on createBody in beginContact callback

I am getting this error on creating body in contactListener ...
0
votes
0answers
164 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
0answers
41 views

Help deciding data structure for spatial partitioning, using only value-types in c#

I simply want to implement some sort of grid where I can sort units in an RTS into cells, and then for each unit check to avoid other units and attack other units, in 2d. My map grid is currently 10 ...
0
votes
1answer
111 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
0answers
67 views

How should I cycle my game to be more scalable?

I'm trying to improve my game emulator so it can handle more users. I currently have one separate thread and execute all processing there. The cycles processes players and rooms, rooms are individual ...
0
votes
2answers
511 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 ...
0
votes
1answer
506 views

How to make progress bar in EditorWindow with Threading in Unity?

I need to make a progress bar in EditorWindow. To do this, I perform the function of calculations in threads: Thread thread = new Thread (_worker.Work); thread.Start (); The class itself emitting ...
1
vote
1answer
150 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 ...
1
vote
1answer
317 views

JWJGL Multi-threading to separate update and render

Introduction: I am currently designing a game in Java using the LWJGL 3.0, with Gradle. I have quite an advanced knowledge on multi-threading, and I am aware how GLFW does/doesn't implement multi-...
0
votes
1answer
172 views

Does SDL_SetThreadPriority work with std::thread

I'm trying to set the priority of my threads so that my UI thread can be given priority over background calculations. I noticed that SDL has a SDL_SetThreadPriority ...
1
vote
1answer
88 views

How to control JavaFX's animations execution order when animations “queue” is being altered in run-time?

What is the proper way of handling synchronization between GUI animations' execution order and the user's dynamic input? More specifically, I would like to know how to enforce some logical ...
0
votes
0answers
86 views

How to fx low FPS in a single threaded Directx9 3D game

We're having issues with low FPS in a third-person shooter 3D game. This happens when you have too many polygons on screen. The FPS is locked to 60, and the gameplay is fine, but the moment when you ...
1
vote
1answer
189 views

What's the best practice to use the pbo to upload multi textures?

I have a basic model to upload textures as shown in the following picture. I design this for several reasons: Only the primary thread owns the OpenGL context, so I choose to create buffers, map ...
1
vote
1answer
854 views

OpenGL draw functions and multi-threading. How they work together?

I want to apply multi-thread in a simple way to control and draw 4000 objects. I am using SDL and OpenGL. control : locations, collisions, calculations ... etc draw : OpenGL draw functions ...
1
vote
1answer
305 views

Calculating distance using Job System

I am trying to find out the distance between game objects and the player position using Job System, But I am getting an error of unsafe pointer race condition. Can anyone tell me how to access ...
5
votes
1answer
1k views

Multithreading MMO Server. A thread per area OK? [closed]

As a personal project, I'm setting up a MMO, and writing the server in C#/.NET Core. As of now my architecture is as follows: The world exists of different areas ( you can go from area to area trough ...
0
votes
2answers
334 views

While loop running in thread, but not doing anything [C++]

I am trying to multi-thread my game so that one thread updates and renders the player, while the other listens for inputs. I used a while loop to keep my detached thread running in the background, ...
1
vote
1answer
290 views

My Java Game's movement looks awfull. Maybe Problem with Thread.sleep

I have a big problem with my Java games. In every game I make the movement of the player and objects just looks awfull. The framerate is 60 fps without any problems. But the movement looks extremly ...
0
votes
1answer
76 views

processing request in order on game server

I am creating a simple multiplayer puzzle game in which multiple players can join a lobby and compete with each other. the player that submits the answer first gets the highest point, the player that ...
0
votes
1answer
592 views

Unity: Loading screen without a coroutine (is it possible?)

I need to accomplish something specific but I'm not sure how to do it exactly: My game has 2 scenes: The main menu that has a couple of buttons... ... and the game scene that displays a different ...
0
votes
3answers
1k views

Two Gameloops instead of one, wouldn't it be better?

I have been thinking about this a lot and don't know if i'm thinking incorrectly. Most games have one game loop that can be split into three functions. A basic game loop would look something like ...
0
votes
1answer
435 views

Access a ID3D11Texture2D in another thread

I created a ID3D11Texture2D texture on a thread with DirectX graphics and I passed its pointer to a worker thread. I'm assured that the creator thread will no ...
0
votes
2answers
1k views

Using std::threads to optimize drawing

I'm currently developing a 3D game with its own engine. I have some performance issues in the function that orders all the draw events and sends them to the GPU. I've heard about threads, and I ...
0
votes
0answers
133 views

How can I load a script once in LuaJit/Lua and use it across multiple VMs in different threads?

So, I came across an interesting problem. I'm implementing some threaded game logic, and one of the things I decided to do was to use Multiple Lua VMs, with each worker thread containing its own VM. ...
2
votes
0answers
304 views

How to properly separate render thread from logic thread?

I am not asking about parallelization of physics and so on stuff with parallel_for() like stuff. I've managed to have separate rendering thread from logic thread, ...
1
vote
1answer
490 views

Return value from coroutine to non monobehaviour

I have a class which is not a monobehaviour (lets call it "Generation"), and as such running CoRoutines from within are not an option. I have a monobehaviour (lets call this "TestScript") which needs ...
1
vote
1answer
200 views

In Unity, how do I use the extra time in every frame to do some extra processing?

Let's say, for example, that my target framerate is 60 frames per second. Now, I know that I have a maximum of 16.6 milliseconds to "do everything" every frame in order to maintain that framerate. ...
2
votes
1answer
601 views

Is this an optimal way to architect an OpenGL Renderable object class?

I want to create a class which is a "Renderable class". Basically, world objects will use this as a Base class to create objects that can be drawn into an OpenGL window. This is what i 've got so far: ...
0
votes
1answer
912 views

World & client listening, use multi-threading or multi-process?

My game is based on a client / server architecture where client only sends input and receives server output. Server has to keep track of the game, updating the world etc. But also listen to clients ...
3
votes
0answers
138 views

Understanding callbacks for connecting/disconnecting controller

I am using glfw and let's say I track controllers with a simple struct: ...
0
votes
1answer
506 views

What kind of work is usually done by scheduled tasks

I was reading about how task schedulers work in game engines. What is unclear to me is what kind of work is usually scheduled inside these tasks. Do engines usually tick an actor inside a separate ...
1
vote
0answers
143 views

Cocos2d-x : Socket.io-client-cpp crashes after creating scene

I'm using https://github.com/socketio/socket.io-client-cpp with cocos, because the built-in socket.io doesn't support callback (http://discuss.cocos2d-x.org/t/doesnt-work-with-socketio-2-0-1-and-...
1
vote
1answer
312 views

Timestep with multithreading

There are several questions and articles which deal with timestep - for example: Should game logic update per second or per frame? https://gafferongames.com/post/fix_your_timestep/ Accounting for ...

1
2 3 4 5 6