thejoshwolfe / legend-of-swarkland

Turn-based action fantasy puzzle game inspired by NetHack and Crypt of the Necrodancer
http://wolfesoftware.com/legend-of-swarkland/
Other
91 stars 5 forks source link

Brainstorming: Make movement conflict resolution easier to understand #86

Open thejoshwolfe opened 2 years ago

thejoshwolfe commented 2 years ago

image

Who's going to win the above movement conflict? I'm the creator of this game, and i still don't have an intuitive muscle memory for how these collisions are resolved. this is a problem.

Ideas:

  1. Give every species a movement priority, and the higher priority wins. This is intuitively a "weight" or "strength" measurement for the species. (This already existed in 5.6 in a limited form: rhinos had higher priority than everything else.)
  2. Prefer some cardinal direction, such as east/west before north/south.
  3. :-1: Literally random.

See #85 for why i don't like ideas (2) and (3), although (2) is not off the table.

Idea (1) has the most promise, because players expect all sorts of things to be dependent on what is most visually obvious: the species. (Players also expect that they have priority, but that's counter to Swarkland's fairness design goal.)

The biggest problem with (1) seems to be that it requires a big table of data which hardly ever matters. If every species has a unique priority value, then that's an enormous table, and in most cases the only thing that matters is your priority against others, which means once you polymorph into a wolf or whatever, you're going to need to tab out to the Wiki to look up which monsters are on which side of the table from you. This seems like too much complexity for the gameplay benefit.

Another problem is that it doesn't solve the problem for two individuals of the same species. Unless we give every individual a unique priority, this is going to be a problem. This may be less concerning if the only case where you can't predict which of two enemies will enter a space is when the enemies are effectively interchangeable anyway.

There's a compromise to address the "large table" problem with (1) which is to group species into tiers, which is already implemented on master branch:

  1. amorphous: (no collision) blobs.
  2. small: rats, ants.
  3. medium: humans, centaurs.
  4. large: rhinos, ogres.

The table as it exists now doesn't work well for avoiding collisions because the different tiers operate independently, so can you have a blob, a rat, a human, and an ogre all standing on the same tile in different "physics layers"; this table doesn't resolve collisions; it avoids them. But perhaps a coarse table like this could be used to resolve collisions intuitively without needing a unique value for every species.

thejoshwolfe commented 2 years ago

For reference the current implementation is:

  1. For 3-way collisions, the one in the middle wins.
  2. For 2-way head-on collisions, nobody wins.
  3. For 2-way right-angle collisions, right of way is given to the one on the "right" rotationally (the turtle in the above screenshot).

This rotational symmetry of this implementation is what's so hard to understand. It also interacts with #85 to give the illusion that centaurs have higher priority than humans, and humans higher than orcs. Really what's happening is the AI and the collision resolution rules almost always line up to give that illusion: orcs tend to choose the unfavorable diagonal and centaurs tend to choose the favorable one.