61
Cute Discussion / Re: Admins
« Last post by SquareWheel on August 23, 2023, 11:52:05 PM »Sure why not
The compiler problem is interesting. Some languages(?) have a "hot swap" feature. I know that I was able to use this when I was working with Java in Eclipse and maybe JetBrains. Basically you run the program with some special configuration and, while the program is running, certain changes to Java source files are picked up. This stackoverflow discussion from 2018 indicates that might not exist for Scala: https://stackoverflow.com/questions/50696440/can-hot-swap-be-used-with-scalaYeah, it's definitely harder to figure out how to do stuff in Scala rather than Java. They do have a build tool that does rolling re-compilation (saves information about previously-compiled code in between recompiles) which makes things more bearable - but still kind of an annoying language for some aspects of game programming I find.
I think this problem is probably why some game engines embed scripting engines for the game logic. That way the big C++ (or whatever) engine gets compiled less frequently and your scripts are reloaded and reinterpreted by the engine.
Dummying them out sounds interesting, but also sounds a bit overkill for what I've done in my awesome game development career. I know that for certain (all?) formats for sound, you can stream the file to the audio device. This could be useful for music, since you wouldn't have to wait for the entire file to load, just enough to fill the buffer to send to the audio device.Oh actually for browser, loading things asynchronously sounds like a better solution, since that's how browsers are supposed to work anyway. Sensible behavior for when the files aren't warmed probably is the trickiest part - but past that it's probably good enough to get most of the media loaded seamlessly. For my desktop game I front-loaded all media files at the start, but when I think about it doing something similar probably wouldn't be a huge issue, and would reduce the initial start-up time by a lot.
In IguaRPG, I didn't do this because I didn't learn how. Maybe someday... But what I did there was load the music asynchronously and as-needed. When you enter the desert town, for example, the music files for the field, bar, inn, oracle, and witch's house all start to load (I called this "warming"). This is done with the following code written in the start-up of each "level" (roughly equivalent to the "Room Start" event of a Game Maker "room"):
...
I've had this problem in game dev too only to a worse degree because scala compiler is notoriously slow (30s rebuild times pretty common). I've been theorizing a language that lets you change game code while the program is running (for certain classes of changes)..... Probably will be a long time before I actually do it, but definitely relate to the struggle lol.
I can even imagine it doing something like excluding resources / dummying them out when you only need to test subsets of the game (Music has always taken me the longest to load so often not loading most of the game music helps me).
jukebox.play(Country).warm(NewDesertOracle, Bluehouse, Shop, DesertField, Witch);
From: https://github.com/hubol/igua-rpg/blob/518103cf89ff2e0921af74631d750d42befaff6f/src/levels/desertTown.ts#L39Also I've heard of Trello before, have you used it a lot already? I've been thinking of using one of those corporate task organizer things but I'm bad at adapting new workflows lol.
Towards the end of development of IguaRPG, my code-change-to-reload time was slowing down due to the number of simultaneous HTTP requests needed to get all of the sprites and audio files!