I am trying to do a stardew valley grid like.

ISM instances have an index, and that’s all you need. The data is kept in an int (index) | struct Map and retrieved as needed. It would not reside in the tile itself.

In short:

  • have a single actor with many ISM components, acting as a manager
  • tiles can be moved between ISMs if needed
  • have a struct representing the tile’s data
  • the manager actor holds onto tMaps keeping track of tiles’ state

It takes a while to get one’s head around it but it is quite performant. There are obviously quirks and gotchyas you’ll discover along the way. You will need to understand how instance indexing works, too.

Once you feel comfortable with ISM, you could tackle HISM which can provide further performance boosts under right circumstances.


At this point, you may also want to start looking into:

Here’s a very crude example: