Is it a useful strategy for Mobile VR titles to render faster than their simulation loop?

For example – If a title had a very heavy simulation loop (say 20ms), is it desirable to render at a greater rate, say 90hz?

This would always a present head pose correct to the view, without being stalled on simulation.

Or does this result in discomfort for the player, and instead render and sim should stay in lockstep?

In Unity, how can I render borders of provinces from a colored province map in a grand strategy game?

I am kind of a beginner of Unity.

I am trying do work on a grand strategy game. I already have a province map, colored by unique rgba for each province, looks like something below:


I know that the province map is kind of a look up map for province id. But when I obverse the paradox strategy games, I notice that they have render borders differently for the provinces and nations. For example, in the CK3, the Baron collars are separated with dotted lines, and the kingdoms are separated with enhanced yellow lines.

enter image description here

I thought they have some other maps or files containing those information, so I went to read their dev diary, and I find that all province shape information are stored in the province map.

enter image description here

So, my question is:

Is there any way in Unity3D to create those different borders with some shader and some province map such those given above?

The opposite of a Tit-for-Tat strategy

The tit-for-tat strategy is a well-known strategy that can be applied, for example, in the Iterated Prisoner’s Dilemma (IPD). Roughly, the idea is that you always repeat what the opponent did in the previous round.

I was wondering, does there exist a name for the opposite of a tit-for-tat strategy? That is, a strategy in which you always do the exact opposite of what your opponent did in the previous round.

Of course, in the IPD such a strategy wouldn’t make any sense, but there may be other games where it does. Any links to papers that have investigated such strategies are welcome.

Optimal strategy for tossing three dependent coins

Suppose that I have three correlated coins. The marginal probability of Head of coin $ i$ is denoted by $ p_i$ .

The conditional probability of head for coin $ i$ given the outcomes of coin $ j$ and $ k$ is denoted by $ p_i|x_j,x_k$ , where $ x_j,x_k\in\{H,T\}$ . We can similarly construct the conditional probability of $ i$ given $ x_j$ .

Each coin can be tossed at most once and you receive a $ 1 for a head and -$ 1 for a tail. You don’t have to toss all the coins, and your objective is to maximize the total reward.

What would be the optimal sequence of tossing coins in this case?

If the coins are independent of each other, the order wouldn’t matter. The optimal strategy should be “flip coin i if $ p_i>\frac{1}{2}$ “. For the case of two coins, it can be shown that it is always the best to flip the coin with a higher marginal $ p_i$ . However, this doesn’t have to be optimal for three coin cases. I’ve been thinking about this problem for a quite long time but can’t come up with a general solution or an intuition that might help..

What strategy should I use to sovle this interview problem? May I apply DP on this?

The problem description is as below and it feels like a DP problem but I am not sure, thank you for helping!

You have a certain dose of a drug, say, 200 milliliters, and now some patients need this drug. The doses for each patient may vary from person to person, for example, 2.5 milliliters for A, B, C, 5 milliliters for D, E, and 7 milliliters for F, and so on. The question is, in short, how can you allocate the drugs so that you have the least amount of drugs left? Example input: total drug dose 10 (milliliters). A needs 3, B needs 5, C needs 2, D needs 4, E needs 2. Output: A, B, C or A, B, E (perfect allocation with no drugs left). Note: there may be decimals.

You are welcome to give any hints or mature solutions to the question, or you can ask for more details about it.

Proof strategy to show that an algorithm cannot be implemented using just hereditarily terminating procedures

I am taking my question here from there. Consider the following scenario:

You are given a fixed programming language with no nonlocal control flow constructs. In particular, the language does not have

  • Exceptions, first-class continuations, etc.
  • Assertions, in the sense of “runtime tests that crash the program if they fail”.

Remark: An example of such a language could be Standard ML, minus the ability to raise exceptions. Inexhaustive pattern matching implicitly raises the Match exception, so it is also ruled out.

Moreover, you are forced to program using only hereditarily terminating values. Inductively, we define hereditarily terminating values as follows:

  • Data constructors (including numeric and string literals) are hereditarily terminating.
  • Applications of data constructors to hereditarily terminating arguments are hereditarily terminating.
  • A procedure f : foo -> bar is hereditarily terminating if, for every hereditarily terminating x : foo, evaluating the expression f x always terminates and the final result is a hereditarily terminating value of type bar.


  • Hereditarily terminating procedures need not be pure. In particular, they may read from or write to a mutable store.

  • A procedure is more than just the function it computes. In particular, functions do not have an intrinsic asymptotic time or space complexity, but procedures do.

Hereditarily terminating procedures formalize my intuitive idea of “program that is amenable to local reasoning”. Thus, I am interested in what useful programs one can write using only hereditarily terminating procedures. At the most basic level, programs are built out of algorithms, so I want to investigate what algorithms are expressible using only hereditarily terminating procedures.

Unfortunately, I have hit an expressiveness ceiling much earlier than I expected. No matter how hard I tried, I could not implement Tarjan’s algorithm for finding the strongly connected components of a directed graph.

Recall that Tarjan’s algorithm performs a depth-first search of the graph. In addition to the usual depth-first search stack, the algorithm uses an auxiliary stack to store the nodes whose strongly connected components have not been completely explored yet. Eventually, every node in the current strongly connected component will be explored, and we will have to pop them from the auxiliary stack. This is the step I am having trouble with: The loop that pops the nodes from the stack terminates when a given reference node has been found. But, as far as the type checker can tell, the reference node could not be in the stack at all! This results in an extra control flow path in which the stack is empty after popping everything from it and still not finding the reference node. At this point, the only thing the algorithm can do is fail.

This leads to the following…

Conjecture: Tarjan’s algorithm cannot be implemented in Standard ML using only hereditarily terminating procedures.

My questions are:

  1. What kind of proof techniques would be necessary to prove the above conjecture?

  2. What is the bare minimum type system in which Tarjan’s algorithm can be expressed as a hereditarily terminating program? That is, what is the bare minimum type system that can “understand” that the auxiliary stack is guaranteed to contain the reference node, and thus will not add a control flow path in which the auxiliary stack is empty before the reference node has been found?

Final remark: It is possible to rewrite this program inside a partiality monad. Then every procedure would be a Kleisli arrow. Instead of

val tarjan : graph -> scc list 

we would have something like

val tarjan : graph -> scc list option 

But, obviously, this defeats the point of the exercise, which is precisely to take out the procedure out of the implicit partiality monad present in most programming languages. So this does not count as a solution.

Decide which player has winning strategy in maximum matching problem

Given the following game: Two players, player 1 and player 2, play a game in which the first player starts naming a hero $ h_1$ , then player 2 responds with a villain $ v_1$ who has played in the same movie as $ h_1$ . Then player 1 responds with another hero $ h_2$ who has played in the same movie as $ v_1$ , and so forth. Each hero and villain can only be used once. The first player that gets stuck, has no more hero/villain, loses the game. Note that player 1 always starts.

The two players may only pick heroes and villains from given sets of heroes $ H$ and villains $ V$ ($ |H| = |V| \geq 1$ ). They also get a set of movies $ M$ with the corresponding heroes and villains appearing in that movie.

The question is: can you, based on $ H$ , $ V$ and $ M$ , decide which player has the winning strategy?


Given the following data: the heroes are Iron Man, Captain America, Thor and Spider-Man. The villains are Whiplash, Ultron, Thanos and Vulture. The movies are Avengers: Infinity War (stars Iron Man, Captain America, Thor, Thanos and Spider-Man) and Spider-Man: Homecoming (stars Iron Man, Vulture and Spider-Man). Can you decide which player has the winning strategy?

My approach is to use maximum bipartite matching to find out which player has the winning strategy, because we can split the data in two sets, namely $ H$ and $ V$ and have relations between those two sets. The Hopcroft-Karp algorithm can take two of such sets and find out the maximum cardinality. Please correct me if I’m wrong: in the cases in which there is a perfect matching, player 2 wins and otherwise player 1 wins. Whenever there is a perfect matching, it means that player 2 has always had an answers to the hero that player 1 named.

How would you solve this? Is there a better, more efficient solution than some maximum bipartite matching.

How can I improve combat so my players don’t always use the strategy of focusing fire on one enemy at a time until it’s dead?

I’m DMing a campaign on 5e with a group of four players. We’re all experienced in RPG in general but not specifically on 5e.

Players are Level 4. Wizard, Fighter, Rogue and Druid, Circle of the Moon.

My players have come to the conclusion that, given the mechanics of the game, is much more effective to focus all the fire power on a creature at a time and avoid spreading damage. Their logic is it really doesn’t matter if a creature has 1 or 80 HP left, as longs a it has over 0, he has all capacity to do damage. In effect, creatures are binary, they are either alive and therefore have full capacity to act, or death, in which case they don’t.

Unfortunately I agree with this assessment but I feel it makes the game less fun. Not because I’m looking for super realistic combat but because it limits the combat strategy to “drop them one at a time”.

As such, they tend to not distribute their efforts or engage separately but, instead, swarm into a single enemy, concentrate all the attacks and then move to the next. This feels to me like the more effective tactic but also the least “fun” and role playing way of doing combat.

Is my players interpretation wrong or am I handling the combat in the wrong way? What am I missing?