A simple but powerful real-time chat application built with Godot Engine using ENetMultiplayerPeer for network communication.
- Host & Join: Create or join multiplayer sessions
- Real-time Messaging: Send messages instantly across all connected clients
- User Management: Automatic user detection and connection handling
- Simple UI: Clean and intuitive user interface
- Cross-platform: Works on all platforms supported by Godot
- Godot Engine 4.x
- Basic understanding of GDScript
- Network connection for multiplayer functionality
- Click the Host button to create a server on port 1300
- Wait for players to connect
- Start chatting!
- Click the Join button to connect to localhost:1300
- Wait for connection confirmation
- Start chatting with other players!
- Type your message in the text field
- Click the Message button or press Enter
- Your message will be broadcast to all connected players
_on_host_button_pressed()- Creates and starts a multiplayer server_on_join_button_pressed()- Connects to an existing server_on_message_button_pressed()- Sends messages to all connected peersadd_user(id)- Handles new user connectionssend_message(text, sender_name)- RPC function for message broadcastingserver_opened()- Sets up user identification after connection
peer- ENetMultiplayerPeer instance for network communicationmessage- String variable for message storagemy_name- Exported string for player identification
- Create a new Godot project
- Add a Node2D as your main scene
- Add the required UI elements:
- Host button
- Join button
- Message button
- MessageText (TextEdit/LineEdit)
- MessageLabel (Label)
- Attach this script to your Node2D
- Connect the button signals to their respective functions
- Set the
my_namevariable in the inspector (optional)
- Default Port: 1300
- Default Address: localhost (127.0.0.1)
- Protocol: ENet (UDP-based)
- Max Connections: Unlimited (ENet default)
- Custom server IP input
- User list display
- Message history
- Private messaging
- Chat rooms/channels
- User authentication
- Message timestamps
- Emoji support
Connection Issues:
- Ensure both host and client are on the same network
- Check firewall settings for port 1300
- Verify Godot version compatibility
Message Not Sending:
- Check if properly connected to server
- Ensure RPC permissions are correctly set
- Verify UI element names match script references
This project is open source and available under the MIT License.
Godot Engine kullanarak ENetMultiplayerPeer ile ağ iletişimi sağlayan basit ama güçlü bir gerçek zamanlı sohbet uygulaması.
- Sunucu Oluştur & Katıl: Çok oyunculu oturumlar oluşturun veya katılın
- Gerçek Zamanlı Mesajlaşma: Tüm bağlı istemciler arasında anında mesaj gönderme
- Kullanıcı Yönetimi: Otomatik kullanıcı algılama ve bağlantı yönetimi
- Basit Arayüz: Temiz ve sezgisel kullanıcı arayüzü
- Çoklu Platform: Godot'un desteklediği tüm platformlarda çalışır
- Godot Engine 4.x
- Temel GDScript bilgisi
- Çok oyunculu işlevsellik için ağ bağlantısı
- Port 1300'de sunucu oluşturmak için Host düğmesine tıklayın
- Oyuncuların bağlanmasını bekleyin
- Sohbet etmeye başlayın!
- localhost:1300'e bağlanmak için Join düğmesine tıklayın
- Bağlantı onayını bekleyin
- Diğer oyuncularla sohbet etmeye başlayın!
- Mesajınızı metin alanına yazın
- Message düğmesine tıklayın veya Enter'a basın
- Mesajınız tüm bağlı oyunculara yayınlanacak
_on_host_button_pressed()- Çok oyunculu sunucu oluşturur ve başlatır_on_join_button_pressed()- Mevcut bir sunucuya bağlanır_on_message_button_pressed()- Tüm bağlı eşlere mesaj gönderiradd_user(id)- Yeni kullanıcı bağlantılarını yönetirsend_message(text, sender_name)- Mesaj yayını için RPC fonksiyonuserver_opened()- Bağlantı sonrası kullanıcı tanımlamasını ayarlar
peer- Ağ iletişimi için ENetMultiplayerPeer örneğimessage- Mesaj depolama için String değişkenimy_name- Oyuncu tanımlaması için dışa aktarılan string
- Yeni bir Godot projesi oluşturun
- Ana sahne olarak bir Node2D ekleyin
- Gerekli UI öğelerini ekleyin:
- Host düğmesi
- Join düğmesi
- Message düğmesi
- MessageText (TextEdit/LineEdit)
- MessageLabel (Label)
- Bu scripti Node2D'ye bağlayın
- Düğme sinyallerini ilgili fonksiyonlara bağlayın
- Inspector'da
my_namedeğişkenini ayarlayın (isteğe bağlı)
- Varsayılan Port: 1300
- Varsayılan Adres: localhost (127.0.0.1)
- Protokol: ENet (UDP tabanlı)
- Maksimum Bağlantı: Sınırsız (ENet varsayılanı)
- Özel sunucu IP girişi
- Kullanıcı listesi görüntüleme
- Mesaj geçmişi
- Özel mesajlaşma
- Sohbet odaları/kanalları
- Kullanıcı kimlik doğrulama
- Mesaj zaman damgaları
- Emoji desteği
Bağlantı Sorunları:
- Hem sunucu hem de istemcinin aynı ağda olduğundan emin olun
- Port 1300 için güvenlik duvarı ayarlarını kontrol edin
- Godot sürüm uyumluluğunu doğrulayın
Mesaj Gönderilmiyor:
- Sunucuya düzgün bağlandığınızdan emin olun
- RPC izinlerinin doğru ayarlandığından emin olun
- UI öğesi isimlerinin script referanslarıyla eşleştiğini doğrulayın
Bu proje açık kaynaklıdır ve MIT Lisansı altında mevcuttur.
Feel free to fork this project and submit pull requests for any improvements!
Bu projeyi fork'layabilir ve iyileştirmeler için pull request gönderebilirsiniz!
If you encounter any issues or have questions, please open an issue in the repository.
Herhangi bir sorunla karşılaşırsanız veya sorularınız varsa, repository'de bir issue açın.
