76 |
77 |
--------------------------------------------------------------------------------
/docs/viber3d-docs/components/TemplateMenu.vue:
--------------------------------------------------------------------------------
1 |
2 |
27 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/docs/viber3d-docs/content.config.ts:
--------------------------------------------------------------------------------
1 | import { defineContentConfig, defineCollection, z } from '@nuxt/content'
2 |
3 | export default defineContentConfig({
4 | collections: {
5 | landing: defineCollection({
6 | type: 'page',
7 | source: 'index.md'
8 | }),
9 | docs: defineCollection({
10 | type: 'page',
11 | source: {
12 | include: '**',
13 | exclude: ['index.md']
14 | },
15 | schema: z.object({
16 | links: z.array(z.object({
17 | label: z.string(),
18 | icon: z.string(),
19 | to: z.string(),
20 | target: z.string().optional()
21 | })).optional()
22 | })
23 | })
24 | }
25 | })
26 |
--------------------------------------------------------------------------------
/docs/viber3d-docs/content/1.getting-started/.navigation.yml:
--------------------------------------------------------------------------------
1 | title: Getting Started
2 | icon: false
3 |
--------------------------------------------------------------------------------
/docs/viber3d-docs/content/1.getting-started/1.index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Introduction
3 | description: Welcome to Viber3D - A Modern 3D Game Starter Kit for the Web
4 | navigation.icon: i-lucide-house
5 | ---
6 |
7 | Welcome to **Viber3D**, a powerful and modern 3D game starter kit designed for creating immersive web-based games and interactive experiences. Built with performance and developer experience in mind, Viber3D provides all the tools you need to bring your game ideas to life.
8 |
9 | ## Key Features
10 |
11 | Viber3D comes packed with features to help you create amazing 3D games:
12 |
13 | ::card-group
14 |
15 | ::card
16 | ---
17 | title: Physics Engine
18 | icon: i-lucide-box
19 | ---
20 | Built-in physics engine for realistic object interactions and collisions
21 | ::
22 |
23 | ::card
24 | ---
25 | title: Game Systems
26 | icon: i-lucide-gamepad-2
27 | ---
28 | Comprehensive systems for input handling, audio, networking, and more
29 | ::
30 |
31 | ::card
32 | ---
33 | title: Component Architecture
34 | icon: i-lucide-component
35 | ---
36 | Flexible entity-component architecture for building complex game objects
37 | ::
38 |
39 | ::card
40 | ---
41 | title: Performance
42 | icon: i-lucide-zap
43 | ---
44 | Optimized for modern browsers with efficient rendering and resource management
45 | ::
46 |
47 | ::card
48 | ---
49 | title: TypeScript Support
50 | icon: i-lucide-code
51 | ---
52 | Full TypeScript support for type-safe development
53 | ::
54 |
55 | ::card
56 | ---
57 | title: Asset Management
58 | icon: i-lucide-image
59 | ---
60 | Powerful asset loading and management system for 3D models, textures, and audio
61 | ::
62 |
63 | ::
64 |
65 | ## Core Concepts
66 |
67 | Viber3D is built around several core concepts that make game development intuitive and efficient:
68 |
69 | - **Entity Component System (ECS)**: A flexible, data-driven architecture for building game objects
70 | - **Scene Management**: Easy-to-use scene system for organizing your game worlds
71 | - **Asset Pipeline**: Efficient asset loading and management
72 | - **Input System**: Comprehensive input handling for keyboard, mouse, and touch
73 | - **Physics System**: Built-in physics engine for realistic interactions
74 | - **Rendering Pipeline**: Modern WebGL-based rendering (via React Three Fiber) with optimization features
75 | - **Audio System**: Spatial audio support for immersive game experiences
76 | - **Networking**: Built-in networking capabilities for multiplayer games
77 | - **Development Tools**: Debug tools and performance monitoring
78 |
79 | Ready to start building your game? Head to the [Installation](/getting-started/installation) guide to begin your journey with Viber3D.
80 |
81 | ## Demo
82 |
83 | See Viber3D in action at our live demo site: [viber3d-spacewars.kevinkern.dev](https://viber3d-spacewars.kevinkern.dev/)
84 |
85 | ## Credits
86 |
87 | Viber3D was created by [Kevin Kern](https://x.com/kregenrek) and is a project by [Instructa.ai](https://www.instructa.ai/).
88 |
89 | This kit is heavily inspired by and uses a lot of concepts from [Koota](https://github.com/krispya/koota), an elegant Entity Component System. Special thanks and credits to [Krispya](https://github.com/krispya) and [Brian](https://github.com/Ctrlmonster) for their amazing work.
90 |
91 | We also extend our gratitude to the teams behind React Three Fiber and the various packages it includes, as well as to the Nuxt team and UnJS team for their awesome tooling ecosystem.
92 |
93 | For a complete list of acknowledgments, please visit our [Credits](/getting-started/credits) page.
94 |
--------------------------------------------------------------------------------
/docs/viber3d-docs/content/1.getting-started/2.installation.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Installation
3 | description: Get started with Viber3D game starter kit.
4 | navigation.icon: i-lucide-download
5 | ---
6 |
7 | ## Requirements
8 |
9 | Before installing Viber3D, make sure you have:
10 |
11 | - Node.js 16.x or later
12 | - A modern web browser with WebGL support
13 | - npm, yarn, or pnpm package manager
14 |
15 | ## Installation
16 |
17 | Run the script to create a new project:
18 |
19 | ```bash [Terminal]
20 | npx viber3d@latest init
21 | ```
22 |
23 | ::video{src="https://a.storyblok.com/f/316774/x/0c8b8d92f8/install_viber_3d_720.mp4?cv=1741718543080" poster="" controls}
24 | ::
25 |
26 | ## Cursor AI Integration
27 |
28 | To enhance your development experience with Cursor AI, add our LLMs documentation:
29 |
30 | 1. Visit [viber3d.instructa.ai/llms_full.txt](https://viber3d.instructa.ai/llms_full.txt)
31 | 2. Add this documentation URL to Cursor AI's documentation settings
32 | 3. Cursor AI will now provide intelligent assistance specific to Viber3D development when you add `@Docs` and then search for the docs like `viber3d`.
33 |
34 | For detailed instructions on adding custom documentation to Cursor AI, visit our [tutorial](https://www.instructa.ai/en/blog/how-to-add-custom-documentation-in-cursor-ai).
35 |
36 |
37 | ## Next Steps
38 |
39 | Now that you have Viber3D installed, you can:
40 |
41 | 1. Check out the [Usage Guide](/getting-started/usage) to learn the basics
42 | 2. Explore the [Core Concepts](/core-concepts/ecs-overview) to understand the engine's architecture
43 | 3. Browse the [Systems](/core-concepts/systems) documentation to learn about specific features
44 | 4. Join our [GitHub Discussions](https://github.com/instructa/viber3d/discussions) for community support
45 |
46 |
--------------------------------------------------------------------------------
/docs/viber3d-docs/content/1.getting-started/3.project-structure.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Project Structure
3 | description: Understanding the Viber3D project structure
4 | navigation.icon: i-lucide-folder-tree
5 | ---
6 |
7 | # Project Structure
8 |
9 | Below is an example project structure for a **Viber3D** game. Your actual folder names may differ, but these are the typical directories and files you'll see.
10 |
11 | ```bash
12 | viber3d/
13 | ├── src
14 | │ ├── assets/ # 3D models, textures, images
15 | │ ├── components/ # React components for rendering 3D objects/UI
16 | │ ├── systems/ # ECS Systems for game logic updates
17 | │ ├── traits/ # ECS Traits (components) describing entity data
18 | │ ├── utils/ # Utility functions (math, sorting, spatial hashing)
19 | │ ├── actions.ts # Central actions to spawn or modify entities
20 | │ ├── app.tsx # Main React component (root of your 3D scene)
21 | │ ├── frameloop.ts # Main ECS update loop
22 | │ ├── index.css # Global CSS or Tailwind CSS (if used)
23 | │ ├── main.tsx # React app root, renders
24 | │ ├── startup.tsx # Startup logic (initial spawns, intervals)
25 | │ └── world.ts # Creates the ECS world with default traits
26 | ├── index.html # Basic HTML page with root div
27 | ├── package.json # Project dependencies and scripts
28 | └── tsconfig.json # TypeScript configuration
29 | ```
30 |
31 | ## Key Directories
32 |
33 | **`/src/assets`**
34 | Contains static assets such as textures, images, 3D models (`.glb` or `.gltf`), or audio files.
35 |
36 | **`/src/components`**
37 | React components that render your entities or UI elements. For example:
38 | - `player-renderer.tsx`
39 | - `enemy-renderer.tsx`
40 | - `score-tracker.tsx`
41 | - `postprocessing.tsx`
42 |
43 | **`/src/systems`**
44 | ECS Systems that update game logic every frame. Examples:
45 | - `move-entities.ts`
46 | - `camera-follow-player.ts`
47 | - `handle-shooting.ts`
48 | - `update-bullet-collisions.ts`
49 |
50 | **`/src/traits`**
51 | Traits (a.k.a. ECS components) that store data about your entities, such as:
52 | - `is-player.ts`
53 | - `health.ts`
54 | - `movement.ts`
55 | - `bullet.ts`
56 | - `spatial-hash-map.ts`
57 |
58 | **`/src/utils`**
59 | Helper functions or classes, e.g.:
60 | - `spatial-hash.ts`
61 | - `sort-entities-by-distance.ts`
62 | - `between.ts`
63 |
64 | ## Key Files
65 |
66 | **`actions.ts`**
67 | Central location for spawning or modifying entities (e.g. `spawnPlayer`, `spawnBullet`).
68 |
69 | **`app.tsx`**
70 | Your main game component, often where you set up the Three.js canvas (`