I made a new file format

  Рет қаралды 132,976

TEMPER

TEMPER

Жыл бұрын

Here I talk about the challenges of saving and loading game state along with what I did to solve it.
Join on Discord: / discord
You can play the game here: store.steampowered.com/app/21...
File format code!: github.com/temper-studios/gra...
Follow me on twitter: / temper42604230

Пікірлер: 470
@lunkums
@lunkums Жыл бұрын
"You often only think about this late into development" not unless you've been through this problem before!
@ZgavY
@ZgavY Жыл бұрын
Nope. I'm making my first game ever (it's been months since I started it), and I thought of it since the beginning. Luckily, since I'm writing it in python, this is much much easier for me. But performance is... I mean it runs at about 160 FPS but I'm quite limited to what I can do
@JetJockey87
@JetJockey87 Жыл бұрын
@@ZgavY ahahahaha Oh man that was a good one
@TuxraGamer
@TuxraGamer Жыл бұрын
@@JetJockey87 imagine seriously writing something on Python
@JustS_js
@JustS_js Жыл бұрын
@@TuxraGamer imagine being toxic towards beginners in programming community
@nixellion
@nixellion Жыл бұрын
@@TuxraGamer Imagine that the platform you're writing this comment on is extensively using Python. It may not be the best option for game development, or more specifically for games that require performance, but it is one of the most popular languages that is extensively used in professional work in different fields.
@XceptionalBro
@XceptionalBro Жыл бұрын
Title: I made a new file format Thumbnail: AMOGUS
@zwatotem
@zwatotem Жыл бұрын
I was like 40% likely to click based on the title, but the thumbnail tipped the decision over.
@v0id_d3m0n
@v0id_d3m0n Жыл бұрын
Didnt even realise lmao
@nixellion
@nixellion Жыл бұрын
Filename: savegame.sus
@ChrisD23
@ChrisD23 Жыл бұрын
I thought the file format would have something to do with amogus lol
@LoLingVo
@LoLingVo Жыл бұрын
.sus file format
@therealpeter2267
@therealpeter2267 Жыл бұрын
"Json's crap" - *invents json with a different syntax*
@temper8281
@temper8281 Жыл бұрын
It's way better than json. It's much simpler and much easier to parse.
@dealloc
@dealloc Жыл бұрын
@@temper8281 well the tradeoffs you have is that every change to the format requires you to maintain and update the parser. JSON already has a spec and there are a plethora of fast implementations already. On top of that, you can pass the JSON into virtually anything that accepts it, to either visualize, transform or search it (i.e. with jq). JSON shouldn't be used for everything, of course, just saying that the format you came up with is simple on the surface, but not in practicality. If your goal was flexibility, even if temporary, then JSON would've been your best bet. But I admire you for just building your own thing. That's the best way to learn :)
@temper8281
@temper8281 Жыл бұрын
@@dealloc Why would changing the format require me to change the parser? The parser does not change when the arrangement of the file changes. If you mean that the format changes when...the format changes. Well yeah. But that will happen anyway regardless of the format.
@dealloc
@dealloc Жыл бұрын
@@temper8281 Format as in adding, removing or altering syntax, types, specification etc. Except for formats like JSON which have been standardized. Unless your format also needs to do marshalling, which doesn't sound like a use-case you have atm.
@temper8281
@temper8281 Жыл бұрын
@@dealloc Well the format for the file is locked in. The only code I write is to take data structures and load and save them into the file. You'd have to do that for JSON aswell, unless you have some kind of language reflection that can do all of that for you. Something like that is a non-trivial cost
@shadamethyst1258
@shadamethyst1258 Жыл бұрын
About rewriting the parser on every format change: this is where metaprogramming can come into play. I'm incredibly grateful for libraries like serde in rust that abstract away the need to do this by hand, and you're using C++ so doing that there shouldn't be too hard either
@rogo7330
@rogo7330 Жыл бұрын
Text parsing is easy, especially if you doing your own format and it is simple to parse. I think it's better to write something by your own, and if it's hard to you -- change how you are doing it. I wanted to say this because "grateful libraries" are often to general for your task and you don't control their code, thus you can't tweak it and you are stuck with API that those libraries providing (which is often some state-machine crap that often goes as far as reading files by itself, almost like you don't know how to do it). On the other hand, if library provides functions that can parse array of data (not "file" on your disk) and somehow saving context to another block of memory to be called again when you're need it -- that's great.
@luukvanoijen7082
@luukvanoijen7082 Жыл бұрын
@@rogo7330 if you are saying this about serde, you clearly havent used it nor understand how it does what it does
@rogo7330
@rogo7330 Жыл бұрын
@@luukvanoijen7082 yep, didn't used it. Also im not using Rust for anything. Im more like C + shell squad. But if serde works for you - great. It's only tool at the end
@luukvanoijen7082
@luukvanoijen7082 Жыл бұрын
@@rogo7330 fair enough and agreed
@jearlblah5169
@jearlblah5169 Жыл бұрын
Serde is flippin awesome. Being able to do #[derrive(Serilization, Deserilization)] is so easy
@dakrazyk_
@dakrazyk_ Жыл бұрын
Never trust someone who uses a light theme code editor.
@temper8281
@temper8281 Жыл бұрын
You shouldn't trust me.
@conabe
@conabe Жыл бұрын
I don’t know how to change VS to dark mode, my eyes 😢
@MaxCE
@MaxCE Ай бұрын
three lines of tabs too
@Derpalerpa
@Derpalerpa Ай бұрын
Nah, me and my homies use whatever 🗿
@stefanoctaviansterea1266
@stefanoctaviansterea1266 Ай бұрын
and has a #define for main() as MAIN
@btarg1
@btarg1 Жыл бұрын
A full game like Gmod's LIDAR mode is something that I have wanted to see for a while, keep up the good work
@MrMacio484
@MrMacio484 Жыл бұрын
Gmod's LIDAR mode is based off a game called "Scanner Sombre", so you might want to check that out too.
@kwoshent0
@kwoshent0 Жыл бұрын
bruh. Scanner Sombre is a full game, and it came before Gmod's LIDAR mode
@aidentheonion2
@aidentheonion2 Жыл бұрын
there is a game that inspired LIDAR called Scanner Sombre
@NaviYT
@NaviYT Жыл бұрын
I was considering making one but I figured either someone was already heavy into developing a game with this mechanic or Gmod community would hate it.
@MetroTO.
@MetroTO. Жыл бұрын
Isn't that the scan game in roblox?
@Templarfreak
@Templarfreak Жыл бұрын
"always keep your data as simple as you possibly can" cannot understate this, with doing anything programming-related, not even considering saving and loading for a game, this is an extremely important idea
@temper8281
@temper8281 Жыл бұрын
Definitely true!
@tam_69420
@tam_69420 Ай бұрын
ive once heard that bugs ussually arise because they were "smarter" than you at the time of writing them, and the more complicated and the "smarter" you try to code, the smarter these bugs become and the harder they are to debug, keeping eveything simple and dumb yet effective enough to do the job is your best bet with preventing bugs.
@Templarfreak
@Templarfreak Ай бұрын
@@tam_69420 this is pretty true from my own experience. it also really helps to code things in 2 very key ways: 1. break things up into as small bit-sized modules as possible where you can easily test each one when you are done writing said modules and so bugs are occurring in decoupled places that dont require you to detangle or disseminate a lot of code at once to narrow your search down. 2. templating, inheritance, and/or composition when used carefully and considerately will help expose bugs more easily and make them easier to test because the deeper into the code a bug is the more places it will be visible and the more ways you can test it.
@Moonlytee
@Moonlytee Жыл бұрын
1:35 AMONGUS But in all seriousness, this is was very informative and I'm thankful I stumbled upon this video!
@minineji7050
@minineji7050 Жыл бұрын
Sus
@zebbaukhagen9738
@zebbaukhagen9738 Жыл бұрын
Some very interesting ambient noise behind you! I thought maybe there would be a psychological horror twist somewhere, but instead I just learned something. It kept me engaged.
@thecwd8919
@thecwd8919 Ай бұрын
Huh, a bird chirping. I really need to get to bed earlier.
@skejeton
@skejeton Жыл бұрын
so true about thinking late. a similar thing is when you gotta implement an undo system which needs you to change all the mutations into commands x3
@sr_meia_noite
@sr_meia_noite Жыл бұрын
I thought "Well, he's going to create a parser for his structs to know how to read/write in binary format, making it efficient in size, reading and writting" *Proceeds to save information as raw text*
@temper8281
@temper8281 Жыл бұрын
I'll end up doing both when it ships. If it is worth it.
@valueconomy
@valueconomy Жыл бұрын
Cool idea. I think you could have achieved this with a mixture of binary JSON and distributing those graph files, but great job. I normally am not a fan of when people try and invent new formats, but I understand the value in readability. I just think eventually you realize you can use an existing solution and eliminating you needing to maintain some bespoke format spec, parser, etc. Keep it up.
@LOC-Ness
@LOC-Ness Жыл бұрын
Uhum, but JSON is crap!
@valueconomy
@valueconomy Жыл бұрын
​@@LOC-Ness In a world of infinite potential and endless possibilities you could be right. "JSON is crap!" does not mean anything, so I cannot agree. Do you have a specific reason or experience you can point to? That would be meaningful.
@temper8281
@temper8281 Жыл бұрын
@@valueconomy JSON is crap though
@sa1t938
@sa1t938 Жыл бұрын
@@temper8281 depends on what you are using it for. There's a reason its extremely popular
@valueconomy
@valueconomy Жыл бұрын
@@temper8281 Thanks
@dankmemequeen9581
@dankmemequeen9581 Жыл бұрын
I like the style. The dots make it look satisfying.
@skejeton
@skejeton Жыл бұрын
this is really cool looking! will you draw the particles that are occluded or drawing particles through walls is intended?
@temper8281
@temper8281 Жыл бұрын
Good question. At the moment they aren't occluded which is what LIDAR would look like if you did it in real life. But not sure it looks good or not in the game
@camilleon352
@camilleon352 Жыл бұрын
i loved the combination of eerie sound effects and just so many blinding transitions (i am watching from a dark room)
@temper8281
@temper8281 Жыл бұрын
It sounds like you hate it! 😁
@IzzyMann
@IzzyMann Жыл бұрын
19 seconds in i said to myself " this is interesting!" and you now have a new sub! :) keep it up bro!
@temper8281
@temper8281 Жыл бұрын
Thanks!
@w花b
@w花b Жыл бұрын
I was thinking the same and even understood everything until he started deviating from C to C++ stuff.
@_GhostMiner
@_GhostMiner Жыл бұрын
Him: creates a new file format. Me: creates a folder with hundreds of json files to save properties of each level object. We are not the same.
@temper8281
@temper8281 Жыл бұрын
If it works, it works! Don't let anyone tell you different.
@hw2007
@hw2007 Жыл бұрын
I did too! I renamed my .txt file to a .hw2007 file!
@ares106
@ares106 Жыл бұрын
I wouldn’t underestimate content and level design. I feel like that’s where a lot of indies fall short. They have a cool and interesting core gameplay loop but it’s hard for one or a few developers to scale it up into a full game experience by creating enough compelling content.
@Adam-pk7go
@Adam-pk7go Жыл бұрын
This is sort of what I’ve seen too. Lot’s of people have great concepts for games, and they just start making stuff, not really planning much in the way of minute to minute gameplay, then once they get there, they just throw some basic mechanics/systems they’ve seen in other games in and it feels stale or lacks cohesion. Not to say that it’s bad to reuse mechanics though. So many games feel like they had a great idea, just fell flat in terms of execution of that idea
@temper8281
@temper8281 Жыл бұрын
True.
@bob_kazamakis
@bob_kazamakis Жыл бұрын
This guy should meet the other guy on KZfaq that created reflection in C++ for this purpose
@temper8281
@temper8281 Жыл бұрын
I watched that and that guy is crazy! :D
@birdbeakbeardneck3617
@birdbeakbeardneck3617 Жыл бұрын
lmso jhd
@o-manthehuman7867
@o-manthehuman7867 Жыл бұрын
Just got this randomly recommended. Game looks awesome, can't wait for it to get released!
@temper8281
@temper8281 Жыл бұрын
Thanks!
@mom0367
@mom0367 Жыл бұрын
This is the most threatening aura I've seen from a video about file formats.
@temper8281
@temper8281 Жыл бұрын
Be afraid.
@ztgasdf
@ztgasdf Жыл бұрын
Wishlisted. Definitely excited for this.
@dickjohnson59
@dickjohnson59 Жыл бұрын
There are already established solutions for this problem. Maybe have a look at the cereal library, which has an interface pretty much the same as yours, but with support for different file formats. It also supports serializing global data that's referred to via pointers versioning, should you ever need it. It is also not hard to write a serialization archive for your own file format.
@temper8281
@temper8281 Жыл бұрын
Hmm strange must have missed all those established solutions for my custom game engine.
@micalobia1515
@micalobia1515 Жыл бұрын
Msgpack is a pretty good binary json alternative, parses a lot faster and is a lot smaller, and keys aren't required to be strings which is nice.
@temper8281
@temper8281 Жыл бұрын
Sounds boring.
@micalobia1515
@micalobia1515 Жыл бұрын
@@temper8281 And JSON ain't?
@temper8281
@temper8281 Жыл бұрын
@@micalobia1515 JSON is
@vadiks20032
@vadiks20032 Жыл бұрын
bro this soundtrack is perfect for programming video. it pretty much shows all the sufferring you've experienced as you were making the code and working on the game
@temper8281
@temper8281 Жыл бұрын
More suffering is to come. I can assure you of that
@vadiks20032
@vadiks20032 Жыл бұрын
@@temper8281 the osundtrack must have randomly agonizing screams aswell then
@temper8281
@temper8281 Жыл бұрын
@@vadiks20032 Yeah it's mostly my screams
@stgigamovement
@stgigamovement 26 күн бұрын
Speaking from experience, making a decent file format can be long, but BWTC32Key is quite ingenious for what it is.
@leetaeryeo5269
@leetaeryeo5269 Жыл бұрын
Just curious (I have no experience in game dev, as I’m more a systems and enterprise developer), but would a SQLite database provide a lot of the same sort of benefits? You can implement indirection through foreign keys linking tables, so pointer data types aren’t a major hurdle. And if one of the basic types are insufficient, you can fall back to using JSON for an individual column to describe weird data types. Plus you’d gain the benefit of a prewritten and pretty well optimized library for reading and writing the file. Plus random access for data in the file would be a bit faster due to the database engine, which would let you prioritize loading relevant data first without having to really parse the full file, if I understand stuff right. Am I off base on my thinking?
@adamhenriksson6007
@adamhenriksson6007 Жыл бұрын
I would love to hear why a format like JSON or XML is insufficient for this use case, cause writing a serializer and de-serializer for your custom plaintext format, while not that hard, seems a bit overkill for ergonomics IMO.
@GlitchyPSI
@GlitchyPSI Жыл бұрын
I'd like to know this too. I am using JSON myself because it integrates with web technologies and allows me for a quick implementation of anything with libraries readily available for several languages and in some cases even built-in in the same runtime (e.g. NodeJS) * Saying this as somebody who's making a few binary file formats too
@SahilP2648
@SahilP2648 Жыл бұрын
So I haven't watched the video but it would make total sense to prevent people from looking into your game code or even determining how the game was coded. Arguably one can save anything in JSON or XML but that would mean that people can reverse engineer stuff. Many programs use custom extensions specifically so that other people don't know what's in it. It will be a security risk. For games it will be modders or hackers trying to modify save files which can give undesirable effects.
@GlitchyPSI
@GlitchyPSI Жыл бұрын
@@SahilP2648 Sure, I can understand this, and it's very valid IMO, but it REALLY depends on how you actually serialize stuff methinks
@hypario
@hypario Жыл бұрын
​@@SahilP2648 creating a custom format never blocked any modder / hacker to still reverse engineer the game. when you save data in the client side, they will always be able to read it. And even in this case, he still used a human readable format, which will still make people able to read it...
@SahilP2648
@SahilP2648 Жыл бұрын
@@hypario no that's the whole point of an extension. You can reverse engineer some of it but think of all the Android apps using .APK, or programs using .DLL and tons of custom formats. You don't just change the extension and keep the data in byte format without performing some steps. I would suggest at least for gaming you can have the entire world state in RAM which would not take more than 100MB even for demanding titles (and makes sense since RAM is much faster than SSD), then when you go over a checkpoint you make a copy of the RAM contents, serialize, encrypt (or semi-encrypt based on your custom logic) and put it in your custom extension.
@tomcheng3903
@tomcheng3903 Жыл бұрын
I am *very* curious to know why you think JSON & XML are trash, but your format is better From what I can tell, you've *just* reinvented array-only JSON with a dreadful library API that involves faffing around with linked lists The reason most people consider JSON/XML to be 'trash' is because they're generic hierarchical text formats But if you *want* a generic hierarchical text format, i have no idea why you wouldn't use json
@temper8281
@temper8281 Жыл бұрын
Because it's made for a specific purpose. JSON/XML are general interchange formats. My format is designed to be integrated with my game engine. That makes it much easier to work with.
@tomcheng3903
@tomcheng3903 Жыл бұрын
@@temper8281 In what way is it easier to work with? It looks like a generic format for me, in the readme you just say it's 'a text file format used to save and load hierarchical data'. In what way is that different to JSON, such that it's better for your game?
@temper8281
@temper8281 Жыл бұрын
​@@tomcheng3903 Why don't you write one and you'll find out. Easy peasy. Besides you won't be faffing around with linked lists!
@tomcheng3903
@tomcheng3903 Жыл бұрын
@@temper8281 I already have - I write my own formats all the time, because I think JSON&XML *are* trash for many things. I normally write a very specific binary format that will perform better than json - that's the whole point. If I don't have much data & don't care about performance, then I use json. I don't just reinvent json with a different syntax if you don't want someone criticising your format, just don't make a youtube video calling json&xml trash without any understanding why & then proceed to make all the same mistakes When you put videos online, people watch them & learn from them, & it's infuriating seeing dogma like this get spread around! I don't want to live in a world full of JSON. But I also don't want to spend the next 10 years debugging crappy json alternatives because it was trendy to shit on json but nobody actually knew why
@temper8281
@temper8281 Жыл бұрын
​@@tomcheng3903 Oh no cry me a river!
@KazmirRunik
@KazmirRunik Ай бұрын
I thought people did this regularly when they were making save data types. If you look into the folders for your games, you see all sorts of file extensions, and some of them will just be made up. Like, if you go into a Touhou game install & save a replay, you'll find ".rpy" files that the creator just sort of made up. It's very different from the ".rpy" files that are used by the RenPy visual novel engine or the ".rpy" files used to define a resource for a Twisted Web server. However, all of their uses of the same extension while having completely different contents, it illustrates that they independently made their file types up on the spot. It's not a terribly uncommon practice, and it means you have a deep understanding of why other developers also do the same thing!
@temper8281
@temper8281 Ай бұрын
They do yeah. Primarily because you can make a very simple file format that loads fast and makes things easier to manage.
@Golem642
@Golem642 Жыл бұрын
Let's be honest : we all clicked because of the thumbnail
@michaelsander2878
@michaelsander2878 Жыл бұрын
The music was distracting but the content was worth the weird music.
@lucaciucci7719
@lucaciucci7719 Жыл бұрын
Have you considered using the cereal library? It generalises what you are doing and it is very simple to use. You can also easily implement your own file format if you don't like the predefined ones (binary, JSON, XML, ...)
@temper8281
@temper8281 Жыл бұрын
Don't use external libraries.
@v01d_r34l1ty
@v01d_r34l1ty Жыл бұрын
​@@temper8281 Protocol Buffers ("Protobuf") by Google is also a popular implementation for serialization, though I haven't heard of games using it.
@xeon39688
@xeon39688 Жыл бұрын
@@v01d_r34l1ty he said it's awful
@hamu_sando
@hamu_sando Жыл бұрын
The internet is full of bad role models and bad advice. Ignore everything this guy does and just smile 😂
@temper8281
@temper8281 Жыл бұрын
@@hamu_sando I'm a great role model. Just gotta give me a chance.
@ya_papug
@ya_papug Жыл бұрын
That music tho. Gave me actual goosebumps
@nope.nope.3704
@nope.nope.3704 Жыл бұрын
Man invented serialization
@temper8281
@temper8281 Жыл бұрын
There's more behind the curtain just waiting to be revealed!
@jvcrules
@jvcrules Ай бұрын
"Also, we do everything from scratch here so lets roll out own". Subscribed when i heard this
@norb3695
@norb3695 Жыл бұрын
Dude I thought the game in the background was Gmod with the "Lidar" addon what the fuck I'm looking forward to playing your game!
@Axodus
@Axodus Жыл бұрын
Every object has its own save and load function? Wow, I coded a system like that myself! My save code basically asks every node politely to send their data and saves all the responses, this is very plug and play, and no node being removed from a scene would cause a save load error.
@doodidood
@doodidood Ай бұрын
Another cool file format that I've started to use recently for configuration stuff is toml - it's super human readable and easy to parse/write.
@GamerX-2000
@GamerX-2000 Жыл бұрын
I’m an aspiring game developer, and this is a really helpful message! I’ve only worked on platforms that don’t have save data or don’t need it- like simple Roblox stuff or khan academy’s coding platform. Problem is, idk how to deal with save data. Anyone have a good video that addresses the concept (not a coding tutorial, but an explanation of the overarching idea). On khan academy, due to a lack of save data (unless you use cookies on the html part, which I haven’t started) users usually have a print function that outputs an array that the player can save elsewhere, and paste into an array in the code later(and the program takes that array and breaks all its data into the individual variables)
@doktoracula7017
@doktoracula7017 Жыл бұрын
You already get that idea, instead of outputting the array to player you just write it to file and add some code to check for that file on game start so it can be loaded. Instead of file you can use cookies or any other storage type to keep it. That's the whole idea really.
@x1nto
@x1nto Жыл бұрын
Hey! You talked about JSON and XML (which are indeed trash), but have you heard of Protobuf? It's a way to save data to a binary format and it supports structured, typed data alongside optionals and stuff.
@temper8281
@temper8281 Жыл бұрын
Yes I have a protobufs are awful xD
@x1nto
@x1nto Жыл бұрын
@@temper8281 honestly, I mostly like them because of the compression they provide, but I understand that it might not fit in some use cases
@darrennew8211
@darrennew8211 Жыл бұрын
@@temper8281 ASN.1 to the rescue! ;-)
@aeghohloechu5022
@aeghohloechu5022 Жыл бұрын
I guess the issue is that they want a human readable output but protocol buffers kind of makes it quite hard
@x1nto
@x1nto Жыл бұрын
@@aeghohloechu5022 that's true but if you have source protobuf files, that shouldn't be a problem at all
@mario64thane
@mario64thane Жыл бұрын
Man's turning LIDAR into a full game!
@zedlz
@zedlz Жыл бұрын
I have no idea whats going on but you are very cool
@quickgaming2466
@quickgaming2466 Ай бұрын
First of all, if you r truly a dev behind this game - I applaud to you.
@temper8281
@temper8281 Ай бұрын
I am
@Eternal_border
@Eternal_border Жыл бұрын
That game looks fun ngl
@jacobmoore2036
@jacobmoore2036 Жыл бұрын
This game already exists. Its called Scanner Sombre.
@FireDragon91245
@FireDragon91245 Ай бұрын
Very nice, for languages that run ontop of a Runtime and thus support reflection are easy to save in json, JAML you just need to write a generic recursive funtion to traverse any struct down to any primitive and your set
@JetJockey87
@JetJockey87 Жыл бұрын
In the standard SDLC, Data Modeling comes before Solution Design. I understand Game Dev is a lot more... Agile, but it's a good idea to lock down your data model. You think you're saving yourself time by reinventing the wheel, but there are sooooo many useful libraries and functions to parse and handle JSON and XML. Heck you don't even need to use NoSQL dbs, you can use SQLite and handle state with a standard RDBMS with PKs and FK constraints, clustering, indexes and more. Very performant.
@temper8281
@temper8281 Жыл бұрын
Data modeling and solution design are one and the same. You can't do one before the other. I'm not reinventing the wheel. I'm building a wheel that is perfect for my usecase.
@Talel_kraiem
@Talel_kraiem Жыл бұрын
I've got the same problem and it almost made me cry
@johnseed2148
@johnseed2148 Жыл бұрын
Great video :D! How would you go about solving this problem if you planned everything from the beginning?
@temper8281
@temper8281 Жыл бұрын
It's not possible to know exactly what your data will look like at the beginning. So best thing to do would be have tools that keep you flexible. Having a file format is useful because I can tailor it exactly to my data. The other thing I would do is try to keep data is simple as possible without much levels of indirection. Complicated data structures and pointers are difficult to serialise.
@sebase3283
@sebase3283 Жыл бұрын
the thumbnail be like: DONT SAY IT DONT SAY IT
@hoodie_cat
@hoodie_cat Жыл бұрын
To be honest, I only clicked on this video because of the amogus thumbnail and I had thought you'd made some sort of amogus save file
@JasonMitchellofcompsci
@JasonMitchellofcompsci Жыл бұрын
That time over a decade ago I ran into a similar problem brought me down a path of trying to write my own malloc that could be fed a specific chunk of memory to operate on. Why? So to save I could either copy the whole blob to a file or just mmap the file from the outset and have the state auto saving. Of course that wouldn't be human readable but it does solve the problem of saving any data structure.
@mumbojumbo02
@mumbojumbo02 Жыл бұрын
simplicity is bliss
@lunkums
@lunkums Жыл бұрын
Btw, great informative video! It was clear and to the point. One thing I think that could use improvement is the background music. It was a little distracting and didn't fit the vibe
@temper8281
@temper8281 Жыл бұрын
Yeah I think it was too loud. And also too scary
@uipo1122
@uipo1122 Жыл бұрын
@@temper8281 I actually liked the music
@stuartdowning5628
@stuartdowning5628 Жыл бұрын
@@temper8281 definitely good music choice.
@land3021
@land3021 Ай бұрын
0:57 Yeah it's pretty spooky trying to get code to save code that the code is creating inside a program that mind you, that code is part of the same file in the same code that is running the thing that this code is saving...
@WellSwolen69
@WellSwolen69 Ай бұрын
I use Godot on Debian bookworm I use their own resource stuff, but I recommend using something like Deltarune does it's code Split up major areas of the game into chapters that have different data. Save files can start on any chapter and non necessary data can be ignored and left into previous chapters unless needed again.
@maxperignon8794
@maxperignon8794 Жыл бұрын
So interesting!
@pranaav2027
@pranaav2027 Жыл бұрын
Wow, You really made a Very Awesome Save Format, I really hope you continue developing this File Format in your Free time so that More Game Developers use it. Also, I am Guessing that the BG Music is from the game you are making, but it really was kinds scary and making it little hard to Focus to the Video. After looking back at a few Videos of yours and Checking the Steam page of the Game, I think it is a really awesome concept of a Game, Really Hope it comes out neat.
@mariocamspam72
@mariocamspam72 Жыл бұрын
this capitalization is aneurysm-inducing
@pranaav2027
@pranaav2027 Жыл бұрын
@@mariocamspam72 I know, Been a thing from a long time to capitalize almost every word I type, though now I am trying my best to not capitalize unnecessarily anymore.
@mariocamspam72
@mariocamspam72 Жыл бұрын
@@pranaav2027 you're doing good, some habits are hard to break. 👍
@pleasecontactme4274
@pleasecontactme4274 Жыл бұрын
@@pranaav2027 that's a really funny habit
@RugbugRedfern
@RugbugRedfern Жыл бұрын
pretty neat but what the heck is going on with the background audio
@temper8281
@temper8281 Жыл бұрын
Yeah will fix it for next video. I'm just bad at editing
@Rose-ec6he
@Rose-ec6he Ай бұрын
This is an interesting perspective. It feels more unique to C++. Given that, json parser are normally built-in to most languages, raw pointers and non-trivially-serilizeable types are less common in other languages and C++ offers no reflection or similar features to dynamically account for types' structure. The list goes on, like the first class package management, etc. This feels highly influenced by C++. I don't mean this negatively, it's just an observation, I've got little experience with C++ so this type of solution is novel to me. Thanks for sharing
@temper8281
@temper8281 Ай бұрын
Nowadays I just write binary files for game data that are just simple functions that write/read data directly into/from a file. C++/C inability to inspect data at run time forces you to take the more explicity approach, but can be simpler in many ways.
@Dylank001
@Dylank001 Жыл бұрын
Your game looks pretty cool! Did you make it in your own engine?
@temper8281
@temper8281 Жыл бұрын
Yeah
@quenbyako
@quenbyako Жыл бұрын
Why not to use yaml? Or, if you worry about speed of parsing, use hcl format (it looks weird, but you definitely reinvented hcl file format... If you like it, then use hcl 😁)
@temper8281
@temper8281 Жыл бұрын
But why
@leucistic
@leucistic Жыл бұрын
I swear to god, I thought the video was a file format for amongus just because of the thumbnail. I need help.
@story_mind1
@story_mind1 4 ай бұрын
Before the game is left just rewrite a .txt or any text file with the data, and read it at the beginning
@oxey_
@oxey_ Жыл бұрын
This is just #[derive(Serialize, Deserialize)] with extra steps :p
@aarohgokhale8832
@aarohgokhale8832 Жыл бұрын
Why is the music so anxiety inducing
@etopowertwon
@etopowertwon Жыл бұрын
I drank kool aid of sqlite for my pet projects. I get atomicity and reliability and extebsability out of the box without headache of renaming files. Everything has some sort of id. So unit* can be saved as unit->id. It has drawback of boilerplate, but I can live with it and I can make complex query into saved state of project using sqlite client.
@Pericles_89
@Pericles_89 Жыл бұрын
I'll be honest the amongus in the thumbnails is why I clicked
@ftwgaming0
@ftwgaming0 Жыл бұрын
I don't think this many of us would be here if our ape brain pattern recognition didn't see an amogus in the thumbnail.
@Sinke_100
@Sinke_100 Жыл бұрын
Got me thinking, how about u write some states in color, save file could be small resolution png
@technologyondemand4538
@technologyondemand4538 Жыл бұрын
what game is this? looks sick! i wanna play this. can i join some sort of thing to keep track of the game dev progress? (edit): steam link in the description :p (edit2): will you be releasing a native linux version as well? ig i can play with proton with steam, but native apps are always nice!
@temper8281
@temper8281 Жыл бұрын
No native linux version I'm afraid!
@technologyondemand4538
@technologyondemand4538 Жыл бұрын
@@temper8281 that's fine, it should work through proton with steam
@JoeMama-ng1xc
@JoeMama-ng1xc Жыл бұрын
i first thought this was a joke video because the thumbnail looked like it was an among us character
@shuba5173
@shuba5173 Жыл бұрын
horror themed tutorial
@patrlim
@patrlim Жыл бұрын
Game reminds me of the gmod lidar gamemode
@raptorjesus3396
@raptorjesus3396 Жыл бұрын
Protobuf dto definition for each go, generate dto files from definition. Each go can load a it's specific dto, and export it's dto. (Impl wise the dto is stored as a field in the go). On save game the game instance manager exports the dto for each go. Write the flat tree to a file. The state manager of the game instance resolves references. It's as easy as that
@raptorjesus3396
@raptorjesus3396 Жыл бұрын
The game instance state manager is a Singleton backed by a concurrency safe dictionary mapping the a ID to a reference . The go as a onattach and detach method that registers with the gism. For multiple reasons you don't ever want to store a pointer to a go in another go. Most of them are isolation, state safety and thread safety related.
@raptorjesus3396
@raptorjesus3396 Жыл бұрын
Take a look at the state mgmt of the REDengine, or Gamebryo for examples,that do exactly that, but unnecessarily complicated (own file format, live queries etc.)
@temper8281
@temper8281 Жыл бұрын
Too complicated.
@haxidenti6001
@haxidenti6001 Ай бұрын
Uhm. Everytime when i create some application and save files or configs, i use custom sort of format. Is it new something?
@Kugelschrei
@Kugelschrei Жыл бұрын
Interesting, but you do have to rewrite your parser everytime you change anything within your data structure? That sounds like lots of overhead to me, but granted, its nice to have human-readable files. Easy Save does this for Unity too, and its backwards compatible. It is not as pretty when looking at the textfile, but also readable. When you for instance add some variable to a class that hasnt been there before and then load/save data, it doesnt break but just fills in the missing data. If there is too much data because you removed a variable, it gets omitted. Pretty good system that doesnt require any kind of manual parsing on my end and saves any of my custom classes and structs
@ETXAlienRobot201
@ETXAlienRobot201 Жыл бұрын
can't say i like the unity format at all. rather, should say, "formats" , because they failed hard in being future-proof.
@goitegi
@goitegi Жыл бұрын
I thought this is was going to be a funny meme where he made the file format to be represented as amongus. Now I'm disturbed by the ominous music
@emberdrops3892
@emberdrops3892 Жыл бұрын
Really interesting gamedev log! Just one point of feedback. I don't know if I'm alone with this but the constant ominous sound effects in the background were, for an explanatory video, very distracting
@snugray_p1659
@snugray_p1659 Жыл бұрын
I feel like I'm listening to a creepypasta
@temper8281
@temper8281 Жыл бұрын
I'm watching you all
@reinadorojo
@reinadorojo Ай бұрын
I think it's useless and doesn't meet the requirements you plan, but if the game is about dots and darkness you can make the file save in binary and transform the 1 into dots (.) and the 0 into a square (■).
@nomadshiba
@nomadshiba Жыл бұрын
if your data structure was something similar to unity ecs, you wouldnt have nesting and everything would be data driven, so saving and loading etc, anything would be possible without any problem
@nomadshiba
@nomadshiba Жыл бұрын
you just load the data and systems can pick up from there without you needing to do anything else
@MiggySmallzXD
@MiggySmallzXD Жыл бұрын
The loud sounds in the background is very distracting. Cool vid though!
@jaysistar2711
@jaysistar2711 Жыл бұрын
The ability to use serde in Rust for compile time reflection is worth switching from C++ by itself. That's not even saying anything about the dynamic to static dispatch where needed without having to write both a class with virtual functions and a concept as well; in Rust we just use a trait, and a v-table is made if we ever create a &dyn to our struct for dynamic dispatch, but if we use either the struct or a generic, then it's monomorphised to use static dispatch.
@temper8281
@temper8281 Жыл бұрын
I gotta write a game! Not spend time writing code! 😱
@jaysistar2711
@jaysistar2711 Жыл бұрын
@@temper8281 That's the idea.
@bluebukkitdev8069
@bluebukkitdev8069 5 ай бұрын
Really cool looking game in the background. What is it?
@temper8281
@temper8281 5 ай бұрын
Blinded by Fear. It's the game I made. It's on steam.
@kairu_b
@kairu_b Жыл бұрын
nice craps 😆. Great video
@ProtoMan137
@ProtoMan137 Жыл бұрын
I mean yeah, that's how I guess one could do it, but why do I feel like there will be a jumpscare throughout the whole video?
@temper8281
@temper8281 Жыл бұрын
Just wait until you play the game!
@zsiger6921
@zsiger6921 Жыл бұрын
Im just here for the amongus from the index picture
@mahuba2553
@mahuba2553 Жыл бұрын
hey you are playing that funny horror map
@salad5701
@salad5701 Жыл бұрын
1:37 is that.. is.. is that what i think it is???
@horseradish843
@horseradish843 Жыл бұрын
I hope you implement versioning, since this is unmaintable after release. Its always a better idea to use an existing thing like json, xml or even use protobuf which will make versioning much easier. I cant see how this extends json or xml
@temper8281
@temper8281 Жыл бұрын
No it's not always a better idea. And yes, it can be versioned.
@flxy04
@flxy04 Жыл бұрын
Clicked on this because I thought there was an amogus in the thumbnail, got a really consise breakdown of data saving. Also: the game looks really good, it's a great idea to limit vision in this way!
@X7cF4
@X7cF4 Жыл бұрын
In my programs I store my data via a data manager class I made as a library
@kkuriboh
@kkuriboh Ай бұрын
why don't you just use something like cbor to byte encode and decode data structures, then just write it to a file?
@JohnJCB
@JohnJCB Жыл бұрын
Huh this game reminds me of scanner sombre
@temper8281
@temper8281 Жыл бұрын
Me to
@fiona9891
@fiona9891 Ай бұрын
it looks a lot like sdlang or the KDL document language
@timecubed
@timecubed Жыл бұрын
Can't wait to make a .amogus format
@roezir
@roezir Жыл бұрын
sickk
Never install locally
5:45
Coderized
Рет қаралды 1,7 МЛН
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 3,9 МЛН
Самый Молодой Актёр Без Оскара 😂
00:13
Глеб Рандалайнен
Рет қаралды 11 МЛН
Iron Chin ✅ Isaih made this look too easy
00:13
Power Slap
Рет қаралды 35 МЛН
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 197 МЛН
What School Didn't Tell You About Mazes #SoMEpi
12:49
mattbatwings
Рет қаралды 176 М.
The US Bans Kaspersky
9:53
Mental Outlaw
Рет қаралды 271 М.
I Made a Zero Player Game
12:30
Sam Hogan
Рет қаралды 10 МЛН
Programming with Math | The Lambda Calculus
21:48
Eyesomorphic
Рет қаралды 156 М.
How One Small Change Broke Wikipedia's First Link Rule
20:33
Not David
Рет қаралды 558 М.
I Designed A CPU (And So Can You)
19:14
Owen Gibson
Рет қаралды 16 М.
this is the most broken number that exists.
16:24
tristangent
Рет қаралды 125 М.
I Designed My Own 16-bit CPU
15:46
AstroSam
Рет қаралды 1,9 МЛН
Optimizing my Game so it Runs on a Potato
19:02
Blargis
Рет қаралды 502 М.
How To Fail At Game Feel
3:48
Artindi
Рет қаралды 65 М.
10 Дней в мире Страшных Мобов в майнкрафт
44:16
Lp. Последняя Реальность #107 РОДНОЙ ДОМ [Финал] • Майнкрафт
1:8:20
MrLololoshka (Роман Фильченков)
Рет қаралды 1,8 МЛН