Quote:
Originally Posted by Hude
Duh, updating the roids after all the battles can be done in a single SQL query. If there was 1000 battles, it affects 1000 rows. That should be executed in a fraction of second.
|
Ok, maybe I over simplified a bit but here's how I would do it:
- Create a temporary table with target and attacker coords and roids captured.
- At the beginning of the tick reset temporary table.
- In the battle engine, instead of updating target and attacker roids, store the coords and captured roids in temporary table.
- After battles, update target and attacker roids with a query from temporary table, no looping involved.
I wanted to add a sarcastic remark about the performance here but I'll behave myself.