How to make a LEVEL EDITOR in Unity

How to make a LEVEL EDITOR in Unity

Brackeys

7 лет назад

276,969 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Requiem_For_A_Dream
Requiem_For_A_Dream - 04.06.2023 18:03

Thx a lot.

Ответить
Hache_raw
Hache_raw - 29.05.2023 01:03

Thank you!!

Ответить
august0490
august0490 - 28.04.2023 00:07

Great idea! Could you make a tutorial to apply this idea for 2D isometric games? thanks

Ответить
Mr Potato
Mr Potato - 08.03.2023 09:53

YOOOO I was making a low poly map maker in 3d with editor scripting (I wanna sell it as an asset) AND MY IDEA IS MOSTLY LIKE THIS!!!! Life saver!
One thing that is different, mine wont need an external app

Ответить
Jasmine Marie
Jasmine Marie - 24.02.2023 08:07

Great tutorial even now. I have now used this to make the same for RuleTiles and it feels like magic with rule tiles.

Ответить
NovaNecrotic
NovaNecrotic - 04.01.2023 17:09

laughs in tile palettes

Ответить
Like, Zoinks!
Like, Zoinks! - 20.12.2022 11:40

Does anyone know how this could be done with tilemaps? I'm making a top down dungeon crawler style game and it would be so useful to rapidly generate new levels. I could totally do tilemaps manually but I think the method in this video would work better if it could be applied.

Edit: Kalavian GD posted the answer in the replies, huge thank you to them

Ответить
The Lazy Indian Techie
The Lazy Indian Techie - 02.09.2022 15:15

Wow!

Ответить
Robble
Robble - 07.08.2022 11:48

noice xd

Ответить
Matthew Weitzner
Matthew Weitzner - 04.08.2022 01:12

This is the best unity channel

Ответить
DARK AMBIGUOUS
DARK AMBIGUOUS - 28.07.2022 08:59

I made a level editor for my really cool 3D labyrinth game that I’m making for phones, I’m almost done with it and the cool part is I made it and my entire game with using only Visual Scripting

Ответить
Dmitry Chernokozov
Dmitry Chernokozov - 03.02.2022 12:48

Download the Scripts link doesnt work, please update

Ответить
VLTNO
VLTNO - 23.01.2022 21:50

Does this work with tilemaps?

Ответить
The Roaming Kilt
The Roaming Kilt - 19.10.2021 14:59

This idea could also be a way to store save data.

Ответить
게잼
게잼 - 18.10.2021 15:10

thx brackey

Ответить
Reno Facundo
Reno Facundo - 02.09.2021 08:32

For Unity, is this still relevant in 2021? I mean, built-in the tile map tool allows you to draw the map in real time...

Ответить
AleGM
AleGM - 08.06.2021 23:46

Brackeys Channel in Spanish?

Ответить
Azvern Dias
Azvern Dias - 08.06.2021 16:57

How would I use a tilemap, with this?

Ответить
Koussay Hajlaoui
Koussay Hajlaoui - 29.05.2021 22:26

ColorToPrefab why it doesn't work

Ответить
magnusm4
magnusm4 - 03.05.2021 19:06

I would love to later develop a simple but fun system of using colors for map generation.
One top down color for mountains and if possible, setting a certain spectrum of a RGB as a certain type of ground/object like a bridge or ground and anything in between could be either height or kind. Then use a shader code like your tutorial to fill it in.
Then for fun a secondary all around color that sets the depth to create mountains and cliffs in the background, then simply fill in the blanks from the top down perspective. And then finally from the player's level to the background's area.
Will most likely have to make it a grid system to enable and disable areas so the size doesn't cause performance issues or crashes the whole thing.

Ответить
Caroline Eulália
Caroline Eulália - 03.04.2021 12:52

I really love it

Ответить
AZTEC MAN
AZTEC MAN - 19.03.2021 03:16

For anyone who may be struggling with colors exactly matching:
just treat each color as a Vector4 and make sure the distance is less than some small amount

//if colors are almost the same, treat the colors as equal
if (Vector4.Distance(mapping.color, pixelColor) < .01f){

}

Ответить
buddyroach
buddyroach - 06.03.2021 11:32

then you can make a quick app in c# to paint and edit/manage a folder full of levels and point it at the folder unity is using so you can update it right from the app. limit it to a color pallete of only the colors you used for the level as well as the dimensions. would be sick.

Ответить
SBB Gameplays
SBB Gameplays - 21.02.2021 16:33

My character freezes when he passes over the junction between one box and Another, what happend?

Ответить
Zachery Majernik
Zachery Majernik - 29.12.2020 21:16

I did this, but since the player is a prefab and is created at the start I cannot get the camera to follow the player.

Ответить
Zachery Majernik
Zachery Majernik - 29.12.2020 00:25

What is the pixxel size for the boxes? because mine are 128x128, but when the level loads in they are too big and they overlap.

Ответить
Brendan Mullins
Brendan Mullins - 26.12.2020 15:37

In case anyone else is trying to do this for a 3d game, you still have to set the Texture Type to "Sprite (2D and UI)" or the values will be weird when parsing the image

Ответить
taiwo oluyole
taiwo oluyole - 22.12.2020 05:31

Is the flexible with 3D, because to be honest . . . I actually have no idea how to use 2D.

Ответить
Mehmet Rıdvan Yıldırım
Mehmet Rıdvan Yıldırım - 11.12.2020 14:02

Can I use this method for a 3d top-down game such as Archero?

Ответить
ShortyDP16
ShortyDP16 - 08.12.2020 00:12

Tip: This is more useful than just placing objects. I use a certain color square to tell my player character which gun the level will use. If the level contains a white square, the player plays that level with a machine gun. If there is no white square it defaults to the shotgun.

Ответить
BitPham
BitPham - 06.12.2020 11:09

Wow! This is actually really helpfull! Im glad that you exist, but im sad that you left

Ответить
Felippe Alexandher
Felippe Alexandher - 28.10.2020 03:48

What about a boss control script?

Ответить
Raiq Aariz
Raiq Aariz - 24.10.2020 02:42

...





WAHHHHHHHH BRACKEYS IF U HAVE CHILDREN PLEASE LET ONE OF THEM TAKE OVER UR CHANNEL.

Ответить
boring.
boring. - 16.09.2020 00:05

It's transparent, not transparrent.

Ответить
lib
lib - 06.09.2020 15:33

Oops!

We can't seem to find the page you're looking for.
Are you sure it exists? Try your luck on the old forum!
Doesn't exist there either? Give some angry looks at one of the forums staff members!
Image of the numbers 404

Ответить
donutbedum
donutbedum - 05.09.2020 22:57

Brackeys, you have the biggest gamedev brain I've ever seen

Ответить
trytoguess
trytoguess - 02.09.2020 17:35

I am not sure about how Texture class is implemented in Unity but I guess it is an array of height * width elements with the first dimension identifying vertical axis (y) and the second dimension identifying horizontal axis (x). In this case, it is way more convenient to loop over pixels along y and then along x (in the video it is vice-versa). Although this won't help a lot (maybe at all) with small images but it will definitely help with bigger images (depends on your system). This happens because every time you access memory, the nearest data is copied to your CPU cache. If your image is big enough in width, looping along y axis and then x axis means that everytime you copy a lot of data to your CPU cache and not use, instead you go load data from your RAM. On the other hand, if you loop along y axis and then x axis, everytime you get a value for a pixel, the closest points (the ones that you will access next) are copied to your CPU cache which is much faster than RAM.
I hope I achieved in explaining the basic idea. For more information you can read about it on internet, the name of the thing is spatial locality.

Ответить
Julius Nickel
Julius Nickel - 02.09.2020 13:08

May i suggest to rename this video into
"How to make a LEVEL GENERATOR in Unity" ?
Because I expected, that we will create an editor script to build the levels inside of unity, not in photoshop :)

But anyway, thank you very much for this video an all the others, which helped me a lot to learn game developement!

Ответить
Karioton Studios
Karioton Studios - 01.09.2020 17:28

You explain so clearly, you inspired me to become a game developer

Ответить
buhuhuh
buhuhuh - 30.08.2020 02:59

Would you use the same method for an isometric or hexagonal tilemap?

Ответить
NS777
NS777 - 27.08.2020 02:44

Useful!

Ответить
IGB
IGB - 24.08.2020 06:25

3D level editor?

Ответить
Ivan Medina
Ivan Medina - 23.08.2020 19:59

how do you think this would work to create a road map for a city? how would it behave with diagonal roads :O

Ответить
Setseretze
Setseretze - 14.08.2020 10:50

the first problem.. how are u gonna put ur lv while its exported

Ответить
marakatat
marakatat - 14.08.2020 10:10

How I can make this script for 3d?

Ответить
Matter Reslux
Matter Reslux - 13.08.2020 02:54

Do you think this would be a good pairing with the tile map tutorial you did later? I could imagine expanding the colors used to match with all your tiles and then using this method to make much larger maps much faster.

Ответить
Eric Sinkovits
Eric Sinkovits - 28.07.2020 21:28

I had issues with [if (colorMapping.color.Equals(pixelColor)){}] not working when I had other colors besides pure black. I switch to use [ if (ColorUtility.ToHtmlStringRGB(colorMapping.color) == ColorUtility.ToHtmlStringRGB(pixelColor)){}] and is working much better for me.

Ответить
Person the human
Person the human - 17.07.2020 19:45

i've tried something like this before only my player would literally just jump around on the pixels

Ответить
Seb
Seb - 06.07.2020 20:13

Unity Documentation? More like Brackeys

Ответить