Off Topic
    • Categories
    • Tags
    • Users
    • Groups
    • Amazon
    • OT Fundraiser
    • Register
    • Login

    The OFFICIAL programming thread

    Tech
    22
    1.4k
    10.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JamJ
      Jam @A Former User
      last edited by

      @hog said in The OFFICIAL programming thread:

      Well this will do. I’m not Rockstar Games and I’m not making an AAA title. There’s still some occasional mesh tearing issues but I’ll wait until I have the actual higher-poly game assets before I try and fine-tune it further.

      - YouTube

      I like the:

      “Nail Gumby’s Feet to the Floor”

      version better!

      "laissez les bons temps rouler!"

      1 Reply Last reply Reply Quote 0
      • TazzT
        Tazz
        last edited by

        I’ll stick this here if you’re interested in rewiring a microprocessor.

        “The first chips to use copper interconnects, which were produced in 2000, had 1 kilometer of wiring per square centimeter. Today’s 14-nanometer-node processors contain more than 10 km of copper wiring in the same area, she said.”

        By Katherine Bourzac  /  Feb 17, 2017  /  Semiconductors

        Graphene Could Buttress Next-Gen Computer Chip Wiring

        Graphene Could Buttress Next-Gen Computer Chip Wiring

        Current can literally blow copper interconnects away, but graphene could keep them intact

        GTFO

        ? 1 Reply Last reply Reply Quote 0
        • ?
          A Former User @Tazz
          last edited by A Former User

          @tazz said in The OFFICIAL programming thread:

          I’ll stick this here if you’re interested in rewiring a microprocessor.

          “The first chips to use copper interconnects, which were produced in 2000, had 1 kilometer of wiring per square centimeter. Today’s 14-nanometer-node processors contain more than 10 km of copper wiring in the same area, she said.”

          By Katherine Bourzac  /  Feb 17, 2017  /  Semiconductors

          Graphene Could Buttress Next-Gen Computer Chip Wiring

          Graphene Could Buttress Next-Gen Computer Chip Wiring

          Current can literally blow copper interconnects away, but graphene could keep them intact

          Kind of related: something like 10% of all of the world’s energy consumption is used for computing and that fraction is growing all the time. Apparently half of that energy is consumed (actually wasted) by things like that copper wiring.

          Source: Youtube: Photonics — a light on the computing horizon

          1 Reply Last reply Reply Quote 1
          • KilemallK
            Kilemall Careful, railroad agent
            last edited by

            Photonics is gonna be great.

            https://i.imgur.com/hX2CMMZ.jpg

            Never go full Lithu-
            Twain

            No editing is gonna save you now-
            Wingmann

            http://s3.amazonaws.com/rrpa_photos/72217/DSC_2528.JPG

            http://s3.amazonaws.com/rrpa_photos/20416/PTOB 101_resize.jpg

            1 Reply Last reply Reply Quote 0
            • ?
              A Former User
              last edited by A Former User

              Just had the most frustrating week of coding I’ve ever had getting the below procedural floor plan generation working. It sounds so simple but each room needs to have its own walls and I needed to get the doorways lined up between the different rooms. After I’d rewritten it literally 5 times and still couldn’t get it to work I remember thinking it’s just too difficult. Another couple of rewrites with different approaches got me there though.

              It’s just a rough first cut. There are too many doorways etc etc. But it is satisfying seeing the enemies hit and slide down the walls with the rag doll physics I implemented earlier.

              - YouTube
              StuS 1 Reply Last reply Reply Quote 3
              • Gators1G
                Gators1
                last edited by

                Kinda obvious what your scam is here. You have it create shitloads of rooms and then make players buy grenades through microtransactions.

                alt text

                ? 1 Reply Last reply Reply Quote 2
                • ?
                  A Former User @Gators1
                  last edited by A Former User

                  @gators1 said in The OFFICIAL programming thread:

                  Kinda obvious what your scam is here. You have it create shitloads of rooms and then make players buy grenades through microtransactions.

                  Hmm, this is good stuff. Lemme get a pen and paper.

                  1 Reply Last reply Reply Quote 2
                  • StuS
                    Stu @A Former User
                    last edited by

                    @hog said in The OFFICIAL programming thread:

                    Just had the most frustrating week of coding I’ve ever had getting the below procedural floor plan generation working. It sounds so simple but each room needs to have its own walls and I needed to get the doorways lined up between the different rooms. After I’d rewritten it literally 5 times and still couldn’t get it to work I remember thinking it’s just too difficult. Another couple of rewrites with different approaches got me there though.

                    It’s just a rough first cut. There are too many doorways etc etc. But it is satisfying seeing the enemies hit and slide down the walls with the rag doll physics I implemented earlier.

                    - YouTube

                    Spawncamper…

                    It is easy to do justice - very hard to do right

                    1 Reply Last reply Reply Quote 0
                    • JamJ
                      Jam
                      last edited by

                      It’s time Hog gave eyesight to the victims.

                      "laissez les bons temps rouler!"

                      1 Reply Last reply Reply Quote 0
                      • ?
                        A Former User
                        last edited by A Former User

                        I need to get a reproducible random value for a position in 2d space. If I knew x or y was bound by some number, then I could derive a unique seed for each location by using something like x * max_y + y. Unfortunately, for my application, neither x nor y are bounded.

                        So I thought, okay, I’ll use a 2d noise function, specifically OpenSimplex noise since that’s the one provided by Godot. From experience, I knew that OpenSimplex doesn’t produce cleanly distributed noise values - for example, I’ve never seen it produce a value greater than 0.88. So then I went looking for more information and found this blog that discusses it:

                        nelsonminar  /  Oct 10, 2021

                        Distribution of 2d noise functions

                        Distribution of 2d noise functions

                        So I’ve been using noise functions in my plotter art. One thing to be aware of with noise functions is the output distributions aren’t uniform. I don’t just mean the smooth variat…

                        Their results show OpenSimplex noise producing a bell curve and give some code for correcting it at the bottom of the article. Unfortunately, maybe due to implementation differences, Godot doesn’t reproduce the same nice curve. Instead I pretty much always get something like the below (no matter what seed I used):

                        c56d7da4-2265-429c-be52-71dcd6faaa76-image.png

                        So now I’ve got to work out what equation produces a helmeted viking leaning over a tavern bar so I can correct for it.

                        1 Reply Last reply Reply Quote 2
                        • B
                          Blanks
                          last edited by Blanks

                          Nah I think that’s actually Batman.

                          Hope that helps!

                          1 Reply Last reply Reply Quote 3
                          • ?
                            A Former User
                            last edited by

                            Hmm. I might need to rethink or abandon this. I’ve never used Matlab but I went through the code snippet in the blog line by line and looked up what the functions did in the online help. I’m doing the equivalent now in Godot which is doing linear interpolations on a curve but even with a million sample points in my curve I’m still getting these high points sticking at +/- 0.5 and zero is always low for every seed. (The +/- 1.0 end points are supposed to be low since they cover only half the range of the other columns).

                            1c77a1a7-ea4a-4ceb-9f1e-42d230cdf9c3-image.png

                            1 Reply Last reply Reply Quote 0
                            • ?
                              A Former User
                              last edited by A Former User

                              Actually, nevermind, I fixed it. Godot curves have a “bake” feature where it samples the curve and caches some number of points (100 by default) and so it wasn’t using the full million. I’ve turned that off and am now getting away with a curve with only 16K points and it’s pretty even now (even enough anyway). I’ll experiment further with how much more I can reduce the number of points in the curve.

                              CorrectedOpenSimplex.gif

                              1 Reply Last reply Reply Quote 1
                              • ?
                                A Former User
                                last edited by A Former User

                                I feel like I’m asking for help with my homework here but, anyway, if anyone wants to venture an opinion it will be welcome:

                                I’ve got this code snippet in glsl that takes a vector of two values (e.g. an x and y coordinate pair) and returns a pseudo random number between 0.0 and 1.0.

                                float rand(vec2 co){
                                    return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);
                                }
                                

                                The problem is that I need to pull 4 random values for the same x, y coordinate. I was going to make the second and subsequent call pass back the previous result as both the x,y and values but then any x,y pair that shares the same first result will also have the same subsequent values. I’d like more randomness or differentiation.

                                Edit: actually having written it out, I’ve got an idea. For each additional value I need, I’ll multiply the original vector by the previous random value that’s produced and call it with that.

                                KilemallK 1 Reply Last reply Reply Quote 1
                                • ?
                                  A Former User
                                  last edited by A Former User

                                  Shaders are a pain the arse to debug. Can’t set breakpoints; can’t print debugging values. You have to set a pixel to a color representing a value and and hope you can find it in the output. In any case this will do:

                                  - YouTube

                                  It’s just a background starfield that hopefully won’t be looked at too closely once there is content in the foreground. The four random values I needed were for:

                                  • star color
                                  • size
                                  • random offset x and y values

                                  Doing it in the shader means all of the processing is offloaded to the GPU. Doing it the way that I’ve done it means any given x and y position value will always recreate the exact same stars. If my math is right (and it probably isn’t) it should be able to scroll like that in any direction for billions of years before the pattern ever repeats.

                                  JamJ 1 Reply Last reply Reply Quote 1
                                  • tiggerT
                                    tigger
                                    last edited by

                                    So you are making star citizen and jerraye is making valheim?

                                    ? 1 Reply Last reply Reply Quote 0
                                    • ?
                                      A Former User @tigger
                                      last edited by

                                      @tigger said in The OFFICIAL programming thread:

                                      So you are making star citizen and jerraye is making valheim?

                                      Yep. But I’ll need 400 million in funding before I can continue. Can I interest you in an NFT spaceship?

                                      tiggerT Gators1G 2 Replies Last reply Reply Quote 1
                                      • tiggerT
                                        tigger @A Former User
                                        last edited by

                                        @hog said in The OFFICIAL programming thread:

                                        @tigger said in The OFFICIAL programming thread:

                                        So you are making star citizen and jerraye is making valheim?

                                        Yep. But I’ll need 400 million in funding before I can continue. Can I interest you in an NFT spaceship?

                                        Oooh. Yes. I will be rich! Everyone with NFTs is rich!

                                        1 Reply Last reply Reply Quote 1
                                        • Gators1G
                                          Gators1 @A Former User
                                          last edited by

                                          @hog said in The OFFICIAL programming thread:

                                          @tigger said in The OFFICIAL programming thread:

                                          So you are making star citizen and jerraye is making valheim?

                                          Yep. But I’ll need 400 million in funding before I can continue. Can I interest you in an NFT spaceship?

                                          Please keep working on it. You already seem to be farther along than Chris Roberts.

                                          alt text

                                          1 Reply Last reply Reply Quote 2
                                          • JamJ
                                            Jam @A Former User
                                            last edited by Jam

                                            @hog said in The OFFICIAL programming thread:

                                            Shaders are a pain the arse to debug. Can’t set breakpoints; can’t print debugging values. You have to set a pixel to a color representing a value and and hope you can find it in the output. In any case this will do:

                                            - YouTube

                                            It’s just a background starfield that hopefully won’t be looked at too closely once there is content in the foreground. The four random values I needed were for:

                                            • star color
                                            • size
                                            • random offset x and y values

                                            Doing it in the shader means all of the processing is offloaded to the GPU. Doing it the way that I’ve done it means any given x and y position value will always recreate the exact same stars. If my math is right (and it probably isn’t) it should be able to scroll like that in any direction for billions of years before the pattern ever repeats.

                                            I found a bug!

                                            When I click on “QUIT” in the upper left-hand corner, nothing happens!

                                            "laissez les bons temps rouler!"

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post