Kni Game Framework

repository·main·Indexed 43 days ago

https://github.com/kniengine/kni

An open-source .NET-based game framework and re-implementation of Microsoft's XNA. Kni allows developers to write games in C# for desktop (Windows, Linux, macOS), mobile (Android, iOS), web (WebGL, WebXR), and VR/AR platforms. It includes a comprehensive content pipeline for processing audio, graphics, and media assets, featuring tools like mgcb and KNIFXC.

Tokens
46K
Snippets
135
Records
220
Agent score
57%

What's inside Kni

  1. What is MonoGame?

    main

    MonoGame is a .NET framework for creating games for desktop PCs, video game consoles, and mobile devices using C#. It is a re-implementation of Microsoft's XNA Framework.

    Unlike high-level engines like Unity or Unreal, MonoGame is a "bring your own tools" framework. It provides the low-level building blocks to construct your own engine and tools rather than providing a built-in scene editor. It is designed for developers who prefer coding and want control over how their game works under the hood.

    Key features include:

    • Game framework core
    • 2D and 3D rendering
    • Sound effect and music playback
    • Input handling (Keyboard, mouse, touch, and controller)
    • Content building and optimization
    • Game-optimized math library
  2. Overview of Xna.Framework.Media components

    main

    The Xna.Framework.Media package is designed for media playback and device library access through three primary abstractions:

    • MediaPlayer: Handles music playback and global playback state control.
    • VideoPlayer: Manages video playback with synchronized audio.
    • MediaLibrary: Provides access to the device's music, videos, albums, and playlists.
  3. Overview of MonoGame and KNI build tools

    main

    The ecosystem provides several specialized tools for managing game assets and shaders:

    • MonoGame Content Builder (MGCB): Used to build content pipeline content.
    • MGCB Editor: A graphical front end used to edit .mgcb files.
    • KNI Effect Compiler (KNIFXC): Used to compile standalone effects (shaders).
  4. Overview of Kni

    main
    Kni is a .NET framework for creating games across desktop PCs, Mobile devices, Virtual Reality (VR/AR) headsets, and the Web. It is an open-source re-implementation of Microsoft's XNA Framework and is a derivative of MonoGame & XNA Touch. It uses the C# programming language and the .NET framework.
  5. Overview of supported input devices in Xna.Framework.Input

    main

    The Xna.Framework.Input package provides a unified interface for the following device types:

    • Mouse Input: MouseState with position and button tracking, plus custom cursor support.
    • GamePad Support: Multi-gamepad input including triggers, thumbsticks, D-Pad, and buttons.
    • Touch Input: Multi-touch support with built-in gesture recognition (tap, hold, double-tap, drag, flick, pinch).
    • Joystick Support: Access to raw joystick axes and buttons.
    • XR Controllers: Support for VR/XR hand controllers and input.
  6. Overview of Xna.Framework.Content.Pipeline

    main

    The Xna.Framework.Content.Pipeline is a development-time package used to compile game assets into optimized binary formats (XNB). The pipeline consists of several key components:

    • Content Processor Framework: Provides base classes and attributes for defining asset transformations.
    • Content Compiler: Handles the compilation of assets to binary XNB format, supporting optional compression.
    • Intermediate Serialization: Uses an XML-based format for asset data during the pipeline process.
    • Type Writers: Provides binary serialization writers for custom types.
    • Importers: Infrastructure for bringing raw files into the pipeline.
    • Compression Support: Includes LZ4 and Brotli codecs for optimized asset storage.
  7. Overview of Xna.Framework.Game core components

    main

    The Xna.Framework.Game package provides the fundamental building blocks for KNI games, including:

    • Game Class: The main entry point that manages the Update/Draw loop.
    • GameWindow: Provides platform-agnostic window management, supporting both fullscreen and windowed modes.
    • GameTime: Provides frame timing information, including elapsed time and total game time.
    • GameComponent System: An architecture for managing updateable and drawable components.
    • GraphicsDeviceManager: Handles automatic graphics setup and manages device resets.
    • GameServiceContainer: A dependency injection container for managing game services.
  8. Overview of Xna.Framework.Graphics capabilities

    main

    The Xna.Framework.Graphics package provides a complete graphics API abstraction layer for the KNI game framework. It includes support for:

    • Core Rendering: GraphicsDevice, SpriteBatch, Model, and mesh rendering.
    • Textures & Buffers: Texture2D, Texture3D, TextureCube, VertexBuffer, and IndexBuffer.
    • Render Targets: RenderTarget2D, RenderTarget3D, and RenderTargetCube with MSAA support.
    • Render States: BlendState, DepthStencilState, RasterizerState, and SamplerState.
    • Effects & Shaders: An Effect system including built-in effects like BasicEffect and SkinnedEffect.
    • Content Loading: Automatic deserialization of compiled graphics assets.
    • Packed Vector Formats: Optimized in-memory color formats.
  9. Overview of Xna.Framework.XR capabilities

    main

    The Xna.Framework.XR package provides the following core capabilities for immersive experiences:

    • XR Device Support: Provides abstraction for headsets and controllers, including session lifecycle control.
    • Head Tracking: Provides access to the position and orientation of the VR headset.
    • Hand Tracking: Provides monitoring for hand and controller states.
  10. Overview of Xna.Framework.Audio capabilities

    main

    The Xna.Framework.Audio package provides the following core audio features for KNI games:

    • Sound Effects: Managed via SoundEffect and SoundEffectInstance.
    • 3D Audio: Spatial audio simulation using AudioEmitter and AudioListener.
    • Microphone Input: Support for audio capture from microphone devices.
  11. Overview of Xna.Framework.Content components

    main

    The package provides several key abstractions for managing game assets:

    • ContentManager: Handles asset loading, caching, and supports a RootDirectory.
    • Content Readers: Type-specific logic used to deserialize compiled content.
    • Title Container: An abstraction that defines where game assets are stored.
    • ResourceContentManager: A specialized manager for loading content directly from .resx resource files.
    • Type Reader Support: An extensible system that allows you to implement custom readers for your own data types.
  12. Features of the MGCB Editor

    main

    The MGCB Editor provides a graphical interface for managing MonoGame content projects with the following capabilities:

    • Project Management: Create, open, save, and import existing XNA .contentproj files.
    • Content Editing: A tree view for project structure and a property grid for editing content settings.
    • Build Operations: Build, rebuild, clean, or rebuild specifically selected items.
    • Content Creation: Create new content types such as fonts and XML.
    • Extensibility: Support for custom importers, processors, and writers, including a template format for adding new custom content types.
    • Workflow: Full undo/redo support.