dnd 5e – How should I handle a Poltergeist throwing a PC into another?

I wanted to include a Poltergeist in one of my encounters but I’m not entirely sure how to handle one thing in its stat block.

The Poltergeist can use its Telekinetic Thrust ability to toss a creature up to 30 feet, and that creature takes 1d6 damage per 10 feet moved if it hits a “hard surface or heavy object”. It also says it can hurl objects at creatures and they take 2d4 damage on hit. The text is below:

Telekinetic Thrust. The poltergeist targets a creature or unattended object within 30 feet of it. A creature must be Medium or smaller to be affected by this magic, and an object can weigh up to 150 pounds.

If the target is a creature, the poltergeist makes a Charisma check contested by the target’s Strength check. If the poltergeist wins the contest, the poltergeist hurls the target up to 30 feet in any direction, including upward. If the target then comes into contact with a hard surface or heavy object, the target takes 1d6 damage per 10 feet moved.

If the target is an object that isn’t being worn or carried, the poltergeist hurls it up to 30 feet in any direction. The poltergeist can use the object as a ranged weapon, attacking one creature along the object’s path (+4 to hit) and dealing 5 (2d4) bludgeoning damage on a hit.

The Monster Manual reads that the Poltergeist is more driven by rage than anything else, and I was planning on playing it as blindly attacking the party by flinging objects at them or pushing them away. That said, it seems at least possible that it could throw one PC into another. How should I rule this? Should only the tossed creature take damage? The PC that was hit? Both?

unity – Billboard geometry shader vertex generation to handle changes in Y

I have a shader that takes an array of points. At each point, a geometry shader creates a quad oriented towards the camera.

This works fine when the camera and point are at around the same Y value, however, looding down upon the billboard results in it shrinking to a point the closer the camera approaches directly overhead.

Example (Youtube)

void geom(point v2g IN(1), inout TriangleStream<g2f> triStream) {
    // Calculate some vectors
    float3 up = float3(0, 1, 0);
    float3 look = _WorldSpaceCameraPos - IN(0).position;
    look = normalize(look);
    float3 right = cross(up, look);

    // And how far off-centre our corners are
    float halfS = 0.5f * IN(0).colorScale(1) * _Scale;

    // Calculate verts
    float4 v(4);
    v(0) = UnityObjectToClipPos(IN(0).position + float4(+halfS * right - halfS * up, 1.0f));
    v(1) = UnityObjectToClipPos(IN(0).position + float4(+halfS * right + halfS * up, 1.0f));
    v(2) = UnityObjectToClipPos(IN(0).position + float4(-halfS * right - halfS * up, 1.0f));
    v(3) = UnityObjectToClipPos(IN(0).position + float4(-halfS * right + halfS * up, 1.0f));

    // pass through color texture lookup
    float2 color = float2(IN(0).colorScale(0), .5);

    // Start pushing verts
    g2f o;
    o.position = v(0);
    o.color = color;
    o.uv = float2(1.0f, 0.0f);


I’m guessing my issue is related to the fact that my up and look are approaching coincidence, as the forward derives directly from the camera and the up is in world space, however, I’m uncertain of my diagnosis and unclear on how to generate an appropriately rotated up?

localization – How do you handle localisation with special tags for long languages

I think the option you have taken is already the correct one.

Your design should always accommodate for larger text (in both font size and length) because you should also be considering accessibility of you design. For example, if this is a web application, then the user might have the browser set to display large fonts or have the zoom set to a higher value than the default 100%.

With regards to it “looking odd”, it’s hard to comment without seeing the rest of your design and where these tags would fit into that. However, I would recommend that you expect tags to sometimes span multiple lines and try to find a design that accommodates that situation just as well as it does for single-line tags.

javascript – Handle multiple buttons with different API IDs in a HTML table

Ok, so my scenario goes like this: I am building an API of financial transactions. Backend does not matter for this problem, the only thing is that the API has a route /users/:userid/transactions/:transactionid. On the frontend (PHP and pure JavaScript, no NodeJS BFF or anyhing like that, just plain old client side JS with axios library) I have a page with a HTML table showing all transactions. Each row of the table (each transaction) has two options: Approve or Cancel. I then created two buttons for each row with the corresponding actions. However I am having some trouble dealing with these buttons because the buttons should call the API using the corresponding transactionid.

I have defined all the <button>´s with the id of the HTML element being the ID of the transaction to be used when POSTing on the route mentioned above. The button onclick attribute is used to call the JS function that will execute the POST and the id of the HTML button is passed to the function to be used as the transactionid. Like this:

<button id="EG202090283" onclick="Transactions.cancel(this.id)">Cancel</button>

In this case, the POST request is sent to /users/:userid/transactions/EG202090283. Of course this is not secure because the user can simply change the button id and POST to another route. But I don’t know another alternative and I’m looking for best practices about this.

The question is: how to link these two buttons (Approve and Cancel) to the desired transaction only and how to that in such way that is difficult for the user to change the transaction ID? Is it using sessions, do I need a BFF pattern for this?

How does the rsync daemon handle simultaneous access to the file?

In order to give different permission to different users. I have module like this:

    path = /data/cvs
    comment = example
    uid = rsyncbackup
    gid = rsyncbackup
    read only = no
    list = yes
    auth users = , guest1:ro, guest2:ro, admin1:rw, admin2:rw
    secrets file = /etc/rsyncd.secrets
  • There will not be any problem if both guest1 and guest2 are connected, since they are all read only.
  • What will happen if both guest1 and admin1 connect to the daemon? since admin1 is modifying the files and the guest1 is reading from it. Will there be racing? I can of course limit the max connection to 1. But this is inefficient when only ro users want to connect. Is there lock to prevent other user to connect when a rw user connect to the daemon? Is there options to only allow single rw user to connect but allow multiple ro users to connect?
  • what will happen if both admin1 and admin2 connect to the daemon? Both admin want to modify the path, is there lock prevent later one modify anything before the first one drops connection? Or is there lock to prevent multiple user modify the same file but still allow them modify different files?
  • what will happen if multiple ips try to connect to the daemon with same user for example admin1?

cpu – If the integer representation used is “0 through 4,294,967,295 (2^32 − 1)”, so does this mean the register cannot handle negative numbers?

From Wikipedia:

A 32-bit register can store 2^32 different values. The range of integer values that can be stored in 32 bits depends on the integer representation used. With the two most common representations, the range is 0 through 4,294,967,295 (2^32 − 1) for representation as an (unsigned) binary number, and −2,147,483,648 (−2^31) through 2,147,483,647 (2^31 − 1) for representation as two’s complement.

So if the integer representation used is “0 through 4,294,967,295 (2^32 − 1)”, so does this mean the register cannot handle negative numbers?

From a similar standpoint, if the integer representation used is “−2,147,483,648 (−2^31) through 2,147,483,647 (2^31 − 1)”, so does this mean that the register cannot handle numbers greater than 2,147,483,647?

dnd 5e – Ideas on how to handle a denying/unaware team attacking player?

Short: Right now I’m thinking about our next session and how to handle a PC who has attacked us the second time with an AoE spell. To defend him: he’s denying that he has done it intentionally and even saying that he doesn’t know anything about it.

First: I don’t want/need the best solution, just some ideas – like “how would you react?”.

But I will start by describing the whole situation:
We are a group of 5 PC – there are two double-pre-mates and I’m the lonely fifth one.
Two sessions ago the fighter in question attacked two of us the first time while we explored a mine occupied by wererats and some following smaller ones. The first small rat attacked him, as he’s always the one going first. Our archer, the rat and I were attacked by black tentacles getting out of the face of our knight and/or the rat – as the rat bite him in his face. The rat was slashed in three parts and the archer and I were lucky enough to dodge.
After we cleared the room we surrounded the fighter and asked him what it was, if he has any explanation or why he did it to us. He has only answered that he doesn’t know what it was and he hasn’t done it. We told him that we will watch him and aren’t really trusting him anymore.

Some days (in-game) later we got to an old cathedral occupied by orcs and ogres. We attacked the orcs with the help of the wererats, as the cathedral is the real home of them.
While fighting the first ogre (the fighter his accompanying cleric and I) these black tentacles popped up again, this time clearly out of his mouth, and attacked the ogre, an orc, the cleric and me. All were damaged (necrotic) and also prevented reactions for one round as we had to get rid of these tentacles first.
During the fight we haven’t talked about it as there were a lot more orcs than we thought first. The end of our last session was that we have “finished” (we haven’t checked the cathedral – only surrounding) the fight. We’ve lost some wererats and we all are heavily damaged, nearly all spell-slots are used and we have this big-black-mysterium in our group.

As it was the second time, this time we were damaged and we’ve clearly seen that the origin of these tentacles is the fighter we have to react somehow.

My current idea is to call the archer, as he still doesn’t trust the fighter and was betrayed in his past, so he will very likely support me. After this I would like to approach the fighter and “command” him to drop his weapon and get on his knees. I have placed a force-ballista (artificer) during the battle and can use my crossbow. If he doesn’t follow we get to the first problem – if I really attack him he will get very likely unconscious as he has 4HP remaining. Should I? I’m a lawful-neutral/good dwarven artificer, trying to get part of “Hammers of Moradin” and waiting for a sign of Moradin himself that I’m worthy to join the hammers.
So from my perspective it would be possible for my PC to attack a presumably lying, betraying, team-attacking, necromancy casting human fighter.
But in success-case, he’s now on his knees, I would at first arrest/tie him, ask him again in hope that he will talk more about these tentacles and otherwise transport him to the next town to present him to the local guards or similar and get him judged.

Now the question: do you have other ideas? How would you react? Everything is possible/valid response – as I’m pretty new to DnD (it’s my first campaign) and I want to get some ideas about what else could be possible.

front end – Best way to handle and combine client side and server side validations

I want to know if the way that I handle form validations is a good way.
What I actually do is a very detailed client side validation to validate each field and with custom error message for the UI according to the error. So for each field the user can see the associated error message.

But in the server, I do the validation in a more general fashion. So imagine that I have 3 fields in my form: name , email and password.What I do in the server is that after validations I don’t generate custom message, if maybe 2 field are not correct or maybe empty I just return a 422 status code with a more generic message like You should fill each field correctly.
Is it a good way to handle validations?

microservices – Where to place an in-memory cache to handle repetitive bursts of database queries from several downstream sources, all within a few milliseconds span

I’m working on a Java service that runs on Google Cloud Platform and utilizes a MySQL database via Cloud SQL. The database stores simple relationships between users, accounts they belong to, and groupings of accounts. Being an “accounts” service, naturally there are many downstreams. And downstream service A may for example hit several other upstream services B, C, D, which in turn might call other services E and F, but because so much is tied to accounts (checking permissions, getting user preferences, sending emails), every service from A to F end up hitting my service with identical, repetitive calls. So in other words, a single call to some endpoint might result in 10 queries to get a user’s accounts, even though obviously that information doesn’t change over a few milliseconds.

So where is it it appropriate to place a cache?

  1. Should downstream service owners be responsible for implementing a cache? I don’t think so, because why should they know about my service’s data, like what can be cached and for how long.

  2. Should I put an in-memory cache in my service, like Google’s Common CacheLoader, in front of my DAO? But, does this really provide anything over MySQL’s caching? (Admittedly I don’t know anything about how databases cache, but I’m sure that they do.)

  3. Should I put an in-memory cache in the Java client? We use gRPC so we have generated clients that all those services A, B, C, D, E, F use already. Putting a cache in the client means they can skip making outgoing calls but only if the service has made this call before and the data can have a long-enough TTL to be useful, e.g. an account’s group is permanent. So, yea, that’s not helping at all with the “bursts,” not to mention the caches living in different zone instances. (I haven’t customized a generated gRPC client yet, but I assume there’s a way.)

I’m leaning toward #2 but my understanding of databases is weak, and I don’t know how to collect the data I need to justify the effort. I feel like what I need to know is: How often do “bursts” of identical queries occur, how are these bursts processed by MySQL (esp. given caching), and what’s the bottom-line effect on downstream performance as a result, if any at all?

I feel experience may answer this question better than finding those metrics myself.

Asking myself, “Why do I want to do this, given no evidence of any bottleneck?” Well, (1) it just seems wrong that there’s so many duplicate queries, (2) it adds a lot of noise in our logs, and (3) I don’t want to wait until we scale to find out that it’s a deep issue.

c++ – What is a good platform to handle Game Subscription (SaaS) sales?

I’m looking to add subscription licensing to a long running Windows PC game with regular updates.

Ideally the provider would handle payments/licenses/downloads/updates as part of the arrangement.

I’d like a solution that is considerably cheaper than Steam – perhaps 5-10% of sales. Although I accept that if an initial sale is made through Steam, they should get their normal cut of the ongoing license fee.

Easy integration into C++ with sample code would be helpful too.

I have looked at:

  • xsolla: Currently the top runner, has auto-updates.
  • gumroad: Just handles the license & initial download.
  • mycommerce: Like gumroad, but more business feel.
  • patreon: Don’t know if this is suitable.

Are there any other providers I should research before I invest the time integrating one?