[WIP] Fortnite Build System

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

3 Likes

damn its perfect

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. :slight_smile:

Thanks for pointing that out. The ESC button will release the mouse, I will update the instructions.

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

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

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.

1 Like

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.

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? Hitman style TPS stealth game project / Semi-dynamic cover, clothing, minimap etc.

I’m sorry my native language isn’t English. So I can make some wrongs. I’m sorry.

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

BY spatial hash I don’t mean the data structure, I just mean the coordinate translated in grid format (aka position/sizeOfCell)

1 Like

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 :)!

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.

1 Like

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 :slight_smile:

…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…

2 Likes

Looks really good! Love the animation.

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

I’ll upload it to Github the next days, I dont have enough time to work more on it

Cool stuff. Kudo’s for open sourcing it.

1 Like

https://github.com/SradnickDev/GridBasedBuilding
Have Fun.

1 Like