Procedural Generation of a City in Unity

  Рет қаралды 52,977

TJ

TJ

Жыл бұрын

This is the final devlog of our month long game challenge, and for the last week I needed a proper city, now I could spend 5 hours placing it by hand, or 12 hours coding a system to generate the terrain, and since Im luckily to bad at math, Ill teach you (wildly oversimplify) how I generated it using Wave Function Collapse and if you keep watching Ill let you know how you can get the code to do this yourself.
All code from this project: github.com/TJGameDev/NeonRogue
Itch.io download: goat-hill-games.itch.io/rogue...
Check out the Synty store by using my affiliate link to support the channel! syntystore.com?ref:TJ
Twitter: / tjgamedev
Music in order of play -
jump man 93 - bruh: • jump man 93 - bruh
Evan King - Lets Go! / @contextsensitive
contextsensitive.bandcamp.com/
HOME - Head First: • HOME - Head First [Syn...
About me -
Hi I'm TJ, a developer who is passionate about learning gamedev. I primarily develop games on the unity platform using C# but any code is fair game. I’m still learning a lot but hope you’ll enjoy my
Software Used -
Unity Version: 2021.1.22f1
Visual Studio Code: code.visualstudio.com/
Adobe Premiere Pro: www.adobe.com/products/premier
Adobe Photoshop: www.adobe.com/products/photoshop
PC Specs -
NVIDIA GeForce RTX 3080
AMD Ryzen 7 2700x
32GB RAM
Way too much caffeine
#wavefunctioncollapse #unity3d #indiedev #gamedev #indiegame #gamedevelopment #devlog #madewithunity
#indiedev

Пікірлер: 127
@TJGameDev
@TJGameDev Жыл бұрын
There are bound to be a few bugs, feel free to leave them here and I’ll get them patched asap. Sorry the vid took a lot more effort than I was expecting so bug fixing was minimal haha.
@jayoflegend5602
@jayoflegend5602 Жыл бұрын
I think the Exp Card makes your Exp gains like infinite? Idk I kept leveling up on repeat after grabbing it. Also, the Extra Draw Card crashed the game for me haha. I am impressed with what you were able to accomplish in such a short amount of time, however. I especially like the Sandevistan effect.
@diabloxdan
@diabloxdan Жыл бұрын
I tried out the game quickly and I'll post some of the problems I ran into when I was playing it for around 30 mins. Warning this post is really long and It's a little weird to format on youtube. ==================================================================BUGS======================================================================= - Like the guy above me said, when I got the Extra Draw Card my game froze and wasn't able to play anymore. I could still open the esc menu, and I had to use the restart game to continue - On my first run with the Assault Rifle I was able to get to level 17 before I could no longer pick any cards when I leveled up. It would freeze the game and I could unfreeze it with going into the esc menu and back out to continue. However, I still couldn't pick a card and was still 17 with a full xp bar. Once I got enough xp to level again. The same freeze would happen and I had to esc in and out to continue. - I kept playing my first run until I hit 5 minutes and let the guys kill me. Even as I died and the death animation played it kept spamming the hurt sound. - On the second run, my timer had continued from the first run and I was already at around 5 minutes. - I had the option to pick the sandevistan multiple times even though it wouldn't do anything - I got the sandevistan the first run, but I was able to use it in my second run despite not getting it yet. - In the second run after picking some xp cards I was able to fully level off a one xp cube. Spent most of the run picking cards and avoiding the extra card upgrade. - Because I was constantly left clicking when using the sword, whenever I got a level up I would immediately pick a card on accident. - Because of the timer bug running on into my next game I was able to quit at around the 7 minute mark (5 mins from first run, and 2 mins from second). This got me enough credits to max the rest of the ripper doc upgrades. - When picking a weapon at the start all 3 weapons say they rapidly fire projectiles even though 2 of them are swords. - I started a round with 12 rolls even though I should only have around 6-8 (Not sure how many I'm supposed to have). - On my 3rd run I unlocked the sandevistan and I wasn't able to use it at all. There was also no cool-down indicator on it. I also got the upgrade dozens of times and still couldn't use it. - The xp card bug making me level off every xp drop made me hit a high level extremely quick. In the end the only 2 cards I could get were the extra card which would break my game, and the sandevistan that didn't work. - When rolling, xp cubes stop coming towards you and continue again when you finish the roll. - It still plays the hurt sound when an enemy hits you even whilst rolling. There's more bugs, but I'd have to play more to find them and have to constantly try and avoid all these problems to get there. A little bit of feedback for the game besides the bugs ===================Feedback================== - You level way too quickly even without the xp bug. I was spending a lot of the early minutes I played in the card picker. The start of the game wasn't very smooth with the constant leveling and card picking. - The sword swings look cool but kinda feels bad. I wasn't able to tell if my sword swings were always hitting or not (They weren't always hitting I'm pretty sure). - The upgrades in the ripper doc were way too cheap and their displayed increases were weird. For example the first reload upgrade said 100% > 100% and then on the second level it said 100% > 105%. I got enough credits from a one 5 min run to get around half the upgrades. - I saw a card for damage mitigation which reduced the damage you take by 50% which is pretty strong if it does what it says. After that it then shows another 12 cards that mitigate damage that you can pick. - I think you should also nerf the firerate cards and rename them to attack speed have them also apply to the swords (Maybe they already do, but I'm not sure). - 1 is a little awkward to press for the ability, I'd suggest changing it to something else like Q or E
@BakaBrosEnt
@BakaBrosEnt Жыл бұрын
Is there a best way to get ahold of you for business inquiries?
@SebastianGraves
@SebastianGraves Жыл бұрын
The fact that you just decided to bang out an entire project in a single month fills me with determination. Well done man.
@ioanaldea1509
@ioanaldea1509 Жыл бұрын
I was just looking at a tutorial made by you and uhh it did not go well for me...
@TJGameDev
@TJGameDev Жыл бұрын
Thanks bro I appreciate it
@FanaticChain
@FanaticChain Жыл бұрын
Amazing job like always! I’m sad to see tavern team go but I’m excited for the future ahead!
@UselessFodder
@UselessFodder Жыл бұрын
TJ, it was really cool seeing this project come together in only one month. You covered so many important topics in these videos, yet the pacing (and humor!) were absolutely on point. It's obvious that you put a ton of work into this and I really appreciate it! Stoked to download the game and kill me sooner Cyberpunk zombie robot guys.
@TJGameDev
@TJGameDev Жыл бұрын
Thanks man, working on patching a few things in the game haha
@keithin8a
@keithin8a Жыл бұрын
Really enjoyed following your progress on this! Congrats on finishing!
@TJGameDev
@TJGameDev Жыл бұрын
Thanks so much!
@JensDev
@JensDev Жыл бұрын
really wanna make some more procedural stuff myself now.. Great job on the game!
@TJGameDev
@TJGameDev Жыл бұрын
Thanks Jens
@nilsleonhardtdev
@nilsleonhardtdev Жыл бұрын
I couldn't wait to see the next video.. Amazing as always! Keep up the hustle. Btw I love your Unity stuff and also the videos.
@TJGameDev
@TJGameDev Жыл бұрын
Thanks man, that’s great to hear!
@sudhansubalasahoo
@sudhansubalasahoo Жыл бұрын
It's great that you persevered through this challenge in this month. Great job
@TJGameDev
@TJGameDev Жыл бұрын
Thank you!
@brannanvitek1035
@brannanvitek1035 5 ай бұрын
This was great! You're an awesome developer. Thanks for explaining WFC, you made it make so much sense.
@TJGameDev
@TJGameDev 5 ай бұрын
Thanks so much man!
@kpr2
@kpr2 2 ай бұрын
Mad props! Thanks for sharing your technique & your code. 👏
@TJGameDev
@TJGameDev 2 ай бұрын
You’re welcome!
@stevenshoemaker1618
@stevenshoemaker1618 Жыл бұрын
A new video from TJ always makes my day go from check minus to check plus
@TJGameDev
@TJGameDev Жыл бұрын
Thanks man, glad you enjoyed!
@curiouspers
@curiouspers Жыл бұрын
This is the best explanation of wave function collapse I've ever seen! Great job, man!
@TJGameDev
@TJGameDev Жыл бұрын
Thanks man, glad you liked it!
@KillingSurvival
@KillingSurvival Жыл бұрын
Well seems I'm about to binge watch all the vids uve made over the last year
@TJGameDev
@TJGameDev Жыл бұрын
Haha thanks man
@KillingSurvival
@KillingSurvival Жыл бұрын
@@TJGameDev thank you, Ur content is very fun and makes my brain tick which is awesome, actually useful content ❤️
@inoroth2001
@inoroth2001 6 ай бұрын
JEREMY! You betrayed us! Someone had better let Dani know.
@thatonedudelive7260
@thatonedudelive7260 Жыл бұрын
Amazing!!! Can’t wait to play this honestly. Sadly moving in 2 days so it will be a little while before I can.
@Ironroc
@Ironroc Жыл бұрын
Congrats on finishing up! I'll check this out soon.
@iiropeltonen
@iiropeltonen Жыл бұрын
Good Job on getting your challenge done. Good explanation of WFC also!
@TJGameDev
@TJGameDev Жыл бұрын
Thanks!
@TheFlopster
@TheFlopster Жыл бұрын
JEREMY RETURNS
@TJGameDev
@TJGameDev Жыл бұрын
The return of the king!
@____blank____
@____blank____ 9 ай бұрын
"I decided not to go to an art school because I hate working at a restaurant" hahaha
@fka8159
@fka8159 Жыл бұрын
Thanks a lot for the video and especially the Code. I've been doing the exact same Thing for a couple of weeks - procedurally generate a Cyberpunk City - and your code could help me a lot. I chose a different approach, I randomly placed whole streets and then dynamically filled the space inbetween with procedurally generated buildings. The wavefunction collapse method seems more organic though, I think I'll revise my code now after seeing this video. Liked and subscribed
@TJGameDev
@TJGameDev Жыл бұрын
Great, hmu on discord if you have any questions
@elderyaag3534
@elderyaag3534 Жыл бұрын
My man Randy should really watch you. Great work!
@PaniniDev
@PaniniDev Жыл бұрын
Hi TJ!! Super excited for your next upload
@TJGameDev
@TJGameDev Жыл бұрын
Thanks man!
@gegenton3953
@gegenton3953 Жыл бұрын
Awesome achievement of actually finishing it, good job!
@TJGameDev
@TJGameDev Жыл бұрын
Thanks!
@BcGhosted
@BcGhosted Жыл бұрын
I love the Jeremy reference
@AndersonReis42
@AndersonReis42 Жыл бұрын
this is exactly what I was looking for
@TJGameDev
@TJGameDev Жыл бұрын
Glad it helps!
@waytoomuchtimeonmyhands
@waytoomuchtimeonmyhands Жыл бұрын
Nicely done and good video. To the point and not a lot of nonsense.
@TJGameDev
@TJGameDev Жыл бұрын
Glad you liked it!
@chadzulu4328
@chadzulu4328 Жыл бұрын
Bruh, this is truly badass!
@TJGameDev
@TJGameDev Жыл бұрын
Thanks man!
@captainnoyaux
@captainnoyaux Жыл бұрын
Hey that's super informative thanks for the video !
@TJGameDev
@TJGameDev Жыл бұрын
Glad it was helpful!
@diegosatori5718
@diegosatori5718 Жыл бұрын
Looking and sounding good
@TJGameDev
@TJGameDev Жыл бұрын
Thanks man!
@wcrb15
@wcrb15 Жыл бұрын
Great job! It looks great. Definitely going to be stealing that wave form collapse idea for random generation. Still working on my game, but it's nearly feature complete. Then I just have to work out art and menus/UI. :)
@TJGameDev
@TJGameDev Жыл бұрын
Go for it!
@Sylfa
@Sylfa 11 ай бұрын
2:18 - It mostly only matters if you want to pre-place certain things on the map, say a start and a goal. But if you were to propagate the collapsing possibility space to the next tile(s) as well then you can pick a random tile from anywhere since you'd only have valid tiles on the entire map. The difference should be minimal when you have a single starting point. But if you want to place a single tile of a specific type, say a single upgrade store and a single parking lot where the player starts, then you could place those randomly first, propagate the required tile changes, and still have a functioning map. It also helps when you want to add multi tile pieces, say a park area, since it would ensure that the park has enough space to put an edge tile down even if the generation were to wrap around the back of the park area. Without flood filling the propagation you would have situations where it would pick tiles that don't have any possible tile to choose between them. Not certain if flood filling it will guarantee the map will work though, most people that work with WFC go for the lowest entropy selection and just restart the generation if the map fails to collapse completely.
@mudokin
@mudokin Жыл бұрын
Very cool, I may joink that generation part from your code. I think i can use it for the test game of a VR system prototype.
@TJGameDev
@TJGameDev Жыл бұрын
Go ahead!
@camzxlegendary9649
@camzxlegendary9649 Жыл бұрын
Congrats!
@gibs9731
@gibs9731 Жыл бұрын
"I didnt go to art school because I dont wanna work in a restaurant", epic quote right there! :D
@TJGameDev
@TJGameDev Жыл бұрын
Haha thanks man!
@AldricBenjie1
@AldricBenjie1 Жыл бұрын
Love you tj
@TJGameDev
@TJGameDev Жыл бұрын
Thanks Tim
@alphablender
@alphablender 6 ай бұрын
WOW MAN, AMAZING
@TJGameDev
@TJGameDev 6 ай бұрын
Appreciate it!
@Pixels4Games
@Pixels4Games Жыл бұрын
Wow this cyberpunk game turned out really great. You make it look so easy to make 3D games and yet every time I try I fail - that's why I'm sticking with developing only 2D games - at least for now. Anyway, great video. Keep up the good work :) - Dan
@TJGameDev
@TJGameDev Жыл бұрын
Thanks Dan! I appreciate it!
@IsaacPeek
@IsaacPeek Жыл бұрын
Good Job my dude! You've inspired me to do a similar challenge and attempt some devlogs. I too need practice on completing games and releasing them. I'm going to attempt a similar genre but not do cyberpunk and instead something Western.
@TJGameDev
@TJGameDev Жыл бұрын
Good luck!
@mysterious_monolith_
@mysterious_monolith_ 4 ай бұрын
You're awesome!
@TJGameDev
@TJGameDev 4 ай бұрын
You are!
@styxrakash4639
@styxrakash4639 Жыл бұрын
“I hate working at a restaurant” Take thaaaat you devilish art bois
@nishalllstm
@nishalllstm Жыл бұрын
3:56 "But I decided not to go to art school, because I hate working in a restaurant" 💀hahaha
@emberdragons8244
@emberdragons8244 Жыл бұрын
Jeremy, lol dani we found him.
@NKCubed
@NKCubed Жыл бұрын
aww I love you too man! parasocial relationships ftw
@EvaLunaAlvarezCalderon
@EvaLunaAlvarezCalderon 10 ай бұрын
el juego se ve chido, I arrived here for the Procedural Generation Stuff and I will leave with that and I nice game thanks =D
@NinyaMonke
@NinyaMonke Жыл бұрын
oh my God it's Jeremy
@gamedevgoose9887
@gamedevgoose9887 Жыл бұрын
I DID THE SAME THINK ON MY CHANNEL WOOOO GO PROCEDURAL GENERATION
@keathmueller2430
@keathmueller2430 Жыл бұрын
Haha nice, now you can recreate Armoured Core 1 or 2 but better! xD
@abolfazlmaleki4514
@abolfazlmaleki4514 Жыл бұрын
I. Didn't watch the video until now because i didn't realize this it one of yours
@CoolinarGameDeveloper
@CoolinarGameDeveloper Жыл бұрын
if it runtime generation, it very bad to performance cos u cant bake light static batching and other things
@heromomo2
@heromomo2 2 ай бұрын
What you’ve done is really really cool. I am going to take a look at your code because I want to understand how it works. I wanna learn how you figured out how to generate an entire city. Is there any file I should take a look at first?
@TJGameDev
@TJGameDev 2 ай бұрын
The wave function collapse files
@sechmascm
@sechmascm Жыл бұрын
Racing game next? I loved Jak X for PS2
@naruarthur
@naruarthur 11 ай бұрын
you could have used animation curves for the exp part, it would be ways easier than actual math and easy to adjust too
@TJGameDev
@TJGameDev 11 ай бұрын
That’s a great idea, you’re right thanks
@binabina4445
@binabina4445 Жыл бұрын
And here I am still trying to figure out how to make my character move
@TJGameDev
@TJGameDev Жыл бұрын
Baby steps, you’ll get there!
@binabina4445
@binabina4445 Жыл бұрын
@@TJGameDev lol thanks. I got it to move but then I baked nav mesh and now it slides instead of walks lol. Some baby steps forward and some back 😅
@lucian6172
@lucian6172 10 ай бұрын
I survived your game for 1,444 seconds but the final text doesn't fit properly on the screen to show the Survival Time. It needs some extra spaces. After a few minutes, that screen that pauses the game to show you the upgrades, doesn't show anything anymore. You have to press ESC and Continue because the Upgrades are not showing. You should remake it without paid assets so we can bug fix it and continue it.
@kvbc5425
@kvbc5425 Жыл бұрын
you cool guy tj, you videos good cool
@TJGameDev
@TJGameDev Жыл бұрын
You cool too
@bigedwerd
@bigedwerd Жыл бұрын
Amazing stuff. Have you read about how Spelunky creates it's levels? I believe that game does something similar. They have some prefabs for rooms, but have some random noise that makes each room somewhat unique. For your prefabs you could do something like different graffiti or light colors or whatever you have time or interest adding. I'm curious though, for your entropy are you accounting for the duplicates?
@TJGameDev
@TJGameDev Жыл бұрын
Hey thanks, no I haven’t looked into spelunky’s Gen but I’ll watch some videos on it. Yes I account for duplicates, as technically they are all options
@bigedwerd
@bigedwerd Жыл бұрын
I meant more that it could cause an invalid weight. say for example one side has two curves while another side has 4 grass that are exactly the same. It should technically be 1 grass. If that makes sense.
@TJGameDev
@TJGameDev Жыл бұрын
Yes I see what you are saying, that’s a good point that I hadn’t considered, I might decide to change it thanks
@bigedwerd
@bigedwerd Жыл бұрын
As long as it works. It's still very impressive.
@fantasymagic2108
@fantasymagic2108 Жыл бұрын
the jeremy reference bro #MILKGANG🥛
@alexderus1179
@alexderus1179 Жыл бұрын
Jeremy must be biased to Dani
@TheGiakaama
@TheGiakaama 9 ай бұрын
Good theory, but how do you use the WFC scripts ?
@stepanshnder1850
@stepanshnder1850 11 ай бұрын
how change 3d model build on my 3d model?
@vast634
@vast634 10 ай бұрын
City Gen and visuals are looking good, gameplay and polish not so much in the demo. I think you should nail down the core game-mechanics first, and the obvious bugs (not getting constantly slammed by upgrades for example).
@BoredDeveloper
@BoredDeveloper Жыл бұрын
This is amazing! I wish it was possible to play it on the web instead of downloading, using webgl, I think unity and itch has that option. Never the less, it reminds me of diablo and I love it!
@F4kuBrO
@F4kuBrO Жыл бұрын
How can i learn basics code, im beginner and i dont know how can i learn codes :(
@TJGameDev
@TJGameDev Жыл бұрын
Just look at brakeys channel
@F4kuBrO
@F4kuBrO Жыл бұрын
@@TJGameDev thank you very much!!!!
@pierrotA
@pierrotA 8 ай бұрын
​@@F4kuBrOI'm late so you are maybe a pro now, but I want to give an advice that seem obvious but that is the key imo: pratice. It do not matter if it's small projects from scratch or something downloaded form internet, just try to mess with things. Codes are langages, and like any langages it's way easier to learn by praticing and experiencing that by learning everything in a book.
@BigElkWoodworking
@BigElkWoodworking Жыл бұрын
I’m having problem with my chapter stuck in tpose. Someone please help
@ioanaldea1509
@ioanaldea1509 Жыл бұрын
You mean character? If so I am really sorry I used unity too but I never managed to learn how to make a character walk with animations. Sorry I can't help you. I hope someone here can though. Edit: or try a tutorial mabye idk. Again sorry I can't help.
@Foyxx
@Foyxx Жыл бұрын
No way you got jeremy on steam support lmao
@iulia6707
@iulia6707 Ай бұрын
Hello, did you intentionally let the MapGeneration script empty in your github project?
@TJGameDev
@TJGameDev 4 күн бұрын
Nope must have been a bug
@77chickennug84
@77chickennug84 Жыл бұрын
No way Jeremy was steam support 💀💀💀💀
@qwertz3813
@qwertz3813 Жыл бұрын
3:52 XDDDDDD
@sghoshciv
@sghoshciv Жыл бұрын
Someone port this to vita!
@agoldendragon
@agoldendragon Жыл бұрын
Is there 20 Israeli shekels there? Cool
@erictripps125
@erictripps125 Жыл бұрын
You are really going to just gloss over the sandevistan ability you apparently gave your player controller...
@TJGameDev
@TJGameDev Жыл бұрын
Haha check the previous vid
@erictripps125
@erictripps125 Жыл бұрын
@@TJGameDev Saw it seconds after posting my comment!
@TheOpacue
@TheOpacue Жыл бұрын
Cooool! 😁 Hey man you're a little bit of a bluedrake hu? Rebell who makes cool shit for free 😇👌
@Avalonanon
@Avalonanon Жыл бұрын
I'll do a better logo for you and I also didn't go to art school, as an artist and a pipefitter I'm here to say you don't have to work at a restaurant as an artist ;) also you don't need art school :)
@Lost_Dawn
@Lost_Dawn Жыл бұрын
Why no one is making a procedural car generator infuriates me. Tracks are nothing if the cars and other vehicles are the same old real-world models
@jevilreformed
@jevilreformed Жыл бұрын
First
@SetZor666
@SetZor666 Жыл бұрын
Second
Задержи дыхание дольше всех!
00:42
Аришнев
Рет қаралды 3,7 МЛН
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 24 МЛН
Procedural Generation in Unity
10:22
TNTC
Рет қаралды 63 М.
Adding an AI Monster to my Horror Game - Devlog #2
7:43
LenexTL
Рет қаралды 14 М.
Why Godot made me RUN back to Unity
13:28
TJ
Рет қаралды 170 М.
My Wife and I Made an Indie Game and it Made Millions!
14:45
Eastshade Studios
Рет қаралды 1,2 МЛН
I made a procedurally generated city that can be fully explored
3:14
How I Made My Roguelike Game Replayable
7:28
TJ
Рет қаралды 13 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,5 МЛН
How to ACTUALLY get into Gamedev
14:01
DaFluffyPotato
Рет қаралды 708 М.
The Real Reason Robots Shouldn’t Look Like Humans
1:27:20
Veritasium
Рет қаралды 1 МЛН
Как удвоить напряжение? #электроника #умножитель
1:00
Hi Dev! – Электроника
Рет қаралды 1,1 МЛН
My iPhone 15 pro max 😱🫣😂
0:21
Nadir Show
Рет қаралды 1,2 МЛН
iPhone 16 с инновационным аккумулятором
0:45
ÉЖИ АКСЁНОВ
Рет қаралды 10 МЛН
iPhone 15 Pro в реальной жизни
24:07
HUDAKOV
Рет қаралды 479 М.