## software engineering – How to design a character damage system with ECS architecture?

I am developing an game with ECS architecture and trying to design a character damage system.

Does the following design fits into ECS conception and will it be extendable in future?

• I have an `Actor` component with health percent attribute and `ActorsDamage` system.

• I also have an inventory system, so actors can use some food to increase their health.

• When actors use inventory items, their Lua handlers executes and generates `ActorHit` event.

• `ActorDamage` system receives this event and increases or decreases the actor’s health.

• Other game systems link actors’ AI system or actors’ keyboard control systems can also trigger hit events.

So, is this an appropriate design conception, or is there something I need to correct or improve?

## dnd 5e – Can my Primal Companion roll initiative instead of my character?

### You roll initiative, not your companion.

Primal Companion says:

In combat, the beast acts during your turn.

Normally, participants in a combat will roll initiative, but this rule creates an exception:

Remember this: If a specific rule contradicts a general rule, the specific rule wins.

Instead of following the general rule and having the companion roll initiative, it acts on your turn instead, which is determined by your initiative roll.

## Call them on their bull****

D&D is a game about heroic characters risking their lives several times a day, I personally always play characters who want to survive, and will concentrate on staying alive, but there is a difference between being cautious and spoiling the game by not participating in combat encounters with the rest of the players.

I would say that there is a place for that style of play, but clearly not in your game, so you just need to tell them to knock it off.

I don’t suggest handing out items to make their life easier, or making up new rules, or anything to gently ‘encourage’ them. This player has made a commitment to play a game with other people and their responsibility is to participate with the rest of the players. Remind them of that.

Maybe this player just doesn’t like the style of game you play, and would prefer if everyone else ran away and was far more cautious too, but the quicker you identify that the quicker you can get on the same page – even if that page doesn’t include your player who refuses to join in.

### You can then help them build the right character for them

As an example I currently play a wizard with 19 AC, a druid with 19 AC, a paladin with 21 AC and a monk with 22 AC. Both the wizard and paladin have access to the shield spell, my paladin prefers shield to smite, and my monk has defensive dualist taking his AC to a potential 27! My casters will stay at the back, use spells to increase defence, hide behind trees and keep out of line of sight, but they don’t run away. My paladin will use his slots to stay alive rather than dishing out damage, but will put himself in front of the squishy characters. My monk will look for the easiest targets to stun and let the barbarian take the damage, but all of them contribute.

This is active defence. Running away is not.

Rogues are notoriously squishy, especially if they are melee for some crazy reason, this probably doesn’t help your player feel very safe because everything hits them. You could help create them a character who won’t be so vulnerable after the conversation about participation.

## dnd 5e – Theorycraft: What’s the most self-sufficient character possible?

So this is a theorycraft idea that’s been floating around my head for quite a while now: what’s the most self-sufficient character possible in D&D 5e? Assuming we use the game’s rules and lore/fluff of the “default D&D setting” as reference.

What do you mean by self-sufficient?

Let’s use a story as an example: imagine your new DM turned out to be an Evil Demigod who kidnaps you into the world of his D&D campaign. There’s an empty character sheet in front of you, and as soon as you fill it out (according to normal character creation rules), he’s going to reincarnate you as that character and start his evil campaign.

Now, as you mull over what kind of character you should create, you think about the few key pieces of information you found out:

• The only way you can escape this hellish fantasy world is by beating the campaign
• The DM wants you dead, but he can’t just go “Rocks Fall, everyone dies”. He must kill you in an at least somewhat fair and legitimate manner.
• The DM’s campaign is, in fact, beatable, and with the perfect strategy, the success rate is above 50% (dicerolls and RNG included).
• The evil DM’s world follows the rules and lore of the game, so you can get away with cheesy exploits such as wish+simulacrum or coffelock. (You’ll see why they don’t matter in a second)
• The DM will take it easy at first, so let’s assume that you’re able to survive the early levels and also find some kind of ridiculous cheese that allows you to reach level 20+ (You gain an Epic Boon for every 30’000 exp past lvl 20).

The Obstacles

So if we want to maximize our chances of making it through anything our evil DM throws at us, what problems do we need to solve?

1. Party Members

D&D is (I think) a game where you’re supposed to rely on your companions for solving problems you yourself can’t handle. However, it’s all but guaranteed that the DM will find a way to separate the party, possibly for years on end. So, everyone needs to be self-sufficient anyways.

2. Magic and the Weave

Magic in D&D is very powerful, capable of solving most problems. It also becomes completely useless once we find ourselves in an Dead Magic Zone. As far as i know, all magic in D&D depends on the Weave. This includes things like Ki, Psionics, and perhaps even Divine Magic. Wouldn’t it be a shame if an Eldrich Horror from the Far Realms came along and ate the entirety of the Weave for lunch? This would turn the entire multiverse into an giant Antimagic Field. But we still need a way to kill monsters immune to nonmagical bludgeoning/piercing/slashing damage! The Monk’s Ki-empowered strikes feature, as well as similar features such as the Warlocks Pact Weapon, were confirmed to be supressed in Antimagic Fields, so they’re out of the window. All that’s left are mundane means, Artifacts, or Deities. Speaking of Deities…

3. Divine Intervention

You might be tempted to rely on a God’s power – after all, spells cast by them aren’t suppressed by antimagic. Unfortunately, gods in D&D, especially in epic-level campaigns, tend to be surprisingly killable. Wouldn’t be it a shame if that Lovecraftian Horror slaughtered all the gods after eating the weave? If we want to be self-sufficient, we can’t rely on other people to grant us their power.

4. Artifacts

So, all that’s left to bypass physical damage immunity in the case of an Apocalyptic event that includes the destruction of the Weave, as well as any and all Gods, are Artifacts. They’re also incredibly rare, and we might never be able to find one. Especially if there’s an evil cult that, inspired by the magic-devouring Aberration from the far realms, seeks out to steal and destroy all Artifacts in existence? We can bet that our evil, evil DM will find a way to steal our Artifact Sword. In fact, he might take a page out of the Tomb of Horrors and teleport us into a danger zone while teleporting all of our equipment faaaar away!
So, we can’t rely on any external items, because they WILL get stolen. Unless we have a 100% surefire way to prevent Artifacts from being stolen or destroyed…

5. Food, Water, Air and Aging

Living things tend to need these things to survive. But what if all the Gods are dead, and we’re stuck in a magic-devoid outer space for 10’000 years? Thankfully, this is an easy fix: be a Warforged! No need for food, water, or even air. You also technically don’t age, but take that Immortality Boon just in case you might start to rust.

*6. Sleep *

We don’t want to sleep, ever. It’s like begging our Evil DM to send assassins and/or thieves. Thankfully, Warforged remain fully conscious during their rest, so that problem’s solved.

7. Getting Lost.

Take the wanderer background ability. If magic doesn’t exist anymore, it can’t make you get lost.

What Class?

Here’s my analysis on potentially useful classes. Remember, we ideally want to be able to kill any monster in the game without having to rely on items, the weave, or the Gods not being dead.
This section will also contain the questions I’m most curious about:

Artificer

Potential to attune to 6 Artifacts at once, or perhaps even craft your own Artifacts. But I don’t think they have a way to prevent their items from being stolen/teleported away?

Barbarian

Ancestral Guardian Barbs can deal non-magic Force Damage, but only when they protect other creatures. We can’t rely on always having another creature handy.

Do Zealot Barbarians lose their Divine Fury ability if their God Dies? Does Divine power still exist if all gods die? Do they even need a God? If they can still do the radiant damage without needing any Gods, then they’re amazing. Rage Beyond Death, paired with stacking the Epic Boon that lets you recover half of your max HP, will allow you to fight for days on end. Or more, depending on how many epic boons you stacked.

Bard

I doubt Bards will be very helpful without the Weave.

Cleric

Without their Gods, they’re useless. Did i miss anything?

Druid

Wildshape is suppressed in Antimagic Field. I don’t think Druids can do anything without the Weave.

Fighter

Eldritch Knights have the Weapon Bond Ability, which seems to be able to work with Artifacts! So, if you can find an Artifact weapon that’s hard to destroy (unlike the Sword of Zar***), this might be great for always having a viable weapon on hand. Provided you can get one in the first place.

Monk

Fluff text implies that Ki uses the Weave, so bye-bye Monk.

Now, this depends: If we can have a Paladin that is empowered entirely by their Oath and cause, without needing any God, this might be perfect.
The question is: without the Weave or Gods, would a Oath of Redemption Paladin still retain some of their non-magic abilities, such as Aura of Protection, Improved Divine Smite, Protective Spirit and Emissary of Redemption? If yes, this might be a clear winner. If no, too bad.

Ranger

A Horizon Walker Ranger has the “Planar Warrior” ability, which grants them mobility and a decent chunk of force damage – perfect, as the only monsters immune to force damage aren’t immune to nonmagical damage. It also draws on “the energy on the multiverse”, which seems absolutely omnipresent to me. Unless there’s some Far Realms shenanigans involved, maybe.

Rogue

The Soulknife has A wellspring of psionic energy within you. I’m not sure if this mean they can use their psychic blades without the weave, given that psionics in general seems to be another form of weave-related magic in 5e. Psychic damage also isn’t as reliable as radiant or force.

The Phantom subclass can do extra Necrotic damage via to power of souls, but this isn’t a reliable enough damage type: what if I need to kill a demilich?

Sorcerer, Warlock and Wizard

All of these seem to be absolutely reliant on the weave/ their patrons being alive to do anything relevant. Of course, tell me if i missed something

Conclusion

Whew, this has become quite the wall of text, hasn’t it?
Anyways, I wanted to ask you, fellow theorycrafter, to answer my questions under the “Classes” section, as well as help me find any further things i might have missed: anything to find the theoretical perfect character that can reliably make it through any circumstances.

## nt.number theory – Sum of inverse squares of numbers divisible only by primes in the kernel of a quadratic character

Let $$chi$$ be a primitive quadratic Dirichlet character of d modulus $$m$$, and consider the product
$$prod_{substack{p text{ prime} \ chi(p) = 1}} (1-p^{-2})^{-1}.$$

What can we say about the value of this product? Do we have good upper or lower bounds?

Some observations, ideas, and auxiliary questions

• When $$chi$$ is trivial, it has value $$zeta(2)$$.
• In general, since Chebotarev density theorem (CDT) tells us that $$chi(p)$$ is equidistributed in the limit, I would “want” the value to be something like

$$Big(zeta(2)prod_{p | m} (1-p^{-2})Big)^{frac{1}{2}}.$$

However, if I’m not mistaken, it seems that the error terms in effective forms of CDT may cause this to be very far from the truth. We can’t ignore what happens before we are close to equidistribution as the tail and the head are both $$O(1)$$. We can’t even control the error term well (without GRH) because of Siegel zeroes.

• I don’t think we can appeal to Dirichlet density versions of CDT since those only tell us things in the limit as $$s$$ goes to $$1$$ and here $$s = 2$$.
• Is there a way to “Dirichlet character”-ify a proof of $$zeta(2) = pi^2/6$$ to get a formula for this more general case? At least with Euler’s proof via Weierstrass factorization, it seems that we would need some holomorphic function which has zeroes whenever $$chi(n) = 1$$.

I had a few other ideas but they all seem to run into the same basic problem of “can’t ignore the stuff before the limit”… am I missing something?

## spells – What concerns should I have with allowing a character to hurl bombs with Telekinetic Projectile?

I have a wizard player who wants to use Telekinetic Projectile to hurl bombs. I think this is cool, and would like to allow it, but I’m not sure if it would be too powerful or cause other issues.

Preparing and throwing an alchemical bomb takes one action, uses a weapon attack, and has a range increment of 20′.

Telekinetic Projectile is a spell which hurls “a loose, unattended object” at a target, dealing physical damage. Additionally, the spell states:

No specific traits or magic properties of the hurled item affect the attack or the damage.

Depending on how you read that, RAW may dictate that the bomb’s effects wouldn’t trigger. But you could read it as “the bomb’s effects don’t affect the spell attack or spell damage,” which doesn’t say anything about the bomb’s effects not working separately.

That being said, can think of two possibilities for how to allow it to work:

1. 1 action must be spent preparing the bomb, and then the regular 2 actions spent casting the spell.
2. More strictly (and less fun), 1 action must be spent preparing the bomb, 1 action must be spent putting the bomb down carefully so it becomes “a loose, unattended object”, and then 2 actions must be spent casting the spell. This would obviously be a 2-turn maneuver, unquickened.

Potential concerns and balance issues:

1. Using the spell to hurl the bomb allows casters to use their spell attack for the throw, instead of their (probably worse) weapon attack roll.
2. You’d get the spell damage and bomb effect from one attack roll, rather than having to do one attack (spell or bomb), and then a second attack at -5 (spell or bomb).
3. Using the spell to hurl the bomb eliminates the bomb’s 20′ range increment and gives it a flat range of 30′ (unless the spell is given reach). So better at short ranges, but impossible to use at ranges over 30′.
4. Possible that the rules intend for this gameplay style to be restricted to the alchemist class? This isn’t really a balance thing but more a “spirit of the game” thing, which isn’t high on my list of concerns for allowing my player to have a bit of fun.

Honestly, I’m not convinced that spending an entire turn to deal `bomb effect + 1d6 + ability mod` is terribly unbalanced. Not to mention that the wizard is limited by the amount of bombs he has. What concerns should I have with allowing a character to spend 3 actions to hurl a bomb with Telekinetic Projectile?

## dnd 5e – Player character wants a gun in a prehistoric campaign. What to do?

The easy solution is no. Restrictions on character building are completely reasonable.

A question is, how can you say yes to as much as possible?

First, andriods are not around. Nobody has the magical or technological base to build new life this early since the creation of the world. We could go “android but not really”, but how can we say yes?

Second, guns are not around. People are working out longbow technology, let alone crossbows or guns. You can create magitek guns, or tools that mimic the effect of guns, but that both bends your setting background and probably won’t satisfy the player. So, how can we say yes?

Third, the gunslinger class is a fighter, not an inventor. They are mainly experts with using guns, not creating arbitrary inventions.

Fourth, the mafia. You don’t want a complex criminal syndicate to exist at this point in time.

We need a way for an android or robot who is mainly about shooting things, who is indebted to a shadowy criminal organization, show up in a situation far before guns or androids exist?

How about we steal a plot line.

This is 1000 years since reality is created.

The Dawn War is about to break out, and everything is about to go horribly wrong.

Far in the future, near the end of time, a faction has decided that everything went wrong from the start. They have put together an artificial life form — an android — equipped it with advanced non-magical weapons (to avoid being detected), and sent it back to the dawn of time.

Its mission — and it cannot choose to refuse, it is a robot, right? — is nothing less than to change what happens in the Dawn War. Reshape reality from its root, and prevent the calamity (from the perspective of the conspiracy) to come.

The android isn’t the only thing they have done. They have sent messages to a collection of trickster gods and spirits to get them to act in certain ways to derail the Dawn War from its trajectory. These trickster gods are powerful beings, but they are not in the “inside” of the established celestial heirarchy; neither are they on the opposite side of the Dawn War.

The robot was sent back as part of this influence attempt. It was used to boost the power of this 3rd faction to the point where it could change the balance of power.

Now, the robot was a trojan horse gift to the trickster gods. It was intended to be used, trusted, and then as the Dawn War kicks off, it would act independently to tweak history in the way the end of time wants. These instructions where embedded deep into the robot’s memory so the trickster gods couldn’t find it.

But no plan survives contact with reality. Between the influence of the chaos gods and the fact that a useful android has free will, the android got tired of having its chain pulled. It has gone rogue. It doesn’t understand its full destiny — it just wants out from under the thumb of coyote, raven and the shadow council.

As the Dawn War approaches, hidden subroutines will activate and new instructions will deploy; but those instructions where intended for a far more subsurviant robot as originally designed, not the chaos-corrupted android that the player is. The messages and instructions will arrive, but it will be up to the PC to determine if they are acted upon.

Result: Character is an android (check) gunslinger (check) in the ancient past (check). The character has a connection to not one, but two different illicit “criminal” organizations (the chaos gods and the conspiracy from the end of time). They are given an ignorable unreliable connection to plot hooks (unlocked programmed messages from the conspiracy at the end of time).

Who is the conspiracy? What is their goals?

What is the calamity in the Dawn War? What causes it? Who fights in it?

The information provided — what are the results of acting upon it?

How much has reality already been changed by the intervention of the End Time Conspiracy?

What is Coyote, Raven and the Shadow Council up to? Do they know they are puppets? If they do, what do they think of that?

How much free will does this robot have?

## unity – How do I add a third axis of movement for my character to go up and down?

My movement system at the moment is based off of a tutorial I followed. The tutorial is about moving with spherical gravity. I want to add another axis of movement so my character can fly up and down with jet propulsion, but I cant get it to work, here is a couple parts of the tutorial code below:

``````void Update()
{
Vector2 playerInput;
playerInput.x = Input.GetAxis("Horizontal");
playerInput.y = Input.GetAxis("Vertical");
playerInput = Vector2.ClampMagnitude(playerInput, 1f);

if (playerInputSpace)
{
rightAxis = ProjectDirectionOnPlane(playerInputSpace.right, upAxis);
forwardAxis =
ProjectDirectionOnPlane(playerInputSpace.forward, upAxis);
}
else
{
rightAxis = ProjectDirectionOnPlane(Vector3.right, upAxis);
forwardAxis = ProjectDirectionOnPlane(Vector3.forward, upAxis);
}
desiredVelocity =
new Vector3(playerInput.x, 0f, playerInput.y) * maxSpeed;

desiredJump |= Input.GetButtonDown("Jump");

transform.rotation = Quaternion.LookRotation(forwardAxis, upAxis);

}

...

{
Vector3 xAxis = ProjectDirectionOnPlane(rightAxis, contactNormal);
Vector3 zAxis = ProjectDirectionOnPlane(forwardAxis, contactNormal);

float currentX = Vector3.Dot(velocity, xAxis);
float currentZ = Vector3.Dot(velocity, zAxis);

float acceleration = OnGround ? maxAcceleration : maxAirAcceleration;
float maxSpeedChange = acceleration * Time.deltaTime;

float newX =
Mathf.MoveTowards(currentX, desiredVelocity.x, maxSpeedChange);
float newZ =
Mathf.MoveTowards(currentZ, desiredVelocity.z, maxSpeedChange);

velocity += xAxis * (newX - currentX) + zAxis * (newZ - currentZ);
}
``````

How can I add another axis? I already have a third axis control for the trigger buttons set up in the input project settings, but I just cant find a way to fit a rising and falling axis in here. Help would be much appreciated

## dnd 5e – Advise of Making a lvl 20 multiclass character that targets the mind for 5e

I will be making a level 20 character for a one shot that will have alot of roleplay and combat. I want to be a bard plus something else. Either a lore or whisper bard and then either an Aberrant Mind Sorcerer or a Great Old One Warlock. I want to have at least 17 lvls of bard so at a key moment I can use true polymorph and turn into an aboleth. With all that in Mind, pun intended, what is the most optimized combo of 17 lvls of bard (lore or whisper) and 3 lvls of Aberrant Mind Sorcerer or a Great Old One Warlock?

## How do I deal with my group having issues with my character?

I am fairly newish to D&D. Our group plays every week and I have been a GM before. My character is fairly chill, chaotic neutral

I very nearly stopped reading right there, literally at that exact point mid-sentence. Chaotic neutral alignment is infamous for being the primary classic excuse some people use for why their character causing problems for the party should be considered ok, to the point where many groups outright ban that alignment entirely.

Almost the entire rest of your post then proceeded to conform exactly to everything chaotic neutral is infamous for. Specifically:

• Causing nuisances for the party
• Undermining the seriousness of situations that the other players want to treat seriously
• Doing obviously bad, or at least risky, things that have consequences for the whole party
• Doing things to the other party members, serious or not, that are unwelcome

She will often be the one to push the button in the middle of the room, or lick the wall etc.

If there is a button in the middle of the room and the other players are staying well away from pushing it, then most likely they want it to not be pushed. By anyone. And considering the context, they likely have excellent reason for that desire. And there your character goes, doing exactly what the other players – seriously – want no one to do.

When everything is getting a bit too serious during times that are not serious, my character may do something to bring the story back to life. The GM loves it and will always let me go for it, as the story is richer and more enjoyable and I will feed more into some of the story elements he has done. The group however want to follow everything to the book.

For the other players, what you describe as “too serious” may be exactly the level of seriousness they want. So, they’re getting the play experience they want, and then your character comes along and breaks it.

For example tonight we were having a long rest, and my character was having a bit of fun and while they slept, put mud on their hands and woke them with a feather…when they woke they got a muddy face. Nothing major, just a little prank. It’s not real.

Real or not, you pranked the other party members. That by itself is something many players view as a major negative. Many, maybe even most, campaigns are intended to be the player characters, as a united group, vs assorted NPC groups in the world. Pranking another party member puts your character in conflict with another player’s character, even if it’s a minor and non-serious conflict, and that breaks the party vs the world paradigm.

In addition, you spent game time on doing this prank. Game time that could have been spent instead on whatever quest or storyline the other players have been getting invested in. You took away from the parts of the game they enjoy most, and used the time you took to instead actively annoy them.

And one of them set their familiar onto me to attack, which I of course batted it away… I am a tabaxi, I have claws… the GM made me roll to hit it and with my roll it died (can be brought back with a spell). This is a great twist to the story!

No. No, it is not. If it happened as part of adventuring against the bad guys, then maybe, but it didn’t. It happened as part of one party member bothering the other party members for no reason, and that makes it definitively a Bad Thing that the party member in question caused.

Setting their familiar on you may have been an overreaction if it was in response to just this single prank, but I think it was probably in response to accumulated frustration and annoyance built up over your character’s entire play history in the group. And then your character, who’s already been getting on their nerves all the time, killed their familiar. If the characters were real people, acting with their own emotions and without the group of players to keep them in a matching group, your character would be exceedingly lucky if she got away with just being expelled from the party.

An ogre then attacked us due to all the noise they were making about it and the ogre ruined their tents, Instead of the characters continuing on, etc, instead they both start getting actual mad at me, blamed me for everything.

This entire sequence of events started with your character doing something pointless and deliberately annoying to the other characters, which then escalated into serious bad things happening. Judging by everything you’ve described, in their place I would probably be mad at you too. If you had just said “I sleep through the night” instead of doing your prank, the familiar would still be alive, the tents would still be intact, and the party would already be on their way.

I mean, is this not the point of the game, to have moments that you can not control, or you might fuck up etc.

Sometimes, maybe, but almost never because of the actions of another party member. It is the GM’s role to provide such things, not yours. Your role, as a fellow party member, is to help your party overcome these obstacles.

The person who had the bird has actually nearly killed my character by accident during the campaign and I didn’t freak out and go on some kind or attack mode.

The critical key words here are “by accident”. You may not have intended the consequences of your prank, but the prank itself was absolutely intentional. I would guess that the accidental near-killing was also a one-off event, while your prank was part of an extended behavior pattern.

our characters do not seem to mesh well.

Indeed. The character you described would mesh poorly with most groups, and if you find a new group and play a similar character in the new group, you will likely end up with the same issue again.

I think you need to retire the character, and make a new one to replace her in the party. Choose an alignment that is not chaotic, craft a personality for the character that takes things more seriously, and accept that the game is more about engaging in imaginary heroics and less about pranks, jokes, and randomness. The game is supposed to be fun, yes, but the other players want that fun to come from achievements, overcoming challenges, and the story. Re-orient yourself to focus on that, and both you and the other players will likely start enjoying it more.