Author Topic: IguaRPG 2 Devlog  (Read 7031 times)

SquareWheel

  • Administrator
  • Cutester
  • *****
  • Posts: 802
  • Cutes: 139
    • View Profile
Re: IguaRPG 2 Devlog
« Reply #15 on: September 30, 2023, 09:14:44 PM »
Main features are ADTs and also a function overload system that distinguishes functions of the same name by the argument of the first type.
It only makes sense that ducklang would have some form of duck typing.

I have no clue how any of this stuff works but it sounds very impressive.

dcco

  • Cutest
  • ****
  • Posts: 469
  • Cutes: 112
    • View Profile
Re: IguaRPG 2 Devlog
« Reply #16 on: October 01, 2023, 10:39:15 PM »
Ducklang unironically a good name for a language lol

hubol

  • Cutesterest
  • ******
  • Posts: 1135
  • Cutes: 630
    • View Profile
    • hubolhubolhubol
Re: IguaRPG 2 Devlog
« Reply #17 on: October 02, 2023, 05:28:50 PM »
100% agree and I will effortreply to everyone’s effortposts later today!!

hubol

  • Cutesterest
  • ******
  • Posts: 1135
  • Cutes: 630
    • View Profile
    • hubolhubolhubol
Re: IguaRPG 2 Devlog
« Reply #18 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 ^_^

dcco

  • Cutest
  • ****
  • Posts: 469
  • Cutes: 112
    • View Profile
Re: IguaRPG 2 Devlog
« Reply #19 on: October 05, 2023, 05:27:55 AM »
The is keyword seems really nice, I wish TypeScript had it. Your syntax for indexing tuples is cool!
Yeah implementing ADT/union types in TypeScript is doable, but very bulky, when really they shouldn't be that much more complicated than an advanced enum. The ideal syntax is probably a pattern-matching syntax which would look something like:
Spoiler (click to show/hide)
But I'm trying to keep the syntax as minimalist as possible rn so idk.

Quote
- What is no on line 3?
It's just another case for the ADT, one that takes no arguments. Basically just a default, altho kinda unnecessary since it has the same meaning as frame:(0) as defined.

Quote
- 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 ^_^
I know what youre talking about, that is different from syntax highlighting, but not sure what it's called either. Rn I almost exclusively work in Sublime Text, which doesn't really do that kind of error highlighting since it's just a text editor at heart (maybe there is some plugin/package that does for some languages tho idk).

I think usually you would need to develop for a specific IDE to get error highlighting. Maybe I would think about it in the distant future, but even getting the compiler to spit out decent error messages is kind of a chore. In general I think error handling is the worst part of making a language lol.


SquareWheel

  • Administrator
  • Cutester
  • *****
  • Posts: 802
  • Cutes: 139
    • View Profile
Re: IguaRPG 2 Devlog
« Reply #20 on: October 05, 2023, 05:56:32 AM »
I don't really like using switches, but I do like GDScript's match feature.  It removes most of the footguns and adds some useful features.

Previously you could opt-in to falling through with the continue keyword, but I guess that was removed.

dcco

  • Cutest
  • ****
  • Posts: 469
  • Cutes: 112
    • View Profile
Re: IguaRPG 2 Devlog
« Reply #21 on: October 05, 2023, 11:16:59 PM »
secretly i was describing a match statement but wasnt sure of people's familiarity so presented it as a switch statement. yeah a match statement is actually actually what i would do (imo fall-throughs cause bugs way more than they are useful). i did a lot of programming in functional languages during grad school, and match statements are a staple of them.

i didnt know godot made use of them that's cool - especially being able to match dictionaries - i wish typescript could do that.

SquareWheel

  • Administrator
  • Cutester
  • *****
  • Posts: 802
  • Cutes: 139
    • View Profile
Re: IguaRPG 2 Devlog
« Reply #22 on: October 06, 2023, 03:46:28 AM »
Ah I didn't know it was a common thing in functional languages.  It looks like PHP8 got it too, so it supports both switch and match.

Yeah fall throughs always seemed like one of the worst designs in program control flow.  Just asking for trouble.  I thought the continue keyword was a nice compromise, but in truth I almost never use it.

hubol

  • Cutesterest
  • ******
  • Posts: 1135
  • Cutes: 630
    • View Profile
    • hubolhubolhubol
Re: IguaRPG 2 Devlog
« Reply #23 on: October 09, 2023, 08:59:59 PM »
Are you making something cool in Godot? :dancedog:

SquareWheel

  • Administrator
  • Cutester
  • *****
  • Posts: 802
  • Cutes: 139
    • View Profile
Re: IguaRPG 2 Devlog
« Reply #24 on: October 10, 2023, 12:18:10 PM »
Nah I'm not.  I like Godot, and noodle with it every once in a while when I get an idea, but I've not built anything proper.  I'm okay with that though.  It's fun just to tinker with, and I like the node-based design model it presents.

dcco

  • Cutest
  • ****
  • Posts: 469
  • Cutes: 112
    • View Profile
Re: IguaRPG 2 Devlog
« Reply #25 on: October 10, 2023, 09:12:41 PM »
i still prefer programming at a lower-level rather than using an engine - and the biz with unity kinda makes me feel vindicated in that. but godot looks cool, ive thought about picking up an engine to get skills marketable for an actual job (in the job hunt rn) - and godot seems like it would be cool

hubol

  • Cutesterest
  • ******
  • Posts: 1135
  • Cutes: 630
    • View Profile
    • hubolhubolhubol
Re: IguaRPG 2 Devlog
« Reply #26 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 ^_^

SquareWheel

  • Administrator
  • Cutester
  • *****
  • Posts: 802
  • Cutes: 139
    • View Profile
Re: IguaRPG 2 Devlog
« Reply #27 on: November 29, 2023, 06:53:13 AM »
Seems pretty fancy!  I see you've got some cache busting and source map generation.  The rest seems complicated and beyond me, but I'm happy that you're happy.

GitHub Pages has been a little weird since Microsoft took over.  I still use it, but I feel like they've been focusing a lot more on CI/CD stuff and Pages has kind of fallen on the backburner.  Took me a while to even figure out how to enable it on a recent repo I created.

hubol

  • Cutesterest
  • ******
  • Posts: 1135
  • Cutes: 630
    • View Profile
    • hubolhubolhubol
Re: IguaRPG 2 Devlog
« Reply #28 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 :-)

dcco

  • Cutest
  • ****
  • Posts: 469
  • Cutes: 112
    • View Profile
Re: IguaRPG 2 Devlog
« Reply #29 on: December 19, 2023, 07:44:10 AM »
dang a whole npm package - that's pretty hype