ml4ai / tomcat

ToMCAT: Theory of Mind-based Cognitive Architecture for Teams
https://ml4ai.github.io/tomcat/
MIT License
21 stars 7 forks source link

Higher-level representation of spatial location and procedural generation of maps. #111

Closed adarshp closed 3 years ago

adarshp commented 4 years ago

We will need a higher-level representation of spatial position of the human players, i.e. semantically meaningful regions (which house, which room, etc.) for modeling, planning, and NLP purposes.

We have already been discussing moving towards procedurally generated worlds, so it makes sense to couple the two, i.e. create a data structure with semantic region information (coordinates, bounding boxes, etc) at the time of the world generation.

To find out which region the player is in, we can either:

  1. Loop over the regions to see which one the player is in by analyzing the coordinates of the player and the bounding box corresponding to the region, or
  2. Construct a bounding volume hierarchy (e.g. an R-tree or octree) data structure that can be used for queries.

If we have relatively few regions in the map, then method 1 could work - it's easier to implement. If we have a large number of regions, then method 2 might be the way to go (assuming that we want to provide region information at the same frequency as we were providing the X, Y, and Z coordinates).

@Adi-UA is currently looking into procedural generation, I am just adding this issue to keep track of people's task queues.

To discuss:

Generating things from scratch (more flexibility, easier version control - no need to download additional file assets from scratch) vs using .nbt files corresponding to pre-built structures (@Adi-UA : I am assuming that this is faster? If so, by how much?)

adarshp commented 4 years ago

@Adi-UA I took a quick look at the addBlocksToWorld function in net.minecraft.world.gen.structure.template.Template, and I think that the internal logic of loading structures from a .nbt file is not really more complex than just looping over each block of the structure saved in the .nbt file and placing the structure centered at a given position. But please double check this.

If that is indeed the case, then I think it would be good to go ahead with trying to generate the structures themselves programmatically.

If the procedural generation of the world does start to take overly long due to the complexity of the generation algorithm, it would make sense to 'cache' the output of the procedural generation as a world file (similar to the zombie and tutorial mission worlds we currently have), and have the game load that up (I think it would be simple enough to encode this with Make, i.e. rebuilding the world if any of the source code that it depends upon changes). But let's see how far we can get without having to cache worlds.

But before writing any code, we should probably:

  1. Do some research into what other people have already done in this space, so that we can build upon it, and
  2. Think at a high level about the desired features of the map output by the procedural generation algorithm, and then design the algorithm appropriately.

Regarding point 1, a quick Google search shows that there are a few interesting research threads in this area:

If we look beyond Minecraft specifically, we will surely find tons of additional material. But you may want to take a look at these first.

adarshp commented 4 years ago

@Adi-UA Nice work on the recent PR. For the next one, there are a couple of minor changes we should incorporate:

Adi-UA commented 4 years ago

Thanks!

Yes, I'll include these changes in the next PR.