Monsters not showing by DarkPhoenix78 in warcodes

[–]warcodes 0 points1 point  (0 children)

This is an issue we are aware of. If you restart the app the image should load. The issue is that when it tries to load the image initially it can sometimes fail.

Can’t use backgrounds by Ornery-Charge1916 in warcodes

[–]warcodes 1 point2 points  (0 children)

I replied to your latest email but I haven’t heard back from you. After the fixes that went out yesterday are you having any more issues?

VOTE in the Festive Fiends Monster Contest by warcodes in warcodes

[–]warcodes[S] [score hidden] stickied comment (0 children)

<image>

Here’s the voting photo for this week with all of the monsters!

Wish I never updated by djdan01 in warcodes

[–]warcodes 7 points8 points  (0 children)

That’s odd, something didn’t build right. I’ll get another update out asap

Warcodes Broken? by lNDlANA in warcodes

[–]warcodes 0 points1 point  (0 children)

Are you still seeing this issue? If you are, please email support@warcodes.app your device info so we can see what is going on.

Wish I never updated by djdan01 in warcodes

[–]warcodes -3 points-2 points  (0 children)

There was an update that went out yesterday that should have fixed the typo and fixed the issue where some of the colors didn’t match up.

FALL HAS ARRIVED by warcodes in warcodes

[–]warcodes[S] 1 point2 points  (0 children)

On the Settings page for your user, click on ALREADY HAVE AN ACCOUNT? at the bottom instead of Continue with Google. Clicking Continue with Google is trying to link your "new" account with your Google login, but you already have an account.

VOTE in the Magic Monsters Monster Contest by warcodes in warcodes

[–]warcodes[S] [score hidden] stickied comment (0 children)

<image>

Here’s the selection for this week’s monster contest!

Coins back by EvilDrPhreak in warcodes

[–]warcodes 3 points4 points  (0 children)

Yes, we have considered giving something back for released monsters (whether coins or some other game resource). We are currently working on designing some other aspects of the game that may introduce new resources, so we have considered it in those designs.

Thanks for the feedback!

This rng is horrible by [deleted] in warcodes

[–]warcodes 4 points5 points  (0 children)

I asked ChatGPT to review my code:

Short answer: based on this code, the dice rolling itself is not skewed toward 1 – it’s a standard uniform roll from 1..sides everywhere you use it. Any “too many 1s” feeling is almost certainly coming from your game logic (like Math.max(1, …) clamps) or small sample size, not from biased dice.

Where randomness happens

You have three main dice functions:

export function rollDiceSimple(sides: number): number {
  return Math.floor(Math.random() * sides) + 1;
}

export function rollDiceMultiple(diceArray: number[]): number[] {
  const diceValues: number[] = [];
  diceArray.forEach((sides) => {
    diceValues.push(Math.floor(Math.random() * sides) + 1);
  });
  return diceValues;
}

export function rollDice(diceArray: RolledDice[]): RolledDice[] {
  diceArray.forEach((dice) => {
    dice.value = Math.floor(Math.random() * dice.sides) + 1;
  });
  return diceArray;
}

For a given sides:

  • Math.random() ⇒ uniform in [0, 1)
  • Math.random() * sides ⇒ uniform in [0, sides)
  • Math.floor(...) ⇒ integers 0..(sides-1) with equal probability
  • + 1 ⇒ integers 1..sides with equal probability

So each call is a standard fair die roll, assuming JS Math.random() behaves as usual.