Nat! bio photo

Nat!

Senior Mull

Twitter Github Twitch

Pidgeys are the backbone of my PokemonGo economy, an exercise in math done wrong

Short version

Pidgey

Pidgeys are plentiful and the transformation cost is low.

The average EP yield of a pidgey is 281.

How to mess it up

If you follow my twitter channel you noticed that I made various proclamations about the pidgey economy using a Numbers spreadsheet. Here’s the first one I made:

Nat! ‏@mulle_nat 25. Aug.

Pigeons are the backbone of my #PokemonGo economy. Every pigeon I catch is > worth 233.33 EP min. w/o doubling. Wrong

Mistakes made

  1. I did not know that a transform only uses 11 candy, though requiring 12
  2. I did not calculate (2500-900)/6 correctly …

How to mess it up more

Ok second try:

Nat! ‏@mulle_nat 9 Std.

Revised: Pigeons are the backbone of my #PokemonGo economy. Every pigeon I catch is worth 275 EP min. w/o doubling. Wrong

Mistakes made

I used Numbers and made a copy/paste mistake from a cell, which didn’t have a formula. In the last transform line, the pigeon number actually increased from 3 to 4, which is wrong.

At this point it became clear, that I just couldn’t trust myself with a spreadsheet to come up with a good answer.

How to do it right

Write a simulation in C (Github Project). The proper result (281) I would not have achieved with my spreadsheet approach, since it takes quite a few iterations to stabilize.

//
//  main.c
//  MullePokemonGoPidgeyEconomy
//
//  Created by Nat! on 30.08.16.
//  Copyright © 2016 Mulle kybernetiK. All rights reserved.
//

#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <string.h>


enum
{
   keep_one,
   sell_first
};


#define STRATEGY  keep_one
#define VERBOSE   0


struct pokemongo
{
   int   pidgey;        // Taubsi
   int   pidgeotto;     // Tauboga
   int   candy;
   int   ep_100;
   int   catches;
   int   steps;
};


static void   pokemongo_step( struct pokemongo *p, char *op)
{
   ++p->steps;
#if VERBOSE
   fprintf( stderr, "%d: %s %d %d %d\n",
               p->steps,
               op,
               p->pidgey + p->pidgeotto,
               p->candy,
               p->ep_100 * 100);
#endif
}


static void   pokemongo_catch( struct pokemongo *p)
{
   p->catches += 1;
   p->pidgey  += 1;
   p->candy   += 3;
   p->ep_100  += 1;
   pokemongo_step( p, "catch");
}


static void   pokemongo_sell( struct pokemongo *p)
{
   assert( p->pidgey > 0 || p->pidgeotto > 0);

   if( p->pidgeotto)
      p->pidgeotto -= 1;
   else
      p->pidgey  -= 1;

   p->candy += 1;
   pokemongo_step( p, "sell");
}


static void   pokemongo_transform( struct pokemongo *p)
{
   assert( p->pidgey >= 1);
   assert( p->candy >= 12);

   p->ep_100  += 5;
   p->candy   -= 12;
   p->pidgey  -= 1;
   p->pidgeotto += 1;
   p->candy   += 1;
   pokemongo_step( p, "transform");
}


static int   pokemongo_can_sell( struct pokemongo *p)
{
   if( p->pidgeotto > 0)
      return( 1);
   if( STRATEGY == sell_first)
      return( p->pidgey > 0);
   return( p->pidgey > 1);
}


static int   pokemongo_can_transform( struct pokemongo *p)
{
   return( p->pidgey > 0 && p->candy >= 12);
}


static double  pokemongo_get_average_per_catch( struct pokemongo *p)
{
   if( ! p->catches)
      return( 0.0);
   return( p->ep_100 * 100 / p->catches);
}


#if VERBOSE
static double  pokemongo_get_average_per_step( struct pokemongo *p)
{
   if( ! p->steps)
      return( 0.0);
   return( p->ep_100 * 100 / p->steps);
}
#endif


int main(int argc, const char * argv[])
{
   struct pokemongo   game;

   memset( &game, 0, sizeof( game));
   for(;;)
   {
      if( game.ep_100 >= 1000000 / 100)  // 1 mio EP
      {
         printf( "ep            : %ld\n", (long) game.ep_100 * 100);
#if VERBOSE
         printf( "rate          : %.2f\n", get_average_per_step( &game));
#endif
         printf( "avg per catch : %.2f\n", pokemongo_get_average_per_catch( &game));
         break;
      }

      if( pokemongo_can_transform( &game))
      {
         pokemongo_transform( &game);
         continue;
      }

      if( pokemongo_can_sell( &game))
      {
         pokemongo_sell( &game);
         continue;
      }

      pokemongo_catch( &game);
   }
}

Pidgey economy

  • when you catch a pidgey, you get 100 EP, 3 candy 1 pidgey

  • if you have 12 candy you can transform a pidgey into a pidgeotto to get 500 EP, 1 pidgeotto. But you lose 11 candy, 1 pidgey

  • you can sell a pidgey to receive 1 candy and lose 1 pidgey


Post a comment

All comments are held for moderation; basic HTML formatting accepted.

Name:
E-mail: (not published)
Website: