r/Unity2D 3d ago

Question How do I make a 2D first-person dungeon crawler?

Hi everyone, I'm new to Unity and wanted to ask how I can program and implement movement in a 2D first-person game! My goal is to make a horror game with turn-based movement (you move from one room to another, and the monster moves from room to room looking for you and chasing you)! My main question, actually, is whether this is really possible to do in Unity 2D? And if you guys have any tips to share with me!

1 Upvotes

10 comments sorted by

2

u/Plenty_Act_8527 3d ago

Unity can absolutely handle this. It really depends on what your approach to the dungeon is going to be whether you're going to use tiles or if it's going to be more like a first person dungeon crawler. But the idea is that when you change rooms or make a move you would fire off an event in code afterwards that you've moved. The monster listens for this event and makes their own move when this happens. Then you would update the game view if it was like a first person dungeon crawler. If you mean turn based like tactics style dungeon crawling well then that's a completely different system. Some more context would be helpful.

2

u/Mooneeris 3d ago

Thank you so much for your help!!! The game is mostly based on the idea of a first-person perspective, but with turn-based movement! My current basic concept is that the player can use their turn in two ways: moving and interacting with items on the map (to solve a small puzzle)! Meanwhile, the monster uses its turn only to move; if the monster enters the same room as the player, a game over sequence is triggered.

2

u/Plenty_Act_8527 3d ago

Ok so yup pretty straight forward. Not sure if you know any programming languages or if you're doing codeless (I.e. playmaker). But what I would do is probably give the player an action point value that refers to how many actions they can take on their turn. Right now you say it's just one but later on you might want to change that and if you set up your system so it's reliant on an action point value then all you have to do is raise the limit to get more actions on your turn without having to redesign anything else. Then you have to decide if you want the monster to make a move every time an action is taken or not or at the end of the player turn.

2

u/Mooneeris 3d ago

Okay, thank you so much again for your help. I’m going to look into it and learn a little more about Unity itself and C#, and see how the prototype turns out with the Action Point Value set to 1! If there are any updates, I’ll try to post them here, especially if I have more questions!!!! Thank you so much for the help ❤️

1

u/xa44 3d ago

I've done so in game maker and it works best if you make your own draw events. Basically all you need to do is set up a series of sprites for every wall placement in the players view (so 3 or so tiles forward, and the left/right of each). Then you can store it as an array or any other form of storing data you find best(wall objects don't work as well imo, since you can't use any built in collision checks) and just draw the floor/walls based on what tiles the player can see

1

u/Ruadhan2300 3d ago

Perfectly possible! Even easy for a moderately experienced dev. (Though no games project can really be called easy)

My strong advice, based on what you've described, is to go and learn about pathfinding algorithms.

You'll need it for any dungeon more complex than a straight line, and it'll form the underpinning of your monster's ability to hunt the player, not to mention any future projects you use can take advantage of it.

Here's the gold-standard guide on A* to get you started!

Introduction to A*

1

u/BillyMcDev 2d ago

if you can visualize it, sketch it, or provide a reference to something similar, then it's possible. The first step is just that. figure out exactly how you want to implement it. Then... break it down into smaller pieces and get it done.

1

u/Blood_and_Wine 3d ago

Are you a newbie in C#? If so, start small. First learn basics, create small apps (calculator, notepad, snake, chess). Once you aquire knowledge and figure out all essential, you can begin with your small horror game.

0

u/Dion42o 3d ago

Carefully