Every AAI building has an on_tick function that gets called every single tick. In that function it checks if the buildings tick count is reached and if not exits. So 1 building every 30 ticks will be faster since you avoid the on_tick lua call of the other building even if it just does on comparison.Helickron wrote:What I'm doing at the moment is reducing the update rates of my structures and their amount. The complexity is increasing but the UPS are too. Is there a difference between 2 buildings every 60 ticks vs. 1 building every 30 tick?mrvn wrote:I also try to share control structures. So I have only one control structure to send a hauler to a miner and have it cycle through all my miners and haulers processing one per second. For ore mining you don't need to check often.Keio wrote:If you watch Arumba and Steejo's "refactorissimo" campaign (around episodes 30-40ish), they go through making AAI more UPS-friendly... stuff like having timers so that commands are only sent to/from the programmable structures once every 5-10 seconds etc. https://www.youtube.com/watch?v=3d4WWdk ... U1HGufATF1Helickron wrote:Hey guys,
I've some severe problems with my fps/ups, although having a gaming laptop. AAI is just bending my laptop, giving it a hard time. Is there a thread or a list of tips how to handle that and what to avoid? I made some really nice complex setups, only to delete them afterwards.
1. My biggest problem is the setup for my attack formation. Waypoints are calculated every tick for the formation. I've changed half of them to "follow unit id" which seems to work better overall. I'm thinking about changing it to a "set angle and speed" command, but I don't know how that should work properly.
2.My second project is redoing the zone scanner to not randomly scan tiles but going in circles. To be precise in squares.
3.Zone Cleaning is now done by a single setup and only for zone 1/101/201 where my miners are sitting.
4.I use 3 Haulers that drive to (circle through) every miner and then go back to the depot. Thats a mess. They are often stuck on the map, not moving anymore, not even searching for a path (seen in debug mode).
1. For attack formations I really miss a cos, sin and atan2 function. I want a chaingunner at 60° 3m distance to the direction my warden is facing.
Maybe the unit controller could be extended to allow to set follow-unit-id, angle and distance to make units behave that way automatically.
I noticed that when you select multiple units with the remote control and set them to follow another unit then they will form a circle around that unit. So there already is some code there for this (just not relative to the direction the unit is facing).
2. I've made one that goes in a spiral where each new loop is 5m wider than the previous. I've also patched the zone tool to have buttons to mark zones as lines, alternative lines, spiral or hilbert curve. Will post patches soon.
4. It helps to play with water only in the starting area.