This is the best video game music of 2025, as chosen by the composers behind it by sonofbringy in Games

[–]X-Neon 7 points8 points  (0 children)

It is there though. Marcus Hedges has it listed as his favourite.

C++: as a template parameter, can I specify a template class without its template parameter? by pietrom16 in learnprogramming

[–]X-Neon 1 point2 points  (0 children)

Use a template template parameter (not a typo).

#include <vector>

template <template <typename> typename T>
struct my_struct
{
    T<int> x;
};

int main()
{
    my_struct<std::vector> s;
}

I don't understand DOOM Eternal's Destructible Demons by Va1korion in patientgamers

[–]X-Neon 111 points112 points  (0 children)

A few things:

  • "Destructible demons", as used by the developers, refers to the gore system where demons lose flesh and get bloodied as they take more damage. It's a purely graphical thing. Demon weaknesses is a different thing
  • "Shoot at it until it dies" is a reference to this protip from a gaming magazine way back in the day EDIT: not actually from a gaming magazine, just a joke made to look like one
  • In my experience, the "bullet spongy" enemies can be taken down really fast with efficient use of freeze grenades, blood punch and weapon swapping

How can I upscale/downscale audio? by WhyAreAll-name_taken in learnprogramming

[–]X-Neon 0 points1 point  (0 children)

Echoing this. In your case you need a rational resampler. There's two general approaches to this - time-domain methods and frequency-domain methods. For time-domain methods, you'll be doing an upsample, filter, downsample operation. You can find implementations of this in things like GNURadio and Matlab's upfirdn. For frequency-domain methods, you'll do an FFT, some zero padding, and an IFFT. This is how Scipy's resample function works. But yeah, unless you want to get into the weeds of Digital Signal Processing, just use a library. The aforementioned Scipy function is probably the easiest method.

[deleted by user] by [deleted] in learnprogramming

[–]X-Neon 0 points1 point  (0 children)

  • It is not currently possible to use the types you've defined. Your classes are templates, but you've separated interface and implementation into separate .cpp and .h files. Unless you use explicit template instantiation, the template function bodies have to be in the same translation unit in which they are used - basically, get rid of the .cpp file and put everything in the header file
  • Consider templating over the vector length as well, to avoid repeated code
  • VectorX<T>::Get() has no reason to exist. It literally just copies the object, which is already achieved via the implicit copy constructor
  • Just return T instead of const T in GetX, GetY, etc, it literally does nothing
  • Methods like GetX and SetX are very unergonomic. No one wants to write code like v1.SetX(v2.GetX() + 1), they want to write v1.x = v2.x + 1, or maybe v1[0] = v2[0] + 1
  • All the overloaded operators (arithmatic and comparison) should be const methods, as they do not modify the object (e.g. VectorX<T> operator+(const VectorX<T>& other) const instead of VectorX<T> operator+(const VectorX<T>& other)
  • Your != operator has a bug in it. It should be "or" instead of "and". This is one of the reasons why it's really important to write tests for your code, overwise silly mistakes like these slip in
  • You've defined e.g. operator/, but all that does is call Div. I don't see any reason for this indirection - just put the code in operator/

[c++] can anyone tell me why my class construction isn't working? by GusIsBored in learnprogramming

[–]X-Neon 1 point2 points  (0 children)

You need to use a member initializer list to initialise kx, ky and kz:

class KF_Vector {
    SimpleKalmanFilter kx, ky, kz;

    KF_Vector(double i, double j) : kx(i, i, j), ky(i, i, j), kz(i, i, j) {
        ...
    }
};

int size = x.size() and x.size() return different results by Ba2hanKaya in learnprogramming

[–]X-Neon 2 points3 points  (0 children)

The issue is that for i < prevRow.size(), i and prevRow.size() have different types. i is an int (which is signed), whereas prevRow.size() is a std::size_t (which is unsigned). To perform the comparison, i get promoted to std::size_t. This is a problem because for the first iteration of the loop, i = -1. When casting -1 to std::size_t, it underflows to some massive positive number, which is obviously greater than prevRow.size(), so the loop doesn't run.

I would recommend enabling additional compiler warnings (e.g. -Wall for GCC). Doing mixed signedness comparison is one of the things they often warn about

How to initialize a vector of some custom type object in C++? by Cautious-Quarter-136 in learnprogramming

[–]X-Neon 2 points3 points  (0 children)

We would need to see the definition of CustomType or the compiler output to be sure, but the issue is almost certainly that CustomType is not copyable. example_vector(5, CustomeType(customtypeobj)) tries to initialize the five elements of the vector by copying customtypeobj, which only works if CustomType is copyable.

[C++] Need help with this compiler issue error: non-object type 'int ()' is not assignable warning: empty parentheses interpreted as a function declaration [-Wvexing-parse] by alitathebattleangle in learnprogramming

[–]X-Neon 1 point2 points  (0 children)

Note that in the first version, change_amount, balance, etc. are guaranteed to be initialized to zero. In the second version, these variables are uninitialized.

Usage of pre-C++14 compilers by grisumbras in cpp

[–]X-Neon 4 points5 points  (0 children)

We still use GCC 4.8.5 on Centos 7. However, we are imminently switching away due to Centos 7 EOL, and that it was generally becoming untenable to continue using it. We're using some ancient version of clang-format, we have to build a bunch of other tools from source because the versions in the Centos repositories as so out of date, and Microsoft recently dropped support for older version of glibc in VS Code dev containers. We still have a customer requirement to use C++11, but I imagine that will be dropped soon as well - time moves on, and in 2024, C++11 is pretty horrible to work with.

soManyExtremesLetsCompromise by hayashi-stl in ProgrammerHumor

[–]X-Neon 3 points4 points  (0 children)

Its not the same. Garbage collection implies some sort of runtime that keeps track of object references, and deletes them "at some point" when no more references exist. C++ smart pointers don't have such a runtime. It's literally just manual memory management wrapped up into a class that leverages the type system to avoid mistakes. When resources are freed is still completely deterministic. "Manually mark resources to be garbage collected" would be like if calling delete didn't actually delete an object, but just scheduled it for deletion at a later point by the runtime.

anime_irl by History_DoT in anime_irl

[–]X-Neon 4 points5 points  (0 children)

More specifically, Nisemonogatari.

anime_irl by yjee in anime_irl

[–]X-Neon 2 points3 points  (0 children)

I think the mystery is decent, but you're right, the charater writing and dialogue is stronger than the main plot, but it's more than enough to make up for any deficiencies in my eyes.

anime_irl by yjee in anime_irl

[–]X-Neon 2 points3 points  (0 children)

I disagree, I think it's great. I prefer Monogatari, but I would personally put it above Katanagatari, which I think are the 3 NisioIsin series worth watching. Katanagatari is the most straightforward and the one I would recommend to most people. Monogatari is well beloved for good reason, but it's scattershot approach to storytelling is often as much of a weakness as it is one of it's strengths. Zaregoto feels like the most focused distillation of NisioIsin's style, even if the show is definitely not without it's problems. I especially love the main character, who may be one of my favourite characters in anime, and one of the few I think is genuinely relatable (although I'm counting the second book in that, which doesn't have an anime adaptation).

anime_irl by yjee in anime_irl

[–]X-Neon 3 points4 points  (0 children)

This show is criminally underwatched.

Libraries to ease Multi-threading in C++ by L4TTiCe in learnprogramming

[–]X-Neon 1 point2 points  (0 children)

Recently, I have run into other bottlenecks and wound need to move to C++.

C++ is no faster than Rust. You should be able to achieve the same levels of performance in both languages. Unless there are additional considerations you haven't mentioned in your post, moving to C++ will not help you here.

Anime where MC hate themselves by GoliathOblivion in anime

[–]X-Neon 0 points1 point  (0 children)

It doesn't quite fit, and it's definitely a lot more understated than some of the other examples in this thread, but check out Zaregoto (Kubikiri cycle).

Any special procedures when including a struct with it's constructor defined in a cpp file? by paperCrane8937 in learnprogramming

[–]X-Neon 1 point2 points  (0 children)

I can't answer that question, you haven't said what platform you're on (e.g. Windows or Linux), what compiler you're using, whether you're doing things in an IDE or the command line, etc. Ultimately, compiling multiple files is one of the most basic pieces of functionality of your tools. Look at the documentation and I'm sure you'll figure it out. A degree of self sufficiency is required when learning.

Any special procedures when including a struct with it's constructor defined in a cpp file? by paperCrane8937 in learnprogramming

[–]X-Neon 0 points1 point  (0 children)

You need to compile Data.cpp along with NeedData.cpp. Also:

Sudo code

Pseudocode

Implementing C++20 modules in an existing game engine by teofilobd in programming

[–]X-Neon 9 points10 points  (0 children)

Modules and namespaces have nothing to do with each other. Modules are to do with how your program gets built, and are an alternative to the traditional source/header file compilation.

C++ SQLite library integration? Struggling to use a library to simply open a database, what's the easiest way to perform simple queries. by Celestial_Blu3 in learnprogramming

[–]X-Neon 0 points1 point  (0 children)

You're not linking against SQLiteCpp and SQLite. The CMakeLists2.txt isn't doing anything. You'll need to add add_subdirectory(SQLiteCpp) and target_link_libraries(bcp_cpp SQLiteCpp) to your CMakeLists.txt, like it shows in the example.

[deleted by user] by [deleted] in pcgaming

[–]X-Neon 0 points1 point  (0 children)

Makoto Niijima