1 पॉइंट द्वारा GN⁺ 2024-06-14 | 1 टिप्पणियां | WhatsApp पर शेयर करें

Serious Engine 1 सोर्स कोड विश्लेषण

अवलोकन

  • Serious Sam को एक multiplayer गेम के रूप में डिज़ाइन किया गया था।
  • इसका single-player campaign भी multiplayer की तरह काम करता है।
  • Serious Engine single-player, multiplayer, demo recording और playback को सपोर्ट करता है।

floating-point determinism

  • गेम synchronization के लिए floating-point operations का deterministic behavior महत्वपूर्ण है।
  • यह केवल Windows पर रिलीज़ हुआ था, इसलिए compiler differences से होने वाली synchronization समस्याओं से बचा जा सका।
  • FPU precision differences से होने वाली समस्याओं को हल करने के लिए precision guard का उपयोग किया गया।

tick बनाम frame

  • गेम logic tick rate, rendering frame rate से अलग है।
  • गेम logic प्रति सेकंड 20 tick पर स्थिर है।
  • smooth movement और animation के लिए interpolation का उपयोग किया जाता है।

network multiplayer

  • Serious Engine का networking model client-server आधारित है।
  • सर्वर clients से messages प्राप्त करके उन्हें process करता है, और संबंधित जानकारी सभी clients को भेजता है।
  • packets भेजने के लिए UDP protocol का उपयोग किया जाता है।

packet layer

  • UDP packets का क्रम बदल सकता है या वे पहुँच ही नहीं सकते।
  • Serious Engine, UDP के ऊपर अपना protocol implement करता है ताकि reliability और packet order सुनिश्चित किया जा सके।
  • reliable packets की पुष्टि ACK packets के ज़रिए की जाती है।

connection lifecycle

  • client और server के बीच virtual connection स्थापित करने के लिए broadcast packets का उपयोग किया जाता है।
  • सर्वर client को एक unique identifier देता है, और उसी के आधार पर packets को route करता है।

offline play

  • single-player और demo playback, multiplayer के विशेष रूप हैं।
  • एक ही process के भीतर server और client आपस में communicate करते हैं।

message layer

  • CNetworkMessage एक message abstraction है जिसे stream की तरह पढ़ा और लिखा जा सकता है।
  • messages को compress किया जा सकता है, और डिफ़ॉल्ट रूप से LZRW1 compression का उपयोग होता है।
  • data transfer को न्यूनतम रखने के लिए delta encoding का उपयोग किया जाता है।

message security

  • messages encrypted नहीं होते।
  • chat messages plain text में भेजे जाते हैं।

GN⁺ की राय

  • गेम डेवलपर्स के लिए उपयोगी: Serious Engine की network architecture और synchronization mechanism, multiplayer गेम development के लिए उपयोगी संदर्भ सामग्री हो सकते हैं।
  • deterministic behavior का महत्व: floating-point operations के deterministic behavior को सुनिश्चित करने का तरीका, game synchronization समस्याओं को हल करने में महत्वपूर्ण तत्व है।
  • network protocol design: UDP के ऊपर reliability और ordering सुनिश्चित करने वाला custom protocol implement करना, network programming का एक अच्छा उदाहरण है।
  • security considerations: message encryption का न होना, आधुनिक game development में security के नज़रिए से ध्यान देने योग्य बात है।
  • तकनीकी चुनौतियाँ: शुरुआती 2000 के दशक के network environment में तेज़ रफ़्तार multiplayer गेम को implement करने की तकनीकी चुनौतियों को समझने में यह मददगार है।

1 टिप्पणियां

 
GN⁺ 2024-06-14
Hacker News राय
  • मैं वह डेवलपर था जिसने Serious Sam का नेटवर्क कोड इम्प्लीमेंट किया था। QuakeWorld prediction system से प्रेरित होकर एक साधारण MVP कोड किया था।
  • Serious Sam हमेशा LAN party में अच्छी तरह काम करता था। दूसरे गेम्स को दिक्कतें होने पर भी यह स्थिर रूप से चलता था।
  • मैंने GB Color port के Vigilante 8 multiplayer को deterministic gameplay के साथ इम्प्लीमेंट किया था। GBC link cable का उपयोग करके 1 byte प्रति बार डेटा ट्रांसफर किया था.
  • Croteam एक बेहद प्रतिभाशाली game development team है। उसने Talos Principle series और custom Vulkan game engine विकसित किया है।
  • पूछा गया कि क्या यह Age of Empires के "1500 archers on a 28.8" जैसी ही अवधारणा है।
  • यह बताया गया कि जैसे-जैसे तकनीकी संसाधन बढ़ते हैं, software और धीमा और अक्षम होता जाता है। इसे "Benjamin Button software design effect" कहा गया।
  • Factorio की architecture सिर्फ input events भेजती है, और synchronized simulation core पर निर्भर करती है।
  • Serious Sam को PC Gamer demo के रूप में खेलने की याद ताज़ा की गई। अब इसे एक classic game माना जाता है।
  • Serious Engine की interpolation सुविधा का वर्णन किया गया। console में net_bLerping=0 दर्ज करके interpolation के बिना गेम खेला जा सकता है।