Raylib – A simple and easy-to-use library to enjoy video games programming
github.com
github.com
I’ve been trying to fix this. It’s not quite ready for showing, but whatever: https://github.com/shawwn/noh
I used to work on Heroes of Newerth, a dota clone. The parent company (S2 Games) sold it to Garena, who shut it down last year. In other words, there are ~80 unique characters with wonderful animations that no commercial entity cares about. I offer them to you.
The gamble is that no one will care; Garena is a massive entity focused on the bottom line, and they’re based outside of the US.
The main thing I’d like to do is to get together the names of all the artists that made these cool characters and promote their current work. HoN’s main strength was its graphics and fluidity, which even today some prefer over dota. That was thanks to an incredibly talented art team whose office was based in California, and I had the pleasure of watching them work for six months or so before the devs were relocated to Michigan. I miss them, and I should’ve spent more time learning the tricks of their trade.
I’ve been making a converter from the HoN format to collada, so hopefully this can be a drop-in addition to raylib. Then you can make your own games with characters and props from HoN.
EDIT: the author of raylib is here! https://news.ycombinator.com/item?id=36614060
I don't mean to put out a negative comment though, the project does look very cool. It's just a risk.
But that’s the thing. I fell in love with the engine during my time there. And the only reason was thanks to the assets. I didn’t want to make a million bucks, I just wanted to tinker and play with it.
My hope is that fellow tinkerers will find this useful. If nothing else, they can be stub assets till you’re able to swap them out for your own. And they certainly look gorgeous in comparison to most free models. More importantly, it’s a cohesive dataset —- the entire world is built from parts that all have the same style, which is quite hard to cobble together from random assets you find online.
If Garena ever does have an issue, I’m hoping I can get them on the phone and work out a deal. They want money, we make money, there are ways of transferring some money to Garena to make everyone happy. It’s also a way to reboot an otherwise dead franchise. Plus it costs them nothing to wait and see.
But yeah, this is ultimately a labor of love, and I have no idea how it’ll turn out. In the meantime, it’s at least an incredible reference of one way to implement a modern (circa 2011) game engine.
This is not how lawyers work, especially IP lawyers.
Garena being based in Asia also helps quite a lot, since the IP concerns are a bit less. Cross cultural IP wars seem less frequent, and Asian franchises in particular seem a bit less aggressively litigious than English counterparts.
There is a moral aspect to it too. I put a year or so of my life into developing that game. It’s not legally mine to give away, but it’s the only chance the franchise has for survival. So I’ll just be clear about all of the risks (which seem minimal) and everyone can go into it with eyes open.
Shall I tell you about a small Asian franchise owner called Nintendo, or the reason why the most anonymous among the commonly used file sharing networks—Perfect Dark—originates and has most of its users in Japan?
More seriously, there’s (East) Asian and there’s Chinese, and only the latter can be said to uniformly have lax copyright and trademark enforcement.
OK, uh, I’ve tried a bunch of times to put this in terms that wouldn’t imply a whole lot of work, but I couldn’t, so I’ll just ask outright:
Any exploration hints for someone who hasn’t ever delved into a modern engine and has their knowledge limited to the very obsolete stuff in Abrash’s books and the generalities in Nystrom?
I’ve long wanted to explore how game engines are built, but people don’t usually say good things about the internals—if you do here, that sounds like a chance.
You’re exactly my target user. I want to help as many people get into gamedev as possible.
The most important thing is to get the codebase open in an IDE, and building. From there you can place breakpoints and start looking at things.
One trick is to literally just hit the pause button in the debugger while the game is running and see where you end up by looking at the stack frames. I use that all the time to map out new codebases. Then start changing some code and see what happens.
I’m sorry I haven’t been able to get something comprehensive together yet; my wife and I have been in the hospital for the last month, and we have a month to go. But it’s almost over.
EDIT: there’s a dev stream too. Sorry for the quality and the music, but you might be able to glean some useful tricks. Pay close attention to the chapter titles, since it’s a serialization of my thought process as I hunted down a bug: https://youtu.be/VBj0RcpxCIc?t=132
One of the major hurdles is that it needs to generate assets in a way that fits into an overall art pipeline. Each game studio has a unique style, from the naming of bones in a skeleton to the way UVs are laid out on textures. This will be hard to turnkey.
But it doesn’t need to be turnkey. I bet this will supercharge artists long before it’s an automatic solution for gamedevs. So I predict that any artist who heavily invests in this tooling will stand to win handsomely over the next few years.
Here’s an Erdrich horror I made in a few minutes in ZBrush + photoshop AI: https://twitter.com/theshawwn/status/1669106560654614528?s=6... the eye texture is all photoshop AI, which felt remarkable to me even as terrible as it looks.
The other one who might win is a lone wolf gamedev who autogenerates everything. When all your art is autogenerated, you don’t need a style (or an art pipeline). But this is exceptionally difficult to achieve, and I think very few ML people have the gamedev perspective necessary to pull it off.
Luckily, it’s easier than ever to get into ML. So I’m hopeful that gamedevs will jump into ML themselves, as I did, rather than wait for someone else to make it. Invent the future yourself! You really can.
Similarly, you can do a lot of texturing work with just GIMP and a phone camera.
There are plenty of 3D assets available. There's TurboSquid, SketchFab, ArtStation, and the Unity and Unreal asset stores. Some are free, some cost. Everybody is moving to glTF format, and import and export has much improved.
If you want a good hard project to work on, write something that takes an overly-detailed 3D asset, with extensive detail in the 3D model, and turns it into a much smaller game asset where much of the fine detail is represented in the normal map. This has been done, but not all that well. Nobody has done it since machine learning started to work. Since the goal is to have the visual appearance from all directions match, you need a good evaluator for "looks the same to a human".
You have a few options. One is to write an importer based on the code in src/k2/c_model.cpp. Another is to wait a week or so while I get my WIP code pushed.
Do you have any contact info? I’d love to keep in touch with you, because you’re my target user. In fact, you’re the first person to ever want to use this besides me, and it’d be a shame to let you slip away. My email is in my profile, and twitter DM is the most reliable way to reach me quickly: https://www.twitter.com/theshawwn
Thanks for asking — it meant a lot!
I'm the author of raylib, feel free to ask me about it if you want.
Oh, one question, I was hoping to convert a bunch of models to raylib’s format. Right now my exporter goes from Heroes of Newerth format to Collada. What would be the best way to import from there into raylib? (They’re rigged character meshes with 15+ animations for each, so it’s a bit tricky since there’s no universal simple format like obj.)
raylib supports several 3d model formats (obj, gltf/glb, iqm, m3d, vox), I think Blender has exporters for most of them. Note that some formats support must be enabled in raylib/src/config.h file!
I edited in some context — they’re rigged character meshes with animations, so a few formats are unusable here (like obj) since it can’t handle skeletons. Would you guess that iqm is the best one to look into out of the ones you listed? Otherwise I guess I’ll buckle up and look at all of them.
(Kind of sheepish that the only formats I’ve heard of are obj and m3d…)
That's because those got finished and shipped. There are a huge number of hobbyist small game engines that made it to about 80% of useful before the creator got bored. This is the "0.x" curse of open source. In the Rust gamedev world, it's said that there are five games and fifty engines.
In Rust land, if you want to do something that will get used, get behind WGPU, Bevy, and Rend3, and push. It won't be easy, because they've solved the easy problems and are now working on the hard ones. Progress is way too slow.
Not to impose upon you with a technical question, but I have one for you if you're up for it.
I'm working with a very small indie language implemented in C that has bindings to raylib as a "first party" library/language extension. I'm trying to get raygui working with those bindings.
If I bundle raygui.h together with the rest of the raylib bindings library, everything seems to work. But, if I create a separate bindings library for raygui and try to import both libraries in the same program, then raygui functions seg fault immediately when called (valgrind points to, as an example, GuiCheckBox -> DrawRectangle -> rlSetTexture).
I don't know enough about C programming to trace this all the way down (I've only learned what I know by trying to cobble together extensions for this language) but it seems like when raygui is compiled apart from the main raylib bindings library, raygui somehow isn't able to share the OpenGL context created by the main library? That diagnosis might be a completely off-base, but that's what it seems like anyway.
Is this a familiar situation at all that you've seen in any other language with bindings for raylib? Any advice for what I could try to get this working?
I know it's hard to say anything conclusive without looking at actual code, but at the same time I don't want to take up any more than the bare minimum of your time.
My recommendation is to compile raygui together with raylib, afair, the default raylib Makefile includes an option to add ragui module into raylib on compilation.
I'm currently making an isometric pixel art game using SFML [0]. Technically this is not possible since SFML does not use a depth buffer/z value, but I found a way around this.
I still feel limited in SFML in many ways, like being forced to use the color channels to pass custom codes to the GPU for shaders (while still needing to use color)
Is it possible to setup a custom vertex array in raylib? Beyond world pos, texture pos, and color, is it easy to pass additional information to the GPU for customizing assets in the shader?
Most (all?) of the examples I've see are 3D, but I imagine raylib would have no problem handling a 2D game? Or is specifically designed for 3D and 2D is an afterthought/non-existant?
[0] https://twitter.com/YesboxStudios/status/1676924625912045568
I currently use Raylib with Go and the Go bindings[1] to create screensavers for Linux and I'm really happy with the results.
I even use it at work to draw interactive infrastructure diagrams that animate dependencies, allow controlling start-up etc. It's really flexible and simpler than anything else I've found to get stuff on-screen. I love it!
I’ve always been fascinated by generative art.
EDIT: nevermind, bio says he co-founded Etsy... he's probably well known
"Generative Design: Visualize, Program, and Create with JavaScript in p5.js":
http://www.generative-gestaltung.de/2/
Articles by Tyler Hobbs specially the one on "Flow Fields" :
https://tylerxhobbs.com/essays/2020/flow-fields
Articles by Sighack specially the one on "Watercolor Techniques":
https://sighack.com/post/generative-watercolor-in-processing
"Steve's Makerspace" on Youtube:
Check out the full repo and see the projects!
"Tic-Tac-Toe in Fortran with Raylib”: https://www.twitch.tv/videos/1861499073
“Fortran is the Next Rust”: https://www.twitch.tv/videos/1864047709
I'd consider it the Godot equivalent for C programmers.
Also nice that the Raylib bindings are packaged along with the language.
Is this an actual issue or was he just being too judgemental?
I guess it doesn't matter for the matrix operations since they will be probably inlined, but what about the bigger functions?
Would you say it's easier to use than Monogame or equivalent?
libasound2-dev libegl-dev libgl-dev libgl1-mesa-dev libgles-dev libgles1 libglu1-mesa-dev libglvnd-core-dev libglvnd-dev libglx-dev libopengl-dev libpthread-stubs0-dev libx11-dev libxau-dev libxcb1-dev libxcursor-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxrandr-dev libxrender-dev x11proto-dev xorg-sgml-doctools xtrans-dev
Is this really something to be proud of? I thought snake_case was the common way of writing C?
I'm not saying that's bad, and the API seems really nice to work with, it's just a bit odd and against the "common wisdom" on how to design C libraries.
I guess for a game there might not be a lot of need for other libraries, since raylib really does a lot of stuff.
[1]: https://github.com/raysan5/raylib/blob/master/src/raylib.h
There's a couple of 'conventions' to avoid collisions between types and names, one would be PascalCase for types and camelCase for anything else, another is using snake_case for both, but use the _t postfix for types (which is a bit shunned upon because the _t postfix is reserved by POSIX - but not the C standard).