Developing the edge and fog computing has been the result of the fast growth of cloud-based IoT applications. These new paradigms define new resource management problems such as IoT task offloading challenge. Despite the many conducted effort in the IoT task offloading, this issue remains a research gap partly because this problem is NP-hard inherently, and also because many proposed solutions are based on unrealistic assumptions. Indeed, many proposed solutions suffer from the lack of a real set of tasks for a comprehensive evaluation. Thus, we prepare a collection of Python tasks to provide a realistic context for the assessment of the proposed task offloading methods. Also, this paper proposes a four-tier architecture to determine the specific decision-maker for the task offloading. Then, we formulate this problem as a population (evolutionary) game that is solved by Maynard replicator dynamics. The time and energy consumption are the main optimization objectives in this work. Finally, we simulate the proposed scheme in MATLAB by emphasizing the use of realistic values and parameters. The experimental results indicate that our scheme is a practical approach partly because it contributes to the core traffic decreases and because its convergence time is less than 6 s to solve the problem with 100 tasks.