Skip to main content

A Python library to use MindSpawner Game AI

Project description

MindSpawner

PyPI version License Python Versions

MindSpawner is a Python library that enables developers to create and control AI-powered agents for games and interactive environments. It provides an easy-to-use interface for managing AI behavior and real-time learning.

🚀 Features

  • Simple API for integrating AI-driven agents
  • WebSocket-based real-time communication
  • Lightweight and efficient
  • Easy to integrate with game engines and simulations

📦 Installation

To install MindSpawner, run the following command:

pip install mindspawner

Then, import it in your Python script:

from mindspawner import MindSpawner

🎮 Adding a Game AI

To create and add a game AI, use the following code:

USER_ID = ""  # Copy your "USER ID"
GAMEAI_ID = ""  # Copy your "GAMEAI ID"
gameai = MindSpawner(USER_ID, GAMEAI_ID)

🤖 Running an AI Agent

To send input data to a specific agent and retrieve its output:

AGENT_ID = ""  # Copy your "AGENT ID"
input_data = { "input1": 100 }

action = gameai.agent(AGENT_ID, input_data)
print(action)

🔹 Key Points:

  • input_data is any data that will be provided to the game AI.
  • action stores the AI's response based on the given input.

📈 Updating the Game AI

🔹 Enhancing AI Performance

If you want to improve the AI's performance, evaluate it numerically and update it as follows:

AGENT_ID = ""  # Copy your "AGENT ID"
score = 100  # Example: number of defeated enemies or goals scored
gameai.update_agent(AGENT_ID, score)
  • score is an integer that evaluates the AI's performance.
  • Use game-specific metrics (e.g., enemy defeats, successful actions) to assign a meaningful score.

🔹 Adjusting AI Behavior

If you want to fine-tune the AI’s behavior, use the web interface and click the "Instruct" button for the agent. You can specify behavior rules such as:

  • "Avoid enemies when they get too close."
  • "Maintain an aggressive playstyle."

📜 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mindspawner-0.3.2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mindspawner-0.3.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file mindspawner-0.3.2.tar.gz.

File metadata

  • Download URL: mindspawner-0.3.2.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.4

File hashes

Hashes for mindspawner-0.3.2.tar.gz
Algorithm Hash digest
SHA256 ea7a004e1342f40ea979265b311864d48e9498363b83546a483d54e4ddc5d9a9
MD5 b70496310414e0e58d4b82cb3f874ebb
BLAKE2b-256 9ecaf6c155b8eb0a7f6a321bd6e04a953d67a77333ff0395e4e8fecf799798d1

See more details on using hashes here.

File details

Details for the file mindspawner-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: mindspawner-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.4

File hashes

Hashes for mindspawner-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cd549ef67abe435385c26b72cb253a6b3708a34cdda65eabb1e0fd729a9559e8
MD5 0437a96a33a6a1829ccb8a73dfc69daf
BLAKE2b-256 7a62257941640c7d38a0860ae4fb05a1dba334b6087ef09e0b68ffcddf25dc7b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page