• 14 Posts
  • 173 Comments
Joined 1 year ago
cake
Cake day: July 2nd, 2023

help-circle



  • If you only need it for the interface, a shit workaround would be to prefix all text with an RLM (RIGHT-TO-LEFT Mark).

    Unfortunately no, I expect users to enter Arabic text as well.

    Fast iteration is already fixed by using cranelift in your release-dev profile (or whatever you want to call it), and mold as a linker.

    Maybe, I didn’t try that before, but I don’t expect Cranelift to match the speeds gtk-rs is currently giving me; Cranelift also doesn’t solve the problem of rust-analyzer acting crazy.

    Okay, something helpful instead: Did you try asking in the rust:gnome.org matrix room mentioned in the project page?

    No, I prefer public posts to prevent effort duplication, so much so that my mind started filtering out such things on project pages, but thanks for reminding me.


  • Before anyone suggests another library:

    • Iced and Egui both can’t handle Arabic, which is a deal breaker.
    • Iced takes forever to compile and iterate, maybe that’ll be fixed with dynamic linking.
    • Relm: I didn’t know it existed before I started this project.
    • Qt bindings: IDK I forgot Qt existed, I was always more of GNOME* guy.
    • I am already pretty deep into this project, and don’t want to learn something else for now.

    * GNU Network Object something Environment








  • Oh no don’t get me wrong, a year back I upgraded to an I5-7500 prebuilt, and it’s a beast for all my tasks. (maybe compiling is quick because I split modules a little too much?)

    Your advice is good for not knowing what I’m making. If I was making something multi threaded with much state I would fear UB more.

    may be much rarer in Debug because of speed difference

    Thanks, then I will remember to recreate bugs with opt-level = 3.

    Wait no, this doesn’t make sense if I don’t have access to the user’s machine, maybe I should send him a log-heavy version of some sort? How should I even what I am supposed to log? I should think about this some more before release.


  • Do you have any sources about this “unfitness” of Rust for gamedev? From my experience many people have problems with the borrow checker due to habits they obtained coding in other languages.

    I can’t say anything for sure, but I read this article, in conjunction with this article, before I made this post, so you might consider looking at it, and how it influenced me.

    Edit: wait, I’ll extend this reply even more.

    Edit 2: Done:

    So I’d be interested what special behavior occurs in gamedev that makes coding in Rust more difficult than for other software.

    Maybe it’s because the gaming industry is historically among the slowest industries, they stuck with DOS until there was literally no drivers on it for the latest GPUs, only then did they upgrade. There’s a video explaining how a recent AAA game could run on the steam deck, but not on Linux, it turns out the game was using a Windows XP library that’s too old for wine to support, so how did it work on the deck? they effectively added this to their code:

    if platform_name == "steamdeck" { use_modern_library() }
    

    , which explains why it only ran on the deck, but notice how they still stuck to the ~2003 library as the default even though the modern one works, that’s how much they hate change.

    Considering the above, suggesting they change the particular way of their forefathers wouldn’t be fruitful, unless extremely obvious B I G gains are to be found. Notice how Jonathan Blow’s game development language is literally ‘C++ but better’, and how it mimics C++ in everything but the universally hated parts, and adds none but the universally wanted features. (as universal as an industry can agree on anything, that is)

    That may be because games are a dangerous business, you pool all your resources in one project, and you get basically no income for up to four years, then you release and possibly succeed.

    I also speculate that games aren’t really maintained, most of the best games I know only received 3 patches at most (version 1.3). I think the priority isn’t: “How am I gonna remember how this works in 3 months from now and deal with technical dept”, it’s more like: “How can I implement this in a way that the only thing faster than the implementation time is the feature itself?”, so there is no fear of possibly breaking something that the checker can save you from down the road.

    The last sentence kinda doesn’t make sense since the first 3 years are more that enough technical dept for Rust to start doing its thing, but IDK how they think.

    Bonus: look for Jonathan Blow’s opinions on Rust on Youtube, he is an example of a studio owner fearing the risk of the possible “friction” that the Borrow checker could possibly cause.


  • Hello Pers,

    I made a mistake when writing the post, it reads like I am against the borrow checker, which I am not, I love the checker, and didn’t encounter any - major - problems with it.

    I meant that even if we used unsafe everywhere it would still be a good language, which is an attempt at arguing with those saying that Rust isn’t fit for gamedev because the of the checker. Which I failed at due to lack of experience, as this is my first time making a game, and Rust is my first language*.

    Regarding: “If it doesn’t panic in Debug, it won’t act weird on Release”, even if I got reported a really weird bug related to UB, I should (I am not experienced enough to make a claim) be able to know it’s UB since the game’s gonna crash when I try to recreate the bug in Debug.

    Some would say that shipping the game with runtime checks won’t have an effect on performance, which is probably true, since it’s so simple the list of entities is an array (not a vector), and the game state is - effectively - global (everything is impl CombatContext { fn x(&mut self) {} })**, and some (most? too early in development to tell) of the game is locked at 5fps (maybe I’ll bump it up a bit)***.

    I am so concerned about performance because I had to daily drive a computer that most people on this website - and especially on Reddit - would consider garbage E-waste, for 4 years, and was trying hard to play games on it, which was further amplified by my GPU not supporting Vulkan (nor Dx9 for some time), which meant I couldn’t use Proton, which taught me some hacks that are… let’s not talk about them.

    So I find huge pain in leaving any possible performance optimizations, especially that some people I know are stuck on - arguably - worse machines****; accessibility is a big priority.

    It also makes me angry to see pixel games come with 70Mib binaries and require Vulkan because:

    1 - internet costs money

    2 - they claim in the system requirements that their game “Should run on anything”.

    Memes like: “Oh my game could run on a potato” infuriate me (good thing I don’t use social media), NO, your game can’t run a potato, DooM can, it was actually optimized properly, your 2D pixels can’t even render on a machine a 100x more powerful, you should feel ashamed*(5).

    *: I was messing around with C# + Godot not super long ago, nothing serious.

    **: I have been refactoring my code lately to limit the scope of most functions, in a way inspired by ECSs, but significantly more primitive.

    ***: the game has both a 3D and a 2D part, the 2D part has locked FPS, the 3D part can run at any framerate.

    ****: Macroquad supporting OpenGL only down to 2.0ES would be a problem, if I wasn’t intending on forking it anyway to reduce the binary size (grim is an extremely bloated dependency, I managed to shove off 10 Mib in a few hours), and unless using 1.x is as hard people on the internet claim it is, which is probably false, as these people are mostly weak and say the same things about using a custom engine.

    *(5): this might sound toxic, but that’s how people get better.





  • bad hygiene (for olodumarè’s sake, bathe daily, and if possible brush your teeth at least twice a day).

    I know this is popular in this thread, but how to achieve that? I shower 0-3 a day, with 0 being in days waiting for the washing machine for I have showered too much, and have no clothes remaining.

    It seems no matter what I do, someone thinks I accidentally opened a shower on myself by how sweaty wet my underwear is, then proceeds to tell me I smell awful and banishes me from society back to my computer, which is what I would be doing anyway, also that person is the only one that complains and they (singular) can’t handle heat at all.

    I just checked and the temperature goes up to 42*, I don’t know how hot that is, since I never look at weather, if it’s hot I bear with it, if it’s cold I get sick for 3 days bear with it.

    Also I only wear winter-y jackets for some reason (A joke that went too far that’s been lasting for 3 years?), people underestimate how good they are at shading, and they come with a built-in hat, and protect your body better than any T-shirt ever could.

    Wait did I just answer my own question?


  • It’s hard to answer your request because, you see, your statement is like saying: “Everything is just atoms, so everything is basically the same”, it is “reductionist” of higher values, which even atheists have, but the statement itself cannot be denied, nor replaced with an alternative.

    Edit: I read your other replies, and you seem to not need this one, to ignore it.




  • DoodsOPtoBevy@programming.devOpenGL 1.5 support?
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    edit-2
    4 months ago

    Google says you have a Core i7-620M,

    No, I have an I5, it even has a sticker, but my I5-7500 desktop has an I7 sticker, so stickers aren’t reliable. (I have better evidence than the sticker, trust me)

    that’s a Westmere, first-generation Intel HD Graphics, provided everything is configured correctly you should have OpenGL 2.1.

    I rechecked 1-2 days after making the post, and Mesa reported 2.1 & 2.0 ES, which is consistent with techpowerup, that website never failed me even when I failed myself.

    …and, no, you probably really, really don’t want to use OpenGL 1.x. If your implementation supports shaders at all then it’s going to be some vendor-specific non-standard thing. If you want to do anything 3D then 2.0 or 2.1 is the bare reasonable minimum (2.1 gets you PBOs).

    I think shaders are a 3D-only thing? which shouldn’t be useful for an isometric game. My favorite game runs on DirectX 3.0a, so I 1.x should work, I guess?

    Also I will look up PBOs, that acronym looks cool!

    If you’re doing 2D well I don’t think it would be wrong for bevy to have a 2.5D engine that…tightly-timed assembly at that, once upon a time it was considered impossible to get smooth side-scrolling on VGA cards – until Carmack came along…

    about 1-1.5 weeks ago I watched some Johnathan Blow hating on programming paradigms and game engines, and to be honest, I had already been viewing pre-built engines as things that produce games that are… familiar… they lack souls, integer/buffer_overflows, and their physics are too well-made. I understand the benefits of a prebuilt 3D engine; I played a 3D game on DOSBox and saved before every jump - except the ones that got me stuck in a wall, in addition to an indie 3D C++ mess on Itch (it’s the only game I am excited for its release at the moment, as it’s still in beta).

    I also saw an attempt at using SDL as a Bevy renderer-backend on Github, and there were problems according to the README.md, but I had lost interest by then, because…

    After watching much JBlow, I came away with 3 things:

    1- OpenGL isn’t worth learning anymore, but don’t use SDL to abstract yourself from it, use raylib. That’s his opinion, so I decided to build my engine on Macroquad, a raylib-like thing, as using rust-bindgen feels un-ergonomic.

    2- ECSes and other pre-forced paradigms are meaningless, just write the game.

    3- He doesn’t like Rust, which I ignored.

    You might think Rust is a bad choice if I like overflowing things, as Rust is safe, but before you is something I wrote semi-seriously (I say “semi-” so I don’t get laughed at) a day or two ago:

    let mut key = Key::new(500.0, 500.0, 50.0, PINK, unsafe {
            let x = &entities[9] as *const Box<dyn Entity> as *mut Box<dyn Entity>;
            // SAFETY: This is straight up undefined behaviour, I have a solution
            // that is better, simpler and safe, which is seperating the entity list
            // and `GameContext`, but I wanted this to exist in the git history.
            //
            // And before I sleep and forget, the way is passing `&mut door` to
            // `update()` manually, and passing `entities` to `walk`.
            //
            // A `RefCell` wouldn't have complained at runtime anyway.
            #[allow(invalid_reference_casting)]
            &mut *x
        });
    

    As you can see, using anything remotely similar to Arc<Mutex<T>> would get me accused of having skill issues, which is extremely bad considering I am one of those ‘I use NeoVim/Colmack-DH/Rust/Linux BTW’ people, so I prefer extreme measures, AKA just regular-C-code style of writing, so it won’t be long before I meet some REAL undefined behavior.

    If you’re interested in my little project, it’s about a yellow square in rooms of yellow walls, which I planned to write in 3 days, which I finished today, a few hours after Fajr prayer, one week after I set the deadline to 3 days.

    Time to add a 3D turn-based combat system to it for reason, I first need a flat yellow cube, and some doom-like fake-3D enemies.

    In case you’re into the arcane craft of the elders, here’s a book.

    Thanks, I wish to write assembly sometime down the road, and discover these treasures of knowledge.

    Edit: in case you’re wondering how I solved the code problem, I started thinking and realized that I wanted to pass a &mut T to Key.Update(), but I was also holding a &T inside of GameContext, which is impossible in safe Rust, so I changed it hold a &mut T instead.

    They say: “Make it work, then make it right, then make it fast”, but maybe they didn’t mean jumping to unsafe when they said “work”.

    Edit2: I forgot to say something about prebuilt engines. In addition to creating an inconsistency between quality of the engine (physics and UI interactions), and the quality of the game-specific code, they are also very bloated and that’s reflected in binary sizes and the performance penalty of being a general-purpose engine.

    Macroquad is also an offender of this, as a mere cargo add bloats the release binary up to 70 whole Mibs, but I managed to shave off 10 Mibs in a few hours by cloning the repo and “forking” Macroquad and it’s huge math library, grim, and “de-bloating” them, and my game would still compile fine, so there’s much room for optimizing the binary size, as well as performance, since I am low-level enough to implement my own delta time.

    Also I am crazy about performance, which can be traced back to trying to run games on an HP compaq DC 5800 for 4 painful years, whose GPU is even worse than the laptop’s.

    PBO




  • It’s one of those things I tried to tell redditors on the first 2 weeks of the war, and they called me insane.

    Edit: The other things include:

    “Israel is only taking high-precision for the US bombs so they don’t accidentally hit Hamas and hurt the genocide effort”

    And a general sentiment that Israel isn’t cooperating with Hamas, they’re genuinely scared.

    And another sentiment that Hamas aren’t another ISIS funded by foreigners, they’re actual Jihadis.

    Some of these would still get me called insane, actually, even claiming Israel’s committing a genocide would, so whatever.