How to avoid overwriting a value in Unity (C#)

I’m working on a Tower Defence style game, and wondering how best to handle the "resources" part. I have multiple enemies on screen at a time, and when an enemy dies, it updates a resource that allows the player to build more towers

var tower = Instantiate(buildables[0], center, Quaternion.identity); var controller = tower.GetComponent<TowerController>(); controller.OnKilledEnemy += (sender, args) => {     int.TryParse(goldAmount.text.Replace(",", ""), out var curr);     curr += args.gold;     goldAmount.text = $  "{curr:n0}"; }; 

But if 2 enemies die in the same frame, wouldn’t the value there miss an update?

What ways are there in Unity/C# to mitigate this problem?

Queueing MySQL record inserts to avoid over-subscription of a related resource … table locking?

Given a simplified hypothetical of seats in a lifeboat, if I have the following setup with a lifeboats table and a seats table where each record is one occupied seat in the given lifeboat:

CREATE TABLE lifeboats (   id INT UNSIGNED NOT NULL,   total_seats TINYINT UNSIGNED NOT NULL,   PRIMARY KEY (id));  INSERT INTO lifeboats (id, total_seats) VALUES (1, 3); INSERT INTO lifeboats (id, total_seats) VALUES (2, 5);  CREATE TABLE seats (   lifeboat_id INT UNSIGNED NOT NULL);  INSERT INTO seats (lifeboat_id) VALUES (1); INSERT INTO seats (lifeboat_id) VALUES (1); INSERT INTO seats (lifeboat_id) VALUES (1); INSERT INTO seats (lifeboat_id) VALUES (2); 

I can find lifeboats with available seats by querying:

SELECT      l.id, l.total_seats, COUNT(s.lifeboat_id) AS seats_taken FROM     lifeboats AS l         LEFT JOIN     seats AS s ON s.lifeboat_id = l.id GROUP BY l.id HAVING COUNT(s.lifeboat_id) < l.total_seats 

What is the best way to ensure 2 clients do not grab the last seat in a lifeboat without implementing some coordinating process queue?

My only idea (assuming I’m trying to grab seat in lifeboat 2) is going LOCK TABLE rambo like:

LOCK TABLE seats WRITE, lifeboats AS l READ, seats AS s READ;  INSERT INTO seats (lifeboat_id) SELECT      id FROM     (SELECT          l.id, l.total_seats, COUNT(s.lifeboat_id) AS seats_taken     FROM         lifeboats AS l     LEFT JOIN seats AS s ON s.lifeboat_id = l.id     WHERE l.id = 2     GROUP BY l.id     HAVING COUNT(s.lifeboat_id) < l.total_seats) AS still_available;  UNLOCK TABLES; 

but this is not very elegant, needless to say.

(My environment is MySQL8/InnoDB)

Does Dimentional Slide arcanist exploit allows you to avoid AoO from the starting possition of movement?

I recently had a discussion with my GM about Dimensional Slide exploit. The problem is the wording of the exploit:

"This ability is used as part of a move action or withdraw action, allowing her to move up to 10 feet per arcanist level to any location she can see. This counts as 5 feet of movement. She can only use this ability once per round. She does not provoke attacks of opportunity when moving in this way, but any other movement she attempts as part of her move action provokes as normal."

I haven’t found any rules about the description of "as a part of move action". Is it ment that I must start moving, for example, from threatened square, provoking an AoO, then do DS, or simply perform DS w/o any AoOs?

It is unclear that "as part of the action" require you to make this action exclusively in the middle of an action, not before or after it.

Please, follow your answer with some rules link, so it can be approved point, not just an opinion, because i really need some solid evidence ;D

Thank you.

P.S. I’ve read the thread below, and it states that I can avoid AoOs from any point of blinking, but it has no proof of ability to do so by rules.

Arcanist Dimensional Slide usage specific cases!

How to avoid alienation by expected but slow mood shift, and still keep players out of spoilers?

I run an MLP campaign. By design, at the start of the campaign what the citizens (PCs) know about the world is true, but it’s not the whole and complete truth, and many issues of the past are either not widely known or just reframed to appear less severe than they are. The campaign revolves around them figuring out How Things Really Are, and becoming ones who keep the surface level of the Utopia running.

And here’s the question. MLP makes people think that they know how things really are. So, over time a player may decide that it’s too dark, or by other means too conflicting with their own vision.

Be it other campaign, we could compare our visions for compatibility beforehand, to make sure that it works.

But this campaign is meant to include perspective shifts; I have a few players that are prone to ‘bleeding’ (and know that!) and/or prefer to stay out of spoilers. The ‘actual state of the world’ has/will have a ‘darker past’; this Utopia is based on a few questionable decisions, and is not as stable as it appears at first. I am afraid of alienating these players, or being met by a reaction of "You asked us to play in the Utopia, and then the mood became totally different". Basically, "I was creating my character for another sort of game, one that you initially described to me; and now it’s a different game, one that I don’t actually like".

How to reduce this risk of alienation, yet still keep the mood of mystery and (classical urban-fantasy) ‘this is deeper than you have thought’, without spoilers?

How should I set up and execute air battles in my session to avoid easy encounters?

I’m running the Storm King’s Thunder campaign, and we are at the portion where the PCs get an airship to travel around in, the airship is about 1000ft in the air. There are approximately 5-6 lvl 7 PCs, and they have 3 or 4 hard encounters a day. There are two wizards, a warlock, ranger, paladin, blood hunter, sorcerer, and fighter.

For the most part, they have had fun with the different weapons and enemies they have faced; however, I find that one or two spellcasting PCs have been using spells such as mind sliver, polymorph, and hypnotic pattern to defeat more challenging encounters, such as one with a roc and wyvern. They make the creature make saving throws with hypnotic pattern and cause the enemy to fall to its death, and using mind sliver makes it even harder, especially on low wisdom creatures like rocs. Or with the polymorph spell, they cause the enemy to become a fish or chicken and throw it off the edge, and since the damage carries over, it kills the monster. I realize it was legal and made fights funnier, but it does get annoying when it’s happening in almost every fight. Are there any suggestions on how to keep them on track without them making every encounter easy?

I thought of giving the monsters immunity to these effects, but it sounds like a lame excuse for me not being prepared.

How should I set up and execute air battles in my session to avoid easy encounters? [duplicate]

I’m running the Storm King’s Thunder campaign in dnd 5e, and we are at the portion where the PCs get an airship to travel around in. There are approximately 5-6 lvl 7 PCs, and they have 3 or 4 hard encounters a day. There are two wizards, a warlock, ranger, paladin, blood hunter, sorcerer, and fighter.

For the most part, they have had fun with the different weapons and enemies they have faced; however, I find that one or two spellcasting PCs have been using spells such as mind sliver, polymorph, and hypnotic pattern to defeat more challenging encounters, such as one with a roc and wyvern. They make the creature make saving throws with hypnotic pattern and cause the enemy to fall to its death, and using mind sliver makes it even harder, especially on low wisdom creatures like rocs. Or with the polymorph spell, they cause the enemy to become a fish or chicken and throw it off the edge, and since the damage carries over, it kills the monster. I realize it was legal and made fights funnier, but it does get annoying when it’s happening in almost every fight. Are there any suggestions on how to keep them on track without them making every encounter easy?

I thought of giving the monsters immunity to these effects, but it sounds like a lame excuse for me not being prepared.

How to avoid creating repeated links on the same site?

Hello guys! In a new campaign with the help of a premium list, I am getting repeated links, for example now GSA SER has just created 3 links from the same country and from the same site, on the wordpress articles platform.
– The links were created at different times.
However, they are the same links because they are on the same website.
– The content is different.
– The links / anchors are different.
Could you help me see if something in the configuration generates this problem.

How to avoid killing player characters due to a single (un)lucky roll?

Especially at low levels, Pathfinder characters can usually be killed easily by a single enemy attack, provided the dice fall in said enemy’s favor. An example:

The PC has a constituion score of 10 (modifier +0) and 8 HP

The enemy is of medium size, has a strength score of 14 (modifier +2) and is wealding a quarterstaff (obviously two-handed, as a quarterstaff is a two-handed weapon)

On a hit, the enemy deals 1d6+3 damage. On a critical hit (×2 for the quarterstaff), they can hence deal up to a maximum of 18 damage, which would kill the PC immediately with a single attack! There is no way for a healer to interfere, the character will die at once.

I believe stats as described above are neither unrealistic for a PC at level 1, nor for an enemy they might encounter. However, I recently ran a one-shot that almost resulted in TPK within 30min due to two critical hits the enemies got in early on, killing two of the PCs and thus changing action economy massively in their favor.

How can I avoid that without pulling off some Deus ex Machina stunt?

To be clear about this: I always make sure in session 0 that everyone knows PC death is possible (and so far players have always agreed to it). But even knowing that, it really puts a damper on everyone’s mood if a character the player possibly spent hours on creating dies in session 1 because of a single attack by a generic enemy.

Simply fudging the enemies rolls is not really a possibility, since I’m using Roll20 for my games at the moment and all players are able to see my rolls (including modifiers) once made. There is the possibility to hide rolls from players (which I sometimes use for opposed checks), but I would prefer not to do that for all attack/damage rolls just to be sure, because that already implies I intend to fudge a roll at some point (which I probably would in said situation, but I’d prefer players not to think about that constantly).

While this question might seem related, the problem at hand is not encounter balance (as pointed out above), but dealing with the risk of a balanced enemy killing a player due to (bad) luck.

How can I avoid redundancies when I have multiple distinct Roblox tools with clientside code?

In Roblox, I have two distinct tools with identical clientside code. The serverside code determines their difference to behave differently. However, with identical clientside code, whenever I change one, I have to change the other, and it’s redundant in the game and also tedious. How can I avoid redundancies when I have two nearly identical but distinct tools with identical clientside code? Basically, I have one serverside script to handle the remote events, in ServerScriptService, and two tools, and it happens that they both invoke the same serverscript and are otherwise identical. How can I avoid redundancies?