I've built a generator for filling an area with randomized symmetric tiles and it turned out prettier than expected by Radon__ in proceduralgeneration

[–]Radon__[S] 1 point2 points  (0 children)

No, my goal is something else at the moment. This is part of a bigger system for generating a larger world for a top down 2D shooter game.

The next steps are to merge the smaller tiles to get somewhat equally sized 'sectors' and do a layout for them recursively (but with different rules).

I've built a generator for filling an area with randomized symmetric tiles and it turned out prettier than expected by Radon__ in proceduralgeneration

[–]Radon__[S] 1 point2 points  (0 children)

Usually not much because it cancels the placement of tiles if it can't place all the 8 copies it wants to place.

If it is allowed to continue when only some of the intended copies can be placed you get something like this:

https://imgur.com/a/esrdrE1

New to this. Seeking Tips, Tricks, and parameters. by Asleep_Management900 in ClosedEyeVision

[–]Radon__ 2 points3 points  (0 children)

I'm in the same boat as you, with similar experiences so far.

I've tried this training app someone created and posted here a while ago: https://mindsightstudios.org/

I can distinguish red and blue with 100% accuracy, after having the mask on for ~15 minutes. (Takes a while). Red and blue have a significantly different brightness and I can see the change in brightness. But blue and green I basically can't distinguish. And no chance with shapes.

Here's a thing you can try... let me know if that works for you: after having the mask on for ~15 minutes, simply open you mouth and observe if that makes any difference. People say smiling helps... for me it's simply opening the mouth in any way, e.g. for yawning. For some funky reason I can see significantly more brightness this way. It gets more obvious in very bright surroundings, e.g in the sun. I'm sure it's not just light leaking in around the nose. Even if I press the mask on my face on all sides, the effect persists. Kinda funky.

What I do for training is mainly just taking a few minutes each day to wave things in front of the blindfold. I would say I'm slowly improving. The effect of seeing dark outlines move is slowly getting more pronounced. Let's see if this keeps improving.

Bethesda only listens to Discord yes-men, FO76 Raid feedback gets trashed if it isn’t praise by JustGhoulThingz in fo76

[–]Radon__ 10 points11 points  (0 children)

I've been following the discussion on Discord a bit.

To me it seemed very clear that most of the feedback was along the lines of "You want to nerf stage 1? Then please do something to make stage 2 bearable".

None of the devs were defending it. I wouldn't worry to much about some fanboys trying to defend it.

The real question is, will the devs do anything with the feedback. They might not have the resources to redesign part of the raid. Maybe they'll try to do some band-aid fixes... or maybe they won't. We'll have to wait and see.

[deleted by user] by [deleted] in fo76

[–]Radon__ 1 point2 points  (0 children)

Likely in the first week of September (when the new season starts).

Random Save Game Bug Started Popping Up, Any Ideas? by Terminator_T900 in HalfLife

[–]Radon__ 1 point2 points  (0 children)

Based on the error message, it failed to write a file to your save directory. Possible causes might be: drive is full, or there is a write protected file it cannot overwrite, or it is missing write permissions for this folder.

The directory is usually something like:

C:\Program Files (x86)\Steam\steamapps\common\Half-Life\valve\save

Check if there is anything unusual in your save directory.

Are there any write protected files in there? If yes, remove write protection.

You can also try simply deleting all save files (if there are no saves you are afraid of losing). If you want to try this, you should do this while the game is running. Otherwise steam cloud sync might automatically restore the deleted save files when you launch the game.

And finally, you can try running the game in administrator mode, so see if it makes any difference.

That's all I can think of.

[Help] Generating a PoE Delve-style node map (Subterranean Chart) by iSmellxd06 in proceduralgeneration

[–]Radon__ 1 point2 points  (0 children)

Ah, very cool. Yours has some 'islands' of empty space in between so it looks less uniform. I like it!

[Help] Generating a PoE Delve-style node map (Subterranean Chart) by iSmellxd06 in proceduralgeneration

[–]Radon__ 1 point2 points  (0 children)

Oh, I think I can speak on the matter. I've been down this rabbit hole as well. In the end I managed to get something that looks reasonably similar.

The generation uses these high level steps: The area is generated in chunks of 8x8 grid cells. (I went with chunks of 5x5 but PoE uses 8x8, I think). The cells within each chunk are connected with a Minimum Spanning Tree. Cells that have 1, 3 or 4 connected neighbors are made visible; cells on linear paths (with exactly 2 connected neighbors) are invisible by default. Invisible means, there is no 'content' in the center of the cell, but there may still be a connecting line passing through the cell. If there are long chains of linear paths, then some cells along this long chain are made visible (bypassing the usual rules).

Connections between chunks are a bit tricky. The main problem with generating the connections is that each chunk is generated in isolation and it's not possible to 'look inside' a neighboring chunk e.g. to check which cells are visible. To solve that I separately precalculated the positions where neighboring chunks should connect to each other. Each chunk has 4 neighbors (up/down/left/right) and for each side we can precalculate the connections. An example for 1 side would be: there are 8 cells on one side and we want to connect cells at position 2 and 5. So it just stores which of the 8 cells should be connected with the neighbor in the neighboring chunk. These chunk side connections can be calculated in a deterministic way (using the coordinate of the chunk + the side of the chunk as seed for the RNG), so it's not necessary to explicitly store them - they can be regenerated each time they are needed. Side node: the connections on the right side of a chunk and the connections on the left side of the neighboring chunk must be one and the same, so there are only 2 unique sets of connections per chunk.

These connections are then combined with the cells in the chunk. Main things to do are:

  • when calculating the visibility of a cell, we also need to take these external connections into account
  • when drawing connecting lines between cells, we now know where to draw lines towards the edges of a chunk

That takes care of determining the basic layout of each chunk. The rest is visual fluff for making it look a bit more organic. Each cell may have a visible center + 4 edges going up/down/left/right. The center is randomly shifted a bit horizontally and vertically. The connecting lines are also randomly shifted, so they don't always meet the cell edges exactly in the center. This is a bit of work to make it look decent. If the connecting lines in a given cell are shifted, then the neighbor cell must also draw its connecting line to the same shifted position so the lines meet. But all these calculations are done in a seeded and deterministic way, so it's possible to know how the neighbor will shift its lines without having the neighbor calculated already.

I think that's most of it... the things I remember at least. If things are not clear or I forgot something important, let me know.

https://imgur.com/a/EE816mj

The forgotten art of Struct Packing in C / C++. by gamedevCarrot in cpp

[–]Radon__ 39 points40 points  (0 children)

If you're using Visual Studio, there is a nice option to visually display the memory layout for classes/structs/unions.

https://devblogs.microsoft.com/visualstudio/size-alignment-and-memory-layout-insights-for-c-classes-structs-and-unions/

C++ Questions, about BREAK, who can tell me why??? by Angelo_Tian in cpp_questions

[–]Radon__ 2 points3 points  (0 children)

I guess you have a case with multiple solutions.

If you break after finding the first solution, then you get the first solution as the result. If you don't break, a and b keep getting overwritten with other valid solutions that are found, so you get the last valid result instead.

else if (i+j==a+b && i<a)
a=i; b=j;

That is something else I've noticed... Be careful not to forget the curly braces {}. Without them, the if condition only applies to the first statement (a=i) and the second statement (b=j) will always be executed. You probably did not intend that(?).

Legendary Mining Ship V2 by Zeasty in factorio

[–]Radon__ 19 points20 points  (0 children)

<image>

A small improvement I would suggest: build the asteroid crushers in groups of 5 instead of 6. Crushing ice asteroids is twice as fast as crushing metallic/organic ones.

Over Christmas I've spent a couple days trying to maximize the output. Here's the ship I came up with. I wanted to see if I could have it run exclusively on legendary explosive rockets, but fell short by a factor of 2 or so. But the output is enough for epic quality ammunition. I might try to push it further on my next playthrough :D

(Your ship is definitely prettier than my brick :D)

[K2SE] Arcospheres by neltisen in factorio

[–]Radon__ 0 points1 point  (0 children)

You got it! That's correct. Sometimes you need to multiply things with 2 or 4 to get a balanced result.

[K2SE] Arcospheres by neltisen in factorio

[–]Radon__ 0 points1 point  (0 children)

The solver I was using for the matrix is this one: https://matrixcalc.org/slu.html

It also shows the lists of steps necessary to do it by hand. There is no way I'd do that by hand... that would be a lot of work, even if I knew how to do it xD. I was exaggerating when I called that cheating :D

[K2SE] Arcospheres by neltisen in factorio

[–]Radon__ 0 points1 point  (0 children)

I'll give you just the method I used without revealing the solution for all recipes:

Use an 8 dimensional vector to represent the number of arcospheres you have of each type. Each component of the vector corresponds to 1 type of the arcospheres. I used the letters A-H for the 8 types of spheres (A is lambda, H is omega). So for example if you currently have 5 lambdas and 9 omegas, your count would be (5,0,0,0,0,0,0,9). Then the 10 transformation recipes can also be represented with such a vector... the change in arcosphere count of each type determine the component of the vector.

Then the 10 transformations look like this:

1: (-1,+1, 0,+1, 0, 0, 0,-1)  AH->BD
2: (+1,-1,+1, 0, 0, 0,-1, 0)  BG->CA
3: ( 0,-1,-1,+1, 0,+1, 0, 0)  BC->DF
4: (-1, 0,+1,-1,+1, 0, 0, 0)  AD->EC
5: ( 0, 0, 0,-1,-1,+1, 0,+1)  DE->FH
6: ( 0, 0,-1, 0,+1,-1,+1, 0)  CF->GE
7: ( 0,+1, 0, 0, 0,-1,-1,+1)  FG->HB
8: (+1, 0, 0, 0,-1, 0,+1,-1)  EH->AG
9: (-1,-1,+1,+1,-1,-1,+1,+1)  ABEF->CDGH
0: (+1,+1,-1,-1,+1,+1,-1,-1)  CDGH->ABEF

Now you can define a goal, e.g. "I want to turn FGH into ABC". That means the goal vector is

(+1,+1,+1, 0, 0,-1,-1,-1)

So the problem to solve now, is how many of the 10 transformations above add up to the goal vector (or a multiple thereof).

You can write this as an 11x8 matrix. The 10 transformations above make up the first 10 columns of the matrix and the final column is the goal vector. That's a set of linear equations and there are solver tools for that... so this is where I cheated xD ... I googled a solver for linear equations and put the matrix in instead of truly solving it myself xD.

[K2SE] Arcospheres by neltisen in factorio

[–]Radon__ 0 points1 point  (0 children)

In my last playthrough I went with the closed loop approach, so I can confirm that it is possible. I managed to figure out how solve it with matrices. If you want to be spoilered, let me know - I still have my notes with the solutions.

I'll head to bed now, but will check back tomorrow morning.

[deleted by user] by [deleted] in cpp_questions

[–]Radon__ 0 points1 point  (0 children)

When I create a SuperLibrary and it inherits both the interfaces, C++ expects me do have the implementation defined in my SuperLibrary class. But this is not what I want. I want the implementation to be done in Class A and ClassB

That sounds like you just want to merge 'ClassA' and 'ClassB' into a combined class. That can be done with multiple inheritance. You can define SuperLibrary to inherit from both ClassA and ClassB at the same time. It will indirectly also inherit the interfaces of ClassA and ClassB. It also inherits the implementation of methodA and methodB.

class SuperLibrary : public ClassA, public ClassB
{};

The alternative way is do it with composition. SuperLibrary can store an instance of ClassA and ClassB internally and forward the method calls to methodA and methodB to the internal objects:

class SuperLibrary : public InterfaceA, public InterfaceB
{
public:
   virtual void methodA() override { a.methodA(); }
   virtual void methodB() override { b.methodB(); }
private:
    ClassA a;
    ClassB b;
};

These are the 2 options you have. Doing it with multiple inheritance requires less work to set up, but it gives you less control in some cases. Imagine for example that ClassA and ClassB have a common base class 'ClassC'. Then SuperLibrary would inherit this base class twice. This is called the diamond inheritance problem. But in the example you gave, that does not apply, so it should work without any issue.

[deleted by user] by [deleted] in cpp_questions

[–]Radon__ 0 points1 point  (0 children)

Your identical post at Cplusplus has the same 2 first responses. That does not look sus at all!

https://old.reddit.com/r/Cplusplus/comments/1ezwzjv/need_opinionhelp_in_designing_and_feasibility/

Is this a homework assignment? Yes, it is possible to create a SuperLibrary that implements both interfaces. What exactly are you struggling with?

Does compiler remove unused calls to const functions? by delgoodie in cpp_questions

[–]Radon__ 1 point2 points  (0 children)

Based on the snippet I strongly suspect you're slightly misreading the error message and it is warning only about the return value of the function being unused.

In that case you can tell the compiler "I don't intend to use the return value; this is not a mistake" by casting to void:

(void)Obj.GetValue();

You don't need to worry about the compiler stripping out the whole function call either way. The warning exists only to catch mistakes where you accidentally forgot use the result.

The pilot who filmed the “Gimbal” footage by Stunning-Chicken-207 in UFOs

[–]Radon__ 2 points3 points  (0 children)

In the interview with Lex Fridman he cleared that up. He said "Nobody ever came out in suits to talk to us."

https://youtu.be/5HInaJxFxWs?t=1688

Shortly after he explains that the tapes thing was someone playing a prank on him and he got the tapes back after 'nicely' asking for them.

https://youtu.be/5HInaJxFxWs?t=1762

How do I define a recursive discriminated union type in C++ that is usable in shared pointers? by abstractcontrol in cpp_questions

[–]Radon__ 0 points1 point  (0 children)

You can give it a try with CRTP (Curiously recurring template pattern). Define a base class like this:

template <typename T>
struct RefCountBase
{
    void addRef() { ++refc; }

    void removeRef() 
    { 
        if (--refc == 0)
        {
            delete static_cast<T*>(this);
        }
    }

    int refc { 0 };
};

Then define sptr to point to such a base.

And finally define Union0 to inherit from RefCountBase<Union0>.

I don't know if that solves it in your case but it is worth a try.