URI:
        _______               __                   _______
       |   |   |.---.-..----.|  |--..-----..----. |    |  |.-----..--.--.--..-----.
       |       ||  _  ||  __||    < |  -__||   _| |       ||  -__||  |  |  ||__ --|
       |___|___||___._||____||__|__||_____||__|   |__|____||_____||________||_____|
                                                             on Gopher (inofficial)
  HTML Visit Hacker News on the Web
       
       
       COMMENT PAGE FOR:
  HTML   Show HN: Iron-Wolf – Wolfenstein 3D source port in Rust
       
       
        karhuton wrote 6 hours 51 min ago:
        Stein means rock. Wolfenstein is something like Wolf’s rock.
        
        Eisen means Iron. You could name it Wolfeneisen?
       
        Grimblewald wrote 19 hours 21 min ago:
        Oh man for a second i though ironwolf, the vr game, was about to see
        some love.
       
        iberator wrote 20 hours 33 min ago:
        is it faster than original?
        
        Port it to 286, and then claim RUST victory
       
        hamza_q_ wrote 23 hours 34 min ago:
        Cool! I did an incomplete version in Rust a while back as well. Not a
        source port, tried to recreate the game from scratch myself, without
        looking at the C src code
        
  HTML  [1]: https://github.com/hamzaq2000/wolf3d-reimpl-rs
       
        ninkendo wrote 23 hours 45 min ago:
        Was this translated automatically from C? I picked a spot totally at
        random and saw in [1] in place_item_type:
        
            let mut found_info = None;
            for info in &STAT_INFO {
            if info.kind == item_type {
                found_info = Some(info);
                break;
            }
            }
        
        When typically in rust this is just:
        
            let found_info = STAT_INFO.iter().find(|info| info.kind() ==
        item_type);
        
        Now I want to go through and feng shui all the code to look more like
        idiomatic rust just to waste some time on a saturday...
        
  HTML  [1]: https://github.com/Ragnaroek/iron-wolf/blob/main/src/act1.rs
       
          MaulingMonkey wrote 16 hours 44 min ago:
          (equivalent C file: [1] )
          
          > Was this translated automatically from C?
          
          I'll note that when I convert code between languages, I often go out
          of my way to minimize on-the-fly refactoring, instead relying on a
          much more mechanical, 1:1 style.  The result might not be idiomatic
          in the target language, but the bugs tend to be a bit fewer and
          shallower, and it assists with debugging the unfamiliar code when
          there are bugs - careful side-by-side comparison will make the
          mistakes clear even when I don't actually yet grok what the code is
          doing.
          
          That's not to say that the code should be left in such a state
          permanently, but I'll note there's significantly more changes in
          function structure than I'd personally put into an initial C-to-Rust
          rewrite.
          
          The author of this rewrite appears to be taking a different approach,
          understanding the codebase in detail and porting it bit by bit,
          refactoring at least some along the way.  Here's the commit that
          introduced that fn, doesn't look like automatic translation to me:
          
  HTML    [1]: https://github.com/id-Software/wolf3d/blob/master/WOLFSRC/WL...
  HTML    [2]: https://github.com/Ragnaroek/iron-wolf/commit/9014fcd6eb7b10...
       
          ragnaroekX wrote 22 hours 11 min ago:
          Yes, the code is _very, very_ close to the C-Code. All over the
          place.
       
          derwiki wrote 22 hours 49 min ago:
          Sounds like something an LLM agent might be good at?
       
            ragnaroekX wrote 12 hours 4 min ago:
            It probably would.
            But this port was mostly done to understand Wolfenstein 3D in
            detail, not for the source port itself.
            I could have generated big parts of the code. But I would have
            learning by doing that.
       
          klaussilveira wrote 22 hours 56 min ago:
          As a non-Rust guy, I keep writing the example above. I didn't even
          know about the second option!
          
          If you do that, please share a link so I can learn from you! This is
          awesome!
       
            DauntingPear7 wrote 15 hours 23 min ago:
            Look into rust iterators and their associated functions for rust
            specific implementation. Additionally look into functional
            programming à la lambda calculus and Haskell for the extreme end
            of this type of programming if you’d like to learn more about it
       
        hexo wrote 1 day ago:
        again?
       
        yuppiepuppie wrote 1 day ago:
        This is cool! Wolfenstein will always have a place in my heart.
        
        You should add it to
        
  HTML  [1]: https://hnarcade.com
       
        beemboy wrote 1 day ago:
        Sweet memories...
       
        xeonmc wrote 1 day ago:
        Game would be considered too politically incendiary if released today.
       
          legitster wrote 1 day ago:
          Wolfenstein 3D was pretty squarely a WWII fantasy shooter. Only later
          does it get into the alternate history post-war stuff which does get
          somewhat more squarely political.
          
          I think it cuts both ways. The Wolfenstein franchise has obviously
          relished in violence against Nazis, but also inadvertently is part of
          the trend of glorifying them.
       
            TehCorwiz wrote 23 hours 46 min ago:
            The first game has zombies with guns in their chest and a mecha
            hitler.
       
              bombcar wrote 21 hours 0 min ago:
              Someone's not up to date on the History Channel documentaries
              about WWII!
       
          yorwba wrote 1 day ago:
          Or the other way around. Wolfenstein 3D was first banned in Germany
          in 1994, but unbanned in 2018:
          
  HTML    [1]: https://arstechnica.com/gaming/2018/08/german-ratings-board-...
       
        klaussilveira wrote 1 day ago:
        Somewhat related:
        
  HTML  [1]: https://github.com/Henrique194/iron-doom
       
        amelius wrote 1 day ago:
        Wolfenstein is peanuts compared to writing your own doubly linked list.
       
        vunderba wrote 1 day ago:
        Nice job. Couple notes for the web version:
        
        - Once started the shareware game on Chromium browsers seems to flicker
        like crazy which displays the "B.J. Blazkowicz" face.
        
        - You missed adding the classic code that everyone knows, M-L-I!
       
          ragnaroekX wrote 12 hours 6 min ago:
          Flickering is fixed now. It was introduced with the late feature of
          animating BJ face on the start...
       
          midzer wrote 22 hours 47 min ago:
          Can confirm the flicker.
          
          I did a WASM port of the shareware from [1] playable at
          
  HTML    [1]: https://github.com/fabiangreffrath/wolf4sdl
  HTML    [2]: https://midzer.de/wasm/wolfenstein/
       
          Freak_NL wrote 1 day ago:
          The flickering happens in Firefox too.
       
       
   DIR <- back to front page