Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Assets [WIP] Fortnite Build System

Discussion in 'Works In Progress - Archive' started by Xitech_, Jun 12, 2018.

  1. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
    Hi guys,

    I am trying to re-create the fortnite build system within Unity, and then maybe post it on the Unity asset store. I will use this system myself in the project I am making just to learn more about Vectors and networking. Thus the project is called Vector!

    I'd love to get your feedback, is the system able to predict correctly were you want your next wall/ramp/floor?
    I am still working on a better mechanic when you look down to directly build in front of you rather than away from you. Eventhough this is a known issue I'd still like to hear your feedback on how you would like to see it. I am also very curcious about your creations, so please do share some screenshots!

    For the fortniteplayers: Does it feel close to fortnite?

    You can play the webversion on my website: http://levibucktech.com/Unity



    Thanks for checking it out, cheers

    Levi

    *Character and animations from Mixamo
     
    Last edited: Jun 29, 2018
    Magiichan, deneme09 and Neviah like this.
  2. bati_tanger

    bati_tanger

    Joined:
    Jun 2, 2018
    Posts:
    1
    damn its perfect
     
  3. ImFromTheFuture

    ImFromTheFuture

    Joined:
    May 21, 2015
    Posts:
    30
    Not able to use the web version properly. The mouse doesn't allow me move around properly, and once I've locked the cursor, I can't find a way to unlock it.

    EDIT:
    On reload, it works fine now. :)
     
  4. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
    Thanks for pointing that out. The ESC button will release the mouse, I will update the instructions.
     
  5. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
    Hello again everyone!

    Fixed an issue were if you looked back, the object would be placed too far ahead.
    Placed the camera closer to the player so look down will trigger faster (still working to improve this)

    I've also updated the instructions thanks to ImFromTheFuture!

    Cheers
     
    Last edited: Jun 17, 2018
  6. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
    Hello again everyone

    I've spend a couple night programming on the fortnite like build system.

    * Improved the ability to "guess" where your next buildable will be placed
    * Fixed an issue were left and right placement was off duo to corrections being made
    * Added a mouse speed slider

    http://levibucktech.com/Unity

    I'd still ike everyones feedback on the (new) system! My next things to improve: Better placement for the floor. And a system to check wheter it's possible to build the buildable. Will probably take some time tho :).

    Cheers
     
    Last edited: Jun 26, 2018
  7. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    KISS principle: It doesnt, like at all!

    It's just a giant 4m grid, all asset are align to the grid, so the grid only store few information (the ID, the sub division like windows and door, the orientation), you just raycast in case there is an occlusion (terrain or other), else you can spawn something in that cell.

    From gameplay perspective it solve all alignement, and the prediction is just the spatial hash relative to where the character is. It makes doing the building fast and snappy, no fiddling with position.
     
    Xitech_ likes this.
  8. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
    I'm not fully able to understand what you're trying to say :).

    It's a 3m grid and based on player position and rotation the ray is longer or shorter, making it easier to build up. Based on player rotation you can guess the rotation of the object to be placed.
     
    Last edited: Jun 27, 2018
  9. deneme09

    deneme09

    Joined:
    Feb 26, 2016
    Posts:
    19
    Really loved it. Controls are really perfect. I'm a Fortnite player, I played about 900-1000 matches. My build keys are Q,F,C. But I change they, when I try this. Q,Z,F is really good combination. Thank you.

    Btw, can you comment my stealth project? https://forum.unity.com/threads/hit...mi-dynamic-cover-clothing-minimap-etc.537878/

    I'm sorry my native language isn't English. So I can make some wrongs. I'm sorry.
     
  10. Pandalawl

    Pandalawl

    Joined:
    Jan 27, 2017
    Posts:
    8
    Sounds reasonable, spatial hash is a good idea just use dictionarys instead hashtables
    the only thing left is a tons of conditional statements for buildings wich fit together or nor
     
  11. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    BY spatial hash I don't mean the data structure, I just mean the coordinate translated in grid format (aka position/sizeOfCell)
     
    Pandalawl likes this.
  12. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
    Ah, I see what you mean. I haven't had a good thought on that yet. Thanks for poiting that out, I'll definately have a look on the approach somewhere this week. The idea is most likely quite simple: have an array which holds an array of 3 (which could represent all 3 building types).

    Thanks :)!
     
  13. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Ya their specific approach is one I picked up on and borrowed because it's actually quite ingenious. They have just one object of the same dimension that they place. And they use set offsets so everything always aligns perfectly using very simple math.

    Which also means you don't even need runtime raycasting to place stuff. You can pre scan the map and raycast at the offsets. Then at runtime use a simple mouse pointer ray intersection test against grid cells.
     
    Xitech_ likes this.
  14. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
    Yeah so as of now. I basically caluclate the build position by taking the players position and add a distance to it. Then get the nearest number to the grid (there is no actual grid / array as of now).

    There are some if statements to figure out were's the best place to put but most of these could be removed after a system like everyone is mentioning is implemented.

    I've created the offset in the .FBX file already so I don't have to mess around with that.

    Thanks everyone for pointing that out. It's the next todo thing on my list :)
     
    Last edited: Jul 4, 2018
  15. Daegit

    Daegit

    Joined:
    Nov 20, 2015
    Posts:
    32
    ..next, how would you solve the building on each other ? With just raycasting it wouldn't work, right?because buildings relay on orientation more on just ifNeighbour is inUse, right?

    Thats my approach..



    Already reworked it, to ge more control over placement and stuff like this..
    But yeah didn't touched this for a week..
     
    Last edited: Jul 9, 2018
  16. Daegit

    Daegit

    Joined:
    Nov 20, 2015
    Posts:
    32
     
    edmin687 and Xitech_ like this.
  17. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
    Looks really good! Love the animation.

    Based on the feedback I'm re-writing my entire project, so there will be some delay.
     
  18. Daegit

    Daegit

    Joined:
    Nov 20, 2015
    Posts:
    32
    I'll upload it to Github the next days, I dont have enough time to work more on it
     
  19. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Cool stuff. Kudo's for open sourcing it.
     
    Daegit likes this.
  20. Daegit

    Daegit

    Joined:
    Nov 20, 2015
    Posts:
    32
  21. Skyfall106

    Skyfall106

    Joined:
    Mar 5, 2017
    Posts:
    132
    Any news on this asset? Cant figure out the above asset
     
  22. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
    Somewhere this week I will continue with my implementation of this asset. I've rewritten all the code and implemeted spacial hashing mentioned above. The demo on my website is outdated but I am happy to share it with you if you'd like?
     
  23. Skyfall106

    Skyfall106

    Joined:
    Mar 5, 2017
    Posts:
    132
    would be great. Im working on a city builder project so a grid building system would be good. If you coud send me an updated version to try would be good
     
  24. JustAnotherIndieStudio

    JustAnotherIndieStudio

    Joined:
    Aug 13, 2018
    Posts:
    1
    this is almost spot on i would suggest fixing some things like when your falling and there are no other buildings near u you can still place things in the air also can u do a tut on how u did this would love to use thing in a singleplayer survival game im working on
     
  25. Daegit

    Daegit

    Joined:
    Nov 20, 2015
    Posts:
    32
    You made any progress?
     
    Xitech_ likes this.
  26. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
    I've made some progress and added spacial hashing aswell as building. The "only" thing I need to do it lots of if statements to were I need to place the next wall. e.g. if i'm on a ramp the chances of me wanting to build one up is high. Unfortunately this project is on hold for now.

    I've send @Skyfall106_Gaming a Unity package but he hasn't responded yet.
     
  27. Skyfall106

    Skyfall106

    Joined:
    Mar 5, 2017
    Posts:
    132
    Hey Man! Sorry, I was on trip when you sent me the package and when I got back I was sidetracked by other stuff. The package you sent me was good and was close to what I needed but I have a few questions.

    Do the objects have to be one grid size or if I have a bigger object can it take up multiple spaces.
    Is there a quick way to change build distance
    A way to have no building instead of pressing escape

    Its good so far man and once you update it a little bit more it will be way better!
     
  28. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
    Good to hear man! Hope you've enjoyed the trip :). About your questions:

    - The objects can be any size. Spacial hashing hasn't been implemented yet for the tool I sent you but this will be there soon. This would fix the problem that you won't be able to build inside any object you placed of any size on the grid. Note: The grid size can be changed in the FPSBuildManager.cs line 8 gridSize
    - The build distance can be changed if you click on the FPSController, scroll down to FPSBuildManager.cs and change the build distance via the inspector.
    - You can change this in the code of FPSBuildManager.cs line 51.

    Hope that helps and please let me know if you need more help :).
    For anyone else interested in the package: https://drive.google.com/open?id=19UbYyeQEo_D294OGiO4Kz9BX6GZpNSGW
     
  29. Skyfall106

    Skyfall106

    Joined:
    Mar 5, 2017
    Posts:
    132
    Cool thanks for the note. About the Build Distance, I know you can change it in inspector but what I mean is a quicker way to do it like scrolling with the mouse wheel and such.
     
  30. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
    Ah I see, thanks for the feedback. I'll try and implement that tomorrow morning!
     
  31. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
  32. Skyfall106

    Skyfall106

    Joined:
    Mar 5, 2017
    Posts:
    132
  33. juanktigrexxv

    juanktigrexxv

    Joined:
    Sep 10, 2015
    Posts:
    4

    hello, what kind of player locomotion did you use?
     
  34. juanktigrexxv

    juanktigrexxv

    Joined:
    Sep 10, 2015
    Posts:
    4
  35. edmin687

    edmin687

    Joined:
    Oct 4, 2018
    Posts:
    1
    hello! I also wanna make fortnite type building with own strugle not taking assets so can you please tell me how can i make this fortnite type building
     
  36. TheRealMeliodas

    TheRealMeliodas

    Joined:
    Oct 1, 2020
    Posts:
    2