I’ve finally managed to join this community from kbin, seems we were having federation problems with programming.dev.

So anyway, what sorts of projects are you all using Nim for?

Edit: Post isn’t propagating. Maybe this edit will help?

  • cacheson@kbin.socialOP
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    1 year ago

    Edit: Did you know that if a post or comment fails to propagate, editing it will force a retry?

    Here’s mine: https://github.com/chrisacheson/crnstc

    It’s intended to be a “traditional” (neotraditional?) roguelike with a cyberpunk setting. Both the world and the UI are in 3d, which isn’t something I’ve really seen done before. Usually it’s either one or the other, like CataclysmDDA having a 3d world rendered in 2d slices, or Jupiter Hell having a 2d world with 2.5d graphics. I figured for a cyberpunk setting, being able to visualize the cityscape is important for the feel of it.

    So far it’s very much just in an “early tech demo” state. I’ve implemented basic randomly generated terrain and player movement. I was working on adding line of sight (which gets a lot more complicated in 3d), but ended up getting distracted by the reddit protests and migration to the fediverse. I’ll get back to it eventually.

    If you want to compile it, you’ll actually need Nim 2.0. The .nimble file doesn’t currently reflect that.

    Edit2: Images attached to comments on kbin don’t seem to get copied over to lemmy. Trying this:

    https://media.kbin.social/media/39/15/3915a060e227fd686cc11b5ba77d43d845b4fe904926f98001b751f08314e996.png

  • potatoBoy@programming.dev
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago

    Spending a bit of time cleaning up my libraries and adding features before the new uni semester starts

    Hoping to fix this big bug in my validation library and then publish it to nimble. Also working on a testing framework that has similar API to std/unittest but have better diff printing (since trying to read test failures is a pain at times)

  • insomniac_lemon@kbin.social
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Also on Kbin, I see all posts but the 2 oldest (older Nim version, sortplz).


    Not a project (sorry) but installed Naylib (Nim bindings for Raylib) and am not sure what to do (especially for something that I will continue making content for) to have projects I am motivated to do. Some of the issue is that I want an editor for the boring stuff, though I’ve been thinking about procedural or external assets that might make it bearable. Though not sure if I’ll get the type of setup I’m expecting.

    I mostly want something not based on textures. So polygons, but I’m not sure if I would be better off making(pasting) a basic 2D polygon editor (or only using basic shapes) and possibly integrating it into a tilemap, or if I should go with basic 3D (possibly with some other 3D tilemap editor?) as I expect that to have better support for vertex/face colors. Also I want the game to be maximizable (particularly without bars, that seems more possible with tilemaps or 3D).

    Note that I have lurked with programming for a while, the last thing I did was a simple (92 LoC) game book reader (custom format) with Nim(+Owlkettle) last may. That again was a problem of content.

    EDIT: With Naylib I got a triangle that rotates with the mouse wheel (relevant for an idea I had) but now seeing polygons can’t do collision like squares/circles(?) (which, not directly related but kind of generally not good).

    • insomniac_lemon@kbin.social
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 year ago

      Hey, I created something. It’s like XPM but instead it’s to define polygon vertices in the proper order. I have a text file (first line is number of verts, 0 is origin):

      11
      
             1        
      
      3             9
      
           2   A      
      
             0        
          4     8     
      
             6        
      
      5             7
      
      

      Code and result in attached screenshot.

      I’m not sure how practical it is (rotation, collision, resized-window-friendly placement etc.) or if I’d be better off with something else (that allows vertex colors too? Godot4 would be ideal if the bindings were there, here’s an animated eye I made with Godot4).

      For the format though it might be better if I could have it in the code file (can I have a 16x16-or-bigger matrix?) rather than reading line-by-line. And either way it’d look better with a truly square font (see also Square is a TTF font intended for roguelike games).

      @cacheson

      • cacheson@kbin.socialOP
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Huh, that’s cool. My own experience with this stuff is pretty sparse. I learned a bit of OpenGL 2.0 about 20 years ago, and never quite got to the point of understanding model files. My “models” were just arrays of 3d vertices that I adjusted by hand.

        OpenGL 3.0 and onward are totally different from 2.0, so I had to basically relearn everything. Mostly I used these videos to get caught up, though I didn’t get all that far in. One of them covers Blender OBJ model files, though that may be too heavy for your purposes. Are you just doing 2D? I’m not aware of any formats for that… SVG maybe? Also likely overkill. You might be able to make 2D stuff in Blender, but I’ve never used it.

        • insomniac_lemon@kbin.social
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          7 months ago

          Hey, small update I did end up trying a 3D style with vertex colors (no textures needed).

          Office plant, right is decimated (only somewhat)
          (I have uploaded 2 other images as threads so far, banana+peel and a scene with cartoonish UFOs and a badger+mushroom… also my new avatar)

          I tried it with Naylib but vertex colors don’t render properly. It seems to me like there may have been a Raylib regression unless there’s something wrong or something I need to add to my own code. And that’s using OBJ.

          Godot 3.X could work, but there doesn’t seem to be a way of importing that gives everything a common material aside from manually assigning them to every instance (unless there’s a trick, perhaps mesh library that works without a gridmap, that I’m missing). Though I suspect multiple materials (say if I wanted matte+metal+glass) in one object that might be more difficult to have happen on import. With Naylib I should be able to export models without a material at all, at the very least.

          EDIT: Also if this doesn’t interest you (though it seems like it’s right in-line w/OpenGL) a small thing to add is that it’s neat how Kbin shows the other threads w/the same title as a crosspost. I’m not sure if I noticed it before, but it really works here.

        • insomniac_lemon@kbin.social
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          7 months ago

          I want something that’s: 1. easy-to-create (in-engine+GUI particularly) 2. High-fidelity (scalable+not-resolution-dependent) 3. Low-data
          Interactivity/dynamic stuff (also good aesthetic) is a good bonus. Godot4 has all that (though some of the editors+features could be better) but again, no Nim bindings just quite yet.

          I am not too good with Inkscape (compare my avatar–a quick attempt to mimic polygonal style–to the animated eye example) but the problem with SVG is that in most context it’s rasterized (so a lot more limits and considerations). If there was a tilemap system that live-rendered SVGs, that’d be perfect.

          I’m not chained to 2D, just simpler and thought it might be better to learn (and I do like polygon aesthetic). Not too versed with Blender either*, though I have thought about going that route (simple untextured models) or maybe even a different model program. Same for 2D via 3D models (planes) imported into a 2D engine (Godot allows that, but then you’re losing the benefits of in-engine polygons like animation etc). Godot also has a gridmap and decent+easy visual options (materials+lighting+SDFGI) that could help out with (mostly) textureless models. Though in fairness, I haven’t really looked at Raylib’s 3D capability/options yet.


          To be clear, when I said ‘something else’ I was wondering about other frameworks such as SFML or SDL etc (on Linux) and their (higher-level) polygon capability. OpenGL is way beyond me.

          Other frameworks particularly because what I’ve made isn’t actually specific to Raylib. I could put it in its own file and import+call it, so long as whatever else it is used in will accept a sequence (of vector2 values).

          I might be able to make an editor, too (at least one that functions within the constraints of my format), or at very least a library viewer**. Though I still haven’t made anything game-like yet (admittedly this format is a very similar concept to the gamebook format I mentioned, but a lot simpler “content”) so that puts it in perspective.


          *= have made a few models with it, though disliked the issues with modifiers and often preferred the Maya setup where everything was nodes (not that I can afford Maya, not used it in 10+ years)

          **= like 8 polygons on-screen and you choose what it’s loaded as, and a step up from that would be a tile-map

          • cacheson@kbin.socialOP
            link
            fedilink
            arrow-up
            1
            ·
            1 year ago

            Unfortunately I don’t have much in the way of good advice to give here. My game development experience is mostly limited to the project I posted in this thread, plus a number of ideas that I failed to actually start working on.