Search Unity

Decision based Game

Discussion in 'Getting Started' started by NuhatCosplay, Jan 31, 2020.

  1. NuhatCosplay

    NuhatCosplay

    Joined:
    Jan 31, 2020
    Posts:
    3
    Hey there,
    I'm just getting started with Unity and i've learned some basics. What i want to create now is a very simple 3d first person game.
    The Player walks through a hallway, ends up in a room with 2 doors in front of him and can decide which one to walk through. Depending on which door or way the player walked through, he'll land up an another room with decisions again. How exactly do i start with this? Creating the environment shouldnt be a problem, but the coding part of this seems complicated to me
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,776
    I strongly suggest you stick with getting started for now https://forum.unity.com/forums/getting-started.82/

    Dont venture to making fps, without good understanding of Unity and its API.
    Do few simple 2D projects and prototypes. Try things out. Learn basics of programming and problem solving.

    Your current understanding of "basic" is not sufficient for making 3D fps. Just be aware. Is rather shooting yourself in a foot. So take few steps back, start simple.

    Good luck.
     
  3. NuhatCosplay

    NuhatCosplay

    Joined:
    Jan 31, 2020
    Posts:
    3
    I totall understand what you're saying. My intention is not to make a finished FPS game! My intention is to have a small simple unity project in my portfolio for the university i want to apply to.
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,776
    I don't know what you tried, neither know what you know. So is impossible to even give you sensible hint on the matter.

    You description of the problem is also very vague. Something you need really to work on.

    Best thing I can suggest, is to focus on 2D first. Look into tutorials and internet. Split problem into smaller pieces. Then work on each piece individually. Then work from the ground up. Once you will understand what you are doing and providing you got time, you may consider making something in 3D.

    I assume, you aim to start uni in 2020. Don't be surprised, that time flies quicker than you may think. Specially you probably want to apply within few months, before end of term and you won't be spending full time on this.

    You could of course download FPS Sample, but that won't be any near impressive, as obviously, won't be your own work. So consider, what you try impress with to your future academia, as part of your portfolio.
     
  5. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    I'll present a counter-argument to Antypodish's suggestion, as I don't really agree that it's useful to focus on 2D when you're starting out. After all, 2D is really just 3D with everything locked along the same axis on one plane, and it also introduces some things that are more complicated than 3D (layer rendering order can be a PITA).

    There's three different approaches to making what you want.

    1. You could build the level(s) manually, where you explicitly add everything yourself. This would require everything being in the scene at once, and would also require what Tim Rogers refers to as "honest geometry", meaning, for example, that you couldn't have two adjacent rooms with doors that appear to join them, but have those doorways lead somewhere else.

    2. You could build the rooms out but separate them from each other physically. Activating a door could fade out and fade back in with the player transported to the "In" door in another room. Think something like the old Resident Evil games. If you want to really dress it up, you could make the doorways portals to each other, where you can look through them to see into the other room and the transition is seamless as you pass through.

    3. You could generate the rooms at runtime and manage the state of the whole setup through some kind of logic tree that would have data fields that indicate how many doors should be in the room, what text is on them, audio files to play, etc. This would be the best option if you want to have a lot of rooms, since making them all physically could be daunting. You could have all the level data managed in a spreadsheet and make "edits" to the game while you're away from Unity, even. This option requires the most code-writing up front before you can actually play the game, though, so even if you decide to go with this option, you'll probably want to wait until after you have a functioning prototype to try this.

    - - -

    So, as far as actually making levels, Unity's Pro Builder is fantastic for creating level geometry. It takes some time to get comfortable with using it properly, but the results are worth it. I was using Blender before Pro Builder was provided with Unity, so I'm more familiar with that, and that's a great analog to the tools professional game devs use to create levels.

    Whichever one you use, make a big box and invert it (meaning you want the faces of the box pointing inwards). Create a rectangular box to represent your door. Make sure it's a separate object from your room. I won't walk you through the actual code you'll need, but look into colliders, raycasting, and processing keyboard/gamepad/mouse input. Add the FPS controller from Unity's Standard Assets, and add a script to your player that casts a ray out a short distance when they press a certain button/key. If that ray intersects with the door's collider, consider that door "activated", and load its corresponding room (or simply open it if you're going for Option 1).

    Again, I don't want to spell it all out for you, since you're just getting started. But I think this is a great project to attempt to learn some of the basics. Good luck, and let us know if you need more help!
     
    Bill_Martini likes this.
  6. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,776
    You are right on locking axis and all that stuff.

    Problem with 3D for new starters, whet it comes to rotations and 3D orientation.
    Is really easier to learn and understand first 2D angles using basics trigonometry like sine and cos. However, these can be like black magic on its own. But even can use Pitagoras therms, for basics stuff, whats learned at school.

    In 3D you need start dealing with projections, quaternions and whats not. It brings extra level of complexity, for someone who is just starting ... road to kill the enthusiasm :)
     
  7. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    I don't agree that it's a given a dev will have to master Quaternions to be able to work with 3D. Heck, I'm an idiot and I can do pretty much anything I need without having to understand anything more than looking through the API and a bit of trial-and-error.

    I'd say that telling someone to not pursue their idea and instead do a more boring task that doesn't interest them is more likely to kill that enthusiasm, but that could just be me.
     
  8. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,776
    @Schneider21 We know nothing about OP skills. Many new coming people here, don't even know what is API, or how to read documents. Let alone making games. Of course all can be learned. We all do.

    You not going to learn swim, if someone throw you on deep water straight away. But giving right tools at basics, will give an opportunity to stay afloat. So why not just spend few moments, to learn how to swim first, then go on deep waters when feeling for it? :)

    I would never ask someone go 3D game building, if someone struggles with concept of loops, or methods for example. Without knowing anything about person, that is delusional.

    Mind, for starters learning backgrounds, grasping concepts and principles, before going further, is desired approach.
    Is not about stopping from going do dreams etc. Yes do it by all means. But don't let be fooling our self here. Some principles to pursue dreams are required.

    We know stories about people trying doing their first game as MMO RPG FPS mix. Let be realistic. Not about dream killing.

    We often take our skill and knowledge for granted, assuming others are the same. Doing few basics prototypes, with low complexity first, before going further makes life easier.
    Fast learners will have 0 problem with that approach. But at least will know, what it takes.