[C++/Python] Görev Kategori Sistemi

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 66

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
V0Ljon.jpg
nRg4z0.jpg
vbL3kv.jpg
1LkR1A.jpg


Sistemin sahibi ben değilim, yabancı forumlarda yıllardır dolaşan bir sistem.
Nasıl kurulacağını içerisinde anlattım.

questcategory.txt kullanımı:

ates_ve_buz MAIN_QUEST
efsane_gunluk MAIN_QUEST
/toplu/biyolog/30 COLLECT_QUEST
/toplu/biyolog/40 COLLECT_QUEST
/toplu/biyolog/50 COLLECT_QUEST
/toplu/biyolog/60 COLLECT_QUEST
/toplu/biyolog/70 COLLECT_QUEST
/toplu/biyolog/80 COLLECT_QUEST
/toplu/biyolog/85 COLLECT_QUEST
/toplu/biyolog/90 COLLECT_QUEST
/toplu/biyolog/92 COLLECT_QUEST
/toplu/biyolog/94 COLLECT_QUEST




Metin2 Lobby'da Görev Kategorisi Sistemi: C++ ve Python ile Uygulama

Metin2 özel sunucularında görev kategorisi sistemi, oyuncuların farklı görevleri kolayca bulup yönetebilmesi için oldukça önemli bir özelliktir. Bu sistem, hem oyun deneyimini artırmakta hem de sunucu yöneticilerinin görevleri daha iyi organize etmesine olanak tanımaktadır. Bu makalede, C++ ve Python kullanarak nasıl bir görev kategorisi sistemi kurulabileceği detaylı olarak ele alınacaktır.

Görev Kategorisi Nedir?
Görev kategorisi sistemi, oyuncuların karşılaştığı görevleri belirli başlıklar altında gruplamayı sağlar. Örneğin 'Macera', 'PVP', 'Zindan', 'Toplama' gibi başlıklar altında görevler listelenebilir. Bu sayede oyuncular, aradıkları türdeki görevleri daha hızlı bulabilir.

C++ ile Görev Kategorisi Sistemi
Metin2 oyun sunucusunda görev sistemi genellikle C++ tarafında tanımlanır. Görev dosyaları (quest scripts) da burada düzenlenir. Görev kategorisi oluşturmak için öncelikle görevlerin hangi kategoriye ait olduğu bilgisini içeren yapıları tanımlamak gerekir. Bu yapıda görev ID'si, kategori adı ve görev açıklaması gibi alanlar bulunabilir.

Örnek olarak:
struct QuestCategory {
int questID;
string categoryName;
string description;
};

Bu yapı sayesinde, sunucu tarafında görevler kategoriye göre filtrelenebilir ve istemciye gönderilebilir.

Python Tarafında Kullanıcı Arayüzü (GUI)
Python ile geliştirilen arayüz (örneğin PySide veya Tkinter kullanarak), oyuncuların görev kategorilerini görsel olarak seçip filtreleyebilmesini sağlar. Python GUI sistemleri, özellikle client-side işlemlerde esneklik sağlar.

Python tarafında bir görev kategorisi listesi oluşturulabilir ve bu liste C++ sunucudan gelen verilerle doldurulabilir. Kullanıcı bir kategori seçtiğinde, ilgili görevler ekrana getirilir. Bu işlem için örnek bir yapı şu şekildedir:

class QuestCategoryWindow:
def __init__(self):
self.categories = {}
def load_categories(self, data):
for item in data:
self.categories[item['questID']] = item['categoryName']
def show_by_category(self, category):
filtered_quests = [q for q in self.categories if self.categories[q] == category]
return filtered_quests

Kategori Verilerinin DB ile Eşlenmesi[/Courier]
Görev kategorileri veritabanında da tutulabilir. Metin2'nin DB yapısı, genellikle MySQL veya MSSQL ile çalışır. 'quest_info' tablosuna bir 'category_id' alanı eklenerek görevler kategorilere bağlanabilir. Bu sayede sunucu, görevleri veritabanından çekerken aynı zamanda kategorileri de alabilir.

Uygulama Önerileri ve Performans
Sistem performansını artırmak için görev kategorileri önbelleğe alınabilir. Sunucu başlatıldığında tüm görevler ve kategoriler RAM'e yüklenir. Böylece görev filtrelemeleri daha hızlı yapılabilir. Ayrıca, görev listesi büyükse pagination (sayfalama) sistemi de kullanılabilir.

Sonuç
C++ ve Python kullanarak geliştirilen görev kategori sistemi, Metin2 özel sunucularında kullanıcı dostu bir deneyim sunar. Hem sunucu tarafında verimli kodlama hem de istemci tarafında etkili bir arayüz ile oyuncular görevleri kolayca keşfedebilir. Bu sistem, sunucu sahiplerinin oyun içi görevleri düzenli ve erişilebilir hale getirmesine yardımcı olur.


Task Category System on Metin2 Lobby: Implementation with C++ and Python

The task category system in Metin2 private servers is essential for allowing players to easily find and manage different quests. This system not only enhances gameplay but also enables server administrators to better organize quests. In this article, we will detail how to implement a task category system using C++ and Python.

What is a Task Category?
The task category system allows grouping quests under specific titles such as 'Adventure', 'PVP', 'Dungeon', 'Collection', etc. This helps players quickly locate quests matching their interests.

Task Category System with C++
In Metin2 game servers, quest systems are typically defined on the C++ side. Quest files (scripts) are also edited here. To create a task category system, you first need to define structures that include information like the quest ID, category name, and description.

For example:
struct QuestCategory {
int questID;
string categoryName;
string description;
};

With this structure, quests can be filtered by category on the server side and sent to the client.

User Interface (GUI) with Python
GUIs developed in Python (e.g., using PySide or Tkinter) allow players to visually select and filter quest categories. Python GUI systems provide flexibility for client-side operations.

A quest category list can be created in Python and filled with data received from the C++ server. When a user selects a category, relevant quests are displayed. An example structure for this might look like:

class QuestCategoryWindow:
def __init__(self):
self.categories = {}
def load_categories(self, data):
for item in data:
self.categories[item['questID']] = item['categoryName']
def show_by_category(self, category):
filtered_quests = [q for q in self.categories if self.categories[q] == category]
return filtered_quests

Linking Category Data with Database
Quest categories can also be stored in the database. Metin2’s DB structure usually works with MySQL or MSSQL. Adding a 'category_id' column to the 'quest_info' table links quests to categories. This allows the server to retrieve both quests and their associated categories directly from the database.

Implementation Tips and Performance
To enhance performance, quest categories can be cached. Upon server startup, all quests and their categories are loaded into memory, making filtering faster. Additionally, pagination can be implemented if the quest list is large.

Conclusion
A task category system built with C++ and Python offers a user-friendly experience in Metin2 private servers. With efficient server-side coding and an effective client interface, players can easily explore quests. This system helps server owners keep in-game quests organized and accessible.​
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Benzer konular

Geri
Üst Alt