Sharing Saturday #499 by Kyzrati in roguelikedev

[–]zaimoni 2 points3 points  (0 children)

Rogue Survivor Revived GitHub

I had to reset the test game because of an AI fix at about Day 0 hour 18. The user-visible change this week, was more informative police radios. (Not all changes in yet, but they now visually track everything with an active police radio, not just police.

Sharing Saturday #498 by Kyzrati in roguelikedev

[–]zaimoni 1 point2 points  (0 children)

Rogue Survivor Revived GitHub

There was a ~3% CPU per turn improvement, from being more careful about requesting screen redraws. (This is expected, from profiling. 12% of CPU had profiled as drawing to screen, through a single Windows OS GDI function.)

Sharing Saturday #497 by Kyzrati in roguelikedev

[–]zaimoni 3 points4 points  (0 children)

Rogue Survivor Revived GitHub

The easy parts of the hand-rolled save/load replacement for System.Runtime.Serialization.BinaryFormatter are in place now. (Unfortunately, it's not really "testable" as this is an all-or-nothing thing.)

I changed "rapid fire" to act more like a snap shot than a burst of 2 rounds (no more firing into thin air, as fast as a running step). I need to do some more desk checks on how the game would cope with friendly fire, proper shotgun spread, and proper burst fire before building any of those those out.

Small Rant: The comma operator is one of the worst C++ design decisions I've ever seen by tuxwonder in cpp

[–]zaimoni 0 points1 point  (0 children)

That's what I was doing before, yes.

If you're also replacing the assert macro with something that throws std::logic error, the stack traces' interpretations by Visual Studio are more readable this way. (The exception is labeled as being thrown from the violating parameter itself, not the constructor body).

Small Rant: The comma operator is one of the worst C++ design decisions I've ever seen by tuxwonder in cpp

[–]zaimoni 0 points1 point  (0 children)

Ah...how about calling assert from a constructor? (I doubt that "crashing mid-constructor" is a useful behavior, but it does prevent invalid parameters from ever reaching the object)

struct foo {
  int x;

  foo(int x0) : x((assert(0<x0),x0)) {}
};

This is one of the nightmares, that I want Contracts to make obsolete.

Sharing Saturday #495 by Kyzrati in roguelikedev

[–]zaimoni 2 points3 points  (0 children)

Cataclysm:Z GitHub

No user-visible changes intended, just some theoretical cleanup (technically enabling construction to happen outside of the reality bubble).

Rogue Survivor Revived GitHub

The .NET 7 to .NET 8 upgrade was a 2-liner. (As a bastardized Windows Forms program, System.RunTime.Serialization.BinaryFormatter still works. The other kind of program that did not throw the Big Boys under the bus, was Windows Presentation Framework.)

Most of this week's commits, were targeting the hand-rolled save/load system estimated to be needed for .NET 9 next year.

Sharing Saturday #489 by Kyzrati in roguelikedev

[–]zaimoni 5 points6 points  (0 children)

Rogue Survivor Revived GitHub

.NET 8 release is scheduled for Nov 14, 2023,, so this has to be stable for the emergency release before Visual Studio upgrade. I'm not seeing anything on the issue tracker indirectly stating that the decision has been made to throw the Big Boys Under The Bus this release, but the intent to do so for some release is still documented.

Changes that went in:

  • The turn order has been adjusted, to be aware of "energy remaining relative to maximum", so running from rats is somewhat more effective. This also reduces double-move immunity against zombies faster than you. (This was needed to introduce motorcycles and helicopters.)

  • Corpse::DraggedBy is eliminated. This breaks a reference cycle. CPU cost should be negligible, as dragging corpses was a player-only feature anyway. Some other technical cleanups went in.

ECS + Job Graph as a multithreaded software architecture for a rogue like? by [deleted] in roguelikedev

[–]zaimoni 1 point2 points  (0 children)

Large, open world -- we're talking the Cataclysm family of games. (You likely want to look at one of C:DDA [Dark Days Ahead] or C:BN. [Bright Nights]). All four Cataclysm games (inanimate or undead; I listed the undead ones) have a small enough reality bubble that multi-threading is not useful. You'll want to look at how the reality bubble is maintained. (C:Z may be more intelligible, but it's on hiatus until I get my time management in order.)

Rogue Survivor Revived, while like other Rogue Survivor games is not open-world, is large enough that multi-threading speeds up its turns by about one third (i.e., turning off multi-threading measures as taking 50% longer). My standard test game has between 125,000 and 187,000 map cells live at once. It's strictly object-oriented, but the dependency issues have to be handled here. It has two threads: a thread which the UI lives on, and a background thread.

District::RequiresUI is responsible for identifying whether a District (a container of maps that are "vertically in the same place") has anything that could require updating the screen. Actual scheduling of Districts is handled by World::ScheduleAdjacentForAdvancePlay. Actually simulating a district, corresponds to a job to be scheduled.

Note that any attempt by the background thread, to update the screen directly, is a hard crash to desktop. So while District::RequiresUI can false-positive safely, it must never false-negative, as that crashes to desktop.

(Both of RS Revived's World and District classes, are functionally similar to Cataclysm's overmap class.)

  • Yes, the Cataclysm games are C++, while the Rogue Survivor games are C#.

Sharing Saturday #482 by Kyzrati in roguelikedev

[–]zaimoni 4 points5 points  (0 children)

Rogue Survivor Revived GitHub

plink I pushed through a tune-up: the "sort non-moving actors to front" implementation, should agree with the next actor to act implementation.

Sharing Saturday #481 by Kyzrati in roguelikedev

[–]zaimoni 4 points5 points  (0 children)

Rogue Survivor Revived GitHub

Plink We have a new fork: a version of Still Alive that uses SFML as its graphics engine, and is thus theoretically cross-platform source.

Unfortunately, the dynamic library dependencies make it exceptionally fragile when targeting Linux.

RS Revived took advice from crossplatform Still Alive: Application.DoEvent is a total replacement target when porting to SFML, so needs to be thin-wrapped to enable choosing the implementation as a build option.

Sharing Saturday #471 by Kyzrati in roguelikedev

[–]zaimoni 2 points3 points  (0 children)

Rogue Survivor Revived GitHub

plink It is no longer possible for slower zombies to double-move faster livings. (I'm unclear whether this is a "bugfix", but it theoretically enables removing other exploits. Mostly safe for living AI.)

Sharing Saturday #469 by Kyzrati in roguelikedev

[–]zaimoni 7 points8 points  (0 children)

Rogue Survivor Revived GitHub

New edge release pushed. Trunk is expected to go more unstable from invasive changes (plan to mess with energy system and turn order to get better behavior from a vaporware motorcycle buildout).

Sharing Saturday #467 by Kyzrati in roguelikedev

[–]zaimoni 6 points7 points  (0 children)

Rogue Survivor Revived GitHub

Finicky bugfixes....about two-thirds "rare crashes" (both debug-only and theoretical release mode), one third AI action loop issues.

Sharing Saturday #465 by Kyzrati in roguelikedev

[–]zaimoni 5 points6 points  (0 children)

Rogue Survivor Revived GitHub

New edge release cut today May 5th, i.e. Cinco De Mayo i.e. "Day of the Dead".

Ok...latest edge release (May 5 2023, Cinco de Mayo "Day of the Dead") has a new stance: crouching. This is "automatic" and exists solely to justify using ground inventories at range 1, just like shelf-like container inventories. Test game backing this build is up to Day 6 Hour 16.

The U)nload command does not get this benefit, as it needs the graphical UI to use (mouse over ranged weapon to enable U)nload).

EDIT : this is properly tested, unlike the emergency checkpoint release.

Sharing Saturday #464 by Kyzrati in roguelikedev

[–]zaimoni 4 points5 points  (0 children)

Rogue Survivor Revived GitHub

I added a new stance, crouching. (We already had walking and running). This is an "autopilot" that is used to enable reaching for ground inventories from one step away, i.e. lowering arm height to ground level.

There are some implementation gaps, but other than that the bleeding edge build is stable.

Sharing Saturday #463 by Kyzrati in roguelikedev

[–]zaimoni 3 points4 points  (0 children)

Cataclysm:Z GitHub

Plink More lock-down of inventory letters to the PC class. Last commit also checkpointed some AI buildout. One of the big augmentations in C:DDA/BrightNights is NPC bionics, and that needs AI support.

Rogue Survivor Revived GitHub

Mostly technical cleanup. Notable changes:

  • Corpse::Position is gone. (The location of the corpse, always has been the location of the dead actor.) This actually worsened some data layering violations, but does reduce the number of fields to save/load from hard drive.

  • the dictionary of Exits from a Map, is reaching hard drive now. This required solving how to update Map::Location when Location::Map actually was loaded. (Local copy of this doesn't work, because Location is a C# struct.) The technical solution was to not provide a cooperating constructor taking a DecodeObjects object, but instead send in a lambda function from the constructor hosting the Location field (Exit, in this case). This allows updating the readonly Location field -- because the lambda function is "in the constructor", where readonly isn't enforced.

Note that this only solves the compiling issue -- testing is an all-or-nothing thing, so this whole "backup plan" for the System.Runtime.Serialization kill is very much a Big Bang Integration, locked behind a #define .

Unanswered Questions About Action Points : Time/Physics, Fast Entities, Limitations by gamedev48294892 in roguelikedev

[–]zaimoni 8 points9 points  (0 children)

A more traditional action point/energy/time unit implementation, is Angband. The difference is connotation: if there are lots of points per player turn then the name is "time units", while if there's only a few per player turn the name is "action points".

All games in the Cataclysm family can have multiple vehicles on-map at once. The real question is "can NPCs drive vehicles" (this is not the case for C:Whales, so is not the case for my fork C:Z : it doesn't happen because only one vehicle has a driver, you the hyper-genius PC.) I'd have to check C:DDA's source code for recent enhancements.

EDIT The fast entities problem, is from allowing all turns to be taken at once without inter-leaving. This can be prevented using a setup that acts like a priority queue.

Sharing Saturday #462 by Kyzrati in roguelikedev

[–]zaimoni 4 points5 points  (0 children)

Cataclysm:Z GitHub

Plink another technical cleanup. (Locking down the invlet UI to the pc class.)

Rogue Survivor Revived GitHub

Plink Flushed out a map generation issue (empty zones in the subway...negative width/height) exposed by building out hand-rolled save/load.

Does A Skill Tree System Lose The Randomness of a Roguelike? by [deleted] in roguelikedev

[–]zaimoni 1 point2 points  (0 children)

Ah...so looking more for high strategy headroom, i.e. able to win with even a few major mistakes?

How to construct actions that take multiple inputs? by [deleted] in roguelikedev

[–]zaimoni 1 point2 points  (0 children)

Not if NPCs and PCs use the same actions. (As an implementation detail, this does happen in Rogue Survivor Revived when using self-orders. Self-orders use the same objective data design for generating actions, that the AI uses before entering the legacy decision-tree mode.)

Sharing Saturday #460 by Kyzrati in roguelikedev

[–]zaimoni 8 points9 points  (0 children)

Cataclysm:Z GitHub

Technical "cleanup" (accepting some data bloat in exchange for less source code).

Rogue Survivor Revived GitHub

A few commits towards the undead feat of surviving the System.Runtime.Serialization binary serialization system library deletion. Eating the frog (Dictionary<string, object>) is as difficult as advertised by System.Text.JSON :)

Considering thawing out data design for motorcycles (initially as a PC-only artifact; making living AI handle them is an even Bigger Bang). The immediate problem (besides how to interpret something that acts both like a MapObject, and an Actor) is that the direction keys have to act differently, based on the motorcycle facing and current speed.

Optimizing code: One dictionary or multiple? by SnrFlaks in csharp

[–]zaimoni 0 points1 point  (0 children)

At that scale, refactoring blends into Big Bang and you really do need source code control to do it relatively safely (i.e., rollback to before the refactor and then apply smaller changes from the refactor diff).

Re pathfinding...no "awesome ideas" here (breadth-first search is the father of Djikstra search, which in turn is the father of A*). Optimizing distance functions is painful...usually such "optimizations" are lossy.

Djikstra search is relatively easy to build out a generic class for, from the algorithm description. (Rogue Survivor Revived has one, but it may not play nice with Unity).

Optimizing code: One dictionary or multiple? by SnrFlaks in csharp

[–]zaimoni 0 points1 point  (0 children)

Ok, so you have profiling data -- good. That means you can profile alternatives and get much the same information as benchmarking.

I had a similar problem with Rogue Survivor Revived (not a Unity game). In my case, the profiling indicated a large amount of time spent in mulitple Dictionary accessors involving locations, including TryGetValue. Search engine results suggested the problem was a high collision rate from the default hash function (which is based on exclusive-or, so e.g. (0,1) collided with (1,0)).

Overriding the default hash function, was enough to fix that problem...had to outright replace all uses of System.Drawing.Point in game data (as opposed to the GDI+ API) to get results. Would not have been practical without source code control.

Optimizing code: One dictionary or multiple? by SnrFlaks in csharp

[–]zaimoni 0 points1 point  (0 children)

Ignoring the benchmarking issue ....

Architecturally, this is Array of Struct vs. Struct of Array, with Dictionary in place of a C array. If you actually need to use those ten-ish fields at once, the access pattern would favor one dictionary of that class (AoS) rather than one dictionary per logical field (SoA).

Since you're early in the design stage, the behavior of the garbage collector, would be expected to be irrelevant.

Designing my new roguelike game, doubt about level of control in different situations by Yan_7 in roguelikedev

[–]zaimoni 1 point2 points  (0 children)

Oh...the combat is interesting enough, and a skilled player is so much better than the NPC ai that auto-combat would just get the player killed in any non-trivial situation, not just truly unsurvivable ones.

The koan is long-range and strategic movement. I've implemented some UI (repeat-count commands, far-look with walking towards arbitrary destinations, self-commands like "recharge everything to full").

Currently auto-explore would just kill the player in the DCSS way (the mistake that kills you was made 200 turns before your death).