7 ms·
I agree entirely with the author on the limitations of Raylib. I'm currently working on a tower-defense style game that I started in Raylib, but I'm running int
by netule 2y ago
I agree entirely with the author on the limitations of Raylib. I'm currently working on a tower-defense style game that I started in Raylib, but I'm running into many of the same limitations (and more). Things such as toggling fullscreen not working consistently across platforms, not being able to enumerate screen modes, toggling rendering features at runtime, saving compiled shaders etc., etc. Having said that, I appreciate Ray's work on this library and will continue to sponsor him. Raylib is great for quickly banging out a prototype, but not much beyond that unless you're okay with living with severe limitations.
Lesson learned, for sure, but I'm too far into the development to swap all of the Raylib stuff out for SDL (or something else) now.
- rwbt 2y agoRaylib is easy to get started but once the project gets a little complex it bites back. SDL on the other hand takes more time to setup everything but scales extremely well as the project gets bigger and bigger. Also, SDL is exceptionally well written code.
- visil 2y agoAnd an exceptionally well written documentation, too! One of the first big-ish projects of mine was a raytracer I wrote in C with SDL.
- throwaway2046 2y agoGot a link to that raytracer?
- z3phyr 2y agoIt would be like a regular raytracer, but instead of writing pixels to a file, you write them to your buffer/texture.
- sgt 2y agoThis made me want to look at raylib. It comes with some cute examples that run using WebAssembly: https://www.raylib.com/examples.html https://www.raylib.com/examples.html One thing that's always bothered me about Wasm and browser 3d/2d graphics is that I often find minor issues such as scrolling. Look at the example called "Background scrolling & parallax" here: https://www.raylib.com/examples.html https://www.raylib.com/examples.html I've tested on several devices and it's definitely not smooth scrolling, unless there's something wrong with my eyes. How can 2D smooth scrolling not be a solved problem in 2024?
- dekhn 2y agothe answer to your last question is "inner platform effect" and "second system effect".
- modeless 2y agoIn that sample the foreground scrolls perfectly smoothly for me, but the background looks jittery. This indicates to me that it's not a platform issue at all. That sample is just doing something weird with the background.
- sgt 2y agoYes, the background is odd but the foreground is definitely not smooth. I see small little jitters occasionally. At one point I had to wait 15 seconds for it to jitter, though.
- jay_kyburz 2y agoYes the back and foreground is quite jittery for me on Firefox, and I'm almost certain its the browsers own requestAnimationFrame that's the problem. Update: Although, having a closer look at the scene, I see its pixel art, so I bet the author is snapping floating point positions to a pixel point to prevent sub pixel blurring. Another small update: I was sure requestAnimationFrame was locked to 60fps, but I noticed on Chrome the other day it was 144hz, the full speed of my monitor.
- oersted 2y agoQuick appreciation for the detail that Raylib is named after the creator's name Ray and not ray-tracing, fun. Things Unexpectedly Named After People: https://notes.rolandcrosby.com/posts/unexpectedly-eponymous/ https://notes.rolandcrosby.com/posts/unexpectedly-eponymous/
- airstrike 2y agoSuch a good list.. worth a submission of its own IMHO
- WJW 2y agoI wish they'd add French drains.
- oersted 2y agoIt got good traction a couple times before, many more fun examples in the comments. https://news.ycombinator.com/item?id=39462516 https://news.ycombinator.com/item?id=39462516 https://news.ycombinator.com/item?id=23888725 https://news.ycombinator.com/item?id=23888725
- TrainedMonkey 2y agoHow do you know Ray was not named after ray-tracing?
- dymk 2y agoThe author's name is the first hint, and the lack of ray tracing the second
- pests 2y agoIIRC it defines some common words too like all the color names and uses a lot of names that should be prefixed. Good otherwise.
- diath 2y agoAt least they're all-caps, but as somebody that writes C++ and uses Raylib, I just wrapped it in a namespace in my project that I include, like so (note that cstdio must be included before raylib if you're using it from C++): #pragma once #include <cstdio> namespace raylib { #include <raylib.h> }
- vsuperpower2020 2y agoRaylib has a lot of issues that are never going to be fixed, but I wouldn't blame fullscreen on it. Fullscreen is just absolutely unusably FUBARed on windows and has been for decades. It's probably the same for other platforms. The modern strategy is to just do borderless windowed and pretend true fullscreen doesn't exist.
- netule 2y agoTrue, it’s just one of the many issues that came to mind while writing this. My solution to the issue is also full screen borderless combined with resolution scaling.
- spacechild1 2y ago> just do borderless windowed and pretend true fullscreen doesn't exist. Hah, good to know I am not the only one.
- keyle 2y agoI do the same, I do wonder however, if there are performance issue at the OS level, from running (on a 4K screen) 4K borderless vs. 4K fullscreen. Like, the whole giving the application maximum priority would work the same?
- Just_Harry 2y agoWhether there's a performance detriment from borderless-fullscreen vs exclusive-fullscreen depends on how a program presents its frames (and on the OS, of course). On Windows, under ideal circumstances borderless-fullscreen performs identically to exclusive-fullscreen as Windows will let the program skip the compositor and present its frames more-or-less directly to the display. (Under really ideal circumstances the same applies to bordered non-fullscreen windows.) If the compositor can't be skipped, borderless-fullscreen can be a bit brutal on performance: on a 4K 160Hz screen I've experienced an additional 40-milliseconds+ of frame-latency purely from borderless-fullscreen being used. The Special K wiki has some pages that go into more detail about the situation on Windows: https://wiki.special-k.info/SwapChain https://wiki.special-k.info/SwapChain, https://wiki.special-k.info/Presentation_Model https://wiki.special-k.info/Presentation_Model
- diath 2y agoKind of share the same feeling, started a project about 2 months ago and chose to use Raylib, and while the basic stuff is really simple to get going, the more you use it, the more random minor inconveniences you run into, but at this point I've invested too much into this project to back out of using Raylib. My biggest issue with it right now is the font handling and text rendering, I think I'll have to switch from TTF fonts to pre-baked bitmap fonts for it (which will suck for localization later). The biggest two features I'm missing after switching from Love2D is being able to render multi-color text (with Raylib, you have to manually split up the text into chunks based on color markup, then apply width offset, then call the draw function for each chunk, while also taking into account things like linebreaks and such), not to mention that it seems to tank the FPS a lot when you try to draw a lot of text on the screen (perhaps the draw call batching is broken for text?) and being able to easily chop up textures and make them wrap or tile, Raylib used to have tiled texture draw function in the past but for some reason they removed it.
- abnercoimbre 2y agoI'm the organizer for the conference [0] mentioned in TFA. We had a professional UI/UX designer react to ShapeUp [1], and one of the things she commented on was the font being hard to visually parse. I laughed a little when the author yelled "raylib!" to make sure blame was assigned appropriately XD. I'm currently the top GitHub sponsor for raylib, so there's no hate, but I wish he changed some of his defaults. [0] https://handmadecities.com/seattle https://handmadecities.com/seattle [1] https://vimeo.com/887532756/2972a82e55#t=49m58s https://vimeo.com/887532756/2972a82e55#t=49m58s (timestamped)
- edflsafoiewq 2y agoWhy did you switch from Love2D?
- diath 2y agoI need multithreading, async TCP, and have to implement systems that benefit from type safety. Though, I do still use Lua (using sol2), for interface modules, but I miss the features that Love2D provided on the framework level.
- nextaccountic 2y ago> I agree entirely with the author on the limitations of Raylib. Wow this is kind of insane. About this > Raylib doesn’t do basic parameter validation, by design. This function segfaults when dataSize is null: (...) The developer answered this > For most of the raylib functions is up to the user to validate the inputs, if raylib should consider all possible bad-use scenarios it would require reviewing most of the library functions and it will increase source-code complexity.
- kragen 2y agoin c and c++ this is not just normal but almost unavoidable. if your function takes a t* and someone casts a random int to a t* and pass it in, it is gonna segfault. no possible way to validate it, though in theory you could open /proc/self/maps and iterate through it to catch the segfault cases, or install a segfault handler
- lelanthran 2y ago> if your function takes a t* and someone casts a random int to a t* and pass it in, it is gonna segfault. True, that is not something a function ought to defend against. However, the complaint was not about that, though, it was about not checking if the dataSize parameter is NULL. I don't really have a problem with functions that segfault when given NULL pointer parameters as long as this is clearly documented! Sometime, however, you just need to be familiar with enough projects in C that common-sense gets built. In the specified example: unsigned char *LoadFileData(const char *fileName, int *dataSize); I expected that a function that returns an array needs to tell the caller how large that array is. This specific function is not one I would complain about. These things are usually documented in the headers. In this case it says: // Load file data as byte array (read) So, yeah, it's pretty clear to me that the number of bytes has to be returned somewhere, and there's only one parameter called `dataSize`, so this isn't something I consider to be a valid complaint. [EDIT: Escaped pointers, and added last paragraph]
- defrost 2y ago> unsigned char WARNING unpaired | unescaped *'s !! :-) grrr, markup
- deleted 2y ago[deleted]
- jakubtomsu 2y agoI switched from raylib to Sokol some time ago and it's the best. Super simple and single header C code, no dependencies, cross platform code and shaders, etc etc. I've shipped a steam game and I plan to continue using Sokol in the future.
- user432678 2y agoDo you mind sharing a link or game name? Despite all the advice out there picking up a game engine, I too am pursuing a goal of making a game from scratch using simple parts of C++ and SFML for now, but was also looking at SDL and Sokol. What was your experience? Are you a solo dev? Was it worth it?
- wilberton 2y agoNot the parent, but I also use sokol as the base for my engine. I've shipped 3 3d web games with it, and honestly it was the best technical decision I ever made! There's just so much to be said for owning all your dependencies (as far as possible, sokol is still a dependency but it's way more manageable than a 3rd party game engine)
- user432678 2y agoDo you mind to share your games details? No judging, I promise :) I just need examples from people like me and not AAA studios for motivation sake. I literally was called an idiot for not choosing Unity or Unreal, and was turned down for collaboration with non-tech people just for that. Game dev landscape is crazy these days.
- wilberton 2y agoIt totally depends on the type of game you want to make, whether using an existing engine or rolling your own is the best option. This is one of the games I've made with my engine: https://poki.com/en/g/super-tunnel-rush https://poki.com/en/g/super-tunnel-rush My one tip is only make enough of the engine to support the game you're writing, and write the game at the same time as the engine (don't think you need to finish the engine before you can start writing the game, that route doesn't work out well :)