Journals

kimilil1 week ago2023-11-26 14:53:10 UTC 2 comments
I made this to get my head around the structure of a BSP file and its lumps.
User posted image
Notes:
  • pointer means index to the item in its lump
So basically, the highest level data is the models lump. Its items have pointers into the BSP tree and to the faces that comprise the model. You can safely and completely bypass the BSP traversal by directly retrieving the faces, but that means you're drawing absolutely everything. The world is the first BSP model, and every brush entity is its own BSP model referenced by its index into this lump.

The BSP tree has a lot of academic literature so I'll just skip it.

A face defines a plane, its edges, texture information, and lighting style. There is only a pointer into the lightmap data; the exact shape and size of the data is inferred from the plane, its closest axial orientation, texinfo vectors, and the styles (non-255 value means there's 1 lightstyle of the calculated size, up to 4 lightmaps)
This is just tentative information as of writing. My end goal is to understand enough to be able to completely translate a BSP file into a 3D scene for rendering. I would update this page as I learn things as I go.

References

CaptainQuirk261 week ago2023-11-26 01:12:16 UTC 7 comments
First off, I'd like to say that this is my first journal that I am posting to both TWHL and SoFurry. I'd also like to add the disclaimer that I am not encouraging anybody reading this on TWHL to seek out the SoFurry platform, as that would violate the site's rules. In fact, I'm going to say that if you're not there already, you're not the kind of person who should go there. Anyway, onto the journal.
So I recently started drinking coffee, which is of course much higher caffeine than my previous go-to, Dr. Pepper. Well, last night I drank two coffees and failed to fall asleep at all. It's now five in the afternoon and I'm still not "tired." Which means I see a high likelihood of this becoming a recurring problem...
Why do I keep doing this shit to myself? I'm easily the most self-destructive person I know. I'm going to end up working myself to death, or lazing myself into morbid obesity. I can't find a middle ground in anything. I like to say that I don't think in black and white, but I can't seem to find the gray...
I have a plan3 weeks ago2023-11-13 10:22:44 UTC 3 comments
Hey there,

Finally another journal, and it is of the lighter kind this time around. I have finally got the courage to start moving the information about Deleted Scenes towards the TWHL wiki!

This is pretty big for me as generally I don't feel very comfortable writing things up in the proper, professional way. I feel as if I am not good at structuring things. But, I do understand that this needs to happen eventually, even if it is just one wiki entry a week or a tutorial a month on the weird stuff that Deleted Scenes can do.

I started with the special items in Deleted Scenes, like the "Tools" and the brush entity that is required to use them, that being "trigger_usetool". I hope that I can stick with this for a bit and migrate all the knowledge that I have in my head to a more stable and helpful place, which is in the TWHL entity guides section.

Anyway, that was all I wanted to write about.

See ya later!
Tehcooler4 weeks ago2023-11-05 21:18:51 UTC 3 comments
(I know that it's suppose to be on the 6th of November, but there's a high chance that I'll forgot about it tomorrow, so I'm posting about it now)

I kinda forgot that I have this account until someone on Discord mentioned seeing me in the Shoutbox. So I decided to change up my account a bit so that it isn't looking like it was made by a 5 year old and then I suddenly realized that it's 2 years of me having this account.
So uhhhhhh, happy anniversary or something, idk I don't celebrate things.
Anyways in the mean time, have this picture of a thing I may or may not finish one day. Cya!Anyways in the mean time, have this picture of a thing I may or may not finish one day. Cya!
Loulimi1 month ago2023-11-03 20:58:08 UTC 4 comments
Hi everyone,

Just thought it would be impolite not to share some auto-pro… website you could be interested in!*

With a few (or rather a lot of) months in the making, behold Mapping-Fusion! As you expect the site is centered around GoldSource and Sven Co-op modding. Its aim is very modest, it is just to share our thoughts (Neophus and I) on the mods and maps we play, but also to try to promote and encourage GoldSource mods and modding in the French-speaking community. So far we’ve posted a few tutorials as well as some unbiased reviews of randomly selected maps cough.

Apart from reviews and similar articles, we make sure that anything we create is already present on more widely known websites, so to avoid contributing to the scattering of GoldSource resources.

I’ve also taken some care in implementing microdata. I have the vague hope that at some point, an extensive database of annotated GoldSource resources could really help put some order and help people find what they need as well as new interesting stuff (mods, maps, tutorials…). Not sure how this could materialise though, and it’s obviously a long way from here.

Feel free to share your thoughts! (Either on the website or on anything else if nothing comes to mind)

*: Oh, did I mention, it’s better if you speak, or at least read, French. Here’s a tutorial.
I have updated porting from Linedrawing
I tested with my SDL2 Wrapper = OK It is very fast like Quake 2's or Old Half-Life's Software Rasterizer :)
namespace RasterizerTest;

using DeafMan1983.Interop.SDL2;
using static DeafMan1983.Interop.SDL2.SDL;

unsafe class Program
{
    class Rasterizer
    {
        private uint* m_pixels;
        private int m_w, m_h;

        public void SetFrameBuffer(uint* pixels, int w, int h)
        {
            m_pixels = pixels;
            m_w = w;
            m_h = h;
        }

        // Without SDL_Surface and try to convert from SDL_Color to pixel (uint32)
        private uint ToPixel(SDL_Color color)
        {
            return ((uint)color.b << 16) | ((uint)color.g << 8) | (color.r);
        }

        public void SetPixel(int x, int y, SDL_Color color)
        {
            if (x >= m_w || y >= m_h)
                return;

            m_pixels[y * m_w + x] = ToPixel(color);
        }

        public void SetPixel(float x, float y, SDL_Color color)
        {
            SetPixel((int)x, (int)y, color);
        }

        public void Clear(SDL_Window* window)
        {
            SDL_FreeSurface(SDL_GetWindowSurface(window));
        }

        public void DrawLine(SDL_Color color1, float x1, float y1,
                            SDL_Color color2, float x2, float y2)
        {
            float xdiff = x2 - x1;
            float ydiff = y2 - y1;

            if (xdiff == 0 && ydiff == 0)
            {
                SetPixel(x1, y1, color1);
                return;
            }

            if (MathF.Abs(xdiff) > MathF.Abs(ydiff))
            {
                float xmin, xmax;

                if (x1 < x2)
                {
                    xmin = x1;
                    xmax = x2;
                }
                else
                {
                    xmin = x2;
                    xmax = x1;
                }

                float slope = ydiff / xdiff;
                for (float x = xmin; x <= xmax; x += 1)
                {
                    float y = y1 + ((x - x1) * slope);
                    byte color_r = (byte)(color2.r + (color2.r - color1.r) * ((x - x1) / xdiff));
                    byte color_g = (byte)(color2.g + (color2.g - color1.g) * ((x - x1) / xdiff));
                    byte color_b = (byte)(color2.b + (color2.b - color1.b) * ((x - x1) / xdiff));
                    SDL_Color color = new SDL_Color{r = color_r, g = color_g, b = color_b};
                    SetPixel(x, y, color);
                }
            }
            else
            {
                float ymin, ymax;

                if (y1 < y2)
                {
                    ymin = y1;
                    ymax = y2;
                }
                else
                {
                    ymin = y2;
                    ymax = y1;
                }

                float slope = xdiff / ydiff;
                for (float y = ymin; y <= ymax; y += 1)
                {
                    float x = x1 + ((y - y1) * slope);
                    byte color_r = (byte)(color2.r + (color2.r - color1.r) * ((y - y1) / ydiff));
                    byte color_g = (byte)(color2.g + (color2.g - color1.g) * ((y - y1) / ydiff));
                    byte color_b = (byte)(color2.b + (color2.b - color1.b) * ((y - y1) / ydiff));
                    SDL_Color color = new SDL_Color{r = color_r, g = color_g, b = color_b};
                    SetPixel(x, y, color);
                }
            }
        }
    }

    const int width = 640;
    const int height = 480;

    static int Main(string[] args)
    {
        SDL_Init(SDL_INIT_VIDEO);

        SDL_Window* window = SDL_CreateWindow(null, (int)SDL_WINDOWPOS_CENTERED, (int)SDL_WINDOWPOS_CENTERED, width, height, (uint)SDL_WindowFlags.SDL_WINDOW_SHOWN);
        SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, (uint)SDL_RendererFlags.SDL_RENDERER_SOFTWARE);
        SDL_Texture* texture = SDL_CreateTexture(renderer, (uint)SDL_PixelFormatEnum.SDL_PIXELFORMAT_RGBA32, (int)SDL_TextureAccess.SDL_TEXTUREACCESS_STREAMING, width, height);

        Rasterizer rast = new();
        float r = 0.0f;

        while(true)
        {
            SDL_Event evt;
            SDL_PollEvent(&evt);
            if (evt.type == (uint)SDL_EventType.SDL_QUIT)
            {
                break;
            }

            if (evt.type == (uint)SDL_EventType.SDL_KEYDOWN)
            {
                if (evt.key.keysym.sym == SDL_KeyCode.SDLK_ESCAPE)
                {
                    break;
                }
            }

            uint* pixels;
            int pitch;

            if (SDL_LockTexture(texture, null, (void**)&pixels, &pitch) != 0)
                return -1;

            rast.SetFrameBuffer(pixels, width, height);
            rast.Clear(window);

            float size = 120;
            float x1 = (float)((width / 2) + MathF.Cos(r - MathF.PI / 6.0f) * size);
            float y1 = (float)((height / 2) + MathF.Sin(r - MathF.PI / 6.0f) * size);
            float x2 = (float)((width / 2) + MathF.Cos(r + MathF.PI / 2.0f) * size);
            float y2 = (float)((height / 2) + MathF.Sin(r + MathF.PI / 2.0f) * size);
            float x3 = (float)((width / 2) + MathF.Cos(r + MathF.PI + MathF.PI / 6.0f) * size);
            float y3 = (float)((height / 2) + MathF.Sin(r + MathF.PI + MathF.PI / 6.0f) * size);

            SDL_Color color1 = new SDL_Color { r = 255, g = 0, b = 0};
            SDL_Color color2 = new SDL_Color { r = 0, g = 255, b = 0};
            SDL_Color color3 = new SDL_Color { r = 0, g = 0, b = 255};

            rast.DrawLine(color1, x1, y1, color2, x2, y2);
            rast.DrawLine(color2, x2, y2, color3, x3, y3);
            rast.DrawLine(color3, x3, y3, color1, x1, y1);

            SDL_UnlockTexture(texture);
            if (SDL_RenderClear(renderer) != 0)
                return -1;

            if (SDL_RenderCopy(renderer, texture, null, null) != 0)
                return -1;

            SDL_RenderPresent(renderer);
        }

        SDL_DestroyTexture(texture);
        SDL_DestroyRenderer(renderer);
        SDL_DestroyWindow(window);
        SDL_Quit();

        return 0;
    }
}
Result:
User posted image
Enjoy and happy coding on C#!
EDIT: We did it! Scroll to the bottom to for the final result!
We're two Mappers who haven't released a map for a while and have left many of projects to collect dust, especially our joint projects. Though we have learned a lot from our failures, we still have a lot to learn from successes too, and that is why we're here today.

Oxofemple and I, Chimz, have decided to bring to you a new Sven Co-op map in just 2 weeks! That's right, just 2 weeks.

Why are we telling you this? Well that's because we're counting on you! Not for support and having an audience (though we would appreciate it) but we're asking you to hold us accountable!

We have started work on our project today and are scheduled to release our map on the 10th of November. There will be no delays, no date changes or anything. Come hell or high water, we will release our map in whatever state that is, and to keep our dignity we will do our best with what little time we have and release it.

If we miss our mark, well then, we're asking you to yell at us until we release it in whatever state it is.

So tell us, can we count on you?
Hello everyone,

I made SDL2 wrapper with sbyte*, delegate* < ... > and pass-thought.

Add package DeafMan1983.Interop.SDL2 and DeafMan1983.Conversion into your project!
dotnet add package DeafMan1983.Interop.SDL2
dotnet add package DeafMan1983.Conversion
And open code ( Visual Studio Code )
Add lines in your <project>.csproj
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PublishAOT>true</PublishAOT>
<StripSymbols>true</StripSymbols>
Open your Program.cs
namespace YourGame;

using static DeafMan1983.Conversion;

using DeafMan1983.Interop.SDL2;
using static DeafMan1983.Interop.SDL2.SDL;

unsafe class Program
{
    private SDL_Window* window;
    private SDL_Renderer* renderer;
    private SDL_Event evt;

    // Add init main(int, sbyte**)
}
And why do I add manual function like in C/C++ because somebody understands better.
public int main(int argc, sbyte** argv)
{
    if (SDL_Init(SDL_INIT_EVERYTHING) != 0)
    {
        Console.WriteLine("Error: SDL initializing. {0}.\n", StringFromSBytePointer(SDL_GetError()));
        return -1;
    }

    Console.WriteLine("Woohoo! SDL2 initializes.\n");

    window = SDL_CreateWindow(SBytePointerFromString("Hello SDL2"), (int)SDL_WINDOWPOS_CENTERED, (int)SDL_WINDOWPOS_CENTERED, 600, 400, (uint)SDL_WindowFlags.SDL_WINDOW_SHOWN | (uint)SDL_WindowFlags.SDL_WINDOW_OPENGL);
    if (window == null)
    {
        Console.WriteLine("Error: Creating SDL_Window {0}.\n", StringFromSBytePointer(SDL_GetError()));
        return -1;
    }

    renderer = SDL_CreateRenderer(window, -1, (uint)SDL_RendererFlags.SDL_RENDERER_SOFTWARE);
    if (renderer == null)
    {
        Console.WriteLine("Error: Creating SDL_Renderer {0}.\n", StringFromSBytePointer(SDL_GetError()));
        return -1;
    }

    while (true)
    {
        /*
            WARNING: You need add fixed statement = It works fine :D
        */
        fixed (SDL_Event* evtptrs = &evt)
        {
            if (SDL_PollEvent(evtptrs) > 0)
            {
                if (evt.type == (uint)SDL_EventType.SDL_QUIT)
                {
                    Console.WriteLine("Click with frame window!\n");
                    break;
                }

                if (evt.type == (uint)SDL_EventType.SDL_KEYDOWN)
                {
                    if (evt.key.keysym.sym == SDL_KeyCode.SDLK_ESCAPE)
                    {
                        Console.WriteLine("Press key Escape!\n");
                        break;
                    }
                }
            }
        }

        SDL_SetRenderDrawColor(renderer, 255, 255 /3, 0, 255);
        SDL_RenderClear(renderer);
        SDL_RenderPresent(renderer);
    }

    SDL_DestroyRenderer(renderer);
    SDL_DestroyWindow(window);
    SDL_Quit();
    return 0;
}

// static int Main(string[] args)
We add end of static Main function for C#.
static int Main(string[] args)
{
    // Reforce with default main function into static int Main() for C#
    Program game = new();
    return game.main(args.Length, SByteDoublePointersFromStringArray(args));
}
Compile and check:
User posted image
And try to use native executable:
dotnet publish -c Release -r <rid> --self-contained=true

Result:
User posted image
That is all. It works better than Ethan Lee's SDL-CS because SDL-CS has related class Marshal. If you use then native executable will throws errors cause Marshal doesn't support for native aot. I have proof. I am very excited to release OpenGL's Binding but it works in process....
User posted image
And Evergine's OpenGL's Binding has also related class Marshal.

I am very excited to release soon with OpenGL's Binding for DeafMan1983.Interop.GLFW3, DeafMan1983.Interop.SDL2 and X11'S GL ( glx ) and other desktop environments

Thank you for allowing my upgrade for Net6.x or greater.
PS: It works as well on Dotnet 8.0 too
UrbaNebula1 month ago2023-10-18 15:05:42 UTC 8 comments
Track No. 4
User posted image
Stojke1 month ago2023-10-15 22:03:46 UTC 2 comments
What the hell
User posted image
Suparsonik2 months ago2023-10-04 06:13:07 UTC 5 comments
For US residents: What kinda zombies do you think we'll turn into later today after the announcement test? I'm hoping I'll be a Return of the Living Dead style zombie. That'd be so cool!!
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Also it just so happens to be my birthday.
CaptainQuirk262 months ago2023-09-08 07:45:48 UTC 10 comments
There are quite a few people on this website who use these journals as a way of venting their problems, as well as getting some support from the community. I myself have done this on a small scale... Sorry for keeping this entry to that same convention.

I've been having full-blown existential crises on a weekly basis, sometimes more often. Usually, these happen around midnight (guess when I'm writing this), as for some reason it's when I'm desperately trying to sleep that I do the most thinking. This isn't always a bad thing. Many of my best ideas have come to me during the 2:00 AM caffeine overdose. But so have most of my mental health issues. I can't seem to figure out who I am, really. Over the years, I've built up a facade of sorts that has changed with the political climate, so as to shield myself as effectively as possible. This has been ongoing for so long that it's basically replaced my personality. I don't know who I am outside of my own self-deception, and that is terrifying. Furthermore, I identify as a furry, and I believe I am, but I seem to be more... hardcore (if that's the right word) about it than the rest of the fandom. I truly feel like I should not be what I am, even though there is no existing alternative. I actually care about the politics of the situation, as opposed to the rest of the fandom, which doesn't even seem to care that there is a group of literal domestic terrorists directly and personally opposing them. I mean, are they okay with continuing to be the bottom of the barrel? I soon came to realize that hate can never be dispelled, not completely. Only moved from target to target in the name of "progress." And not seeing this, we think it really is progress. I suppose it's better than letting it stagnate upon one target though. That's when it is allowed to grow.

I recently met a Therian (my brain always thinks theremin first, even though that is not the right word), and they helped put some of this into perspective for me, a little bit at least. I didn't have a very good understanding of what Therians were prior to that, and although the person I talked to seemed to be having a hard time explaining it, from what I can tell, I think I'm something of a mix. I hold some interests related to the furry fandom, and in other ways, I'm more like a Therian. Something of an undecied middle ground.

I'm used to being a shade of gray. I suppose I find some comfort in not being a perfect fit for a hole, because it at least means I'll be unique enough to stand out (I mean, I have a fox fursona who's not a femboy, and I'm still an interesting person!) But in being different in ways nobody talks about, I have no reference point. How am I supposed to know if I'm a one-in-a-million, or if I'm part of a silent majority, if it's silent? Nobody talks about this stuff, whether because there's some social stigma about it or if it's just boring to many people. I mean, I have many issues. I put some forward, and I keep others close to my chest. Like, for instance, how many of yall knew that I'm autistic? My deviancy isn't news to anyone, but my neurodivergency is. And when it's the high-functioning autism like I have, you can rarely ever tell. I never realized how common it really is until me and two friends were sitting in the same group in math class a year ago, and we realized that we all had it (someone overheard this, and it became the autism table. We leaned into it). Considering my neurodivergency, I have even less to compare myself too, because I can't even assume that basic human psychology always applies. Often it does, but sometimes it doesn't. I'm basically just floating in a void.

Sounds fun to think about constantly, huh? I'm probably not gonna get any more than about two or three hours of sleep tonight, because my alarm goes off at 6:30 and I'm still caffienated. Ugh.
Meerjel012 months ago2023-09-05 18:05:59 UTC 0 comments
Lei Shi3 months ago2023-08-28 06:14:18 UTC 9 comments
User posted image
找工作有点难……
I just want to point out that although it wasn't Half-Life 3, Half-Life: Alyx released in 2020, only two years prior to my outlandish estimation.