various: implement fog of war; make enemy AI slightly more intelligent #14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "notashelf/push-wlxxmonulyzt"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
One of the things that has been annoying me for a long while. Previously the entire map would be revealed immediately upon load (same for subsequent floors) and make it practically a juke the enemies while you dash for the stairs simulator. This is partially affected by the lack of map RNG (implemented, not wired up) but I think the map being loaded in its entirety was a huge downside for how engaging the game was.
This implements a Fog of War, where you have a relatively small vision distance (TODO: let items and character stats affect this) and improved the enemy AI to stop chasing you all the way from China while you are a humble fisherman in Spain. Most notably:
can_see_player()now uses actual LOS + range (was only adjacent check)This comes with changes to vision where you can only see 8 tiles in all directions (with wall occlusion) while nemies can see 6 tiles. As I said, enemies won't chase through walls but they do patrol when player is hidden. Unexplored areas are completely dark; previously seen areas remain slightly obfuscated to allow wasting screen free estate. You cannot see enemies in previously explored rooms.
The vision range is a little different for enemies. For now I've elected to make enemy vision slightly less than the player character but that might make it too easy to avoid enemies (Goblin=7, Skeleton=6, Orc=5). To combat this, I've made enemies track alert state and last known player position to "rally" nearby enemies by propagating alert to create a "search party" effect.
Signed-off-by: NotAShelf raf@notashelf.dev
Change-Id: I3e22dbc5e10690871255980c52a24c226a6a6964
dbf8d4886cto71343311ebDude, this is freaking awesome!!! Amazing work! Merge this biatch.
Yeah, I approve 100%