Skip to content

metaversecloud-com/sdk-grow-together

Repository files navigation

Grow Together

Introduction / Summary

A relaxing, loop-based gardening game where players claim plots, plant seeds, grow crops, and harvest them to earn rewards. This interactive social experience allows players to visit each other's gardens, decorate their plots, and create a thriving community of gardeners.

Key Features

Core Gameplay

  • Plot Management: Claim and manage your own 4x4 garden plot in the world.
  • Seed Variety: Access a diverse collection of seeds with different growth times, rewards, and rarity levels.
  • Real-time Growth: Plants grow in real-time with multiple visual growth stages.
  • Watering System: Water your plants to keep them healthy and growing.
  • Harvest Rewards: Harvest mature crops to earn coins based on plant type and rarity.
  • In-game Economy: Use earned coins to purchase new seeds and decorative items.

Social Features

  • Garden Visiting: Visit other players' gardens to see their designs and progress.
  • Plot Teleportation: Quickly teleport to your plot from anywhere in the world.
  • Owner Recognition: Each plot and plant shows the owner's name for recognition.

Decoration System

  • Decorative Items: Purchase and place a variety of decorative items to personalize your garden.
  • Item Categories: Various decoration types including animals, garden accessories, and more.
  • Rarity Levels: Common, Uncommon, and Rare items with corresponding coin costs.

Admin Tools

  • Plot Management: Admins can clear individual plots or all plots in a world.

Implementation Requirements

Required Assets with Unique Names

The app uses the following unique name patterns for managing dropped assets:

Unique Name Pattern Description
GrowTogether_plot View/Open Garden sign assets (key assets)
GrowTogether_crop_{profileId} Crop assets planted by users
GrowTogether_decoration_{profileId} Decoration assets placed by users
GrowTogether_ownerText_{profileId} Owner name text displayed on plots

Technical Architecture

The app uses a combination of data objects, dropped assets, and interactive elements to create a persistent garden experience.

Data Objects

We use data objects to store information about each implementation of the app per world.

World

The data object attached to the world stores ownership information about all plots in the world.

{
  plots: {
    [plotAssetId: string]: string | null; // profileId of owner or null if unclaimed
  };
};

Plot Assets

The data objects attached to the dropped plot assets store information related to each specific plot.

{
  ownerId?: string; // profileId of the owner
  ownerName?: string; // displayName of the owner
  claimedDate?: string; // ISO date string when the plot was claimed
};

Crop Assets

The data objects attached to the dropped crop assets store information related to each specific crop.

{
  ownerId: string; // profileId of the owner
  ownerName: string; // displayName of the owner
  dateDropped: string; // When the crop was planted
  lastWatered: string; // When the crop was last watered
  seedId: string; // ID of the seed that was planted
  growLevel: number; // Current growth level (0-10)
  squareId: number; // Which square in the plot (0-15)
}

Decoration Assets

The data objects attached to the dropped decoration assets.

{
  decorationId: string; // ID of the decoration
  ownerId?: string; // profileId of the owner
  ownerName?: string; // displayName of the owner
  dateDropped: string; // When the decoration was placed
  squareId: number; // Which square in the plot (0-15)
}

Visitors

The data object attached to the visitor stores ecosystem information for each visitor as well as plot ownership information per world keyed by urlSlug.

{
  lastDateCoinsEarned: string; // ISO date string when coins were last earned
  totalCoinsEarned: number; // Lifetime coins earned (for unlocks)
  worlds: {
    plotAssetId: string | null;
    claimedDate: string;
    plotSquares: {
      [squareId: number]: string | null; // droppedAssetId of crop or null if empty
    };
    crops: {
      [droppedAssetId: string]: CropDataObjectType;
    };
    decorations: {
      [droppedAssetId: string]: PlacedDecorationDataObjectType;
    };
  };
};

API Endpoints

The application exposes the following API endpoints:

Game State

  • GET /game-state - Get the current game state for a visitor

Admin Routes

  • POST /admin/clear-plot - Clear a specific plot (admin only)
  • POST /admin/clear-all-plots - Clear all plots in the world (admin only)

Plot Management

  • POST /plot/claim - Claim ownership of a plot
  • POST /plot/teleport - Teleport to a plot
  • POST /plot/view - Open plot iframe view
  • POST /square/view - Open plot square iframe view
  • GET /square - Get information about a specific plot square

Crop Management

  • POST /seed/purchase - Purchase a seed
  • POST /crop/drop - Plant a seed in a plot square
  • POST /crop/water - Water a growing crop
  • POST /crop/harvest - Harvest a fully grown crop
  • POST /crop/remove - Remove a crop from a plot

Decoration Management

  • POST /decoration/purchase - Purchase a decoration
  • POST /decoration/drop - Place a decoration in a plot square
  • POST /decoration/remove - Remove a decoration from a plot

Environment Variables

Create a .env file in the root directory. See .env-example for a template.

Variable Description Required
NODE_ENV Node environment No
SKIP_PREFLIGHT_CHECK Skip CRA preflight check No
INSTANCE_DOMAIN Topia API domain (api.topia.io for production, api-stage.topia.io for staging) Yes
INTERACTIVE_KEY Topia interactive app key Yes
INTERACTIVE_SECRET Topia interactive app secret Yes

For Developers

Built With

Client

React Vite TypeScript Tailwind CSS

Server

Node.js Express

Getting Started

  1. Clone the repository and install dependencies
git clone https://github.com/metaversecloud-com/sdk-grow-together.git
cd sdk-bounty-builder
npm install
  1. Install server dependencies
cd server
npm install
cd ..
  1. Install client dependencies
cd client
npm install
cd ..
  1. Configure environment variables

    See Environment Variables above.

Where to find INTERACTIVE_KEY and INTERACTIVE_SECRET

Topia Dev Account Dashboard

Topia Production Account Dashboard

Resources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages