Un projet pour tester et apprivoiser godot. Ce n'est pas un client officiel. Utile également pour se balader dans les décors et voir les objets nouvellement créés dans un client godot.
Find a file
2020-04-02 21:07:38 +02:00
addons create module 2020-01-24 19:56:51 +01:00
assets update network class 2020-03-30 22:20:59 +02:00
background_loader_scene typos 2018-09-30 16:22:07 +02:00
dispensaire_gridmap typo 2018-09-22 10:45:39 +02:00
dispensaire_scenes typo 2018-09-22 10:45:39 +02:00
game_scene create module 2020-01-24 19:56:51 +01:00
gdnative adding step to store message received (use to synchronize) 2020-04-02 21:07:38 +02:00
gui_scene/GUI update network part 2020-03-03 22:45:30 +01:00
login_scene adding step to store message received (use to synchronize) 2020-04-02 21:07:38 +02:00
modules adding step to store message received (use to synchronize) 2020-04-02 21:07:38 +02:00
scenes adding debug message 2020-01-05 16:36:41 +01:00
test_grid_map Correction des parametre des materiaux du dispensaire. 2018-09-04 15:05:41 +02:00
test_scene réorganisation des fichiers et correction de l'ecran de chargement qui ne s'adaptai pas a la taille du viewport. 2018-08-25 10:05:54 +02:00
.gitignore adding loader msg.xml and correct message when login/register error are detected 2020-01-05 16:16:07 +01:00
.gitlab-ci.yml update network class 2020-03-30 22:20:59 +02:00
.gitmodules remove gdscript and update modules 2020-02-09 16:13:30 +01:00
ca-certificates.crt Add openssl certificate 2018-10-04 17:26:38 +02:00
default_env.tres create module 2020-01-24 19:56:51 +01:00
export_presets.cfg adding loader msg.xml and correct message when login/register error are detected 2020-01-05 16:16:07 +01:00
global.gd create module 2020-01-24 19:56:51 +01:00
global.tscn adding low level communication with server khaganat (UDP) 2019-12-10 21:40:32 +01:00
icon.png initialisation 2018-07-25 09:36:19 +02:00
icon.png.import Portage Godot 3.1beta + bypass login 2019-03-05 20:20:05 +01:00
JukeboxPannel.gd create module 2020-01-24 19:56:51 +01:00
portail.gd wip: ajout du choix de la position d'arriver du portail. 2018-08-21 11:40:29 +02:00
project.godot update network part 2020-03-03 22:45:30 +01:00
README.md update method use for debug message (disabled on release) 2020-03-31 12:31:20 +02:00
TODO update network class 2020-03-30 22:20:59 +02:00

Build

Before build and launch client, build module (before, we need include modules on godot source)

Build module

mkdir build
cd build
# Disable build directory on godot editor
touch .gdignore
# clone godot
git clone https://github.com/godotengine/godot.git
cd godot
# switch on release
#git checkout 3.1.2-stable
git checkout 3.2
# Create link with our module (or copy file to godot/modules - as you like)
cd modules
for file in ../../../modules/*
do
   if [ -d $file ]
   then
      echo "$file"
      ln -s $file .
   fi
done
cd ..
# Copy modules doc to godot
cp modules/*/doc_classes/* doc/classes/.
# Clean project (if you build before)
scons -j$(nproc) -c
# Build a debug version
scons -j$(nproc) platform=x11 target=debug
# or build release_debug
scons -j$(nproc) platform=x11 target=release_debug
# or build release -> becarefull, this version works on root project and impossible to launch editor
scons -j$(nproc) platform=x11 target=release tools=no
cd ../..

Generate doc

If you want, you can regenerate doc. (Normally it's generated)

cd build/godot
./bin/godot.x11.tools.64 --doctool .
cp modules/*/doc_classes/* doc/classes/.

Launch godot with module

cd build/godot
bin/godot.x11.tools.64
cd ../..

Package client khaganat

Configure export

Configure on project export (or edit file export_presets.cfg)

Ex.: export_presets.cfg

[preset.0]

name="khaganat.linux.64"
platform="Linux/X11"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
patch_list=PoolStringArray(  )
script_export_mode=1
script_encryption_key=""

[preset.0.options]

texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/64_bits=true
custom_template/release=""
custom_template/debug=""

Generate package

godot --path . --export khaganat.linux.64 khaganat.linux64.bin

Launch client khaganat

With godot

godot login_scene/login_scene.tsc

Library

NetworkConnection

NetworkConnection -> class to manage/use NetworkConnectionCore All times, connect on NetworkConnectionCore (to get singleton) and launch function The goal is to don't managed Singleton, this class manage At end of program, you need execute function "terminate_network_connection" to remove singleton.

NetworkConnectionCore -> class Singleton (uniq object) [contains network connexion, state connexion] _state_connexion[StateConnectionBase] : Object change class with state connexion [StateConnectionNotInitialized, StateConnectionLogin, StateConnectionSynchronize, StateConnectionConnected, StateConnectionQuit] _network_data [NetworkData] : Object state connexion (Tick receive, send, bit acknowledge) _queue [BitStreamQueue] : queue to store message UDP (just simple method to try re-order message receive by UDP) _socketUDP [Ref] : network connexion

  NetworkConnection(object A)             NetworkConnection(object B)     ...
         |                                       |

+-------+----+---------------------------------------+-----------------------------------------+ | NetworkConnectionCore * _network_data * _queue * _socketUDP * _state_connexion if StateConnectionConnected

ReferentialMessage

ReferentialMessage -> class to manage/use ReferentialMessageCore

ReferentialMessageCore -> class singleton (uniq object) [Manage data provide by msg.xml], we can encode/decode khaganat's message

ViewMessage

PacketServer +---------+ +---------+ +---------+ | Level A | | Level B | | Level C | | (0) | | (0) | | (0) | +---------+ +---------+ +---------+ +---------+ +---------+ | Level B | | Level C | | (1) | | (1) | +---------+ +---------+ +---------+ | Level C | | (2) | +---------+ +---------+ | Level C | | (3) | +---------+

Message UDP : +-------------+ | Server Part | +-------------+ | Type Message (system / application) |

+---------+ | | +----------------+ | | -> | System Message | | Message | +----------------+ | | | UDP | +----------------+ +---------+ +---------+ +---------+ | | -> | Normal Message | -> | Level A +-+ Level B +-+ Level C + | | +----------------+ +---------+ +---------+ +---------+ +---------+

Message UDP : +-------------------+------------+--- | CurrentSendNumber | SystemMode | . . . | 32 bits | 1 bit | +-+-+-+-+-+-+-+-+-+-+------------+--- 1 -> system mode 0 -> normal mode

System Message : +---------+-- | Message | . . . | 8 bits | +---------+--