Тёмный

Unity Arrays? Don't Do this! 

Jason Storey
Подписаться 13 тыс.
Просмотров 32 тыс.
50% 1

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 163   
@InfallibleCode
@InfallibleCode 3 года назад
Great video, Jason! Love the content, love the memes, love that you're finally putting stuff out there. Can't wait to see the next one
@DarkAyumu
@DarkAyumu 2 года назад
Please make more videos, and the editor tutorial if you can that would be splendid. I want to know about Custom Editor and I'd love to hear it from you.
@shadowblaster124
@shadowblaster124 3 года назад
I find the editing and post-production far too distracting. I look to tutorials like this for information, not entertainment. I want to hear what you have to say, not pop culture references.
@page0809
@page0809 3 года назад
The next topic is "Custom Editor Scripts" then "Validations" or vice versa, oh yeah the data interruption was cool!
@tailwindmechanics7454
@tailwindmechanics7454 3 года назад
Good stuff! I like the editing, keeps it light and easier to digest. Yeah I'd be up for editor code. What I'd be most interested in is how you'd setup a codebase for production, something mid sized like an indie pc game. Specifically I want to understand how you use interfaces and why, and how to avoid things like zenject and singletons. Also curious about your take on UniRx and DOTS. Thanks for this man!
@thomasbrush
@thomasbrush 2 года назад
Why'd you stop creating videos. These are so good
@orwell235
@orwell235 2 года назад
Totally agree with Mr Thomas. It was very entertaining yet informative.
@divainsyoutube4254
@divainsyoutube4254 3 года назад
Thank you for another useful video! Love the editing!
@nickygdev
@nickygdev 3 года назад
He's killing it with the editing
@thedude110
@thedude110 3 года назад
Really glad to see you started your own channel, Jason! Loved your contributions to Jason Weimann's videos, always got interesting stuff to add to the conversations.
@GrimOfDonuts
@GrimOfDonuts 2 года назад
JSON serialization & scriptable objects are better alternatives depending on your needs
@grazeen
@grazeen 3 года назад
I would love to see more tutorials from you. About anything really... You seem very experienced with industry and know a lot about shortcuts/easier ways to do stuff.
@ostunij
@ostunij 3 года назад
“Hardly an inconvenience”. 😀
@AnnisVeryGoodGames
@AnnisVeryGoodGames 3 года назад
Neat, this is surely going to be useful at some point! Next level: How do I automate file population? ;) Btw, I notice your videos' audio is not quite synced up -- if you use Davinci Resolve, it can auto-sync your high res audio track based on the video's original audio track (I'm sure Premiere must have something similar).
@JasonStorey
@JasonStorey 3 года назад
Well I do personally have some apis I use that actually generate the prototype data, it can create fake users, ai user faces and random photos... maybe that could be another video when I have time :) As for the audio, that's strange. It seems in sync for me, and the audio is recording directly through the camera as a source, so that IS the original source track. Then again premiere was crashing for me this week so it could have gone a bit wrong, I'll keep an eye on it for the next one!
@AnnisVeryGoodGames
@AnnisVeryGoodGames 3 года назад
@@JasonStorey Sounds interesting! BTW, I like your topic choices so far, they're a bit more niche. Would be great to see more around advanced architecture topics as well. Re audio: That is strange! I asked my partner and he doesn't see it either but I swear the video is slightly delayed. I only even commented on it because I noticed it in multiple of your videos. But hey, if no one else sees it, no need to fix anything, I'll survive. :)
@BigRookDigital
@BigRookDigital 3 года назад
This 1.0x Jason is an Impostor. Put on 1.5x for Authentic Jason. Great job on the editing.
@AllanSavolainen
@AllanSavolainen 2 года назад
I would use JSON files instead of plain text, tad safer and also portable to other systems.
@antijulius
@antijulius 2 года назад
Editor Extension stuff. Would love deep hard details on that.
@4rcant
@4rcant Год назад
i thought Jason Storey was a plugin for json storage
@WorldOfZeroDevelopment
@WorldOfZeroDevelopment 3 года назад
I really like this approach of making data easier to access. You can even put these files behind a web server and dynamically update them without having to have the players download a new game client. Changing that damage stat on a sword no longer requires validating an entire new release! One suggestion: Unity includes the Newtonsoft JSON library already for you which can handle serializing and deserializing complex types for you. Instead of splitting text files manually which can break when you add another field, using some structured data like JSON, XML or YAML can make this more robust and less likely to trigger weird and confusing warnings when a data file is incorrectly changed or your type gets updated. I believe that code to do this will be shorter than the manual parsing version as well! For example: var lines = JsonConvert.DeserializeObject(_file.text); Should be all you need when converting your Items data 😀
@JasonStorey
@JasonStorey 3 года назад
I completely agree! In fact I use Newtonsoft JSON for most of my projects, but in unitys documentation they do actively caution you against relying on the version they include as they only promise it is there for editor tooling and not always guaranteed, also while I would use json/bson for data myself as I am comfortable editing it, when it comes to giving something to non-tech people, asking them to just type some words in a file with commas between them is easier to explain and reason about, so for user facing stuff I often use plaintext/flat files. (though secretly I will often parse what they give me, model it as a json DTO and use that myself. )
@behnamrasooli8801
@behnamrasooli8801 3 года назад
wow! such an improvement in your presentation in just 3 videos. This shows you're really good at this buddy. Thank you a lot :)
@athenasowl1857
@athenasowl1857 3 года назад
The editing on this video is great! xD
@georgekourris798
@georgekourris798 3 года назад
Very good explanation of why arrays aren' t the best approach when comes to data editing and reading. Also thank you for teaching a new for me at least class the textasset, but I tried using also something new that I saw the required attribute and the visual studio compiler wasn' t recognizing it, it was only displaying me the requirecomponent attribute. Does anyone know why I couldn' t access it ?
@robosergTV
@robosergTV 3 года назад
Ok the video editing is awesome
@supertenchoo4271
@supertenchoo4271 3 года назад
Great video Jason
@XZYSquare
@XZYSquare 2 года назад
using notepad to set values in an array that is a good way and gives instant feedback, clearly helps me very quickly make changes to the data in my script I mean unity shouldn't have given the option to inspect these have you not seen scriptable objects?! I mean like, they do exactly what you're doing but gives more freedom lol
@rickloyd8208
@rickloyd8208 5 месяцев назад
Man, why did you stopped your awesome videos... I was ware of txt files but I never thought to use them in the way to fill content of the objects!!! Thank you so much and thumb up!
@DaniArkadia
@DaniArkadia 3 года назад
That Barely an inconvenience got me xD
@evanlane1690
@evanlane1690 3 года назад
Aaaahhh!!!! You started a channel! FUCKING YESSSSSSSS!!!
@theearthburner6159
@theearthburner6159 3 года назад
Very epic
@NewbNinjas
@NewbNinjas Год назад
+ Would love to see the advanced editor stuff, especially the weapons example, perhaps using JSON + validation? Great work JS, thanks again!
@wendten2
@wendten2 3 года назад
Using a comma is not a good idea, as more or less everyone but the english speaking world and former commonwealth uses commas as a decimal point. Now if someone wants to write a float value in their native way or using non english text-software, Unity will treat that float as two ints. The better way is to use a semi-colon (;)
@JasonStorey
@JasonStorey 3 года назад
So technically I agree, though in fact I would use a | instead of a ; The truth is though, if you are delimiting values for data transfer it is usually serialization as a goal to a) compress it for efficiency b) transfer it between systems in an easy format, c) make it human editable. Unless I was being precious with performance in a real enterprise scenario I wouldn't use flat files at all, I would use a structured data format like bson, json or at a push yaml. But the point of this exercise is to take a relatively straightforward set of values as a client request and populate an array. the format doesnt matter as much as the client intent. you can easily "make your own format" as long as you agree with the client about how they get the ideas out of their head. In this case for simply outlining a few item properties this is not long term persistence, it is automating data entry. If this was a bigger problem likely to change regularly I would as far as to build an external GUI application in WPF, MEAN stack or Electron to allow a client to generate these files from a wizard form.
@wendten2
@wendten2 3 года назад
@@JasonStorey I know its a toy example, I just myself had to learn this the hard way. I have to admit that i'm old school, as I'm using excel as a wizard. When converting a sheet to a CSV file, it behaves weirdly to commas. Another issue is that I switch between dots and commas all the time depending on the software, so I might accidentally write a comma instead of a dot. I would rather have a parsing error than a split number that might go under the radar for a long time
@themannyzaur
@themannyzaur 2 года назад
Okay it's safe to say that it's impossible to say "super easy" without adding "barely an inconvenience" to it
@gonzaloescamilla8488
@gonzaloescamilla8488 3 года назад
God, your content is so damn good. keep up the hard work dude!
@HoloTheDrunk
@HoloTheDrunk 2 года назад
Uh... Exactly how low is the average Unity user's programming level..? The fact that "Load text from files" is being hailed as a life-saver in the comments is kind of worrying. Nice video though, the editing is clean and the information is presented clearly. Only thing I could see being improved fairly easily at the moment is the presentation of code: instead of showing a sped-up video of you writing out the code, showing code snippets and shortly explaining them à la Sebastian Lague would probably make for a more dynamic result.
@JoelRehra
@JoelRehra 3 года назад
Hey, Iove the streams you do with Infallible Code, and I am hyped for what you can come up here. But please keep the videos as clean as you keep your code clean... Are those special effects really adding to the underlying message of the video? One or Two might spice it up, but in this video it has been too much ;)
@MaximumSpice
@MaximumSpice 2 года назад
This is amazing. The hard thing about this is as a person who learnt unity and C# on my own, how would I even know these functions and options exist until I come across this. Amazing work tho!
@SparkeyAvalon
@SparkeyAvalon 2 года назад
So what's the difference between this and using scriptable objects for data loading? I used scriptable objects in order to import level data. But I didn't really understand them that well. I just know that I read the data and create objects out of that data. Then I create assets from those objects. But why is the ScriptableObject class in there? What does it do?
@nocturne6320
@nocturne6320 2 года назад
A lot easier and more robust approach would be to use JsonUtility to serialize/deserialize the objects within textfiles
@antonionii
@antonionii 2 года назад
I was trying to recreate the items script file you made but the video cuts off and I'm sort of lost... Where do you call the ConvertToItem method?
@happytofu5
@happytofu5 3 месяца назад
I've never seen a tutorial video edited this entertaining xD
@vanderson.f.milagre
@vanderson.f.milagre 2 года назад
Nice video. I'd like to see you explain how to work with Editor scripts in Unity since I don't really have much of an idea of how to start.
@018FLP
@018FLP 2 года назад
Hmmm, i really love a well edited tutorial video, and you surely scratch that itch, insta subd * cheff's kiss *
@uchihai_a_h4871
@uchihai_a_h4871 2 года назад
Dude isnon steroids...... I am in terms of unity knowledge 😅
@naxxtor
@naxxtor 2 года назад
Late to the party but thanks for the useful video! Any thoughts on loading larger quantities of data (e.g. big datasets generated by another process outside of unity ?)
@nickygdev
@nickygdev 3 года назад
I'm reading Game Programing Gems and on the first chapter they talk about how you should use text files to not scare away designers. Great to see it implemented in Unity
@MohammadFaizanKhanJ
@MohammadFaizanKhanJ 3 года назад
How should we apply our custom components or script automatically? I mean we drag the fbx in the hirarachy again and again and each time we have to add those compoennts. Is there any good approach video ?
@_ironrose
@_ironrose Год назад
The bad thing is, unity loads that text asset into the memory for full apps lifetime even though nothing accesses it. Maybe deleting that textasset reference after the array creation might work better
@issimc158
@issimc158 3 года назад
your videos are awesome. you're awesome. look forward to each and every new vid that you got cooking up.
@kay-dp8qw
@kay-dp8qw Год назад
Very helpful, thank you so much for your videos :)
@thepanable5004
@thepanable5004 2 года назад
that star trek reference was gold! I didn't know you watch star trek
3 года назад
Don't you need to mark the game object as dirty in order to tell the editor it should save the change..?
@ryanlaseter7626
@ryanlaseter7626 2 года назад
I like these kinds of videos. It's easy to initially do the array by hand in Unity but you're right, it requires opening Unity, it's not portable, etc. It's nice when someone says 'there is just a different/better way that is easier long-term and way less overhead' appreciate the video.
@gamepass505
@gamepass505 3 года назад
cool video edit, cool video, cool info, and a cool handsome guy
@asembahra6187
@asembahra6187 3 года назад
very nice video as always . best of luck doing more .
@pliniomourao
@pliniomourao 2 года назад
Yes, please address the Editor code. That's something i'd love to see and adventure into it.
@Myzreal92
@Myzreal92 2 года назад
Why reinvent the wheel and not use a CSV or JSON parser?
@qzswarzeeshan5308
@qzswarzeeshan5308 3 года назад
Do The course on Custom Editor Scripting.
@WhiteNorthStar1
@WhiteNorthStar1 Год назад
Excellent, maybe mention JSON?
@abdullah4653
@abdullah4653 7 месяцев назад
we could use json format instead of text file.
@revraitah
@revraitah 2 года назад
Really cool, never thought about this before!
@sebastianbryant4216
@sebastianbryant4216 2 года назад
I'm only 30 seconds in and I can tell you I already like the memes. 👍
@madscientist338
@madscientist338 3 года назад
You're awesome, thanks for the video!
@ZettaiKennedy
@ZettaiKennedy 3 года назад
I like the editing. Reminds me a bit of that silly style of Clean Code videos :D
@willcallcool
@willcallcool 3 года назад
Great video Jason keep them coming.
@kristoferknutsen5334
@kristoferknutsen5334 3 года назад
Editor extension stuff in more detail comment :D
@okee
@okee 2 года назад
My man used 100% of his editing skills
@KimetMX
@KimetMX 3 года назад
Love the new editing =) Thanks for your time =)
@danielvrsek8370
@danielvrsek8370 2 года назад
Nice try with editing, but your audio is little bit out of sync
@philip487
@philip487 3 года назад
Kudos for the extra effort on editing. Good way to stand out. gg
@happyfarang
@happyfarang 3 года назад
you know we want it! Give us give us give us! heheh
@RichardTongeman
@RichardTongeman 2 года назад
Ahhh I've always wanted to know how to do this!
@alextreme98
@alextreme98 2 года назад
Such a good example, thanks a lot :D
@goehlergamedev
@goehlergamedev 2 года назад
Lol. Loved that Ryan George reference :P
@Andreasohlin
@Andreasohlin 3 года назад
I can see you doing the "hello there" in every intro.
@towercrowgames5115
@towercrowgames5115 3 года назад
Would love a vid on validation in this context.
@Iridium.
@Iridium. Год назад
Would ve loved to see him make more videos..
@takashy87
@takashy87 3 года назад
you started making videos :D
@CCV334
@CCV334 2 года назад
Editor extensions video please 🙏
@bluzenkk
@bluzenkk 2 года назад
this is super useful. Thanks!!!!
@mailmaxxxx
@mailmaxxxx 2 года назад
Not JSON, Jason?
@snek5385
@snek5385 Год назад
More custom editor stuff pleeeeez!
@IndieDX
@IndieDX 2 года назад
Genius! Thanks for sharing!
@zstrizzel
@zstrizzel 10 месяцев назад
elephant in the room: d a t a b a s e s
@Wobling
@Wobling 3 года назад
What font do you use in Rider Jason?
@TheMainStark
@TheMainStark 3 года назад
The jokes landed, great edits!
@MTweedC4
@MTweedC4 Год назад
Your editing is top-notch!
@InexperiencedDeveloper
@InexperiencedDeveloper 3 года назад
Love the unique experience you bring to the game dev community!
@KonaiNobi
@KonaiNobi 3 года назад
Editor extensions -- yes! :D
@NickPavlov00
@NickPavlov00 2 года назад
Why not do this with some Json files?
@Malicos
@Malicos 3 года назад
Insta-hooked on this channel!
@Amheklerior
@Amheklerior 3 года назад
That’s a great one Jason ;) thanks
@CreeperSlayer365
@CreeperSlayer365 2 года назад
These are some top tier game dev vids
@mademade5939
@mademade5939 3 года назад
Yes, editor extension stuff
@Elenthiriel
@Elenthiriel 3 года назад
Man, i love your tips
@alexxxchange
@alexxxchange Год назад
thank you for this!
@Rafaelcraftero
@Rafaelcraftero 3 года назад
high skilled editor
@kerbalette156
@kerbalette156 3 года назад
Awesome stuff thx
@kehmesis
@kehmesis 3 года назад
Yes please. moar!
@ThoughtsOrange
@ThoughtsOrange 2 года назад
He looks so tired
@shirosurfer8864
@shirosurfer8864 2 года назад
Ooh very nice
@treppas
@treppas 2 года назад
🤯 thank you!
@pixeldevlog
@pixeldevlog 3 года назад
Great video !
Далее
Software Architecture in Unity
7:13
Просмотров 118 тыс.
A BETTER way to setup new unity projects!
15:44
Просмотров 56 тыс.
Почему?
00:22
Просмотров 238 тыс.
The Worst Typo I Ever Made
11:25
Просмотров 6 млн
How to find any resource you are looking for!
12:39
Просмотров 20 тыс.
Why is unity so slow!
5:53
Просмотров 70 тыс.
Watch This Before Working on a Big Game in Unity
18:44
Просмотров 297 тыс.
The Power of Scriptable Objects as Middle-Men
17:41
Просмотров 126 тыс.
Premature Optimization
12:39
Просмотров 811 тыс.