A Dice Game Called “Greed”

Imagine we have 5 dice. We roll, them, and jot down the results. Then, based on this chart:

 Three 1's => 1000 points  Three 6's =>  600 points  Three 5's =>  500 points  Three 4's =>  400 points  Three 3's =>  300 points  Three 2's =>  200 points  One   1   =>  100 points  One   5   =>   50 point 

We calculate the score. This program exactly does that. It has two functions, one is greed() which takes a vector of 5 integers between 1 and 6 and calculates the score, and the other is greed_rand() which first generates the vector randomly, and then calculates the score.

#include <iostream> #include <vector> #include <random> #include <map>  std::random_device seeder; std::mt19937 engine(seeder()); std::uniform_int_distribution<int> dist(1, 6);  typedef std::vector<int> list_type;  int greed(list_type die_rolls) {     int ret = 0;     std::map<int, int> cnt;      for (int i = 1; i <= 6; ++i)     {         cnt[i] = 0;     }      for (auto &d : die_rolls)     {         ++cnt[d];     }      if (cnt[1] == 3)     {         ret += 1000;     }     if (cnt[1] == 2)     {         ret += 200;     }     if (cnt[1] == 1)     {         ret += 100;     }     if (cnt[1] == 4)     {         ret += 1100;     }     if (cnt[1] == 5)     {         ret += 1200;     }     if (cnt[2] == 3)     {         ret += 200;     }     if (cnt[3] == 3)     {         ret += 300;     }     if (cnt[4] == 3)     {         ret += 400;     }     if (cnt[5] == 1)     {         ret += 50;     }     if (cnt[5] == 2)     {         ret += 100;     }     if (cnt[5] == 3)     {         ret += 500;     }     if (cnt[5] == 4)     {         ret += 550;     }     if (cnt[5] == 5)     {         ret += 600;     }     if (cnt[6] == 3)     {         ret += 600;     }       return ret;  }   int greed_rand() {     list_type rolls_rand;      for (int i = 1; i <= 5; ++i)     {         rolls_rand.push_back(dist(engine));     }      return greed(rolls_rand); }   int main() {      list_type rolls = {1, 1, 1, 5, 5};     std::cout << greed(rolls) << std::endl;     std::cout << greed_rand() << std::endl;      return 0; } 

The output of this program is:

1100 150 

Thank you and thanks for your input.

Note: If you’re on Windows, change the random seeder to time(NULL).

Back in the Game

Now that I am retired, I am starting on the whole seo game again. I had 7 stores that were pulling in about 1-3 hundred a month before i let them kinda die by not touching them for eighteen months. Now I am active again and I have been experimenting and figured I would document what I have been finding out with respect to tools and methods.

First I changed everthing over to fresh store instant. This made sense because it is hard to fight the big sites and this seemed to be pretty good as…

Back in the Game

PI memorization game

This is a simple game where the goal is to type digits of PI. If a wrong digit is entered the game restarts, and the user is told how many digits he got right, as well as the next few digits.

module Main where  import System.IO import Data.Function   (fix) import Data.Char       (isDigit, digitToInt) import Data.List.Split (chunksOf)   -- Digits of pi pi' = tail $   g (1,0,1,1,3,3) where   g (q,r,t,k,n,l)     | 4*q+r-t<n*t = n : g (10*q,10*(r-n*t),t,k,div(10*(3*q+r))t-10*n,l)     | otherwise   = g (q*k,(2*q+r)*l,t*l,k+1,div(q*(7*k+2)+r*l)(t*l),l+2)  -- Digits from stdin getDigits = map (fromIntegral . digitToInt)           . filter isDigit         <$  > getContents   main :: IO () main = do   hSetBuffering stdin  NoBuffering   hSetBuffering stdout NoBuffering    (getDigits >>=) . fix $   \rec inp -> do      let (past, future) = span (uncurry (==)) $   zip pi' inp      -- Print first digit     putStr "3."      -- Delimiter user input with spaces     mapM_ (`seq` putChar ' ') . map last $   chunksOf 2 past      -- Print score     putStrLn $   "\nScore:       " ++ show (length past)      -- Print next few digits     putStrLn . unwords              . ("Next digits:" :)              . take 10              . drop (length past `div` 2)              . map  (>>=show)              $   chunksOf 2 pi'      -- Try again     putStrLn ""     rec . map snd $   tail future 

One concern that I have with this code is the last line rec . map snd $ tail future. If the digits of PI were finite, then the game would end once the user had entered as many digits as there are in PI, because zip stops once one of its two input lists are empty. Therefor, evaluating future is clearly doing work lazily.

With an infinite PI, does this mean that my program will get slightly slower for every game played as the zips accumulate, until eventually it is entirely unplayable?

[ Football (American) ] Open Question : Now that Antonio Brown was pulled over for excessive speeding on game day, should he play tonight or no?

PITTSBURGH (KDKA) – Pittsburgh Steelers wide receiver Antonio Brown has been cited for driving in excess of 100 mph on McKnight Road. According to police, Brown was heading south when he was pulled over between Babcock Boulevard and the Parkway. The posted speed limit in that area is 45 mph. Officers were responding to a bank robbery at McCandless Crossing when they spotted a Porsche traveling at a high rate of speed and pulled it over. He was cited for reckless driving.

Object pooling of different tpyes of agents (Mobile Game) in Unity

The mobile game I am developing consists of one to four players and different agents that are being spawned and act in their own way. All those Agents (Car, Animal and Powerup) derive from the same base class ‘Agent’ which in turn has a field called ‘rank’ which represents something like ‘low’, ‘medium’ and ‘high’. So an agent with rank ‘high’ will look and behave different than one being tagged ‘low’.

The thing is – the ‘rank’ of the agent is determined at random. The max count of agents active simultaneously is known but this number is not in regard to their ‘rank’. When objectpooling, this would lead to the follwing case:

There’s a max agent count of, say, 6. This would require 6 instances of each agent with rank ‘low’ to ‘high’ to be created, altough some of those instances would never even be used.

So my idea was to create only 6 gameobjects holding the components that each agent requires and use reflection to set the components fields according to the type. The problem is that some compoents which are unique to rank and type would need to be added and removed at runtime.

What solution would be better in terms of runtime and memory performance?

Vi Bank – Virtual Bank Browser Game

Vi Bank is a new free browser based simulation game

About

Vi Bank is free browser based simulation game. The main goal of the game is players tobuild their own virtual bank with a huge network of branches and employees to make a good profit.

Why are you selling this site?

The main reason for selling the business is the fact that I do not have enough time to support and develop it.

How is it monetized?

Whilst the game is completely free to play, it operates…

Vi Bank – Virtual Bank Browser Game

Simple Python Pygame Game

I’m trying to make a simple game for a my school project. Do you have any tips on how to simplify and beautify the code?

https://github.com/20nicolas/Game.git

import pygame as py import os  py.init ()  screen = py.display.set_mode ((800,600))    bg = py.image.load('game-assets-game-background-sidescroller.png') clock = py.time.Clock ()   idle = [py.image.load(os.path.join('player','Idle (1).png')),py.image.load(os.path.join('player','Idle (2).png')),py.image.load(os.path.join('player','Idle (3).png')),py.image.load(os.path.join('player','Idle (4).png')),py.image.load(os.path.join('player','Idle (5).png')),py.image.load(os.path.join('player','Idle (6).png')),py.image.load(os.path.join('player','Idle (7).png')),py.image.load(os.path.join('player','Idle (8).png')),py.image.load(os.path.join('player','Idle (9).png')),py.image.load(os.path.join('player','Idle (10).png'))] run_right = [py.image.load(os.path.join('player','Run (1).png')),py.image.load(os.path.join('player','Run (2).png')),py.image.load(os.path.join('player','Run (3).png')),py.image.load(os.path.join('player','Run (4).png')),py.image.load(os.path.join('player','Run (5).png')),py.image.load(os.path.join('player','Run (6).png')),py.image.load(os.path.join('player','Run (7).png')),py.image.load(os.path.join('player','Run (8).png'))] jump = [py.image.load(os.path.join('player','Jump (1).png')),py.image.load(os.path.join('player','Jump (2).png')),py.image.load(os.path.join('player','Jump (3).png')),py.image.load(os.path.join('player','Jump (4).png')),py.image.load(os.path.join('player','Jump (5).png')),py.image.load(os.path.join('player','Jump (6).png')),py.image.load(os.path.join('player','Jump (7).png')),py.image.load(os.path.join('player','Jump (8).png')),py.image.load(os.path.join('player','Jump (9).png')),py.image.load(os.path.join('player','Jump (10).png'))] shoot_idle = [py.image.load(os.path.join('player','Shoot (1).png')),py.image.load(os.path.join('player','Shoot (2).png')),py.image.load(os.path.join('player','Shoot (3).png')),py.image.load(os.path.join('player','Shoot (4).png'))] shoot_run = [py.image.load(os.path.join('player','RunShoot (1).png')),py.image.load(os.path.join('player','RunShoot (2).png')),py.image.load(os.path.join('player','RunShoot (3).png')),py.image.load(os.path.join('player','RunShoot (4).png')),py.image.load(os.path.join('player','RunShoot (5).png')),py.image.load(os.path.join('player','RunShoot (6).png')),py.image.load(os.path.join('player','RunShoot (7).png')),py.image.load(os.path.join('player','Run (8).png'))]  class player(object):     def __init__(self,x,y,width,lenght):         self.x = x         self.y = y         self.width = width         self.lenght = lenght         self.vel = 5         self.right = False         self.left = False         self.standing = True         self.idlecount = 0         self.runcount = 0         self.jumping = False         self.jumpcount = 14         self.direction = 1         self.jumpingcount = 0         self.shooting = False         self.shootingcount = 0      def draw (self,screen):         if self.idlecount + 1 >= 30:             self.idlecount = 0          if self.runcount + 1 >= 24:             self.runcount = 0          if self.jumpingcount + 1 >= 31:             self.jumpingcount = 0          if self.shootingcount + 1 >= 9:             self.shootingcount = 0          if not (self.jumping):             if not (self.standing):                  if self.right:                     screen.blit (run_right[self.runcount//3],(self.x,self.y))                     self.runcount += 1                  elif self.left:                     screen.blit (run_left[self.runcount//3],(self.x,self.y))                     self.runcount += 1              else:                 if self.shooting:                     if self.direction == 1:                         screen.blit (shoot_idle[self.shootingcount//2],(self.x,self.y))                         self.shootingcount += 1                      elif self.direction == -1:                         screen.blit (shoot_idle2[self.shootingcount//2],(self.x,self.y))                         self.shootingcount += 1                  elif self.direction == 1:                     screen.blit (idle[self.idlecount//3],(self.x,self.y))                     self.idlecount += 1                  elif self.direction == -1:                     screen.blit (idle2[self.idlecount//3],(self.x,self.y))                     self.idlecount += 1          else:             if self.direction == 1:                 screen.blit (jump[self.jumpingcount//3],(self.x,self.y))                 self.jumpingcount += 1                 self.runcount = 0              elif self.direction == -1:                 screen.blit (jump2[self.jumpingcount//3],(self.x,self.y))                 self.jumpingcount += 1                 self.runcount = 0    pows = [py.image.load(os.path.join('player','Bullet_000.png')),py.image.load(os.path.join('player','Bullet_001.png')),py.image.load(os.path.join('player','Bullet_002.png')),py.image.load(os.path.join('player','Bullet_003.png')),py.image.load(os.path.join('player','Bullet_004.png'))]  class bulletss (object):     def __init__(self,x,y,facing):         self.x = x         self.y = y         self.facing = facing         self.vel = 10 * facing         self.shootcount = 0         self.lenght = 50         self.width = 50      def draw(self,win):          if self.shootcount + 1 == 12:             self.shootcount = 0          if self.facing == 1:             screen.blit (pows[self.shootcount//3],(self.x+25,self.y-25))             self.shootcount += 1          elif self.facing == -1:             screen.blit (pows2[self.shootcount//3],(self.x-75,self.y-25))             self.shootcount += 1   def drawGameScreen ():     screen.blit(bg,(0,0))     man.draw (screen)     for bullet in bullets:         bullet.draw (screen)       py.display.update ()  ##main loop  man = player (100,430,100,100) game = True bullets = [] shootloop = 0  idle = [(py.transform.scale(idle[0],(man.width,man.lenght))),(py.transform.scale(idle[1],(man.width,man.lenght))),(py.transform.scale(idle[2],(man.width,man.lenght))),(py.transform.scale(idle[3],(man.width,man.lenght))),(py.transform.scale(idle[4],(man.width,man.lenght))),(py.transform.scale(idle[5],(man.width,man.lenght))),(py.transform.scale(idle[6],(man.width,man.lenght))),(py.transform.scale(idle[7],(man.width,man.lenght))),(py.transform.scale(idle[8],(man.width,man.lenght))),(py.transform.scale(idle[9],(man.width,man.lenght)))] run_right = [(py.transform.scale(run_right[0],(man.width,man.lenght))),(py.transform.scale(run_right[1],(man.width,man.lenght))),(py.transform.scale(run_right[2],(man.width,man.lenght))),(py.transform.scale(run_right[3],(man.width,man.lenght))),(py.transform.scale(run_right[4],(man.width,man.lenght))),(py.transform.scale(run_right[5],(man.width,man.lenght))),(py.transform.scale(run_right[6],(man.width,man.lenght))),(py.transform.scale(run_right[7],(man.width,man.lenght)))] jump = [(py.transform.scale(jump[0],(man.width,man.lenght))),(py.transform.scale(jump[1],(man.width,man.lenght))),(py.transform.scale(jump[2],(man.width,man.lenght))),(py.transform.scale(jump[3],(man.width,man.lenght))),(py.transform.scale(jump[4],(man.width,man.lenght))),(py.transform.scale(jump[5],(man.width,man.lenght))),(py.transform.scale(jump[6],(man.width,man.lenght))),(py.transform.scale(jump[7],(man.width,man.lenght))),(py.transform.scale(jump[8],(man.width,man.lenght))),(py.transform.scale(jump[9],(man.width,man.lenght)))] run_left = [(py.transform.flip(run_right[0],True,False)),(py.transform.flip(run_right[1],True,False)),(py.transform.flip(run_right[2],True,False)),(py.transform.flip(run_right[3],True,False)),(py.transform.flip(run_right[4],True,False)),(py.transform.flip(run_right[5],True,False)),(py.transform.flip(run_right[6],True,False)),(py.transform.flip(run_right[7],True,False))] idle2 = [(py.transform.flip(idle[0],True,False)),(py.transform.flip(idle[1],True,False)),(py.transform.flip(idle[2],True,False)),(py.transform.flip(idle[3],True,False)),(py.transform.flip(idle[4],True,False)),(py.transform.flip(idle[5],True,False)),(py.transform.flip(idle[6],True,False)),(py.transform.flip(idle[7],True,False)),(py.transform.flip(idle[8],True,False)),(py.transform.flip(idle[9],True,False))] jump2 = [(py.transform.flip(jump[0],True,False)),(py.transform.flip(jump[1],True,False)),(py.transform.flip(jump[2],True,False)),(py.transform.flip(jump[3],True,False)),(py.transform.flip(jump[4],True,False)),(py.transform.flip(jump[5],True,False)),(py.transform.flip(jump[6],True,False)),(py.transform.flip(jump[7],True,False)),(py.transform.flip(jump[8],True,False)),(py.transform.flip(jump[9],True,False))] shoot_idle = [(py.transform.scale(shoot_idle[0],(man.width,man.lenght))),(py.transform.scale(shoot_idle[1],(man.width,man.lenght))),(py.transform.scale(shoot_idle[2],(man.width,man.lenght))),(py.transform.scale(shoot_idle[3],(man.width,man.lenght)))] shoot_idle2 = [(py.transform.flip(shoot_idle[0],True,False)),(py.transform.flip(shoot_idle[1],True,False)),(py.transform.flip(shoot_idle[2],True,False)),(py.transform.flip(shoot_idle[3],True,False))] pows = [(py.transform.scale(pows[0],(50,50))),(py.transform.scale(pows[1],(50,50))),(py.transform.scale(pows[2],(50,50))),(py.transform.scale(pows[3],(50,50))),(py.transform.scale(pows[4],(50,50)))] pows2 = [(py.transform.flip(pows[0],True,False)),(py.transform.flip(pows[1],True,False)),(py.transform.flip(pows[2],True,False)),(py.transform.flip(pows[3],True,False)),(py.transform.flip(pows[4],True,False))]   while game:     clock.tick (30)      if shootloop > 0:         shootloop += 1      if shootloop > 5:         shootloop = 0      for event in py.event.get():         if event == py.QUIT:             game = False      keys = py.key.get_pressed ()      for bullet in bullets:         if bullet.x < 800 and bullet.x > 0:             bullet.x += bullet.vel          else:             bullets.remove (bullet)         if keys[py.K_RIGHT] and man.x <= 700:         man.x += man.vel         man.right = True         man.left = False         man.standing = False         man.idlecount = 0         man.direction = 1      elif keys[py.K_LEFT] and man.x >= 0:         man.x -= man.vel         man.right = False         man.left = True         man.standing = False         man.idlecount = 0         man.direction = -1      else:         man.standing = True         man.shooting = False      if keys [py.K_SPACE] and shootloop == 0:         if man.left:             facing = -1          elif man.right:             facing = 1          if len(bullets) < 5:             man.standing = True             man.shooting = True             bullets.append(bulletss(round(man.x + man.lenght//2), round(man.y + man.lenght//2), facing))          shootloop = 1      if not(man.jumping):         if keys[py.K_UP]:             man.jumping = True             man.right = False             man.left = False             man.standing = False             man.walkcount = 0     else:         if man.jumpcount >= -14:             neg = 1             if man.jumpcount < 0:                 neg = -1             man.y -= (man.jumpcount ** 2) * 0.2 * neg             man.jumpcount -= 1         else:             man.jumping = False             man.jumpcount = 14       drawGameScreen () 

Game Site

Why are you selling this site?
No time to update the site.

How is it monetized?
adsense

Does this site come with any social media accounts?

How much time does this site take to run?

What challenges are there with running this site?

c# console Snake game basic movement

I have created a small c# snake game. It has no gameover case and no collision with corners and itself. Has a bug. As snake gets longer, it seems to disappear(having some buggy kind of transparency). Please take a look. Any suggestions and critic is very wanted.

Program.cs

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; using static System.Console;  namespace Snake {     class Program     {         static void Main(string[] args)         {             int speed = 50;              Snake snake = new Snake(speed);             Feed feed = new Feed();              Start(snake, feed);         }         static void Start(Snake snake, Feed feed)         {             bool exit = false;             feed.Draw();              while (exit == false)             {                 snake.Draw(false);                 GetDirection(snake, ref exit);                 snake.MoveHead();                 snake.CheckCollision(feed);                 snake.MoveBody();                  if (snake.HasCollision == true)                 {                     snake.IncreaseLen();                     feed.ChangePos(snake);                     feed.Draw();                 }                 snake.Draw();                 Thread.Sleep(                     snake.Speed                 );             }         }         static void GetDirection(Snake snake, ref bool exit)         {             bool dirIsHoriz = snake.Direction % 2 == 0;              while (KeyAvailable)             {                 ConsoleKey key = ReadKey(true).Key;                 switch (key)                 {                     case ConsoleKey.LeftArrow:                         if(!dirIsHoriz)                             snake.Direction = 0;                         break;                      case ConsoleKey.UpArrow:                         if (dirIsHoriz)                             snake.Direction = 1;                         break;                      case ConsoleKey.RightArrow:                         if (!dirIsHoriz)                             snake.Direction = 2;                         break;                      case ConsoleKey.DownArrow:                         if (dirIsHoriz)                             snake.Direction = 3;                         break;                      case ConsoleKey.Escape:                         exit = true;                         break;                      default: break;                 }             }         }     } } 

Point.cs

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using static System.Console;  namespace Snake {     class Point     {         int x;         int y;         ConsoleColor color;          public int X         {             get => x;             set             {                 if(value > 0 && value < WindowWidth)                     x = value;             }         }         public int Y         {             get => y;             set             {                 if (value > 0 && value < WindowHeight)                     y = value;             }         }         public ConsoleColor Color         {             get => color;             set => color = value;         }          public Point()         {             X = WindowWidth / 2;             Y = WindowHeight / 2;             Color = (ConsoleColor)7;         }         public Point(int x, int y, int color = 7)         {             X = x;             Y = y;             Color = (ConsoleColor)color;         }          public void Draw(bool draw = true)         {             BackgroundColor = Color;             SetCursorPosition(X, Y);              if (draw)                 Write(' ');             else             {                 BackgroundColor = 0;                 Write(' ');             }              //WriteLine(this);         }          public override string ToString()         {             return X + "\t" + Y + "\t" + Color;         }          public override int GetHashCode()         {             return ToString().GetHashCode();         }          public override bool Equals(object obj)         {             if (obj is Point)             {                 Point obj1 = obj as Point;                 return obj.GetHashCode() == obj1.GetHashCode();             }             return false;         }     } } 

Snake.cs

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; using static System.Console;  namespace Snake {     class Snake     {         public Point[] Body = new Point[WindowWidth * WindowHeight];         int direction;         int speed;         int length;         bool hasCollision = false;          public Point this[int index]         {             get => Body[index];         }         Point PrevPos{ get; set; }          public int Direction         {             get => direction;             set             {                 if (value > -1 && value < 4)                     direction = value;             }         }         public int Speed         {             get => speed;             set             {                 if (value > 0 && value <= 1000)                     speed = value;             }         }         public int Length         {             get => length;             set             {                 if (value > 0)                     length = value;             }         }         public bool HasCollision         {             get => hasCollision;             set => hasCollision = value;         }          public Snake(int speed)         {             Point item = new Point(WindowWidth / 2, WindowHeight / 2, 12);             Body[Length] = item;             Length++;             Body[Length] = new Point(item.X + Length, item.Y);             Length++;             Speed = speed;         }          public void Draw(bool draw = true)         {             HasCollision = false;             for (int i = 0; i < Length; i++)             {                 Body[i].Draw(draw);             }         }          public void MoveHead()         {             Point Head = Body[0];             Point Tail = Body[Length - 1];             PrevPos = new Point(Head.X, Head.Y);              switch (Direction)             {                 case 0:                     Head.X--;                     break;                  case 1:                     Head.Y--;                     break;                  case 2:                     Head.X++;                     break;                  case 3:                     Head.Y++;                     break;                  default: break;             }         }         public void CheckCollision(Feed feed)         {             if (Body[0].X == feed.X &&                 Body[0].Y == feed.Y)             {                 HasCollision = true;             }         }         public void IncreaseLen()         {             Point Tail = Body[Length - 1];             int x = 0;             int y = 0;             switch (Direction)             {                 case 0:                     x = Tail.X + 1;                     y = Tail.Y;                     break;                  case 1:                     x = Tail.X;                     y = Tail.Y + 1;                     break;                  case 2:                     x = Tail.X - 1;                     y = Tail.Y;                     break;                  case 3:                     x = Tail.X;                     y = Tail.Y - 1;                     break;                  default: break;             }             Body[Length] = new Point(x, y);             Length++;             Speed--;         }         public void MoveBody()         {             for (int i = 1; i < Length; i++)             {                 int tmpX = Body[i].X;                 int tmpY = Body[i].Y;                 Point bodyItem = Body[i];                  bodyItem.X = PrevPos.X;                 bodyItem.Y = PrevPos.Y;                  PrevPos.X = tmpX;                 PrevPos.Y = tmpY;             }         }          public override string ToString()         {             return Body + "\t" +                    PrevPos + "\t" +                    Speed + "\t" +                    Direction + "\t" +                    Length + "\t" +                    HasCollision;         }         public override int GetHashCode()         {             return ToString().GetHashCode();         }         public override bool Equals(object obj)         {             if (obj is Snake)             {                 Snake obj1 = obj as Snake;                 return obj1.Equals(obj);             }             return false;         }     } } 

Feed.cs

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using static System.Console;  namespace Snake {     class Feed : Point     {         public Feed()         {             X = WindowWidth / 3 + 10;             Y = WindowHeight / 3 - 10;             Color = (ConsoleColor)10;         }         public void ChangePos(Snake snake)         {             Random rnd = new Random();             X = rnd.Next(0, WindowWidth + 1);             Y = rnd.Next(0, WindowHeight + 1);             bool posIsCorrect = true;             for(int i = 0; i < snake.Length; i++)             {                 if (X == snake.Body[i].X && Y == snake.Body[i].Y)                     posIsCorrect = false;             }             if (posIsCorrect)                 return;             ChangePos(snake);         }     } } 

Game mechanics for a persistent real-time strategic/tactical game

I am designing a game based around a fairly realistic simulation of ‘Age of sail’-like trading and combat, and I am currently trying to decide whether to make the game a limited on-line application, in which the game world exists only while all the players – 2 to 8 of them – are all online, or a persistent real-time mmo application, in which game events occur on a set schedule. As a game for a small number of players, uninteresting events could be time-accelerated away.

The trouble with a real-time MMO is that the world objects would be persistent, yet the players would be transient. Since in-game encounters and combat would take place on a schedule determined by the actions of all the players, not just those that happen to be online, players could easily miss an encounter or battle in which their vessel happened to be involved – or at least could be involved.

An idea I had for the MMO version was that otherwise idle time could be spent in training – which would be simulated, not merely administrative, and that active crew positions such as gunners, helmsmen, marines and officers could be filled by players, so one ship might have many players online in engagements, each contributing to the success – or otherwise – of the battle. These positions would be filled by players whose vessels were all engaged in uninteresting travel or laid up for repairs, using a matchmaking system to match the players’ observed skill to that of the NPC into whose shoes they would be stepping. NPC skill progression would be based upon the actual skill improvement of the players who step into the role.

Would these mechanics allow this to be a playable and interesting game? What other game mechanics could allow a game such as this to be playable as a persistent real-time mmo, especially when vessels could spend a long time in transit, doing nothing much of interest?