Generated Graph optimized A* Pathfinding

So i’ve updated the project to address some of the simpler / easier-to-fix concerns brought up. (http://www.java-gaming.org/user-generated-content/members/244457/monster-12-19-17.jar - see top post for updated jar)
specifically,

  1. distance required between monster / exit and human to trigger game over has been decreased (from 2 to .5 units);
  2. Pressing “enter” key restarts the game. At game over, text is displayed to remind the player they can press Enter.
  3. Map generation can no longer generate isolated room-groups. Only group of connected rooms will be kept. This should fix unreachable exits / monsters.

The fix for slower speed when “sliding” on a wall, isn’t as straightforward as I thought it would be, since the intersection finding logic solves for x movement, then y movement separately. It has no way to come back to the x-logic after it realized it’s sliding on a wall in the y-direction in order to increase the x-movement. So the solution would require rewriting the movement intersection logic, which I will do, but just not in this update.

Next i will address the bigger game-design concerns, e.g., fix “repetitive & mindless wandering and hope u encounter exit before u encounter monster and feel like you’re helpless in determining whether u win or lose.” I’ve got some ideas on how i’ll try to improve this, but before i’ll list them below to get some opinions:

Encountering the monster shouldn’t be a rare occurrence that ends in losing; it should be a probable, experience that repeatedly breaks up the monotone of searching for the room, and must therefore also be “resolvable” without defeat. First, to make it more likely to happen, the monster will not wander aimlessly when it is far from the human, but instead “sniff” the general direction of the human and move towards the general vicinity. Second, to make the encounter resolvable/conquerable, the monster will be only slightly faster than the human. In addition, the monster will not be able to chase the human’s exact location even without line of sight. Instead, the monster takes “sniffs” on a ~5 or ~10 second cool-down, which provide it with the approximate location of the human (more accurate with smaller distances), and follows the last sniff location. Only when the monster has line of sight of the human (or his light), will the monster chase the exact location of the human. This gives control to the human on escaping the encounter by juking and such. In addition, the human’s light can be toggled off, making it harder to navigate, but also less likely for the monster to gain line of sight of the human’s light. Lastly, the monster leaves a fading “footprint” trail, to allow the human to have control on avoiding encounters.

These are just initial thoughts. In essence, I’m just trying to avoid the “inevitably” of defeat following the monster/human encounter, as well as make escaping and avoiding an active task rather than luck-based.

Updated, http://www.java-gaming.org/user-generated-content/members/244457/monster-12-20-17.jar (see top post for most updated jar).

In this update,
I’ve changed monster behavior. It no longer can determine the human’s exact location when nearby unless it has line of sight. 1) if it has line of sight of the human, it directly chases the human. 2) else, if it’s “sniff” cooldown is ready, it sniffs which gives it an approximate location of the human (accuracy vary’s depending on distance) and updates it’s movement to go to that approximate location
And the human now get’s a blinking direction indicator when the monster is nearby. Blink frequency is relative to distance, and direction points towards monster. Lastly, human detection distance has been increased.

Hopefully these set of changes help address the almost-guaranteed “game over” on encountering the monster, as well as make encounters with the monster more frequent.

All feedback greatly appreciated :slight_smile:

Another update :slight_smile:

http://www.java-gaming.org/user-generated-content/members/244457/monster-12-22-17-2.jar (most up to date jar in top post)

  1. Added hints; these are purple floor tiles that protrude from the exit horizontally, vertically, and diagonally every 3 tiles. They help the human find the exit more deterministically.
  2. added particle system and monster “footprint” trail indicating where the monster has been recently.
  3. monster speed decreased from 50% to 20% faster than human
  4. camera is more zoomed out by default (z increased from 20 to 25), allowing you to see more of the map. Feel free to try adjusting this ("-" and “=” zoom out and in) and let me know what feels optimal
  5. fixed bug where corridors with dead ends were being generated
  6. Adjusted monster sniff error. Monster is less inaccurate at determining human’s location at farther distances. It’s a linear scale, with a minimum error of 5 units that increases at about .3 units of error per 1 unit of distance.
  7. Stamina and Running. Stuck in a hallway with the monster right behind you? Have no fear, just press “.” for a short burst of movement speed (100% increased movement speed) to get away!

Another update
http://www.java-gaming.org/user-generated-content/members/244457/monster-12-23-17-3.jar (see top post for most up to date jar)

I’ve redone the movement collision algorithm. It no longer makes you slow down if you’re sliding against a wall. Turning tight corners while being chased by the monster will be a little bit less scary.
Plus improved the house generator to require a minimum number of connected rooms (set to 70). We should no longer experience the bug with just 1 or a small number of rooms being generated, and the monster, human, and exit are spawned very close by. So if anyone still experiences this bug, let me know.

All feedback greatly appreciated. :slight_smile:
That being said, I feel like this project is coming to an end soonish; as other than making it prettier (I’m not much of an artist), and doing small fixes & improvements I don’t really know where to take it. Thank you all for your feedback and helpful comments, I had fun building the project, if there are any features or ideas you would like to see before I move to my next project, let me know :).