Skip to content

Instantly share code, notes, and snippets.

// tiny-space-v3_02-snapshot-serialization.cpp (C++11)
//
// DESCRIPTION: Gaming: Space sim in a tiny package.
// Work In Progress.
//
// BUILD: g++ --std=c++11 -O3 -lpthread -o tiny-space tiny-space-v3_02-snapshot-serialization.cpp
//
// CREATED: 2022.01.22 | AUTHOR: xixas | LICENSE: WTFPL/PDM/CC0... your choice
// MODIFIED: 2022.01.23 | AUTHOR: xixas | Added UI colors and jumpgate travel
// 2022.01.30 | AUTHOR: xixas | Randomized jumpgate position
// tiny-space-v3_01-basic-serialization.cpp (C++11)
//
// DESCRIPTION: Gaming: Space sim in a tiny package.
// Work In Progress.
//
// BUILD: g++ --std=c++11 -O3 -lpthread -o tiny-space tiny-space-v3_01-basic-serialization.cpp
//
// CREATED: 2022.01.22 | AUTHOR: xixas | LICENSE: WTFPL/PDM/CC0... your choice
// MODIFIED: 2022.01.23 | AUTHOR: xixas | Added UI colors and jumpgate travel
// 2022.01.30 | AUTHOR: xixas | Randomized jumpgate position
// tiny-space-v3.cpp (C++11)
//
// DESCRIPTION: Gaming: Space sim in a tiny package.
// Work In Progress.
//
// BUILD: g++ --std=c++11 -O3 -lpthread -o tiny-space tiny-space-v3.cpp
//
// CREATED: 2022.01.22 | AUTHOR: xixas | LICENSE: WTFPL/PDM/CC0... your choice
// MODIFIED: 2022.01.23 | AUTHOR: xixas | Added UI colors and jumpgate travel
// 2022.01.30 | AUTHOR: xixas | Randomized jumpgate position
// tiny-space-v2.cpp (C++11)
//
// DESCRIPTION: Gaming: Space sim in a tiny package.
// Work In Progress.
//
// BUILD: g++ --std=c++11 -O3 -lpthread -o tiny-space tiny-space-v2.cpp
//
// CREATED: 2022.01.22 | AUTHOR: xixas | LICENSE: WTFPL/PDM/CC0... your choice
// MODIFIED: 2022.01.23 | AUTHOR: xixas | Added colors and jumpgate travel
// tiny-space.cpp (C++11)
// AUTHOR: xixas | DATE: 2022.01.22 | LICENSE: WTFPL/PDM/CC0... your choice
// DESCRIPTION: Gaming: Space sim in a tiny package.
// Demo base for testing real-time save mechanisms.
// Work In Progress.
// BUILD: g++ --std=c++11 -O3 -lpthread -o tiny-space tiny-space.cpp
#include <atomic>
#include <chrono>
// dag-snapshot-large_a.cpp (C++11)
// AUTHOR: xixas | DATE: 2022.01.20 | LICENSE: WTFPL/PDM/CC0... your choice
// DESCRIPTION: Gaming: World-state snapshot example for non-interrupting saves.
// Repeated directed acyclic graph vertex replacement.
// NO LOCKS.
// Larger data set test.
// BUILD: g++ --std=c++11 -O3 -lpthread -o dag-snapshot-large_a dag-snapshot-large_a.cpp
#include <atomic>
@xixasdev
xixasdev / dag-snapshot.cpp
Last active January 20, 2022 07:43
Gaming: World-state snapshot example for non-interrupting saves - DAG - NO LOCKS
// dag-snapshot.cpp (C++11)
// AUTHOR: xixas | DATE: 2022.01.17 | LICENSE: WTFPL/PDM/CC0... your choice
// DESCRIPTION: Gaming: World-state snapshot example for non-interrupting saves.
// Repeated directed acyclic graph vertex replacement.
// NO LOCKS.
// BUILD: g++ --std=c++11 -O3 -lpthread -o dag-snapshot dag-snapshot.cpp
#include <atomic>
#include <chrono>
#!/usr/bin/env python3
# x4_savegame_xmlanalyzer_v2.py
# AUTHOR: xixas | DATE: 2022.01.12 | LICENSE: WTFPL/PDM/CC0... your choice
# DESCRIPTION: Parse an X4 Foundations savegame XML file and report tag statistics
import argparse
import re
import sys
import xml.sax
@xixasdev
xixasdev / x4_savegame_xmlanalyzer_v1.py
Last active November 10, 2022 23:46
X4 Foundations Savegame: XML Analyzer to determine deserialization criteria
#!/usr/bin/env python3
# x4_savegame_xmlanalyzer_v1.py
# AUTHOR: xixas | DATE: 2022.01.09 | LICENSE: WTFPL/PDM/CC0... your choice
# DESCRIPTION: Parse an X4 Foundations savegame XML file and report tag statistics
import argparse
import re
import sys
import xml.sax
@xixasdev
xixasdev / SaveStateExample_Large.cpp
Last active January 3, 2022 02:48
C++ Gaming: World-state snapshot example for non-interrupting saves (8 threads, 3 million vars)
// SaveStateExample_Large.cpp (C++11)
// AUTHOR: xixas | DATE: 2022.01.02 | LICENSE: WTFPL/PDM/CC0... your choice
// DESCRIPTION: Gaming: World-state snapshot example for non-interrupting saves.
// BUILD: g++ -o save-state-example-large SaveStateExample_Large.cpp -lpthread -std=c++11
#include <cstdio> // printf
#include <atomic> // std::atomic
#include <mutex> // std::mutex
#include <thread> // std::thread