atompacman / Xerof

2D survival simulator (AI sandbox)
1 stars 1 forks source link

Gameloop timing, processes, etc... #15

Open atompacman opened 9 years ago

atompacman commented 9 years ago

We need to agree on how do we handle what I call "processes", that is, everything that has a duration over many frames. For now, the only process we have is the MoveHuman process, which is called every frame and basically just moves characters on the map (and in the future will also drive exploration). AI calls are currently not treated as process, but they should. Anyway what we need to agree on is the frequency of calls to such process. I think frequency should vary depending on what type of process we're talking about. For instance, hunger management can easily be updated every 4 frames, whereas position should be updated each frame to preserve graphical fluidity.

It also think that it could be a good idea that processes are not syncronized - in the way that a process called every 2 frames is not called at the same time than a process lasting 4 frames and then at the middle of this process... anyway we'll see what is the simplest and what is better for performance.

FXRoux commented 9 years ago

les processus comme descendre la faim pourrait être énormément ralentie pour économiser et sa ne poserait pas de problème

Pour ce qui est des processus je pensais faire deux TAS pour communiquer entre la gestionnaire d'action par exemple et l'AI L'AI recevrais des telle character est ready avec les autres info nécessaire pour la prise de décision, et quand l'AI y penserait puis mettrais l'action dans un tas allant au gestionnaire d'Action. Quand le gestionnaire d'action aurait finis d'exécuter l'action et serait près à en exécuter un autre pour cette AI(sa prendrait un TAS par AI) il irait chercher la prochaine dans le TAS et l'executerait tout en envoyant les informations pour que l'AI puisse commencer à préparer sa prochaine action Se serait probablement difficile à faire mais c'est la meilleur chose