Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - hubol

1
Cute Discussion / Re: IguaRPG 2 Devlog
« on: March 23, 2024, 05:38:55 AM »
Haha, Cook, I like your cloneTemplate function a lot! I know the point of the post is that you tried out something where you weren't just using native browser APIs, but in a game project I don't really want to pull in a heavy library like React or Vue for my debug utilities. Thanks for the inspiration there!

Briefly looking at the Vue docs... The Vue SFC looks interesting. It's not really something you can accomplish with React out-of-the-box, in particular declaring styles in your component files in a nice way. I wonder what the development experience is like in an SFC file... React is pretty nice because for the most part you are just looking at TypeScript code, and you get the typical assistance from your IDE because of that...

My first experience with one of these frameworks was React with functional components in TypeScript... So when I saw angular I was very sad... It seemed like components were at minimum 2 separate files. The HTML file has bastard attributes for boolean expressions and looping (Haha, looking at Vue, they also have this: https://vuejs.org/guide/essentials/conditional.html#v-if)... And I recall the TS file being pretty verbose...

It's funny how complicated each framework is...

Finding a dev job is very hard and humiliating. From 2022-2023 I applied to probably 50 game development companies. I heard back from one and went through 7 interviews only to be rejected. I applied to horrible, enormous banks; dating apps; the university... Again, heard back from one. Another extremely rigorous and evil, heartless, disrespectful, inhumane interview process for an evil bank. Rejected because I used TypeScript in the live programming examination. Told I needed to brush up on my JavaScript skills.

The only way I've gotten my past three jobs is through connections I made at another dev job. And I'm pretty sure I only got that job because a guy who worked there looked at my YouTube channel and saw I had a video called "HUBOL AT GDC" or something and believed I was a very important game developer.

I hope you find something Ducko! I don't think the place I work at is looking for people without work experience as a full-stack web dev... But if that changes I will let you know.

2
Cute Discussion / Re: IguaRPG 2 Devlog
« on: March 21, 2024, 05:45:30 AM »
Cook! I’ll respond to your effortpost soon!

3
Cute Discussion / Re: Official Video Games Topic for the Year 2022
« on: February 02, 2024, 12:47:15 AM »
did anybody see that the lyle in cube sector dev randomly showed up again with a "retro 3d" style platformer. i haven't played that one yet but probably should.
https://store.steampowered.com/app/2575900/Corn_Kidz_64/

I played a bit but got scared by how big it started feeling! I love how it looks and sounds! The characters were cute, too. It's been a while so I might go back and restart.

4
Cute Discussion / Re: Official Video Games Topic for the Year 2022
« on: January 04, 2024, 12:48:04 AM »
that does have some jumper energy!!

5
Cute Discussion / Re: IguaRPG 2 Devlog
« on: December 02, 2023, 01:05:29 AM »
The cache-busting and source map generation is from parcel! https://github.com/parcel-bundler/parcel I picked it, basically randomly, a few years ago since I knew I wanted to write in TypeScript and would need some kind of bundler.

But it's nice when tools work and you don't have to think about stuff like that :-)

6
Cute Discussion / Re: IguaRPG 2 Devlog
« on: November 29, 2023, 06:36:54 AM »
I might make a more thorough post later... But for now, I'm happy to announce that I published @hubol/smooch to npm.

I even automated the process of publishing in GitHub Actions. I did some really hacky stuff but I'm pretty happy with it overall!

So now with the asset generation tool working, I've been able to sort of get started on Igua 2. For now, I am basically bringing the old engine in piece-by-piece and making improvements as I see fit. Some of those changes include:
- Some abbreviated method names for commonly-used methods: .withStep -> .step, .withAsync -> .async
- A loooot of reorganization. I'm trying to carefully separate Igua-specific code from game engine code so that I might be able to reuse this engine for other projects
- Using a new library to maintain a context local to an asynchronous chain. In the original engine, I was using zone.js which is this big black box from Angular. To use it, I had to configure my bundler to target web browsers that didn't support native async/await, which was a hassle. I found this obscure stackoverflow answer that indicated someone had made a solution that works with native promises: https://stackoverflow.com/questions/66960129/something-like-async-hooks-for-the-browser/75621061#75621061

Those are the big things! I've gotten smooch integrated with the project now too! https://github.com/hubol/igua-rpg2
If you take a look at the src/assets/generated/ directories you'll see the output from smooch! Take a look at the smooch.json file at the root to see how that output was generated. I'm so happy with it!

Finally, I adapted my crude "continuous deployment" workflow from Igua 1. The game is now pushed to heroku whenever I commit to main. Thinking about it right now, I'm not sure why I didn't try to get it working with GitHub Pages instead... I guess because I already knew how to do this... Maybe some other time I'll try Pages, though.

Anyway, you can see the fruits of my efforts here https://igua-rpg2-d76be5c97e6f.herokuapp.com/
For now, this is a crude sandbox that I am testing the game engine with

It might take a second to load because of the heroku plan i have ^_^

7
Cute Discussion / Re: IguaRPG 2 Devlog
« on: October 09, 2023, 08:59:59 PM »
Are you making something cool in Godot? :dancedog:

8
Cute Discussion / Re: IguaRPG 2 Devlog
« on: October 04, 2023, 02:07:35 AM »
What's zipping the audio files for?  I figure it can't be adding any more compression, so just for packaging?

It's pretty deranged, but the goal is to minimize the number of simultaneous HTTP requests during boot! I believe you are capped to 7(?) simultaneous requests normally. This will also improve reload speed in development. Before, the game would attempt to load hundreds of textures and sound effects in parallel on boot, and even developing locally this started to take a few seconds.

I've avoided playing with TS mostly because I haven't needed to, but I secretly hold the idea that eventually JS will get optional typing and TS will become more of a niche utility for its extra features at that time.  In the same way that LESS and SASS have fallen away as CSS has become more powerful, we seem to move towards fewer steps and less bundling where possible.

It sure would be nice if JS got optional typing! Python did. At my new job they're using plain JS for the backend and it's nice to not deal with a bundler and source maps while debugging... but I certainly miss the types...

I actually did start working on a language for game stuff - doesn't have any of the stuff I was talking about, but it *does* have an actual type system which I'm playing around with a lot. Main features are ADTs and also a function overload system that distinguishes functions of the same name by the argument of the first type. (There will also eventually be polymorphism but I haven't needed it yet). Basically I'm messing around with various type design decisions to see what works and what doesn't.

<code sample>

(syntax highlighter scuffed bc it's hard to keep up with it while actively making the language :U)

Really, really amazing. You are so cool!!!!! The is keyword seems really nice, I wish TypeScript had it. Your syntax for indexing tuples is cool! Two things:
- What is no on line 3?
- Are you going to implement some kind of checker that runs in the editor? Is that thing separate from a syntax highlighter? I have no clue ^_^

9
Cute Discussion / Re: IguaRPG 2 Devlog
« on: October 02, 2023, 05:28:50 PM »
100% agree and I will effortreply to everyone’s effortposts later today!!

10
Cute Discussion / Re: IguaRPG 2 Devlog
« on: September 16, 2023, 04:46:41 PM »
Update #2: smooch adventures?!

Since I am writing adequate commit messages, I will use my git history to see what wacky stuff I've been up to!

W1. Normalized paths in console output
I thought it would be a cool idea to rewrite paths printed to the console so that they are relative to the current working directory. Since paths are different on Windows and Unix machines (Windows uses \ instead of /), my logging abstraction also normalizes this. These changes mean that my naive automated tests can check that particular paths are being correctly output! I also think it improves the readability of the logs, which is somewhat of a priority for this project.

Here's a sample:
Code: [Select]
            NativeDependencies Checking that native dependencies are installed to .smooch/native-deps
            NativeDependencies Native dependencies appear to be installed.
                        Ffmpeg Set Ffmpeg path to .smooch/native-deps/node_modules/@ffmpeg-installer/win32-x64/ffmpeg.exe
             SmoochJsonWatcher Started
                     FsWatcher Started with subscriptions: audiCnv
                     FsWatcher Ignored Message #0 (Catch-up) <no events>

W2. Converting audio files
The previous incarnation of smooch used sox to convert audio files. This required the user to install a native dependency before running the tool. You also had to make sure that you installed the liblame thing for mp3 or whatever. It got annoying!

Apparently there are some packages on npm that seemingly abuse the "optionalDependencies" property in package.json. Examples: https://github.com/kribblo/node-ffmpeg-installer/blob/master/package.json , https://github.com/parcel-bundler/watcher/blob/69f3099f009330d53abdb0e7d53e9f9204af04b3/scripts/build-npm.js (this code generates a package.json!)

They use this property to install binary packages that are installable on the user's architecture. I searched for a package like this for sox, but I couldn't find one. So I used the @ffmpeg-installer/ffmpeg library. So, smooch now uses ffmpeg to convert audio files. I implemented this and it seems to work fine! Cool!

W3. Type hints in template programs
A core component of smooch is the ability to get metadata about transformed assets and apply the metadata to a template program to generate a code file. Special context is exposed to the code file, and it's not always intuitive how to use that context without types. VS Code supports loading .d.ts (TypeScript declaration) files from within JavaScript files (our template programs are plain JavaScript files) using JSDoc. I love using TypeScript in clever ways, and don't like doing lots of manual work. So, I found a tool to generate a single .d.ts file from some types (for some reason this feature is not built into TypeScript)!! The result is some example template programs with types embedded using JSDoc!: https://github.com/hubol/smooch/blob/973ade74ca20f731e7a44a1e9da2492b8704ee97/dist/templates/audio-convert.js

W4. Zip archiving of audio files
I got to implement this and it's looking good! At first I was exploring the possibility of keeping a cached zip file and only adding newly converted audio files to it. But on my machine it takes only ~200ms to zip the entirety of IguaRPG's sound files to a new zip file.

W5. Library bugs, version conflicts, native dependencies...
I ran into an issue with one of the libraries I'm using, @parcel/watcher. I observed that when upgrading to version 2.3.0, it was possible for one of the functions exposed to me to hang infinitely. I did some digging and found this commit: https://github.com/parcel-bundler/watcher/commit/9b7c657df8ad1c0d020541eae0dd38b921c94fb8 ...And if I upgrade to that particular version, I also experience the hanging. I tried to create a small repro so that I could report an issue, but to no avail. I am guessing they introduced a deadlock, but I have no idea how to read and/or debug C++.

@parcel/watcher is supposed to provide performant file system events. The library is even used by VS Code! I would like to use it in this project. But, I don't think it's a good idea for smooch to require a specific version of the library...

Imagine we have this package.json in our IguaRPG 2 project:

Code: [Select]
{
   ...
   "devDependencies": {
      "smooch": "^1.0.0",
      "parcel": "^9.0.0",
   }
}

Both packages depend on @parcel/watcher. smooch requires a specific version 2.2.0 due to the aforementioned bug, but parcel might need something higher than that. npm will be unable to resolve this conflict!

This would be no issue if @parcel/watcher had no native dependencies. I could simply pack all of its JavaScript code into my smooch bundle, and there are now no worries about conflicting dependencies.

But because of the native dependencies, I have two choices:
1. Download specific versions of their binaries for all supported platforms, and include them in my repository and require them from my bundle
2. Install the native dependencies using npm at runtime, and place them in a special folder that only smooch is aware of

I went with 2, even though I'm pretty sure it's unorthodox AF. It actually required surprisingly little code: https://github.com/hubol/smooch/blob/f663e32a20f9d0e7486e1150051b449f4001a462/lib/common/native/native-dependency.ts

The NativeDependencies class exposes isInstalled, install, and require methods. And I think they look pretty nice! I also did some crazy shit so that the correct API of the package is returned from the require method (-:

But yeah, now these dependencies are installed to a separate package at runtime, ensuring that the desired version is installed with the correct native dependency! I'm glad that I was able to accomplish this with very little code and by leveraging shit that already exists!

11
Cute Discussion / Re: IguaRPG 2 Devlog
« on: September 14, 2023, 05:32:17 AM »
Making some progress on smooch...

Have had to invent a loooooot of really kooky stuff. It's fun. Maybe I'll talk about it more sometime.

12
Cute Discussion / Re: IguaRPG 2 Devlog
« on: August 25, 2023, 06:03:53 PM »
I've been wanting to make my own language for game programming anyway.

I want to see it!!!!!!!!!!! Do it!!!!!!

13
Cute Discussion / Admins
« on: August 23, 2023, 07:40:37 PM »
Can the default theme for the forums be Curve Multi Color;vrt=pink

14
Cute Discussion / Re: do you lot still appreciate capies?
« on: August 21, 2023, 08:48:51 PM »
So good. Love the delayed audio and WinXP hints.

I played AUS recently. Very nostalgic experience but also can't say I had a lot of fun...

15
Cute Discussion / Re: IguaRPG 2 Devlog
« on: August 21, 2023, 08:42:44 PM »
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.

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-scala

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.

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).

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.

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"):
Code: [Select]
jukebox.play(Country).warm(NewDesertOracle, Bluehouse, Shop, DesertField, Witch);
From: https://github.com/hubol/igua-rpg/blob/518103cf89ff2e0921af74631d750d42befaff6f/src/levels/desertTown.ts#L39

When .play is called on the jukebox object, the jukebox asynchronously waits for the "warming" process to finish (or starts one if one was not already started), then begins to play the song! The asynchronous nature here means that the game doesn't freeze during this time.

I found the warming approach to be satisfactory. And when the music file is not "warmed" (e.g. when the player loads their save file), the load time for the music file is pretty fast on desktop. Probably less than a second! This is probably from a combination of:
  • Using the .ogg format
  • Having short music files ^_^
  • SSDs are fast

(It is quite a bit worse in the browser since it has to make an HTTP request and that can take a while!)

Also 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.

I have now used it for SBW2 and IguaRPG! I like it because I choose not to empty out the "Done" column, so I end up with a big huge pile at the end of the project, which I think is cute! You can see the one I had for Igua, here, I think: https://trello.com/b/Zmb2cdPl/iguana I've got some silly column names.