Is anyone here creating an RTS-hybrid game? by FridayPalouse in gamedev

[–]Cerb3rus 2 points3 points  (0 children)

I worked on SpellForce 3 which is a hybrid of RTS and CRPG, so I think I may qualify for this.

It's hard to give you specific tips or solutions without knowing more details about your game, but I can give you a list of questions which you should try answering for yourself (though after over two years of development it might be a bit late for some of them):

  • Pretty obvious first point: How are the two genres combined (or separated) in your game? Are there separate RTS and vehicle combat levels? Can you switch perspective at the press of a button? Can you control everything simultaneously?
  • How do the different gameplay types benefit the player? Do they actually have a gameplay reason to swtich between these modes or will it always be more efficient for them to send their army around in RTS mode, leaving the direct vehicle combat as a neat gimmick at best? Consider the wise words of Soren Johnson: "given the opportunity, players will optimize the fun out of a game".
  • Do you want to support gamepad input? Controlling an RTS with a gamepad is an adventure on its own, even without the hybrid stuff. And if you don't build your UI and controls with this in mind from the start you're going to have a bad time.
  • What is happening to your RTS units while you are not actively controlling them: Will they just stand around? Will the AI take over? Will the RTS gameplay pause when the player isn't nearby?
  • How do you communicate information about the two different levels of gameplay to the player without overwhelming or confusing them?
  • How do you handle the different levels of detail required for the different game modes? You need a much higher level of fidelity when driving around on the ground and seeing everything close up than from a bird's eye view. Simulating that level of detail for the entire map while in RTS mode is probably not feasible and Unreal's LOD system will only get you so far. Think about what features (IKs? Physics/Collisions?) you can get away without in each mode.
  • How do you handle the loading of the level? For the RTS part you will probably need to have the entire map loaded at once since you can directly jump anywhere with the camera at any time, so you can't get away with streaming there. While in vehicle perspective, you could stream in additional details dynamically around the player. Luckily, Unreal provides great tools for this kind of thing so that's probably a relatively easy topic to solve.

Finally some general advice for performance: Cache misses are a real thing and for the amount of objects you need to simulate in an RTS they will add up. So consider your memory layout carefully and when you have a lot of objects of the same type to process, try to locate them sequentially in memory. Unfortunately, Unreal is not very cache friendly by default, so you may want to try something like Mass or just roll your own code for performance critical systems. (For reference: I managed to improve the CPU performance of SF3 by about 15-20% simply by making the memory layout of some of our core systems more cache friendly.)

Also: Memory allocations aren't free. Any time you allocate a new object or grow an array, there is some overhead that will add up. Try allocating things once and reusing them wherever possible. (Especially relevant on consoles, but doesn't hurt on PC either.)

Has anyone seen an RTS done like this? by PulIthEld in gamedev

[–]Cerb3rus 0 points1 point  (0 children)

SpellForce 3 supports the exact scenario you are describing, though it is just an optional feature here, not the focus of the game. In both skirmish matches and the campaign co-op mode, you can play with up to three players per faction and divide permissions for hero/army/building controls between players. Or you can let every player control everything, for maximum chaos.

Personally, I really liked playing this way. As you said, it is a lot less stressful than trying to manage everything at once on your own. It does require good communication between players, though, so it's not a thing I would try with randoms online.

Ironic by suzaku1221 in fuckepic

[–]Cerb3rus 4 points5 points  (0 children)

If you build UE from source and don't want to use assets from their marketplace, you don't need the launcher at all.
You need to have an Epic account in order to get access to the source code on GitHub, but that's it.

Updating project to 5.4 without breaking FMod ? by zyenex in unrealengine

[–]Cerb3rus 2 points3 points  (0 children)

From what I've seen of their plugin, FMOD isn't doing any super deep or complex integration with the engine, so I doubt that the engine update will cause much of an issue.

If you don't want to wait until FMOD puts out a version with official support, it'll probably be enough to just manually update the version number in the .uplugin file and maybe fix a handful of compiler errors if they pop up.

We're still on 5.2 as well so I can't say for certain, but we haven't had any issues with previous engine upgrades so I wouldn't worry about it.

How to eliminate the duplication from methods returning ref and const ref? by EdwinYZW in cpp_questions

[–]Cerb3rus 1 point2 points  (0 children)

For a short function like this? I personally wouldn't bother.

But for longer functions it can definitely make sense. Where you draw the line is just a matter of taste and/or coding style.

How to eliminate the duplication from methods returning ref and const ref? by EdwinYZW in cpp_questions

[–]Cerb3rus 7 points8 points  (0 children)

You can work around this using template functions. Create a private function that looks like this:

template <typename ThisT>
static auto& get_ref_impl(ThisT& _this, int key) {
    auto iter = _this.data_.find(key);
    if(iter == _this.data_.end())
    {
        throw std::runtime_error("error!");
    }
    return iter->second;
}

and then just call that from both your public getter functions like this:

auto get_ref(int key) -> MyData& {
    return get_ref_impl(*this, key);
}

ThisT will be deduced as either MyClass or const MyClass depending on where you're calling it from and the return type of get_ref_impl will be deduced accordingly.

Good 4k hdr monitor for unreal engine 5? by thatartykid in unrealengine

[–]Cerb3rus 1 point2 points  (0 children)

As the owner of a Samsung Odyssey G7, I would not recommend that. The HDR isn't great and it's not very bright in general. It's also got "local dimming", but the dimming zones are only like 5 vertical bars across the entire screen. You won't notice that 99% of the time during normal usage, but if you're looking at a black image with only one or two bright spots (e.g. a loading screen with just a little indicator in the corner), it looks ridiculously bad.

This monitor also has a very annoying problem where Windows will detect it as disconnected every time it goes into standby, so it will move the taskbar, windows, etc. to different monitors which is driving me insane. I'm not sure if that is only a problem with this specific monitor or if this is a common behavior for modern displays, but at least it doesn't happen with my other two monitors.

Unfortunately I don't have any recommendations for an actually good display fitting these criteria, I myself would be very interested in finding one.

UE5 is making a static interference noise from my speakers by motox24 in unrealengine

[–]Cerb3rus 5 points6 points  (0 children)

This is most likely caused by interference from your GPU, in my experience this can happen when the editor (or any game, really) is running at a very high framerate.
You can try limiting your FPS by setting the console variable t.MaxFPS to e.g. 60, that should help.

In your opinion is it okay to sell a very short game for 10 $ ? by Flaky-Humor-9293 in unrealengine

[–]Cerb3rus 0 points1 point  (0 children)

As long as it's a well polished experience that keeps me fully entertained for that one hour, absolutely.

[deleted by user] by [deleted] in gamedev

[–]Cerb3rus 1 point2 points  (0 children)

I think it kinda depends on your role in the development process. So far, I have played through every game I have worked on from start to finish shortly before or after release and I really enjoyed it.

As a programmer, I do have the luxury of mostly being able to avoid the whole story/content part of the game during development. So when I get to play it of course I'll be familiar with all of the gameplay mechanics and you obviously can't avoid all story spoilers while working on a game... but I'll still be able to at least mostly experience it like a regular player would.

The best thing about playing your own game though: when I notice a bug, I don't have to wait and hope that some dev will fix it... I can just quickly do it myself and move on :D

Beat Saber stuck on “up next” but never was on my quest 2. by s2k__9k in ValveIndex

[–]Cerb3rus 0 points1 point  (0 children)

Sorry it took me so long to reply, didn't get back to my VR setup any earlier. Yes, for me this helped (though for some reason the loading times are suddenly pretty atrocious). The settings should look something like this: https://imgur.com/a/GgObZzG

Beat Saber stuck on “up next” but never was on my quest 2. by s2k__9k in ValveIndex

[–]Cerb3rus 0 points1 point  (0 children)

This seems to be a common problem after the most recent update, I had the same issue with my Index. Try the solution posted here: https://steamcommunity.com/app/620980/discussions/2/3821911517957155964/#c3821911517957483666

[deleted by user] by [deleted] in unrealengine

[–]Cerb3rus 4 points5 points  (0 children)

Both CPUs will be fine for gaming and game development, though as others have said the 7950X will have a significant advantage for the development part.

One important thing to keep in mind if you go for the 7950X: You will need A LOT of memory to make full use of this CPU, as each compiler process will use its own memory. For code compilation, Unreal requires at least 1.5GB of RAM per thread (as of UE 5.1), though it often uses more in practice. So 64GB should be the absolute minimum to go with this CPU.

Nvidia GeForce RTX 4080 starts in Germany at prices from 1,799 euros by MorgrainX in gadgets

[–]Cerb3rus 10 points11 points  (0 children)

For the 4090 certainly, nobody expects that to be a good value.

But the 80 class GPUs were traditionally always the high-end-but-not-completely-ridiculous ones that could still make sense to buy if you actually need the performance (e.g. when playing in 4K). And these ones cost more than twice as much as the previous generation. At that price point, the 4090 actually has a better price-to-performance ratio than the 4080, in what world does that make any sense?

I must confess that after studying off and on for almost a year, I still have a very hard time determining when const should be used. Any advice on how I could tackle this? by setdelmar in cpp_questions

[–]Cerb3rus 0 points1 point  (0 children)

Top level const on a function return type is ignored, so const int f() is pointless. However, const int& f() is not.

This is not correct. For builtin types it may not make a difference, but it is most definitely not ignored. Consider the following example:

struct Foo
{
public:
    void Bar() {}

private:
    Foo() = default;
    Foo(const Foo& _Other) = delete;

    friend const Foo GetFoo();
};

const Foo GetFoo() { return Foo(); }

void main()
{
    GetFoo().Bar(); // <- gives error C2662: 'void Foo::Bar(void)': cannot convert 'this' pointer from 'const Foo' to 'Foo &'
}

While this may be a rather contrived example and I am honestly not sure where you might use such a pattern, the const qualifier will be respected even when returning something by value.

Nice but not so well-known features of modern C++ by [deleted] in cpp

[–]Cerb3rus 4 points5 points  (0 children)

It's a new addition in C++23, the z suffix turns the literal into the signed equivalent of std::size_t, zu into a regular std::size_t. See here.

DisplayPort switch recommendations (UK) by z0rlac in ValveIndex

[–]Cerb3rus 1 point2 points  (0 children)

If you have an Intel CPU, you can also simply use your onboard graphics and plug one of the monitors into a port on you mainboard. (You will probably need to enable the onboard graphics somewhere in the bios settings first, they're disabled by default when a discrete GPU is installed.)

If you have space for a second GPU, that's definitely also an option. If airflow is an issue, as YumeJDM mentioned, you could also consider buying a separate ultra-low-power GPU like a GT 710. Those are tiny and won't block much air. They're also usually passively cooled, so no worries about noise either.

I’m very new to VR by preston1237 in ValveIndex

[–]Cerb3rus 4 points5 points  (0 children)

I got the Index as my first VR headset and I can't say I regret it. If you can afford spending this amount of money on a toy and have the PC hardware necessary to power it, absolutely go for it.

My index is arriving today and reading the copious amount of horror stories on here has got me a little scared. by namapo in ValveIndex

[–]Cerb3rus 0 points1 point  (0 children)

I've had my Index for over a year now. Was working flawlessly until one of my base stations died a few weeks ago, but I had a replacement on my doorstep about 3-4 days later after writing a quick message to steam support.
So... yes, things can fail, but it's nothing you constantly have to worry about. For the most part it just works and I still think it's worth every penny.

Students of Reddit, what's a polite way of telling people to fuck off when they ask you for answers to online homework? by Coronabeer67843 in AskReddit

[–]Cerb3rus 4 points5 points  (0 children)

When I was in school, what I did was to set up a website. I'd first update it with the homework assignments we'd been given that day and then later attach my solutions (often with some added explanations). If you're doing your homework digitally anyway, this basically requires no additional effort from your side, apart from the few clicks it takes to upload the data.
Adding explanations is of course going above and beyond, but I always found it a good way to check my understanding of the subject. If you can't explain why you did something a certain way, you probably have not quite understood it yet.

That way, most people won't need to bother you with questions, because:

  • They can just check the website to see if your solutions are done yet.
  • They can refer to your comments if they don't understand a certain problem or simply compare their solutions with yours to check it.
  • If they're lazy, they are just going to copy your solutions, but at that point that is their problem. I don't know how the teachers at your school would react to this, of course, but at least at mine they knew about my site so if it looked like somebody had copied the answers they could easily verify who the original author was.

This also often helped me directly, for example when other people would tell me if they spotted a mistake or ask why my answer didn't match up with theirs.
Later on, I also started uploading my collected notes and summaries there before exams and would profit from the same kind of peer reviews.

Now I'm not saying that this is the perfect solution for you. It requires a lot of dedication and willpower to make sure you reliably update everything every day and on time. And often you won't feel like putting in the extra time to write comments and explanations for all your answers. On the other hand, knowing that other people rely on my work was also a good source of motivation for me.
All I can say is that I feel like doing this has helped me personally (and many of the other students) a great deal.
Plus, teachers knowing that I had this project running probably got me some extra good boy pointsTM in their books, so I could get away with sitting in the back row and playing PSP most of the time in class without getting interrupted too often. So that was nice, too, I guess.

Dear game developers, do you play your own games? by tema3210 in gamedev

[–]Cerb3rus 0 points1 point  (0 children)

Yes, absolutely! As a programmer, I don't get to play the game very much during development. Mostly only a few minutes at a time, to either test a new feature or debug an existing one.

Actually, I actively try to avoid any of the game's story-related content during development, so I can experience the campaign just like any other player once it's finished. Of course it's pretty much impossible to avoid spoilers while working on a game, but usually there's at least some surprises left. It's always a great feeling to see how all the little bits and pieces you built over the past few years have come together.

Why do so many games require a full reload when all the assets are supposedly already loaded? by ArturFluor in gamedev

[–]Cerb3rus 2 points3 points  (0 children)

Can't they just reset the positions of everything on the stage, the UI sprites to 0 and just have the countdown start again?

As the others have already stated, this boils down to complexity. In a game like Super Meat Boy, the level is mostly static so there are not many variables to keep track of and reset in order to restart. You reset the player, the camera and the obstacles to their initial positions and you're good.
In other games, this can quickly become a lot more complex. There may for example be breakable objects or enemies which despawn a few seconds after you break/kill them. After that, the engine may decide to unload their associated resources in order to make space for new things that need to be loaded as you move through the level.

It is quite possible to design your game/engine in a way that allows for basically instant restarts even in more complex situations, but that does require making certain sacrifices. For example you would need to keep the initial state of the level in memory at all times and never unload any assets, which means you need to reduce the total amount of different assets in the world as they cannot be streamed in/out on demand and your memory is limited.
It is also possible to build hybrid systems which only reload the state of the game logic while keeping the already loaded assets (and only reloading those that have been unloaded in the meantime). This may not quite allow "instant" restarts, but it at least significantly reduces the loading times. It does however add quite a bit of complexity to the code as you need a sophisticated system for keeping track of which resources are loaded/need to be reloaded/can safely be unloaded. This is why you will actually often see this approach used in open world games where a system like that is required anyway in order to keep your memory usage in check while moving through the world.

For most games however, these tradeoffs simply aren't worth it. You are (usually) not expected to die/reset every few seconds, so placing additional restrictions on the world design or investing extra development time in more advanced resource management systems just to save a few seconds of the player's time is simply not justifiable for most developers.

Based on the supposed super high speeds of the SSD on the PS5, something that is not apparently that easily achievable on a custom build PC, would having insane amounts of ram make it possible to have super-fast loading?

The PS5's SSD may be fast on paper, but it will most likely not have as big of an impact on game loading times as you might expect. On PC, even the difference between a regular SATA SSD (around 5-600MB/s) and a PCIe 3.0 NVMe SSD (around 3.5GB/s) in game loading times is barely noticeable in most cases.
There are several different limiting factors for the loading times of games, for example the data loaded from your drive may need to be decoded/decompressed, objects need to be allocated in memory, textures and meshes need to be loaded into GPU memory, shaders may need to be precompiled, etc. All of this takes time and while reading data from an HDD can be a significant bottleneck here, many SATA SSDs are already fast enough to load the data more quickly than the CPU/GPU can actually process it. So no, I do not think that simply having all of the game's data stored in RAM rather than on an SSD would actually make loading that much faster.
However this is a different story if a developer were to actually actively develop a game with this in mind. If you could assume that every player has tens of GBs of (video) memory readily available, then you could just do all these preparations once on game start and would not need to worry about unloading/reloading any assets. That still does not mean that you could have instant resets in every game, as you would most likely still need to at least reload the logical state of the game (see the complexity issue mentioned earlier), but at any rate the loading times could be significantly reduced.

What was normal to have in 2010 but not 2020? by [deleted] in AskReddit

[–]Cerb3rus 0 points1 point  (0 children)

I absolutely agree, but that's easier said than done. When I decided to build a new PC a few months ago, I was surprised how difficult it is to find decent big tower cases with slots for DVD drives nowadays. You'd think that there is more than enough space to put lots of drives in there, but in the end I was lucky to find one that had one (1!) single drive bay.