Gamedev Spreadsheets: Practical Example

Поделиться
HTML-код
  • Опубликовано: 29 янв 2025

Комментарии • 45

  • @anything_x
    @anything_x 2 года назад +6

    This is the most important video on yt related to the logic behind programming to avoid butcher code! I wish every butcher would see that. What u explain is the essence of everything in game dev! That said from an artist. Can't write a single line of code, but I understand the principles of structuring and logic behind finding the shortest way. With people like you I would achieve triple A stuff. A pro artist in indie game dev is nothing worth without a good programmer. Vice versa. Keep it up! You are a man of language, in many ways!

  • @Phroggster
    @Phroggster 2 года назад +1

    Model or data-driven design like this is so practical, and not just in the gamedev world.

  • @Cryptic808
    @Cryptic808 2 года назад +4

    I started using DataTables last year and my god it changes everything. Especially debugging. To make rows of data just for testing and to be able to immediately flip between rows to try different settings out is amazing.

    • @CraigPerko
      @CraigPerko  2 года назад

      It just makes developing so much easier and less spaghettish.

  • @shanebegovic8550
    @shanebegovic8550 2 года назад +1

    Yeah the way object oriented programming ties logic and data together really does many developer's heads in. It's like this massive brainworm you have to unlearn to be a productive developer. It was a massive mind blown moment for me when I first figured out you could separate functionality from your data structures and create really reusable code like that. Turns out you can also create really configurable designs and formulas and whatnot, which I wasn't aware of. Glad this kind of stuff is transferable.

  • @tprice112106
    @tprice112106 10 месяцев назад

    Thank you for this. Without knowing I needed to hear this I needed to hear this. Thank you

  • @mcgeufer
    @mcgeufer 2 года назад +2

    Yep, I admit, I got it wrong first. I was not aware that the term "spreadsheet" is used for anything outside excel or google sheets.
    I'm not a native English speaker, and love that excuse.

    • @CraigPerko
      @CraigPerko  2 года назад

      No need for an excuse, if you heard it wrong lots of other folks did too and I need to know about it.

  • @xBuzzlee
    @xBuzzlee Год назад +1

    I love this. You have an amazing way of explaining the ways of a game developer on a basic level, which is easy and fun to follow. I just stumbled upon your channel and I've learned a lot of "basic" things that I wish I knew earlier. I was wondering if you take suggestions for content. If so, I would love to see you talk about replication for multiplayer. Hoping you could give some practical examples and best practices. Keep up the good work :)

    • @CraigPerko
      @CraigPerko  Год назад

      I'm afraid I don't know much about multiplayer, it's not an interest of mine.

  • @seelengeier317
    @seelengeier317 2 года назад

    THIS IS AWESOME!
    Thanks a lot about the clarification. Your last video was already a good brain starter for the process but I misunderstood you there as well.
    Having this example and a clearer explanation on why and how is everything someone who starts could ask for.
    An example in multiple most used game engines would be the only thing I would add here (e.g. Unity, Godot, GameMaker...) but that is a lot to ask ^^.
    Thanks again and keep up these extremely helpful videos, they are the best source of gamedev mind food you can get here on YT :D

    • @CraigPerko
      @CraigPerko  2 года назад

      I would if I could, but I really don't feel comfortable enough in other game engines to talk about them.

  • @CCGS
    @CCGS 2 года назад

    Great video. Data tables are such a gamechanger ,I use them for defining my item lists and an array for my characters inventory. One warning though, I would recommend making sure your structure is fully defined before making a data table of it. Every time I've gone back to add something to the struct after making the data table, it throws a wicked amount of errors and I have to replace every array instance... that's my only issue with them, I wish they were just a bit more flexible in that regard. But really liked the video, nice job 😁👍

  • @kirashexenwerkstatt8289
    @kirashexenwerkstatt8289 6 месяцев назад

    Thank you for making that video! It helps me so much

  • @nfrancisj2122
    @nfrancisj2122 2 года назад +1

    the cool thing about the excel / unreal connection, is that the director/battle designer/clients can doodle all day long in a conference room about what character can have what stats, and if the stats are balanced...bla bla bla.. all in excel, and then the programmer just reimports ,and it's all set.

  • @sanfransiscon
    @sanfransiscon 2 года назад +2

    These videos have been awesome!
    This seems like a godsend for making any kind of bestiary or list of character jobs/classes.

    • @CraigPerko
      @CraigPerko  2 года назад

      That's the basic idea, yeah.

  • @DarioOrtisi
    @DarioOrtisi Год назад

    Hi beatiful explanation. I was wondering if there is a way to connect the variants choice and save in this spreadsheet. Thanks in advance.

    • @CraigPerko
      @CraigPerko  Год назад

      ... varian?
      There's almost always a way to connect things and save them, because the spreadsheet simply lists the asset name. But I don't know what a varian choice is, so I can't give specifics.

    • @DarioOrtisi
      @DarioOrtisi Год назад

      @@CraigPerko oh dude forget the t. I mean variant

    • @CraigPerko
      @CraigPerko  Год назад +1

      @@DarioOrtisi So that could mean two things, I think. The first is if you're setting up a list of variants for a particular thing. In that case, you could either use an array of classes (or names or whatever), or have a spreadsheet where one of the fields is "this is a variant of..." and link back to the parent. Both options work fine, depending on what you need.
      The other thing it could mean is variants that the player chooses during gameplay. You normally wouldn't try to save live changes to a data table. Instead, you would use a save game for that, which is also pretty trivial. Just two or three blueprint nodes. Create an array of "variants chosen" and save it to the save game.

    • @DarioOrtisi
      @DarioOrtisi Год назад

      @@CraigPerko great thank you very much. It so helpfull

  • @lorrmaster4778
    @lorrmaster4778 2 года назад +1

    That's a really nice feature. I was looking for a spreadsheet system like this in Unity for a turn-based project I'm working on. Closest I can find is maybe storing a bunch of prefabs / ScriptableObjects in a folder?

    • @CraigPerko
      @CraigPerko  2 года назад +2

      This is one of the reasons Unity is harder to use than people think.

    • @lorrmaster4778
      @lorrmaster4778 2 года назад

      @@CraigPerko One question I have is that if you're limited by what is essentially a flat series of data points, how do you deal with the differences between objects? Maybe I have a potion spreadsheet, but what about each type of potion? I can have a healing potion, a speed potion, and a potion that affects health, speed, and a third stat all at once. Maybe a potion needs a script attached to it. Are the effects in the sheet or just defined somewhere outside of it?

    • @CraigPerko
      @CraigPerko  2 года назад +2

      @@lorrmaster4778 So, there's a few ways to go about it. If you have very specific categories, you can simply use an enum and switch based on it. However, you can also point to code objects - for example, actor classes or components. So, for example, you can have a "spawn this actor" variable that points to a type of actor.
      The point is that the actor reference would only spawn in to do that one thing. The effect isn't "the potion". You don't have to spawn it in when, for example, you're buying potions or choosing what potions to drink. It might be a fairly generic actor that takes some arguments through an interface-defined function, or it might be a super specific one-off. Either way, it's its own little thing and not entangled with other systems.

    • @lorrmaster4778
      @lorrmaster4778 2 года назад

      @@CraigPerko Okay. I've been wondering about what kinds of data should be stored in spreadsheets. Can they represent changeable data in runtime, or only a very rigid set of data? So the PokeDex would contain data that doesn't change, but are runtime individual Pokémon with swappable attacks managed in a data sheet or by a component?

    • @CraigPerko
      @CraigPerko  2 года назад +2

      @@lorrmaster4778 Although I'm calling it a spreadsheet, that's just a turn of phrase to keep things grounded. We're talking about any flat data structure. Data tables are optimized for unchanging data used to help define the world, but an array would serve realtime needs, wherever you happen to stick it. The two are conceptually identical, it's just that data tables are built to be accessed in a specific way.

  • @RobLang
    @RobLang 2 года назад +2

    Data driven coding is one way to architect a system. Another way is Domain Driven Design. It's a different way of forming boundaries to minimise change.
    DDD takes the perspective that when you mutate an object you change something within a boundary.
    Spreadsheets are poor at representing hierarchical data. If your data is hierarchical, you will get complex really very fast.
    So I would say that use the right model for the game you're making. Sometimes that's a flat structure, sometimes it really isn't.

    • @CraigPerko
      @CraigPerko  2 года назад +1

      While I agree, my goal is to help newbies that just want to make something with complicated systems. In my opinion, other methods of minimizing spaghetti require a lot of insight into exactly how all these pieces work, and newbies would never know that.
      I'd rather they get a little annoyed by "stacking flat things" rather than having to try and imagine how things they've never tried to make before will change when they try to make them.

  • @MarlonBos
    @MarlonBos Год назад

    Love this

  • @LawlFrank
    @LawlFrank 2 года назад

    I'm not familair with data tables, but why not import the data through code (from xml or json or whatever else works for you)?
    For example, you can 1: read directly from your data file,
    or 2: store your data in a static, so you can more easily create objects with it later,
    or 3: you can read the data and create prototypes of objects and store those.
    I'm not familiar with Unreal either. I use Unity, but I mostly work with code, not in the editor. All this dragging arrows around and having to click and select things seems very annoying to me.
    Whenever something is repetitive and/or annoying it means you should probably find a way around it.
    As a programmer, you have all the power. Just code it the way you want it to work.

    • @CraigPerko
      @CraigPerko  2 года назад

      Go for it, man. Code your own engine, too, while you're at it. But 99.9% of people aren't programmers.

    • @LawlFrank
      @LawlFrank 2 года назад

      @@CraigPerko Hmm, yeah maybe I guess they aren't... You can learn it though, I also taught myself. There's plenty of material online.
      But yeah if you want to do it without coding, I guess the data tables make a lot of sense :)
      It never occurred to me you could make games without being able to code.

    • @CraigPerko
      @CraigPerko  2 года назад

      @@LawlFrank That's one of the reason I'm making these videos. A lot of folks come in to Unreal to try to make a game because they hear they can do it all in blueprint. And for small projects, that's absolutely true... but you might need some tips.

    • @LawlFrank
      @LawlFrank 2 года назад

      @@CraigPerko For me coding is also the most fun part of making games though :)
      I mainly watch your video's for your insights on game design.

  • @hkanything
    @hkanything 2 года назад

    Look like it is not far from having a simulated playtest as unittest to balance attribute by random sampling win probability. That's could break away from flat spreadsheet into simulation backed by the game physics. Now you would need an AI controlled pawn

  • @mrpinkdev
    @mrpinkdev 2 года назад

    Love how you called the video a work with spreadsheets and then literally started to code down classes lol

    • @CraigPerko
      @CraigPerko  2 года назад

      Nope, no classes. But, yes, a struct.

    • @mrpinkdev
      @mrpinkdev 2 года назад

      @@CraigPerko my bad