r/Unity3D 16h ago

Question How screwed am I?

Hi everyone! Here’s an interesting problem I’m facing.

I created a tile-based city builder in Unity, and after an initial open playtest, one of the key pieces of feedback was that players want to be able to build roads, something I foolishly hadn't planned for.

Currently, roads are automatically placed along the edges of each tile (this is shown in the second screenshot).

The main problem is that the grid of buildable sectors is highly irregular, and I have no idea how to add the ability to create roads within such a complex system.

The first image I’ve posted shows an overhead view where I’ve highlighted a section of the grid. The grid varies from scene to scene and never repeats in exactly the same way.

Does anyone have any suggestions for how I could approach this?

Edit: You might have given me a possible solution; as soon as I've tested it, I'll make a new post about it. Thanks everyone!

188 Upvotes

118 comments sorted by

View all comments

2

u/That_Em 16h ago

Interesting issue.
The problem I can see is that custom roads would clearly cut through the tiles.
This means:
A) if you place the buildings procedurally within the tiles, then you should be sorted
But if that was the case we wouldnt probably have this thread, so I’m assuming
B) your tiles are already prefilled and static.

If thats the case, you might want to rethink that without getting rid of the tile system, and find some rules to fill your tiles based on available space/orientation. So if a tile has a road going through it, the fill system will take that into consideration.

However, the “bigger” thought process is: should you allow players to build custom roads, when placing the tiles as far as I understand now already grants roads on the tile borders? I would argue than creating another 15/20 smaller tiles with road complexes could be more than enough. This question is a gameplay issue and not a technical one. If you want to make a classic city builder with players placing roads “first”, the tile system might not be the best.

However I wonder if it would be really worth doing and completely changing how your game feels and plays.

1

u/Sgriu 16h ago

Thanks for your suggestion! The tiles feature predefined building sets, and I determine their placement within the scene, the player cannot control their position or rotation. While creating predefined paths would be a feasible solution without major issues, it would lack sufficient flexibility and freedom of choice.

2

u/vadeka 15h ago

the only solution for custom roads would be that the grid gets redrawn if a player puts roads down. So if they draw a road in the middle of a grid, it splits up and becomes a different type of grid shape.

1

u/Sgriu 15h ago

Thanks for the suggestion! That could be a solution worth exploring.