Live data from Hacker News

Raylib v6.0

github.com

11–20 of 43 posts

Re: Raylib v6.0

#11
post #7
post #5

I'm currently building my roguelike in swift using c-interop with raylib - this brings me so much joy

more info pls.

there is not much to brag about yet :'(

About a year ago I was curious about building an ECS-based game engine with world simulations like in dwarf fortress, but obviously at much smaller scale while playing Starfield. Something cool started to materialise after tinkering so I thought why not turn it into a space-sim roguelike with a simulated living world.

I use swift because it gives me fantastic devex with all its great type inference and macros + raylib gives me cross platform input handling / rendering and window management.

C-interop setup is basically instant - you point compiler to c headers and the API becomes immediately visible on swift side

As for swift ergonomics, I particularly love that I can now write very readable code, like:

> world.addRelation(attacker, Attacks.self, target) > world.addRelation(player, Owns.self, sword)

or

> for (entity, position) in world.query(Position.self).with(Health.self, Velocity.self).without(Enemy.self) {}

Re: Raylib v6.0

#12

do we still need unreal engine and unity? if yes what are the things that raylib is missing that these engines have? beginner gamedev so please take it easy here

Raylib is more of a low level runtime library than an engine. Godot, Unity, Unreal etc. come with very extensive interactive tooling for game creation. Modern engines are really about interactive content editing and collaboration in the development process. This is essentially table stakes for game development in larger teams, and comes with a lot of added internal complexity.

Re: Raylib v6.0

#13

do we still need unreal engine and unity? if yes what are the things that raylib is missing that these engines have? beginner gamedev so please take it easy here

Those engines serve a different purpose than a library like Raylib. They give you a bunch of stuff out of the box like lighting, raytracing (esp Unreal), pathfinding, and a ton of helper functions used in making a game like vector calculations.

Raylib helps you draw stuff, play sound, and do the basics. But you're gonna be writing your own lighting/raytrace/pathfind/etc functions and it's ultimately going to take longer. The upside is if you need to do something very unique, all of the power to mske it reality is in your hands because Raylib isn't opinionated on how your game logic works and how it's packaged up. It's just the delivery guy to give the result to the user.

Re: Raylib v6.0

#14
This is awesome. I don't do any graphics programming and don't really have any Raylib experience (or keep up with the projects developments) but it inspired me to begin learning C this past few months. I started building my own zero dependency software renderer (all it can do is color the background and render a spinning 2d rectangle). I'm really excited to dig into the rlsw source code later today.

Re: Raylib v6.0

#15
post #11
post #7

Earlier quoted context omitted.

more info pls.

there is not much to brag about yet :'( About a year ago I was curious about building an ECS-based game engine with world simulations like in dwarf fortress, but obviously at much smaller scale while playing Starfield. Something cool started to materialise after tinkering so I thought why not turn it into a space-sim roguelike with a simulated living world. I use swift because it gives me fantastic devex with all its…

This sounds cool. You mentioned Swift's macros - would you mind talking a bit how you are using them?

Re: Raylib v6.0

#16
post #15
post #11

Earlier quoted context omitted.

there is not much to brag about yet :'( About a year ago I was curious about building an ECS-based game engine with world simulations like in dwarf fortress, but obviously at much smaller scale while playing Starfield. Something cool started to materialise after tinkering so I thought why not turn it into a space-sim roguelike with a simulated living world. I use swift because it gives me fantastic devex with all its…

This sounds cool. You mentioned Swift's macros - would you mind talking a bit how you are using them?

a lot of cool-looking stuff in my ECS is supported by Swift parameter packs; however, once you start using them a lot you find limits pretty soon.

One example: the following wouldn't compile in swift:

  func query(
    _ body: ((repeat each T), (repeat each K)) -> Void
  ) { ... }
so you kinda work around it with extra type wrappers but this looks ugly - I've been using macros to hide some of the ugliness away xD

edit: the example is oversimplified just to show the point - in this example compiler can't really tell where T ends and K starts, so its logical; but I had more complex cases where a human would've been able to infer types correctly

Re: Raylib v6.0

#17
post #11
post #7

Earlier quoted context omitted.

more info pls.

there is not much to brag about yet :'( About a year ago I was curious about building an ECS-based game engine with world simulations like in dwarf fortress, but obviously at much smaller scale while playing Starfield. Something cool started to materialise after tinkering so I thought why not turn it into a space-sim roguelike with a simulated living world. I use swift because it gives me fantastic devex with all its…

Do you use any bindings or directly use C functions (with a modulemap) in Swift?

Re: Raylib v6.0

#18
post #17
post #11

Earlier quoted context omitted.

there is not much to brag about yet :'( About a year ago I was curious about building an ECS-based game engine with world simulations like in dwarf fortress, but obviously at much smaller scale while playing Starfield. Something cool started to materialise after tinkering so I thought why not turn it into a space-sim roguelike with a simulated living world. I use swift because it gives me fantastic devex with all its…

Do you use any bindings or directly use C functions (with a modulemap) in Swift?

No bindings, I wrote a few wrappers myself to make often used functions a bit more swifty, but otherwise its pretty smooth sailing

Re: Raylib v6.0

#19

do we still need unreal engine and unity? if yes what are the things that raylib is missing that these engines have? beginner gamedev so please take it easy here

I don't know that any open source project will ever compete with Unreal and its high end tech targeting the AAA space. But beyond that, Raylib doesn't give a ton of things an engine does because that is not the point of a library like it. This is to let someone build their own engine how they want, Unreal/Unity/Godot/etc let you give up some control and decision options to skip a ton of work building out a lot of basic features.
Post reply on HN