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
1answer
51 views

How do games like Anno or Stellaris manage so much data and processes internally?

Short example: the player controls multiple islands. Each island has factories on it. A factory has inputs, a process that does something with the inputs, and outputs. The process depends on the ...
0
votes
0answers
63 views

Multithreading bug

I am following Sebastian Lague's video tutorials on how to create a procedurally generated world. I have followed his tutorial fully except for the fact that I created a double precision algorithm for ...
0
votes
0answers
62 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
0answers
25 views

How to execute something on a main thread in ECS?

I have a game in which I have 5000 spheres on the scene simultanously. I needed the spheres to check for collisions with player's mouse, so it looks like the player is removing the balls with his ...
0
votes
2answers
135 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
99 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 ...
0
votes
0answers
21 views

How to multi-thread arrays in Unity3D?

I have a 2D graph which takes a long time to process. The code processes all the horizontal lines in a loop as small workloads, and adds the lines to a big 2D array. I don't know how to do the ...
0
votes
1answer
102 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 ...
0
votes
1answer
98 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
79 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
50 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
48 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 ...
0
votes
1answer
114 views

What is more efficient: Excessive Multithreading or Event-Handling through one Class?

I am recently working on a server for a game (1 vs 1 with observers) that shall support parallel games and I wonder whether it is more efficient to create 1 extra thread per game/lobby or to let one ...
1
vote
1answer
109 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
416 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
190 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
156 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
202 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
59 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
459 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 ...
-1
votes
1answer
335 views

Use two Gameloops instead of one

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
299 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
708 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
94 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
264 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
355 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
161 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
463 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
609 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
113 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
309 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
120 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
238 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 ...
3
votes
1answer
371 views

Flicking geometries with OpenGL in Qt app

I have a Qt (5.9.1) app that on Windows many of the geometries I'm drawing flickers. My problem description is vague because I'm at a complete loss. Does anyone know if there's an issue with ...
0
votes
0answers
31 views

How to determine the amount of idel time left in main thread for Unity before next frame?

Hi I'm trying to improve a thread tool and would like to make a function which use the idle time before the next frame. So how can I determine the time left?
2
votes
1answer
244 views

C++ Thread, structuring thread so Gameloop can continue

I want my thread to run seperately, but I want to be able to keep executing the game loop without killing the thread scope, If I remove the join there is a crash ? What can I do ? My desired result ...
0
votes
1answer
373 views

SDL - Limiting loop with timer? Not polling

I am using SDL/Glew to create an engine for a game I want to make. I am trying to set a constant framerate of like around 60 (once every 17ish ms). I don't know the best way to do this so I do ...
0
votes
2answers
151 views

How to run a pathfinder thread and game thread concurrently

Issue: I want to be able to set up my game loop to work concurrently with my pathfinder request, that would be a queue which different units request for in order in the pathfinder thread. My ...
0
votes
1answer
678 views

Unity - animations threading

As one cannot play around with threads themselves, the user-made code that uses unity's API is executed on the main thread. I'm sure unity uses some sort of thread ...
2
votes
0answers
65 views

compiler optimixation interfering with threaded function

I'm making a block game in c++ that stores voxels in a octree and because, at least in my implementation, editing the octree is slow, I'm generating the chunks of land in a separate thread. I manage ...
0
votes
1answer
109 views

Implement delay using polling or threads?

I'm making a real-time risk-like game in Python. Players can move armies from one region to another. I want army movement to take time proportional to the distance between the two regions, therefore I ...
0
votes
0answers
44 views

How does Unity Inspector handle values changing during play without any thread-locks?

First of all, I'm a Java coder. Usually, when you write a game, you run it on thread different than the UI one like: ...
0
votes
1answer
334 views

C++ glGenBuffers does not return proper VBOID when called in thread [closed]

I'm currently learning to properly use multithreading in C++ in combination with OpenGL and GLFW, and I encounter a strange bug in my application. I'm generating a procedurally generated terrain in a ...
2
votes
1answer
2k views

Game loop with multithreading

I have learned how to create and manage threads in C++. Now I'm trying to create game loop based on multithreading but I can't imagine how should I split whole game to tasks. I mean, should rendering ...
1
vote
1answer
621 views

Multi-threaded MMO Server with complex inter-dependencies.

I am working on a Mobile MMO and I am using .NET to build a MMO Server. My current application architecture is as follows. Clients are accepted using Async Calls (BeginAccept/EndAccept). Data ...
6
votes
2answers
2k views

Unity AdMob plugin - rewarding the user on the main thread

There's a simple guide on the Firebase's website on how to implement the AdMob's rewarded video: https://firebase.google.com/...
2
votes
4answers
398 views

Can a loading screen be implemented using one thread only? If so, how?

I have seen guides on how to implement a loading screen using more than one thread. But sure it must be possible to do so with one thread, since older (even 2D) games that run on single-threaded ...
5
votes
1answer
800 views

Loading screen OpenGL with glut API

I'm trying to make a loading screen. My idea is to have two threads working - one in the background loading the 'game' scene, one displaying 'load' scene. When building 'game' scene is finished, it's ...
5
votes
1answer
2k views

How Many Threads is 'Too Many'?

I writing this as I have run into a dilemma that I cannot readily answer. Specifically, how many threads is too many? Background tl;dr: Writing a game (Surprise.) C++11, all server-side bits ...

1
2 3 4 5