Multithreading allows multiple threads to exist within the context of a single process sharing same resources but are able to execute independently.
47
votes
5answers
6k views
How does Dwarf Fortress keep track of so many entities without losing performance?
In Dwarf Fortress you can have hundreds of Dwarves, animals, goblins, etc in game at any one time, each with their own complex AI and pathfinding routines. My question is how does this not produce ...
36
votes
6answers
6k views
Multi-threaded games best practices. One thread for 'logic', one for rendering, or more?
I'm aware there is immense slowing whenever data synchronization is required (let alone any mutex locks).
I was thinking getting it to the extreme and doing threads for any subsystem conceivable. But ...
26
votes
4answers
4k views
Multi-threaded game (engine) design resources?
What are the best resources on multi-threaded game or game engine design and development? As this is obviously where computers are headed, I intend to study this topic and I'd like to know what ...
20
votes
3answers
790 views
Multi-platform multi-threading: What are the real challenges?
While a library like SDL provides a cross-platform wrapper API for threading, I think it would be naive to assume that this leads directly to easy development of games across vastly different ...
18
votes
6answers
1k views
Data structures for interpolation and threading?
I've been dealing with some frame-rate jittering issues with my game lately, and it seems that the best solution would be the one suggested by Glenn Fiedler (Gaffer on Games) in the classic Fix Your ...
14
votes
2answers
5k views
How many threads should an Android game use?
At minimum, an OpenGL Android game has a UI thread and a Renderer thread created by GLSurfaceView. Renderer.onDrawFrame() should be doing a minimum of work to get the higest FPS. The physics, AI, ...
12
votes
4answers
2k views
How can I make message passing between threads in a multithreaded engine less cumbersome?
The C++ engine I'm working on currently is split up into several large threads- Generation (for creating my procedural content), Gameplay (for AI, scripts, simulation), Physics, and Rendering.
The ...
12
votes
4answers
1k views
RTS Game AI Thread
I have a project to make a real-time strategy game from scratch. I am still at the early planning stage, but I have been programming a little to see the mechanics.
I know how to program. I also have ...
11
votes
5answers
904 views
Sprites as Actors
I'm not experienced in Game Development questions, but as a programmer. In the language Scala, you can have scalable multi-tasking with Actors, very stable, as I hear. You can even have hundreds of ...
10
votes
6answers
737 views
What is the best way to exploit multicores when making multithread games? [duplicate]
Many people suggest to write a program, and then start optimizing it. But I think that when it's coming to multithreading with multicore, a little think ahead is required.
I've read about using ...
9
votes
1answer
541 views
Why does V8 not run with SDL threads?
i was able to compile and link V8 against my game and code interpretation works fine. However I want to divide my code and the game loop should exist in one thread and the scripting engine should run ...
9
votes
1answer
1k views
Scene Graph in Separate Thread
I develop my own game engine for fun (but not profit). I have rendering in one thread and my scene graph updates (velocity, etc.) in another. When it's time to render, the render thread adds the ...
8
votes
3answers
611 views
How should I structure my classes to allow for multithreaded simulation?
In my game, there are plots of land with buildings (houses, resource centers). Buildings like houses have tenants, rooms, add-ons, et cetera, and there are several values that have to be simulated ...
8
votes
2answers
972 views
Java code for client-server game on Android
I have developed a game on Android. Now I want to play it on wifi or 3G. I have game packets which I want to send form client (mobile) to server then to another client (mobile).
I don't know how to ...
7
votes
3answers
905 views
Android threads trouble wrapping my head around design
I am having trouble wrapping my head around game design. On the android platform, I have an activity and set its content view with a custom surface view. The custom surface view acts as my panel and I ...
7
votes
2answers
1k views
XNA: How does threading work?
I would like to implement threading in my XNA game but I'm not sure how things work when compiling for the XBOX 360. Could someone elaborate on this?
For example, how many threads does XBOX support? ...
7
votes
1answer
363 views
How wise is this multithreading architecture?
I'm rewriting a game engine I wrote in an attempt to parallelize as much as possible. I'm considering making properties which may be accessed from multiple threads all use accessors which use boost ...
7
votes
2answers
1k views
Multi threaded game - updating, rendering, and how to split them
From the StackOverflow post (it was recommended I move this):
So, I'm working on a game engine, and I've made pretty good progress. However, my engine is single-threaded, and the advantages of ...
6
votes
3answers
405 views
When does parallel-tasks engine becomes a good solution?
I'm often tempted to break the game I'm working on to try a parallel-tasks based architecture, but that don't seem a big requirement for my project so I avoid this for the moment. I'm planning to just ...
6
votes
2answers
414 views
How do you handle scripting in multithreaded environment
In my experience, two approaches are preferred when people want to handle scripting in multithreaded environment.
Synchronize every accesses to scripting module with one coarse-grained lock.
No ...
5
votes
3answers
222 views
What operations should be multithreaded?
I wonder what game operations should be multithreaded, and which should always run on the main thread.
The most expensive operations I could come up with are:
loading a level
loading resources (for ...
5
votes
1answer
190 views
Should I amortize scripting cost via bytecode analysis or multithreading?
I'm working on a game sort of thing where users can write arbitrary code for individual agents, and I'm trying to decide the best way to divide up computation time.
The simplest option would be to ...
5
votes
1answer
2k views
How to use multi-thread OpenGL application to update VBO and use it at the same time?
I have simple application. It has two threads. Each thread has it's own rendering context, but they share one VBO (this is working, I tested it).
Now what I want: One thread is rendering some data ...
5
votes
1answer
191 views
Does using [STAThread] with XNA have any negative implications?
I'm working on a game in XNA, which has an inbuilt level editor. To facilitate this I want use the FileOpenDialog from Winforms. I followed the instructions as per this answer. This involves setting ...
5
votes
1answer
245 views
Loading content (meshes, textures, sounds) in the background
In my game, I am aiming for a continuous world, that is, a world where you can go anywhere without breaking the immersion through load times and "virtual seams".
My world is broken up into regions, ...
4
votes
4answers
858 views
A* algorithm very slow
I have an programming a RTS game (I use XNA with C#). The pathfinding is working fine, except that when it has a lot of node to search in, there is a lag period of one or two seconds, it happens ...
4
votes
4answers
915 views
Creating the concept of Time
So I've reached the point in my exploration of gaming where I'd like to impliment the concept of time into my little demo I've been building.
What are some common methodologies for creating the ...
4
votes
1answer
247 views
How do I use threads together with DirectX11?
I have only found the documents on MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476884(v=vs.85).aspx Although it doesn't say anything about creating them, it mentions that device is ...
4
votes
1answer
266 views
Splitting logic into threads in Java tower defence game
I'm making a tower defence game in Java!
It's my first game development.
I want to know how many threads Do I need to create in a game, to split logic..
I've made this one:
Main App thread (adds ...
4
votes
2answers
655 views
How to create a thread in XNA for pathfinding?
I am trying to create a separate thread for my enemy's A* pathfinder which will give me a list of points to get to the player. I have placed the thread in the update method of my enemy. However this ...
4
votes
2answers
375 views
Using Python what is the best way to perform heavy tasks in the background?
I'm generating large amounts of procedural map data on the fly, however my game engine doesn't rely on them to render the scene and I'd like to build it on in the background and pop it into the world ...
4
votes
3answers
729 views
Is it necessary to wait for rendering thread to terminate in surfaceDestroyed(…)
I just wrote a simple Android app that uses SurfaceHolder.Callback interface to communicate the state of the SurfaceView. In the Callback.surfaceDestroyed() method i just informed the rendering thread ...
4
votes
2answers
229 views
Mixing threads and coroutines in Unity3D Mobile
I had a coroutine in Unity3D that downloaded a zip from a server, extracted it to the persistent data path, and loaded its contents into memory. The flow looked something like this:
IEnumerator ...
4
votes
4answers
1k views
One True Event Loop
Simple programs that collect data from only one system need only one (blocking) event loop. For example, Windows applications have the message loop, POSIX network programs usually have a ...
4
votes
1answer
785 views
Synchronization between game logic thread and rendering thread
How does one separate game logic and rendering? I know there seem to already be questions on here asking exactly that but the answers are not satisfactory to me.
From what I understand so far the ...
3
votes
4answers
1k views
How to properly multi thread an RPG
I am working on an RPG type game in Java and I would like to know a few things relating to threading,
What is the best way to implement a "wait for this then do this" without hanging the whole ...
3
votes
3answers
407 views
Get rid of the usual MUD cycles
I am working on a MUD engine and I want to do it a little differently then all the MUD games I played. I find a "cycle" system very boring. One of the idea I had is to make every clients socket ...
3
votes
3answers
488 views
State Changes in a Component Based Architecture [closed]
I'm currently working on a game and using the naive component based architecture thingie (Entities are a bag of components, entity.Update() calls Update on each updateable component),
while the ...
3
votes
2answers
322 views
Is it safe to run multiple XNA ContentManager instances on multiple threads?
My XNA project currently uses one ContentManager instance, and one dedicated background thread for loading all content.
I wonder, would it be safe to have multiple ContentManager instances, each in ...
3
votes
3answers
634 views
Multi Threading In Update Loop
Okay so I am working on a game engine and this was my previous game loop:
Game::Run()
{
While(!m_GameDone)
Client.Update();
LocalServer.Update();
}
but what I want to do is:
...
3
votes
1answer
465 views
Best way to separate display and game logic (threads)
What is the best way to separate render and game logic threads?
I'd like to make logic-heavy game (ai, machine learning, and network) in which world updates 50-60 times per second.
I want to ...
3
votes
1answer
390 views
What is the right process to get compatibility or at least a workaround for the ‘Threaded optimization’ feature of NVIDIA?
It's peculiar this issue is not well understood on NVIDIA forums and project forums.
For example, the well known ioquake3 project based on id tech 3 requires to force 'Threaded optimization' off on ...
3
votes
2answers
285 views
Profiling code with threads and script interpreter
Basically, how I profile a game that have multithreading and script interpreter? (Lua in my case)
I have no idea of where to look for that.
Also it would be nice to be able to profile code that ...
3
votes
0answers
76 views
DirectX9 thread lock problem with “present” and background loading new textures
Given:
Selfmade 3D engine based on DirectX9 written in C++
Task:
While render loop runs load additional textures in a background thread
Current Implementation:
- Create device with ...
3
votes
1answer
185 views
Unity editor stalling on second attempt to play
I am attempting to use a Tobii TX300 eye-tracker as an input device for Unity. This device is connected via LAN (TCP connection managed by Tobii SDK). The Tobii SDK has appropriate methods (I am ...
3
votes
0answers
274 views
Android threads trouble wrapping my head around design [duplicate]
Possible Duplicate:
Android threads trouble wrapping my head around design
I am having trouble wrapping my head around game design. On the android platform, I have an activity and set its ...
2
votes
3answers
390 views
Should I dedicate a single thread to each player in a split-screen game?
I was thinking about making multiplayer version of a game I am making with SDL and OpenGL. It would be a split-screen game.
Do you think it would be a good idea to have each part of the screen (game ...
2
votes
4answers
389 views
Do games use threads?
I 'understand' that the concept of how a game runs i.e
while (game_loop = true)
{
//handle events
// input/output/sound etc
}
But it has come to my attention while programming in another ...
2
votes
4answers
1k views
How to separate my rendering from game loop?
If I have a (complex) operation that takes a long time for it to finish, for instance, a couple of seconds, my frame rate drops far below the acceptable. How could I still implement it while it is not ...
2
votes
3answers
210 views
Multithreaded game fails on SwapBuffers in render thread at exit
The render loop and windows message loop run on separate threads. The way the program exits is that after PostQuitMessage is called in WM_DESTROY the message loop thread signals the render loop thread ...