@jakub_neruda@techhub.social
@jakub_neruda@techhub.social avatar

jakub_neruda

@jakub_neruda@techhub.social

Software Engineer, hobby game programmer, I sometimes draw funny comic strips.

Currently working on a retro arena FPS game called Rend: https://medium.com/@nerudaj/list/devlogs-rend-97b960bf3cbe

#cleancode #programming #gamedev #pixelart

This profile is from a federated server and may be incomplete. Browse more on the original instance.

jakub_neruda, to cpp Czech
@jakub_neruda@techhub.social avatar

Funny. I removed all modules from my C++ codebase (roughly 10% of it) and I got about 10-16% shorter compilation times. Not to mention Intellisense no longer crashing all over the place.

I wonder if it ever be a worthwhile feature to use.

djlink, to random
@djlink@mastodon.gamedev.place avatar

a new Nintendo console will be announced during this fiscal year.

jakub_neruda,
@jakub_neruda@techhub.social avatar

@djlink Oh no, not dual screen. Twenty years from now it will be a pain to emulate ๐Ÿ˜…

Right now I am playing Trackmania Turbo DS on my phone and I had to remember how to navigate menus so I don't have to constantly switch screens ๐Ÿ˜‰

jakub_neruda, to cpp Czech
@jakub_neruda@techhub.social avatar

My networking code is doomed to never get itself into production. What the hell is this error about?

jakub_neruda,
@jakub_neruda@techhub.social avatar

@gracicot Sadly, the compiler output is exactly the same as the error output.

Btw, since MSVC 17.8.5, they included a button that shows you the structured output from the compiler output that is related to the error.

Plus I fear that even if I had clang, I am using such cutting edge features that the code wouldn't compile.

I am 99% sure this is caused by my intermixing of modules with headers, but I am not sure why. Standalone server binary compiles just fine, problems arise when I spawn the server inside the game code...

jakub_neruda, to gamedev Czech
@jakub_neruda@techhub.social avatar

Dammit... socket classes are NonCopyable through declaring their copy constructors private.

This prevents the autogeneration of the move constructors.

Thus, by proxy, I cannot make a factory function that would return std::expected<sf::UdpSocket, ErrorType>, because it has value semantics ๐Ÿ˜ญ

And I C++ diagnostics really didn't help here - I had the socket wrapped in another class that I wanted to return in the expected and all I got was "cannot convert from 'Client' to 'std::expected<Client,ErrorMessage>'"

Laurent commented that it will be fixed in SFML3, but he also made that claim in 2016 (https://en.sfml-dev.org/forums/index.php?topic=20997.0)

A real bummer when I cannot make an idiot-proof API because underlying types are trying to be even more idiot-proof...

jakub_neruda, to rust Czech
@jakub_neruda@techhub.social avatar

Tip 40 of - Rust's error propagation is amazing

As much as I love C++, its optional and expected objects can just envy one killer feature of their Rust counterparts. If you're working with a Result<T, E> in a function that returns a Result<U, E2>, you can use operator ? to simply unwrap the Ok value into a variable. If the result contains an error, Rust will not panic; rather, it returns that error from the current function similar to how exception would bubble up the code. The only limitation is that the function must return Result with the error type to which the propagated error can be implicitly converted.

Option also supports the operator ?, which either propagates None up the call stack or safely unwraps the stored Some.

I'd kill to have this in C++, where you would have to employ non-standard compiler extensions to create a macro that would be at least close.

jakub_neruda,
@jakub_neruda@techhub.social avatar

@smoku I am not sure I like this. One of the reasons why people dislike exceptions is that you never know the full set of exceptions that can be thrown from the function.

If Zig does this in compile-time then do you have visibility into the full set of exceptions?

jakub_neruda,
@jakub_neruda@techhub.social avatar

@lhp @smoku Not sure what you mean by this. Can you please explain more?

jakub_neruda, to random Czech
@jakub_neruda@techhub.social avatar

I always thought it was a weird choice to push neural-net-AI development in Python as it has to be painstakingly slow.

Just the other day, I learned about llama.cpp which ports Meta's GPT to C++. And it can run on a common laptop! On a Pixel phone! On a friggin Raspberry!

I really hope that the next step in AI development is about porting these applications to performant languages so all of these cool models can be run on a consumer-grade devices for free instead of premium enterprise cloud servers.

hbons, to random
@hbons@mastodon.social avatar

typedef uint8_t u8;
typedef int8_t i8;
typedef uint16_t u16;
typedef int16_t i16;

should have done this ages ago...

jakub_neruda,
@jakub_neruda@techhub.social avatar

@hbons @MostlyBlindGamer One could possibly confuse it with unicode encodings or complex numbers...

jakub_neruda, to gamedev Czech
@jakub_neruda@techhub.social avatar

Even though I am working with 16x16 pixel sprites, producing at least passable weapon sprites is hard.

Here are six different drafts of the rocket launcher and the current version in-game.

I am still not satisfied.

Rocket launcher in-game.

Liquidream, to gamedev
@Liquidream@mastodon.gamedev.place avatar

PROBLEM:
Social Media can be linked to depression

SUGGESTION:
Try to improve Social Media life, by balancing successful/beautiful posts (e.g. ), by also posting brutally honest imperfect/failed attempts (?) ๐Ÿ˜‰

HASHTAG =

jakub_neruda,
@jakub_neruda@techhub.social avatar

@Liquidream Do quirky, funny bugs also apply or just downright failure / burnout stories?

jakub_neruda,
@jakub_neruda@techhub.social avatar

@Liquidream I like the idea, so hopefully I will mess something up so I can post it next sunday ๐Ÿ™ƒ

Speaking of the dark side of the gamedev, I can't recommend enough Jason Schreier's book Blood, Sweat and Pixels. You could post each page with shoddy sunday hashtag ๐Ÿ˜ƒ

jakub_neruda, to gamedev Czech
@jakub_neruda@techhub.social avatar

Every single time someone invents a fantasy console with Z X action keys or makes an indie game with those buttons, I am like "Why do you guys hate QWERTZ users so much?!"

jakub_neruda, to gaming Czech
@jakub_neruda@techhub.social avatar

I am learning German with Duolingo and I wonder if anybody could recommend a german gaming news site, preferably with shorter posts that I could use to improve my reading skills.

If you don't know, boost is appreciated.

amxmln, (edited ) to gamedev
@amxmln@mastodon.design avatar

Fellow people, I'm having trouble learning about good architectures for complex digital card games, where every card has individual effects, similar to Magic, Hearthstone, etc.

Have you ever built something similar? Do you know of any resources in that regard? ๐Ÿค”

jakub_neruda,
@jakub_neruda@techhub.social avatar

@amxmln I tried multiple times and I always ended up making a total derivative of the games before.

My advice would be to start with a strong theme instead of generic fantasy, victory condition and a mana system. You can win by draining opponents lives to 0 like in HS or MtG or you can destroy 2/3 of their bases (Warhammer, Radlands). You can have 1 mana per turn (Epic), any card can be mana (WoW), broken mana system of MtG or lives can be also mana (Vampire the Masquerade).

Then define main factions within your theme and several subfactions. Each plays differently - token spawners, creature boosting, spell damage, growing creatures, stealing, traps, etc. Define a combo within each subfaction and make all cards contribute to that combo or to counter combos from other (but not all) subfactions.

Ofcs this is not the only way, but it can carry you pretty far. Try to not create effects that draw cards, it is always too powerful. Play tons of games to see how they do it.

jakub_neruda,
@jakub_neruda@techhub.social avatar

@amxmln Oh! You're talking about a computer card game! I was thinking tabletop and how to design it ๐Ÿ˜ƒ

You can perhaps use a Visitot pattern - your whole game is a data structure that can be traversed and each card (or rather effect) is a Visitor that can browse the scene and do transformation to it.

So each effect is its own class that can be slotted into cards. If you're using and entity component system, each card can also have traits that would allow your visitors to only traverse cards with those traits, making the boilerplate code that much simpler.

jakub_neruda,
@jakub_neruda@techhub.social avatar

@amxmln I consider Refactoring Guru a good source on OOP design patterns: https://refactoring.guru/design-patterns/visitor

jakub_neruda, to gaming Czech
@jakub_neruda@techhub.social avatar

I am a huge fan of Metroidvania genre, but I never player a game before. But today I finished Aria of Sorrow and oh boy, how could I miss on such great game for so long?

While Zero Mission, Gato Roboto and Hollow Knight are still my top 3, the Soul system and the build variety reminded me of Dark Souls (as well as grinding levels to steamroll bosses).

What a treat!

ben, to random
@ben@mastodon.bentasker.co.uk avatar

deleted_by_author

  • Loading...
  • jakub_neruda,
    @jakub_neruda@techhub.social avatar

    @ben Just to be sure - if I restrict my moq version to anything lower than 4.20, then there is no risk of putting this to my system, at least until I migrate to other mocking lib, right?

    jakub_neruda,
    @jakub_neruda@techhub.social avatar

    @ben I just noticed that NuGetizer also uses SponsorLink (no wonder, it is from kzu as well).

    Let's hope Roslyn Analyzers quickly fix this hole that allows SponsorLink to exist.

    steamdeckhq, to Steamdeck
    @steamdeckhq@mastodon.world avatar

    is a fantastic game that expands on the prequelโ€™s foundations wonderfully. Sadly, playing on the is nowhere near as great as the game and doesnโ€™t deserve the Verified badge.

    A copy was provided by the publisher for review.

    https://steamdeckhq.com/game-reviews/remnant-2/

    jakub_neruda,
    @jakub_neruda@techhub.social avatar

    @steamdeckhq That is so sad to hear. I had the game on my radar, but considering Deck is my only PC capable of running games, I will have to pass or hope for performance patches ๐Ÿซค

    jakub_neruda, to programming Czech
    @jakub_neruda@techhub.social avatar

    Tip 15 of - Mathematical constants in C++

    Since C++20, you can include header <numbers> and use many commonly used, precomputed mathematical constants like Pi, Phi, square root of 2 and 3, natural logarithms of 2 and 10, and many more! Even better, you can choose their precision by specifying the underlying type via a template.

    And since C++17, the <cmath> header contains some special math functions I've never heard of like cylindrical Bessel functions, associated Legendre polynomials, or Riemann zeta function.

    Constants are here: https://en.cppreference.com/w/cpp/numeric/constants
    Special functions are here: https://en.cppreference.com/w/cpp/numeric/special_functions

    jakub_neruda, to cpp Czech
    @jakub_neruda@techhub.social avatar

    C++20 modules are now foolproofly usable in latest release of MSVC (v17.6.4).

    Standard library is precompiled automatically.

    CMake code is simpler, target_include_directories are no longer needed.

    It only took 3 years. Yaaay!

    jakub_neruda,
    @jakub_neruda@techhub.social avatar

    @gracicot @DanielaKEngert Yes, you're right, vcpkg can be sandboxed and has the best ergonomics so far. But is so excruciatingly slow (because it builds transitive dependencies). So far I never had a case where I would have two deps with shared transitive dep so I am shying away from it.

    And yes I know you only go through the installation process once, but for Github Action, you have to do it every time.

    jakub_neruda,
    @jakub_neruda@techhub.social avatar

    @gracicot @DanielaKEngert Yes, if you have a docker or self-hosted agent, then vcpkg is probably the best choice. If you're open-source github dev then your best bet is to use prebuilt binary releases and essentially implement all of dependency management by hand (like SFML) because no package manager ever thought of build times being an issue.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • โ€ข
  • provamag3
  • khanakhh
  • mdbf
  • InstantRegret
  • Durango
  • Youngstown
  • rosin
  • slotface
  • thenastyranch
  • osvaldo12
  • ngwrru68w68
  • kavyap
  • cisconetworking
  • DreamBathrooms
  • megavids
  • magazineikmin
  • cubers
  • vwfavf
  • modclub
  • everett
  • ethstaker
  • Leos
  • tacticalgear
  • normalnudes
  • tester
  • GTA5RPClips
  • anitta
  • JUstTest
  • All magazines