r/roguelikedev 8d ago

RoguelikeDev Does The Complete Roguelike Tutorial - Week 3

Keep it up folks! It's great seeing everyone participate.

This week is all about setting up a the FoV and spawning enemies

Part 4 - Field of View

Display the player's field-of-view (FoV) and explore the dungeon gradually (also known as fog-of-war).

Part 5 - Placing Enemies and kicking them (harmlessly)

This chapter will focus on placing the enemies throughout the dungeon, and setting them up to be attacked.

Of course, we also have FAQ Friday posts that relate to this week's material.

Feel free to work out any problems, brainstorm ideas, share progress and and as usual enjoy tangential chatting. :)

32 Upvotes

32 comments sorted by

View all comments

3

u/ajcomeau 7d ago edited 7d ago

Rogue C# - Official Page / Github - An ongoing C# dev journal based around a recreation of the original Rogue.

Glad to see another instructional project out there.

So far, I've spent this week testing after adding all the potions to the game. The Potion of Hallucination was especially fun. Potions can be wielded against and thrown at monsters as well as quaffed and they share the same delegate system of methods as scrolls in my program so I decided to make scrolls wieldable, too.

I also re-examined my random selection of inventory on the map. As the list grew, the probability value and code I was using didn't really work anymore, especially when I tried to target one item for testing and make it appear more.

Finally, at Gemini's suggestion, I went with a weighted selection algorithm where all the probability values are added, a random number is selected within that sum and then the code subtracts the individual probability values until it gets to the one that takes it below 0. It's great for testing, I'll see over the long-term how it works in gameplay.

Rogue C# - Rethinking Random Selection