What can I read about how we tie the stochastic characteristics of task resolution into statements about a game system’s aesthetics? [closed]

I like making RPG systems. One thing I’ve noticed is that different kinds of task resolution systems make the game significantly different.

Background

For example, games like D&D 3.X and Shadowrun 4E have a very details-oriented approach to task resolution. A typical die roll in combat might be something like 1d20+1+1+4+3+(7+2+3)*1.5+20-2 v.s. 10+8+min(4,1)+5+3+2+5, where each number comes from a different source and things like "I enjoyed breakfast greatly! +3 to hit" and "My shoes are freshly polished for +1 max dex mod to AC" matter greatly.

There are a limited number of modifiers and choosing the right combination for any given character is immensely important to the character’s success in the game.

Other games, like FATE 2.0 or Amber Diceless, have a different approach. There a typical task looks like 5+4dF vs 3+4dF±2. All of the things that are tracked carefully in the first examples are abstracted away into a single modifier. This modifier generally does not exceed 50% of the base skill amount, and is generally regarded as less important than having a higher base skill amount. (In Amber diceless the ‘rolls’ are even more extreme: 1±1 v 3±1 is an example of a task’s mechanical description there).

I am comfortable talking about this kind of difference between RPGs in general. We can talk about levels of abstraction, we can talk about focus, we can describe a system as ‘high-level’ or ‘detail-oriented’ or whatever.

The problem

What I am less comfortable with is the manner in which the stochastic character of a system’s task resolution comes off to participants of RPGs run in it.

For example, I can tell you that the absence of dice in Amber significantly changes the feel of the game versus a similar setting modeled and run in FATE 2.0.
I’m much less articulate as to what the actual differences are, though. I’m aware of some popular pieces on randomness in RPGs, like the ‘goblin dice’ thing, but none of them really talk about the full space of stochastic design available to us as game designers. We can talk about how 2d6 is ‘less swingy’ than 1d13, but how using one or the other more commonly for some hypothetical ruleset would influence our aesthetic perception of that ruleset is not immediately clear.

I’m looking for a published overview of ways that different features of a task resolution system (in terms of stochastic analysis) are relevant to the ‘feel’ (i.e. the perception of aesthetic qualities) of the overall game system from a game-design perspective. In particular, I’m interested in the impact of the magnitude of the stochastic variance of the resolution system on the system, as well as the impact of greater or lesser volatility, and of polynomialization of the distribution (i.e. how binomial, trinomial, etc distribution for a game’s randomizer affects the game’s overall aesthetic).

Basically, I’m looking to read published work addressing the question: How do we tie the stochastic characteristics of task resolution into a statement about the experience of using a particular role-playing game system?

What makes a good answer?

Answers will recommend further reading on the topic to support the claims made in their shorter overview. IJRP preferred. I’m looking for an overview, not a full discussion– it’s sufficient to provide references to appropriate academic literature and to explain how, and that, that literature answers the question. Also, since comments indicate that people are seeking primarily for online sources, let it be explicitly mentioned that offline sources like books are no less good for their being offline (RPGs may be young, but they most certainly predate widespread internet use).

Cores, threads and sockets: what does it mean the calculation $T = tcs$ and the number on windows task manager performance?

Well, suppose then we have an CPU system such as:

Thread(s) per core $ \equiv t$ : 4

Core(s) per socket $ \equiv c$ : 4

Socket(s) $ \equiv s$ : 1

Then, we must to perform a simple calculation such as: $ 4 \cdot 4 \cdot 1 = 16 $

Therefore, in general we have:

$ $ T = t\cdot c \cdot s \tag{1}$ $

I guess that the equation $ (1)$ gives you then the total number of threads which your system can handle simultaneously.

On the other hand, consider the figure, of windows task manager, in the following:

enter image description here

In the red box we clearly see the number of "Threads". So I would like to know:

What is the difference between the number given by formula $ (1)$ and the number given by windows task manager?

Greedy sequential/parallel task scheduling

We have N tasks that need to be scheduled for processing. Each task consists of two parts that need to executed in order. The first one is guarded by a mutex and therefore only one task can be executing this part at a time. The second part has no such constraint and any number of the tasks can be executing this at the same time. For task i we know how much time it needs to spend in each part, namely mi for the guarded part, and ai for the part that can be executed in parallel.

The problem is to find a permutation of the tasks such that the time needed to execute all of them is minimized.

My intuition says that this can be solved with a greedy algorithm, by scheduling the tasks in descending ai order.

For example given the tasks with:
m1 = 3, a1 = 9
m2 = 2, a2 = 7
m3 = 6, a3 = 10

The optimal solution is the permutation 3, 1, 2.

However, I have trouble proving that the greedy solution is optimal. Any ideas on how to do that?

What are the differences between “Escape” and a common task to get free?

The Explorer special ability Escape (2 Speed point), as stated in the (old) Cypher System Rulebook is used to get free (p. 41):

You slip your restraints, squeeze through the bars, break the grip of a creature holding you, pull free from sucking quicksand, or otherwise get loose from whatever is holding you in place. Action.

But this is already possible using a common Might or Speed (or even Intellect) task, as stated in example in the description of the Giant (p. 295):

If a giant attacks a single target, she can choose to do regular damage or to grab hold of her victim, dealing 4 points of damage instead. On his turn, the victim can attempt a Might defense roll to struggle out of the grip, a Speed defense roll to slip out, or an Intellect-based task to distract the giant.

So what’s the difference between Escape and a common defense roll?

Blocking task report is showing false positive

Here is the code I am using to send email alerts. It seems to send more false +ves, can anyone guide me how to resolve this ?

DECLARE @Waiting INT; DECLARE @Message NVARCHAR(MAX);  SELECT  @Waiting = COUNT( s.session_id ) FROM    sys.dm_exec_sessions s LEFT OUTER JOIN sys.dm_exec_connections c ON ( s.session_id = c.session_id ) LEFT OUTER JOIN sys.dm_exec_requests r ON ( s.session_id = r.session_id ) LEFT OUTER JOIN sys.dm_os_tasks t ON ( r.session_id = t.session_id AND  r.request_id = t.request_id ) LEFT OUTER JOIN (                     -- In some cases (e.g. parallel queries, also waiting for a worker), one thread can be flagged as                     -- waiting for several different threads.  This will cause that thread to show up in multiple rows                     -- in our grid, which we don't want.  Use ROW_NUMBER to select the longest wait for each thread,                     -- and use it as representative of the other wait relationships this thread is involved in.                     SELECT  *                             ,ROW_NUMBER() OVER ( PARTITION BY waiting_task_address ORDER BY wait_duration_ms DESC ) AS row_num                     FROM    sys.dm_os_waiting_tasks ) w ON ( t.task_address = w.waiting_task_address )                                                             AND w.row_num = 1 LEFT OUTER JOIN sys.dm_exec_requests r2 ON ( r.session_id = r2.blocking_session_id ) WHERE   ISNULL( t.task_state, N'' ) <> ''         AND ISNULL( DB_NAME( r.database_id ), N'' ) = 'MyDB'         AND ISNULL( w.wait_duration_ms, 0 ) > CASE                                                     WHEN FORMAT( GETDATE(), 'HH:mm' ) >= FORMAT( CAST('07:00AM' AS TIME), N'hh\.mm' )                                                         AND  FORMAT( GETDATE(), 'HH:mm' ) < FORMAT( CAST('05:30PM' AS TIME), N'hh\.mm' ) THEN 10000                                                     ELSE 20000                                                 END ---  this will change the wait time to 20s during offpeak hours.         AND s.session_id <> ISNULL( w.blocking_session_id, 0 )         AND is_user_process = 1;    ---- added on 2019-04-02 @8.40AM to neglect the parallel queries.threads blocking themselves   IF ( @Waiting > 30 )     --send email  

How to optimize algorithm which tries to get the lowest sum for a task

I have a puzzle game which I am not sure how to prove that I have the right answer. I am sure that a code can be written to get all the possible solutions and find the best one from them. However, I am not sure what logic this code should follow. I managed to write a code which can follow my logic, but it does not try all options and therefor maybe a better option exists

The Puzzle is the following:

We have a wizard which makes very special jewelry. However, because they are so special there are some rules that he should follow when creating them.

He has 30 types of beads and unlimited count from each type. Every bead has different color but for simplicity lets name them (B1, B2, B3, B4 … B30 because this is not important). The important part is that every bead type costs different amount of gold coins

B1 -> 1 gold coin

B2 -> 2 gold coins

B3 -> 3 gold coins

B30 -> 30 gold coins

There are three special operations that he can use when creates a jewelry:

  1. He can buy beads, but every time when he buys a bead he should put it at the end of the jewelry.

For example:

  • When he starts the jewelry no bead is added, so he can buy for example B4 for 4 gold coins and put it on the first place

  • After that he can buy another bead, for example B6 for 6 gold coins and he should put it at the end.

    Now he has jewelry from B4 – B6

  • After that he can buy another bead, for example B11 for 11 gold coins and he should put it at the end.

    Now he has jewelry from B4 – B6 – B11

The total amount of gold coins that he used for creation of this jewelry is 21

  1. He is so good that if he has jewelry from some beads he can cast a magic and he can increment all the beads with one. However, this magic costs 2 gold coins.

For example:

  • If we continue with the jewelry from the previous point B4 – B6 – B11, he can cast this magic and the result will be a new jewelry B5 – B7 – B12. This operation will cost for him 2 gold coins.

  • If he continue incrementing one more time, the jewelry will become: B6 – B8 – B13. This will cost him 2 gold coins.

From these two steps he spend 4 more gold coins and the total amount of the jewelry at the moment is 25

  1. The third and the last operation that he can use is to switch position of two adjacent beads. This will cost him 1 gold coin.

For example if we continue with the jewelry from previous step B6 – B8 – B13:

  • He can change the position of the second and third beads and the new jewelry will become B6 – B13 – B8 and the cost for this operation is 1 gold coin.

  • Now he can change the position of the second and first beads and the new jewelry will become B13 – B6 – B8 and the cost for this operation is 1 gold coin.

From these two steps he spend 2 more gold coin and the total amount of the jewelry at the moment is 27

The question is what is the smallest amount of gold coins that he should use to create the following jewelry:

B18 – B1 – B16 – B19 – B6 – B22 – B14 – B15 – B2 – B12 – B27 – B18 – B11 – B1 – B14 – B9 – B23 – B1

One thing to notice. The start and end bead of the jewelry are not connected. So there is no easy way to swap their positions with one move. You should move through all other beads.

The general approach of solving that I took is:

Instead of starting from 0, I start from the complete jewelry. If I have B1 at last position, I just remove it (this conforms to buy B1 action). If it is not a last position I move it to the last position and then remove it. If I do not have B1, I decrease until I have B1 and repeat all the other steps. If we are left with 2 beads just use them.

var final = [18, 1, 16, 19, 6, 22, 14, 15, 2, 12, 27, 18, 11, 1, 14, 9, 23, 1]; var totalSum = 0; var resultTable = [];  function sum() {     return final.reduce((acc, el) => acc + el, 0); }  function removeOne(arr, indexOfOne) {     if (indexOfOne === arr.length - 1) {         totalSum += 1;         arr.pop();         resultTable.push({ action: "remove last", arr: arr.toString(), cost: 1, totalCost: totalSum });        } else {         var nextOfOne = indexOfOne + 1;         var temp = arr[indexOfOne];         arr[indexOfOne] = arr[nextOfOne];         arr[nextOfOne] = temp;         totalSum += 1;         resultTable.push({ action: "swap", arr: arr.toString(), cost: 1, totalCost: totalSum });       } }  function decrementAll(arr) {     final = arr.map(el => el - 1);     totalSum += 2;     resultTable.push({ action: "decrement", arr: arr.toString(), cost: 2, totalCost: totalSum }); }  var i = 2;  while (sum() > 0) {     var indexOfOne = final.lastIndexOf(1);      if (final.length === 2) {         totalSum += final.pop();         totalSum += final.pop();         resultTable.push({ action: "sell", arr: final.toString(), totalCost: totalSum });         break;     }      if (indexOfOne !== -1) {         removeOne(final, indexOfOne);     } else {         decrementAll(final);     } }  console.table(resultTable);  

It can be run here: https://repl.it/@SamAAZZ/wizardjewerly

However, without using a code I managed to get answer 129, 128.

Do you have any idea how can I improve the code to get the right answer. Maybe this involves finding all solutions, but I really do not know how I can make it. A general idea how to approach such kind of tasks is also a good start for me.

Any code in different languages is also OK. I can run it and observe how it works to check logic behind finding all possible solutions. I know how to get all solutions if I have only one operation to test, however here there are three operations for 18 positions and I really do not have idea how to approach this problem

Thanks in advanced

Why do Amdahl’s law and Gustafson’s law give us different speedups, when applied on the same task?

I am given a task, where exactly 50% of the work is parallelizable. When applying Amdahl’s law to calculate speedup when using 2 processing units instead of one, I get a different result than the one I get when calculating the same speedup using Gustafson’s law. I don’t understand why is that.

Is there a name for the class of algorithms that are the most efficient for a particular task?

This would be analogous to the Kolmogorov Complexity of a string, except in this case, I’m interested in the algorithm that solves a given problem using the least number of steps.

We would therefore have to be able to show that any other algorithm is of the same order of complexity as the algorithm in question.

I’m asking because I’m working on a paper that makes use of this concept, and I was surprised when I realized that I’m not aware of any name for this concept, though I’ll concede I’m risking embarrassment if there is such a name, that I’m simply unaware of.

list sorting task

I am trying to understand how to sort by multiple columns in Mathematica.

Here is a simple data set consisting of results of sports matches. Each element represents a game, and contains fields for date, first team’s name, first team’s score, second team’s name, second team’s score, and game location (home, away, or neutral). Some elements may be duplicates, or they may disagree on who played whom, or where a game was played. (Assumeing one team could only play one game per day.)

I would like to be able to evaluate each game and flag each having a conflict as “FALSE” or not having a conflict as “TRUE”.

The score list is called gameList:

{{DateObject[{2020,1,1}],"Alpha",1,"Bravo",2,"away"},  {DateObject[{2020,1,1}],"Bravo",2,"Alpha",1,"neutral"},  {DateObject[{2020,1,1}],"Charlie",3,"Delta",4,"home"},  {DateObject[{2020,1,1}],"Delta",4,"Charlie",3,"away"},  {DateObject[{2020,1,1}],"Echo",5,"Foxtrot",6,"home"},  {DateObject[{2020,1,1}],"Foxtrot",5,"Echo",6,"away"},  {DateObject[{2020,1,1}],"Gulf",7,"Hotel",10,"home"},  {DateObject[{2020,1,1}],"India",9,"Juliet",2,"home"},  {DateObject[{2020,1,1}],"Kilo",10,"India",9,"away"},  {DateObject[{2020,1,1}],"Lima",11,"Mike",12,"neutral"}} 

Here is some code that flips (if necessary) team and score pairs so that the team whose name starts earlier in the alphabet comes first in each game record. In the event the names and scores are reordered, the game location is also changed from home to away or vice versa.

alphaSortKey =    Table[AlphabeticOrder[gameList[[i, 2]], gameList[[i, 4]]], {i,      Length[gameList]}]; gameList =    Table[Append[gameList[[i]], alphaSortKey[[i]]], {i,      Length[gameList]}];  regular = Cases[gameList, {_, _, _, _, _, _, 1}]; regular = Table[Take[regular[[i]], 6], {i, Length[regular]}];  needTeamsFlip = Cases[gameList, {_, _, _, _, _, _, -1}]; holderLoca = Table[needTeamsFlip[[i, 6]], {i, Length[needTeamsFlip]}]; holderLoca =    Table[If[holderLoca[[i]] == "home", holderLoca[[i]] = "away",      If[holderLoca[[i]] == "away", holderLoca[[i]] = "home",       holderLoca[[i]] = "neutral"]], {i, Length[needTeamsFlip]}]; needTeamsFlip =    Table[Take[needTeamsFlip[[i]], 5], {i, Length[needTeamsFlip]}]; needTeamsFlip =    Table[Append[needTeamsFlip[[i]], holderLoca[[i]]], {i,      Length[needTeamsFlip]}]; holderTeam = Table[needTeamsFlip[[i, 2]], {i, Length[needTeamsFlip]}]; holderScor = Table[needTeamsFlip[[i, 3]], {i, Length[needTeamsFlip]}]; Table[needTeamsFlip[[i, 3]] = needTeamsFlip[[i, 5]], {i,     Length[needTeamsFlip]}]; Table[needTeamsFlip[[i, 2]] = needTeamsFlip[[i, 4]], {i,     Length[needTeamsFlip]}]; Table[needTeamsFlip[[i, 4]] = holderTeam[[i]], {i,     Length[needTeamsFlip]}]; Table[needTeamsFlip[[i, 5]] = holderScor[[i]], {i,     Length[needTeamsFlip]}]; needTeamsFlip =    Table[Take[needTeamsFlip[[i]], 6], {i, Length[needTeamsFlip]}];   ordered =    DeleteDuplicates[Flatten[Join[{needTeamsFlip}, {regular}], 1]]; Column[ordered = SortBy[ordered, {#[[1]] &, #[[2]] &}]]  ordered =    DeleteDuplicates[Flatten[Join[{needTeamsFlip}, {regular}], 1]]; 

But

 SortBy[ordered, {#[[1]] &, #[[2]] &, #[[4]] &}] 

returns an error.

The desired output would be:

{{DateObject[{2020,1,1}],"Alpha",1,"Bravo",2,"neutral",FALSE}, {DateObject[{2020,1,1}],"Alpha",1,"Bravo",2,"away",FALSE}, {DateObject[{2020,1,1}],"Charlie",3,"Delta",4,"home",TRUE}, {DateObject[{2020,1,2}],"Echo",6,"Foxtrot",5,"home",FALSE}, {DateObject[{2020,1,2}],"Echo",5,"Foxtrot",6,"home",FALSE}, {DateObject[{2020,1,2}],"Gulf",7,"Hotel",8,"home",TRUE}, {DateObject[{2020,1,3}],"India",9,"Kilo",10,"home",FALSE}, {DateObject[{2020,1,3}],"India",9,"Juliet",10,"home",FALSE}, {DateObject[{2020,1,3}],"Lima",11,"Mike",12,"neutral",TRUE}} 

Thanks in advance for suggestions!