Skip to main content
gamedev.net
🔒 Locked

Sharing Resources Per Task For Frames

Started by Dead6re 1 reply 750+ views
Original Post
Dead6re
Dead6re
Should I set aside time for processing tasks such as reading and processing the network messages, AI and path finding per frame or can I follow in one big loop. Approach 1 Perform Network Tasks Check If Timer for frame has expired, If not continue AI Processing Check If Timer for frame has expired, If not continue etc.. On Expired: Render and restart loop Approach 2 Network Tasks AI Processing etc.. Render Approach 1 has been used in FPS games, but I was wondering wether you need to allocate and check the time for each function to ensure you don't get laggy games? Game genres for each approach or a custom approach under FPS, MMO and RTS.
Sc4Freak
Sc4Freak
Just one big loop should be fine. Don't limit framerates, and if it's too slow to hit a target framerate, then begin optimising problem areas.
Arex
Arex
Do timings only if you require them, but still probably requires multiple threads. Because if you want to wait for something it is probably waiting of some other process to end. :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.