I was thinking about how the final program will run: I guess that there are several very distictive processes and I wonder if these should/could be programmed as separate processes (threads).
Processes:
- graphics (time critical for flicker-free display)
- background music (time critical, distinct from game)
- AI (much CPU time)
Graphics is the most critical if we want the game to move fluently. Therefore this process must have the highest priority.
Background music is the simplest task. The music can be from a WAV file or from a CD (which I prefer). However, since this music has no relation with the game I do not like to handle it in the main game loop. We just must be able to start, stop and probably fade the music.
AI is not time critical. Units simply continue with there current task (or wait) until new orders arrive. AI will however consume large amounts of CPU resources. Such a process can easily be interrupted for graphics update.
So, is it wise to make our program a multi-thread application?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems like the most likely choice, and would probably save us some headache later on (maybe). But for the sake of brainstorming, what other ways could we do it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was thinking about how the final program will run: I guess that there are several very distictive processes and I wonder if these should/could be programmed as separate processes (threads).
Processes:
- graphics (time critical for flicker-free display)
- background music (time critical, distinct from game)
- AI (much CPU time)
Graphics is the most critical if we want the game to move fluently. Therefore this process must have the highest priority.
Background music is the simplest task. The music can be from a WAV file or from a CD (which I prefer). However, since this music has no relation with the game I do not like to handle it in the main game loop. We just must be able to start, stop and probably fade the music.
AI is not time critical. Units simply continue with there current task (or wait) until new orders arrive. AI will however consume large amounts of CPU resources. Such a process can easily be interrupted for graphics update.
So, is it wise to make our program a multi-thread application?
It seems like the most likely choice, and would probably save us some headache later on (maybe). But for the sake of brainstorming, what other ways could we do it?