There is something else that I don't understand, why they start with a big integers like: 1048822 ?
As long it's done on map init without any wait involved it should be true i guess (even if you remove units before, because remove an unit is not something instant).
But if it's done after, then it could be wrong (unit or even other handle recycling)
Now if for some silly reason you really want to create 2 such units and it's done after map init, or even with some wait between the 2 unit creations, you still can use a loop and use Create/RemoveUnit as long it's necessary.
However that would be horribly inefficient, and maybe you would have even to care about limit op.
handle id has nothing to do with where in system the handle points to, its counter and god knows why blizzard decided to count from 0x10000
if it was directly connected to the pointer position you would never have 2 handles closer than 4 integers to each other, its simple indexing, something on style of struct allocation but with intial value 0x10000
then why can I make texttag with handle id 0?
and basically why texttags have id of 100 or less?
again, handle has nothing to do with actual memory, its simple counter with linked list, the very same principe struct allocation uses
if it was actual memory, it would be impossible to have 2 handles having difference in handle id of 1 because unit is maybe even 100 bytes big class all things considered, so you would have 0x100000 and next handle would be 0x100100 maybe
anyways your question was answered, if you create the units immedietally after each other, their handles should be next to each other
Special event is not widget too and it has normal handle id, hence the name HandleId not WidgetId
I don't know if it's relevant, but it seems that all the handles that extend agent have those high number IDs, while the text tags, lightnings and images, which each have it's own stack, only extend handle.