I'm doing calculations on some of the particles belonging to specific halos and to do so I need to make an array with size comparable to the ID number of those particles but they are too large. Is there any way I can reduce them without losing their uniqueness?
You are right, the general idea of a "ID to Index Map" is made difficult by the large range the IDs span, as most approaches need to allocate an array at least of size max(ids)-min(ids).
The typical alternative is to sort. You can always sort the global ID list, and the sort indices are then such a mapping. Indeed the sort indices are exactly a re-numbering of the particles in the range [0,N-1], and you can then allocate an array covering them (e.g. 22.5GB for int32 of this size for Illustris-1).
If this is too vague perhaps you can say more about what you're trying to do and I can give a more specific suggestion.
I'm trying to trace certain FoF group's particles IDs and Coordinates throughout the snapshots, is there a simple way to do that directly?
Following the tutorial in the Example Scripts page you load the main progenitor branch, including the SnapNum and SubfindID fields. Then just below you load particles from a FoF group. Putting these two together you can load the associated particles back in time following the tree.