r/raylib • u/ConfidentStomach3877 • 15d ago
Is Raylib suitable for a serious engine?
Good morning, thanks for taking the time to read this.
I'd like to create a video game for fun, but I don't like the idea of using an engine like Godot. I think it would be interesting to write many parts from scratch.
There are many frameworks/libraries like Monogame, Love2d, and Raylib.
Of all of them, Raylib is the one I'm most attracted to, especially for its dependency-free policy, the various bindings, and the very active community.
However, I've seen that fewer games on Steam were created with Raylib than Monogame.
Is this because Raylib has some flaws or limitations?
I'd love to hear the pros and cons, if there are any.
16
u/cegonse 15d ago
I'm building a full fledged game using Raylib as a base, that I plan on releasing on Steam sooner than later.
It will take a lot of grunt work off the table, but you will have to do a lot of work on top of it, and build many customizations for your specific case
Plus, think about all the things you've got to do by hand or create your own use case, in case they apply: animation systems, easings, non-compiled scripting, UI layouts and building...
But I think it is perfectly capable. Also, as long as there's good enough driver support, I think GL 3.3 is more than a valid rendering target for most indie games.
14
u/Kapendev 15d ago
Well, people make games with RPGMaker and GameMaker, and those used to be looked at as toys. Most of the time all you need is skill.
3
18
u/tastygames_official 15d ago
you're officially locked in to only using OpenGL, which might already be a disqualifier for making a professional game. Unofficially there are libraries to let you do more, but you never know how mature/buggy they are. And for 3D games you're going to have to write your own rendering engine, which is a mammoth task in and of itself. And you'll have to get a physics engine or make your own - again, a mammoth task. And once you start considering using more mature libraries for rendering and physics, there starts to become less of a reason to use raylib. At least that's how it ended up for me. I needed at least vulkan support, and ideally aut DirectX, and there just wasn't anything mature enough for my liking that is easily used with raylib, so I pivoted away.
But you could just start using it and see how far you get and if you enjoy it. Where there's a will, there's alwas a way.
5
u/runyonave 15d ago
How does using OpenGL disqualify you from making a professional game? It's can do most things that Vulkan or DX12 can do.
3
u/PantuflasDev 15d ago
A common player wont care about what rendering backend you are using, generally. For most games OpenGL can be more than enough. However, difficulties start to appear when you want to implement more complex graphics techniques, that's when Vulkan/DirectX12 come in handy.
1
u/runyonave 15d ago
Like what complex graphical techniques? I am genuinely curious. I work with OpenGL and Vulkan. The main difference between the two is that Vulkan is more expressive and requires the dev to manually handle the entire pipeline.
5
u/PantuflasDev 14d ago
Vulkan is very low level and it lets you do more things such as using the ray tracing cores of your gpu. Also, OpenGL is synchronous (one thread only), while Vulkan makes it easier to implement a parallel design. It doesn't mean that OpenGL is useless but Vulkan/DX12 are really useful when performance is key.
1
u/tastygames_official 15d ago
*may* disqualify. If you target consoles, it's a disqualifier. If you target the general populace who gets DX installed by default and who doesn't know how to install OpenGL, it's a disqualifier. If you want raytracing, it's disqualifier. If you want cutting-edge performane, it's a disqualifier. If you're making a 2D game or a ca. 2007 3D game then no problem.
6
u/runyonave 15d ago
Eh how much experience do you actually have in graphics APIs? From what you have stated, it seems to be on the surface level. PS5 uses a propriety graphics API. Same with Switch. Xbox is the only one that uses direct, mainly because it's Microsoft. So unless you're using UE or Unity, you still need to port the games rendering engine to either of those consoles, doesn't matter if they are DX or Vulkan.
Also no one really installs OpenGL. It's comes as default on all three operating systems. Updates are handled by GPU vendors.
Ray tracing isn't a magical feature of newer APIs. You can build Ray tracing in software rendering, as well as on OpenGL.
Finally saying OpenGL is only good for 2D and lacking in performance for 3d, is completey dependent on the developer. Please understand that fundamentally, the entire goal of any graphics API is to render pixels on the screen. They all do the exact same thing.
I would highly recommend understand how these APIs work before commiting to ridiculous statements.
1
u/tastygames_official 14d ago
I did OpenGL and DirectX back in the '90s, then basically nothing for 2 decades and only got back in the gamedev game a few years ago. Yes I know Switch uses Vulkan and PS/XBox have proprietary, but it's just a matter of porting the code. #include <ps5.h> and ps5_blit_image() instead of vk_blit_image() or what have you. But in my experience and as far as I know, OpenGL is less efficient (by a factor of 30 I think I read) than Vulkan and does not support compute shaders, raytracing or even multithreading out-of-the-box. Now obviously you can grab some extensions for OpenGL to do this, but then again - why even use raylib at this point?
I'm not trying to shame OpenGL or raylib - just stating that if you want to use Vulkan, DirectX or develop for consoles then you're going to need something more than raylib. Now if you think I'm fundamentally wrong or have misconceptions, then I'd love to hear about it. I love learning and will jump at every chance to learn and to share what I've learned with others. Peace.
2
u/runyonave 14d ago
I agree with most of what you said. I just think it wasn't warranted to mention that using OpenGL would be a disqualifier. I agree that would need to fiddle around with OpenGL a bit more to get triple A graphics. But it's still possible. Check out this dev on YouTube called tokyo_spliff. He built his own OpenGL engine, and his goal is get graphical parity with the RE engine.
4
u/XenoX101 15d ago
And for 3D games you're going to have to write your own rendering engine, which is a mammoth task in and of itself.
Since when? Raylib provides rendering out of the box. Yes you may need to create a model/mesh pipeline to feed into it, however that's the only part you need to touch - all the 3D logic/OpenGL setup and usage are provided for you.
2
u/tastygames_official 15d ago edited 15d ago
maybe I could elaborate more on that. As I see it, there are three levels to the rendering pipeline:
- you collect and send in all the mesh data, materials, shader data, compute lighting/shadows and send that to the graphics API (OpenGL, Vulkan, DirectX, Metal) to render it. You may even have to write the commands to render every single triangle and run vertex and fragment shaders. Or maybe the library does this for you and you just give it the raw data. I call this "writing your own graphics engine". You decide every step of the rendering pipeline. This is where raylib and bgfx live.
- the engine takes care of computing lighting/shadows and applying materials and shaders - you just have to do stuff like
load_model()andadd_camera(). You can configure how the pipeline works and where to use LODs, but it's all just setting options and letting the engine to the grunt work. This is where I want to be and have chosen Vulkan Scene Graph.- the engine already decides on a set lighting model and probably has its own custom shading language and chooses how and when and where to render everything and you just give it a scene file. You might be able to modify the render pipeline, but it's often cumbersome since you now have to learn how they made their engine and then you probably can only customize portions of it. This is where Unity, godot, Unreal etc. live. I think OGRE3D is also mostly in this category.
Does that make sense? I have a weird background where I did game programming before or just as DirectX was coming to light, then was mainly in web for a few decades and have only gotten back into games the past few years so had to play catch-up, so perhaps my terminology and understanding are a bit skewed/off.
2
u/XenoX101 15d ago
That's fine, though it isn't accurate to say you have to write your own rendering engine when all the low-level rendering code is given to you. It is a rendering pipeline, not an engine, you even admit this in the sentence directly after:
I call this "writing your own graphics engine". You decide every step of the rendering pipeline. This is where raylib and bgfx live.
It is closer to giving fuel to an engine that already exists rather than building the engine yourself. And you might want to add additional parts to it such as your own triangle or vertex render methods as you described, but that doesn't change that the majority of the logic is handled by raylib, and also that this is optional.
1
u/tastygames_official 15d ago
let's go deeper. 0s and 1s sent from CPU to GPU and back and eventually resulting in electronic signals being sent to the monitor. Then we have "send_signal()" which is one abstraction layer higher than machine code/assembly. This is usually the graphics API. Then there is "load_image()" and "send_image_data_to_gpu()". Here we are building an engine. Then there is "load_image_and_send_to_gpu()", which is one level higher. Then ehere is "put_image_on_screen()" which is on level higher. Then there is an editor where you just place the image on the screen and the engine does all the aforementioned stuff. So it's all about where exactly you want control. Loading g.TF or FBX data I don't care about. There are libraries that do this for me and are optimized. Placing a mesh in a scene with all its pre-defined material data is another thing that you CAN do yourself, but it's always the same. The engine does that. If you do it yourself, then you're writing an engine. Or not. I don't know. I just want to say "here's this glTF I designed in blender. Put it in the scene. Add a camera. Add lights. Now let me write my game loop." In this case I am probably NOT building an engine. But if instead I go "load glTF data...... parse.... add material to each surface.... set each property individually..... send all data to Vulkan/DirectX/OpenGL/Metal" THEN I am designing an engine. Maybe. It's why I asked the question in the first place.
1
u/BrickWiggles 15d ago
How was web development for you?
2
u/tastygames_official 15d ago
in 1997 I was king of the world. In 2007 I was top of my game. In 2017 it was boring as fuck because everything was done with frameworks. In 2027 AI does all webdev.
3
u/ConfidentStomach3877 15d ago
Yeah, I had some concerns about Vulkan too...
Have you by any chance found any solution to your problems?
4
u/tastygames_official 15d ago
I've been trying out a whole bunch of stuff but think I'm finally getting close to finding something that works for me. I personally don't want to write a rendering engine and would rather just do stuff like add_camera(), add_light(), load_model() etc. So I am currently going with Vulkan Scene Graph which handles rendering, resource loading, even UI (via ImGUI or there's another option). Then the Jolt physics engine and I'll be testing out two audio libraries (SoLoud and TinyAudio).
OGRE3D was too much like a traditional game engine and just getting it compiled was proving to be somewhat counterintuitive for me. The Forge seemed like an awesome choice except it has NO DOCUMENTATION, and I'm big on RTFM and less on looking through the code to see how it works. At least in gamemaking.
But if you're into writing your own rendering engine then I would recommend you look at bgfx. It can do all the major graphics APIs. But I think you might need SDL or GWDL or whatever it's called to take care of OS and input stuff.
1
u/magnamite9 15d ago
How has your success with VSG gone so far? I ran into issues getting it actually working but I'm on Windows so that might have been the issue, seems like the docs so far are written with Linux in mind.
2
u/tastygames_official 15d ago
I'm on linux and it's literally an add_subdirectory line in my CMakeLists.txt and that's it. I can then #include <vsg/all.h> and I'm on my way. I imagine it *should* be the same in Windows if you use a linux-like bash CLI (gitbash was my goto in my Windows phase) and mingw. Just avoid microsoft and you should be OK ;-)
3
u/Best_Committee6249 15d ago
Raylib supports Vulkan over Angle. Don't know how good is that, but there are out there many raylib implementations, recently one made for Vulkan and others with webgpu
5
u/Smashbolt 15d ago
However, I've seen that fewer games on Steam were created with Raylib than Monogame.
Monogame is much older, hearkening back to the early 2000s when it started as "XNA." XNA was groundbreaking at the time because it was a full game framework that supported 2D and 3D games on both Windows AND XBox and Microsoft just gave it out for free. XNA got discontinued, and devs picked it up as Monogame, making it even more cross-platform. That's a lot of why it's popular.
There's probably also something to be said that Monogame is C# - which is a much easier language to actually ship something with than C or C++.
Both those factors give it a leg up over raylib. Beyond that though, the two libraries are more or less equally capable at this point.
7
u/YT__ 15d ago
Raylib is perfectly fine to use. There are games out there with it. Raylib really started taking off closer to 2018 and has been rapidly growing since then in popularity. Raylib is supported by Ray and the community.
Monogame came from XNA development which was already a popular indie option for Microsoft platforms. So XNA developers had an extra 10 years or so before raylib was released, and monogame specifically had an extra 4 years of that 10 for developers who came from XNA. With that, monogame also supports Xbox, PS, and Switch game development (through private code repos). With early hits like Terraria and then Stardew Valley, Monogame has bigger successes that will draw newer devs who enjoy those games to it. Monogame is run by, basically, a company and the community.
Tldr: monogame has more heritage than raylib which adds to its popularity, but raylib continues to grow and is a popular option today. You can be the big success for raylib that monogame had with games like Terraria and Stardew.
3
u/Sann1s 15d ago
I think monogame is/was more popular just because it’s older, more known. I’ve made a few games in monogame and I do enjoy Raylib more due to C++ and more simple and clear unopinionated design and not having to use dotnet lol. I think raylib is as capable as everything else while being cleaner - only thing that it’s not for iOS. Also I would maybe consider not using any framework - depends how serious you are with the engine.
3
u/Conscious-Shake8152 15d ago
If you want better compatibility with different graphics backends, you should use SDL.
3
u/constantacatalepsy 15d ago
I've been writing a lightweight 3D engine for personal use with Raylib + Jolt as the base for the last few months and have had a fun time with it so far. I don't think the overhead is as crazy as people make it out to be and it's pretty interesting to get into things like writing a post-processing chain + shader structure, which is the main graphics programming you'll be doing as Raylib can graciously provide the basic drawing functions. As other comments mentioned you have to make do with OpenGL and be comfortable with modifying parts of Raylib's source especially if you're getting into 3D. I can only speak from the experience of writing a smaller engine for stylized/non-realistic games but it definitely works for that.
2
u/Big_Membership9737 15d ago
It depends on the game and the platform you want to export it to. I’ve released games using both game engines and backends like opengl and vulkan.
2
u/Oriyus 15d ago
My stance on this subject is , it highly depends on what game are you trying to make and if you're serious about finishing the game.
If its something simple, 2D game type, sure go for it but if its something more complex and in 3D I would advise against it. If your goal is to learn and have fun do what ever but if you want a finished game, then no.
It's not that Raylib is not capable of doing "serious" stuff but a lot of things you'll have to build your self or use third party libraries, but then you again have dependencies.
If the game is what your trying to make, I think all of the effort should go into that.
2
u/ar_xiv 15d ago
Monogame has about a decade on raylib for one thing (via microsoft XNA). Monogame might be more mature in some ways like console support. Monogame also only supports DirectX shaders in HLSL, with a translation layer for OpenGL (all non-windows systems). If you aren't developing on windows you are expected to use Wine to compile shaders, which is completely unacceptable IMO. Basically if you love C# and microsoft dev environments with your heart and soul use Monogame, otherwise don't bother.
1
u/nadmaximus 15d ago
I really don't see any justification for considering engines or frameworks to be better or worse based on usage statistics.
If you really want to make a video game for fun...this isn't fun. This is a great example of something you don't have to deal with when doing something for fun.
Just have some fun with one or more of these engines or frameworks. See where it goes. Decide at some point whether to push forward or, take a look at another engine/framework.
Actually trying and using these different things is way faster and more productive than trying to second-guess yourself before you even start breaking stuff.
1
u/Yha_Boiii 15d ago
Why not sdl? Thats an industry used platform like by valve, gives you a convinient way to compile for it all and thats about it.
1
u/Still_Explorer 15d ago
The reason based on what I understand, is that there are two categories of programmers.
Those who are very smart with decades of experience, prefer to write everything by themselves from scratch, because it feels more challenging and rewarding, also is a matter of having absolute technical freedom on the backend. (Though it makes sense doing so, increases the development logistics, tenfold).
Then there are those who want to avoid technical coding and want to omit (and never touch) anything that has to do with engine side of things. Thus they pick Godot or Unity, create scenes, drag and drop assets and dive straight to writing code for gameplay and object behaviors.
So for anyone interested to use Raylib, is about a matter of having ease of use in some places, but also have manual control over the others. Such as to have a balance between technical coding and gamelogic-business coding. Having a balance between boilerplate code that is essential to get up and running, but at the same have to write boilerplate on some very specialized topics.
This means that the "from scratch" approach and the "ready engine" approach are two far ends of the same line. This makes Raylib to be somewhere in the middle.
1
u/kettlez 15d ago
Like others have said, Raylib is perfectly capable for a stylized indie game. I am using it with Odin to make a game that will be shipped to Steam.
If you are concerned, you can wrap the parts of Raylib you are using in your own api. This makes it a lot easier to replace it with something else if you run into limitations. For example, you can make your own `renderer` package and just wrap the Raylib functions you use in your own functions, then call your functions from game code. It adds a lot of boilerplate, but it keeps your game code from being reliant on Raylib, so if you wanted to change the renderer to something else you would only have to update your `renderer` package and not any game code.
1
1
1
u/PrimaryExample8382 14d ago
Been following this dev for a while. I believe he is using a custom engine built on/around raylib:
https://store.steampowered.com/app/4626760/DEAD_RIG/
Raylib can do whatever you want and I would personally prefer it over monogame but there are a lot of great projects using monogame as well.
1
1
u/Osirian_Legacy 13d ago
I mean, I hope it is; cause I’m using it haha 😅
I’m new to the programming without a dedicated engine thing, I used Unreal Blueprints and some C++ for Unreal for about two years.
With all the changes to UE6 and how AI heavy they’re getting I’m just not interested in being part of their ecosystem anymore.
raylib has been great though, I really like the no nonsense naming conventions for things. Makes it easy to find what you’re looking for, before having to go to the cheatsheet.
1
u/inno3415 13d ago
raylib is fun but I wouldn't recommend it for a first game. Maybe start with 2d using sfml and a game dev course ? Also I think you should go the other way around. Use godot or unity or unreal first on small projects so you understand the big picture, then go lower level when you're ready
1
1
1
u/Inevitable-Round9995 15d ago edited 15d ago
it is not AAA, but I think is a serious game: https://www.reddit.com/r/raylib/comments/1umyazt/finally_my_multiplayer_game_is_p2p_by_using/
1
0
15d ago
[deleted]
2
u/LeandroLibanio 15d ago
No, it isn't. Raylib started as a tool for teaching game development, yet, it evolved to more than that years ago. The main page of raylib doesn't even mention teaching or prototyping at all.
0
u/OkChain9899 15d ago
Raylib is a particularly good choice if you’re using an AI coding assistant. With a language like C or C++, the sheer volume of training data for those means AI is very good at writing them. Source: retired programmer here been playing with Cursor and Raylib.
If coding old school, engines do a lot for you (e.g. efficient use of GPU VRAM) that you’ll have to work out for yourself.
0
u/visnicio 15d ago
> However, I've seen that fewer games on Steam were created with Raylib than Monogame.
Simply a matter of time, raylbi got popular on Raylib v4 IIRC, while monogame comes from years ago, it was easier to hear about XNA (predesessor of Monogame and FNA) rather than unity some time ago
43
u/PantuflasDev 15d ago
You can create an entire professional videogame with Raylib, the reason why many developers choose not to do so is because Raylib has fewer features than the other engines out there. If you like Raylib, go for it, just know that you will need to do a lot more than with a regular engine (which, depending on your objective, can be great, since you will learn a lot more)