Multithreading allows multiple threads to exist within the context of a single process sharing same resources but are able to execute independently.
0
votes
0answers
3 views
LWJGL hanging on quit
I have an LWJGL 2 application that, when on Windows, seems to hang after closing the window. When doing a thread dump, the only 2 daemon threads (Excluding Java ones such as DestroyJavaVM) are AWT-...
1
vote
0answers
37 views
How to handle player actions in a multithreaded gameserver
I'm working on a multiplayer game, and today I implemented basic "spatial hashing" in my entity-component-system.
Before implementing that algorithm, I was sending players actions to all connected ...
5
votes
2answers
220 views
Should I care about CPU affinity of threads?
I am currently developing a rendering engine which I plan to use for creating games. The engine makes heavy use of multithreading, I have a thread for OpenGL rendering, a thread for updating, a thread ...
1
vote
0answers
71 views
Thread per connection or thread-pool in a MMO server?
So I'm writing this MMO server, and I'm really struggling in this topic. I'm writing a fast paced MMO, and the server max players would be 800.
I have read that one thread per connection is not a ...
0
votes
0answers
62 views
Thread speeds up in XNA when window is minimized
I think that´s a simple question for some of you.
My XNA game has a main thread and another thread when the game is started (to be able to update and draw game components while textures and game data ...
0
votes
0answers
17 views
How to capture the state of a collection while allowing other threads to modify it?
I am working on a learning project, a small MMO server. The server "ticks" at a specific interval in order to control the frequency at which information is sent out to the clients, as well as other ...
0
votes
0answers
27 views
Listening to mouse clicks in a seperate thread
I'm developing a card game and I need to pause the game logic until the player clicks on a valid card game.
I separated the player's Update method in to a seperate thread, and I'm doing this ...
1
vote
1answer
44 views
When should new threads be created in a game or how should time consuming task be handled?
This has been a question that has always troubled me while thinking about the code and logic behind gaming, I was wondering when and when not, is it appropriate to create new threads for different ...
5
votes
1answer
372 views
Using Threads to create GameObjects
I have this game client which connects to the server and sends requests and getting responses.
I have created a separate thread for listening to the server. Based on the response from the server, I ...
1
vote
0answers
13 views
Locking object access with Allegro's threading API
If I have a data structure for the Allegro threading API as shown in the example here:
https://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Threads
And I lock the mutex, is there a way to have ...
0
votes
1answer
54 views
Multithreading problem in openGL?
Let's say that I have two threads.
Both of them generates and binds to a vbo separately.
If I join and run these threads the behavior will be undefined obviously.
Because one may generate the vbo ...
4
votes
2answers
196 views
OpenGL threaded loading
I'd like to introduce seamless level loading which means I need multiple threads. The main thread is for rendering the current scene (or for non-seamless level loading a progress bar) while the other ...
1
vote
1answer
575 views
Smooth loading screen bewteen scenes
I created a loading screen to display a loading animation as the next scene is loading. I load the next scene asynchronously with:
yield return SceneManager.LoadSceneAsync(scene,LoadSceneMode....
1
vote
0answers
134 views
Libgdx - Building dynamic 3d models with Modelbuilder/MeshPartBuilder while rendering
Context: I'm building a mobile game targeted for android with libgdx. It's an endless highscore based game. The environment/terrain is build dynamically. It's kind of a maze/wall/block terrain. I'm ...
1
vote
1answer
99 views
Shared data in multithreaded pathfinding engine
Imagine a case where you have lots agents in a big world, who frequently need to calculate the shortest/best path from A to B. In this case it seems natural for me to create a pathfinding engine where ...
0
votes
0answers
34 views
Synchronization Problem in MatchMaking
i have an online html5 game that in my server i have a concurrentHashMap named Onlines . when user is online we add key,value of him to Onlines Map.in Onlines i have a field of status :0,1,2
0:free
1:...
0
votes
1answer
34 views
Scene with Node graph thread safe, with important efficeny
I will try to be as explicit as I can, and I apologize for my grammar...
I am working on a game engine (specifically on the Render part) and I am facing some conception choice that will involve a lot ...
2
votes
3answers
110 views
C++ Multithreading: accessing objects together
I'm kinda new to C++ Multithreading, and I'm keeping it simple right now. I will keep things simple and write psuedo-code. I'm making a Turn Based Strategy Game but let's keep it at Chess for now.
I ...
5
votes
1answer
90 views
Check if thread has OpenGL context
I'm looking for a way to check if a thread accessing a namespace function has a OpenGL context attached to it. I have looked around and all I can find is,
GLFWwindow* glfwGetCurrentContext();
Which ...
2
votes
0answers
44 views
Is there a way to identify, within a shader, the current GPU thread ID?
My question is rather simple: within a shader, is there a way (that works both in DirectX and OpenGL) to retrieve the ID of the given GPU thread being executed at the given iteration?
I am using ...
1
vote
1answer
195 views
Unity3D: Making heavy calculation on separate thread [duplicate]
So, I've created a program with Kinect as its input. As you know, Kinect will send the data 30 frame per second.
I have a model that will mimic Kinect's input motion, so on Update() I read the ...
10
votes
1answer
828 views
How to await async operations / coroutines?
I'm looking for a generic / reusable way to wait for coroutines and asynchronous operations to finish in Unity 5, similiar to C#5's await keyword.
The simplest way I can think of is something like ...
0
votes
0answers
54 views
XNA Access violation from KernelSoundEffectInstance
Some users (but not all) are reporting a periodic crash in my XNA game. They say it's happening every 15 to 20 minutes. I am unable to replicate this myself, so I asked users to send me error logs.
...
3
votes
1answer
117 views
Locust Swarm algorithm for path finding (devour and move on)
I need to model a locust swarm that devour food stacks and move on to next stacks. I searched for articles and found few articles. These papers is about optimization applications but I want to convert ...
31
votes
8answers
10k views
How can a game handle all characters at once?
This question is just to gain knowledge about how a game can handle so many characters at once. I am new to gaming so I beg your pardon in advance.
Example
I am creating a tower defense game in ...
-2
votes
1answer
78 views
Is there any limit to the amount of threads you can run at the same time? [closed]
So i have a decent CPU with 2 cores and 4 threads, Will that effect the number of threads i can allow my program to run simultaneously?
In my case, im using a thread for each player on a server.
0
votes
1answer
359 views
Is it safe to set Lua Table data from multiple C++ threads?
As the title states. I'm curious if it's safe to set data in different Lua tables that exist in the same lua state. From multiple C++ threads.
I'm asking this because my current system actually has a ...
0
votes
0answers
40 views
In Cocos-2d-x, is there a way to get a shared OpenGL context for use with background loading
We are using parts of the Cocos-2D-X engine and we have a background loading thread which loads textures in the background. Is there a way to get a ShareGroup so we can safely bind an OpenGL context ...
0
votes
0answers
50 views
Multithread OpenGL to Upload Meshes
My game is rendered in dynamically generated chunks, each of which has its own mesh.
Every time I generate a chunk and upload its mesh, there is a huge lag spike.
Is there a good way of eliminating ...
0
votes
0answers
92 views
Merging OpenGL rendering result with other graphical elements like user interface. Concepts
For my application, there are several elements drawing: An user interface elements, and several libraries for rendering part of the content of the window. Lets imagine some kind of Google Earth where ...
4
votes
1answer
247 views
Multi-threading for rhythm game?
I'm trying to recreate a rhythm game. However trying to get the key-presses with SDL2 I ran into the problem, that you can only get an event every time a frame has been successfully rendered (I can't ...
2
votes
1answer
201 views
Can you use a standard multi-thread if only reading unity objects?
First of all I know about coroutines and how to use them (they're awesome).
A friend of mine was telling me about the way the he implemented his saving system in a game he was working on, after ...
1
vote
1answer
76 views
computationally Intensive routine, ThreadPool or new Thread?
I had to write a computationally expensive routine that runs in 20-30ms. This routine cannot run in the main thread since it would kill the frame rate. The routine runs on demand, when some data ...
9
votes
3answers
8k views
How to not freeze the main thread in Unity?
I have a level generation algorithm that is computationally heavy. As such, calling it always results in the game screen freezing. How can I place the function on a second thread while the game still ...
2
votes
0answers
77 views
Putting each animation on a thread
I'm trying to make my game as friendly to multi-core as possible. as such, i'm putting each animation on a new thread. I was hoping someone could check out my proof of concept code in java;
an ...
4
votes
2answers
76 views
Threading/Streaming files while rendering the scene
I am writing a game engine and am trying to wrap my head around data streaming while rendering. What I mean by this is being able to load resources (however slow it may be) while rendering and not ...
2
votes
2answers
365 views
RTS combat system
I am developing a small-scale TB/RT Strategy hybrid, not unlike the Total War series. It's in the classic medieval setting, with only melee infantry combat currently implemented for testing. Units are ...
2
votes
2answers
1k views
Async loading in libGDX to set the screen
I would like to bring up a loading screen, for this would make the load async.
How can I do this? I looked on the libGDX website but I do not understand very well, maybe because of my poor English.
...
4
votes
1answer
420 views
Unity3D multi-threaded data importer?
Goal
I would like to be able to separate all my data file readers from the main thread and balance the load over multiple frames. The idea being that while the data is being read/parsed/filtered I ...
3
votes
1answer
431 views
How can I exploit multithreading in collision resolution?
I'm trying to speed up my collision resolution by using multiple threads.
I'v read through Box2D's source code and while it was challenging and educating, it didn't really point me to how I could use ...
2
votes
2answers
214 views
If IDXGISwapChain::Present blocks, does that mean I'm GPU bound?
I updated my DirectX11 renderer to render on multiple threads using deferred contexts. Before my change, the Present method took a negligible amount of time (according to VTune analysis). After my ...
3
votes
1answer
679 views
Resource streaming with job threading system
I am currently researching resource streaming for my current game engine. To add a bit of context, I am doing a contiguous world for a Baulder's Gate style CRPG. So while the camera is usually looking ...
3
votes
1answer
125 views
UDP server and two clients
So - my whole knowledge comes from google and stackoverflow. I'm trying to create an UDP server (with two slots per new instance of the game) and clients.
My problem is here that I totally don't know ...
23
votes
3answers
7k views
Is it normal for a game to use 100% CPU?
I just implemented multi-threaded input handling in my game engine where the code that polls the OS to gather input from it and time stamps them is in a separate thread and each frame in the main ...
1
vote
0answers
326 views
What LuaJit threading archietecture should I use?
I am in the process of designing my own Game Engine for use in a real time CRPG - think Baulder's Gate. I know most of my specifications right now, and I am currently in a planning phase.
I chose Lua ...
5
votes
1answer
146 views
Is locking required to implement a seperate rendering thread?
I kept reading a lot about this, but still not sure about a proper way to implement an independent render thread (variable timestep) running parallel to a physics thread (smaller, fixed timestep).
I'...
0
votes
1answer
90 views
Delay between bullets java - new Thread
Let's say that I have a cannon on the bottom of the screen that shoots balls to the click direction. I also have some collisions algorithms and here comes the problem. I am trying to implement an ...
6
votes
1answer
1k views
Multithreaded Game Loop
I'm trying to implement a multithreaded game loop. I already did that but had to use a few locks for that, which ruined the performance. After researching a bit I came up with this idea:
Instead of ...
3
votes
2answers
472 views
Instantiation of a GameObject not working for a threading reason
I receive the following error
"INTERNAL_CALL_Internal_InstantiateSingle can only be called from the main thread."
"Constructors and field initializers will be executed from the loading thread ...
1
vote
4answers
333 views
OpenGL calls from a different thread?
I understand OpenGL is not thread-safe, but at the same time, Google seems to be giving me mixed responses.
I have a LibGDX game that functions normally, UI/rendering/logic on the same thread, ...