Skip to content

(#54) Implement TrainSets#205

Draft
marcinn wants to merge 35 commits into
mainfrom
dev/trainsets6
Draft

(#54) Implement TrainSets#205
marcinn wants to merge 35 commits into
mainfrom
dev/trainsets6

Conversation

@marcinn
Copy link
Copy Markdown
Member

@marcinn marcinn commented Apr 26, 2026

Fixes #54

JezSonic and others added 23 commits February 21, 2026 21:48
Use p_enabled parameter instead of inherited enabled from TrainPart
to ensure correct acknowledgment behavior.
Add support for MSVC specific compile options and multi-config output directories.
Enhance CMakeLists for MSVC and debug handling
…ions

.clang-tidy will now enforce CODE_STYLE.md
This is initial implementation of tracks rendering.
It is not 100%-compatible with the original simulator,
but still good enough for PoC.

Current implementation:

* adds TrackRenderingServer, which uses RenderingServer directly
* adds initial MaszynaTrack3D node for tracks placement
* adds initial MaszynaSwitch3D for junctions

Limitations:

* tracks are defined as Curve3D with multiple points,
  where the original simulator uses 2-point curves only per track
  segment; this is incompatible with Mover physics server
* junctions are defined as MaszynaSwitch3D, a separate nodes,
  where the original simulator uses for switches two curves per track
  with a common point; this is incompatible with Mover physics server
* common render settings like curve quality or smoothing should be
  implemented as project-wide settings

Issues:

* possible random crashes on gdextension unload / hot reload (to be
  addressed separately)

Co-authored-by: Marcin Nowak <marcin.j.nowak@gmail.com>
…movement

Add track rendering without vehicle movement
…ection

(#203) Add TrainWheels section / LoadFIZ_Wheels
Copy link
Copy Markdown
Member Author

@marcinn marcinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • remove ai slop
  • do better public api
  • reduce mover changes

To do in next review:

  • check commands refactoring

Comment thread addons/libmaszyna/libmaszyna.gd Outdated
add_autoload_singleton("Console", "res://addons/libmaszyna/console/console.gd")
add_autoload_singleton("AudioStreamManager", "res://addons/libmaszyna/sound/audio_stream_manager.gd")
add_autoload_singleton("UserSettings","res://addons/libmaszyna/settings/user_settings.gd" )
_ensure_autoload("MaszynaEnvironment", "res://addons/libmaszyna/environment/maszyna_environment.gd")
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this ai slop

Comment thread addons/libmaszyna/libmaszyna.gd Outdated
remove_autoload_singleton("Console")
remove_autoload_singleton("MaszynaEnvironment")
remove_autoload_singleton("UserSettings")
_remove_autoload_if_present("AudioStreamManager")
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this ai slop

Comment thread addons/libmaszyna/libmaszyna.gd Outdated
ProjectSettings.set_initial_value(name, default_value)


func _ensure_autoload(name: String, path: String) -> void:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this ai slop

compatibility_minimum = "4.4"
reloadable = true
compatibility_minimum = "4.6"
reloadable = false
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this ai slop

func _enter_tree():
_ensure_curve()
_ensure_track()
_ensure_virtual_track()
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Virtual track should not be exposed, and should be managed internally

#pragma once
//---------------------------------------------------------------------------
// Q: 20160805 - odlaczenie pliku fizyki .pas od kompilacji
#include "hamulce.h"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not change Mover!

// TDynamicObject *vehicle{nullptr}; // detected obstacle
int vehicle_end{-1}; // facing end of the obstacle
TMoverParameters *vehicle{nullptr}; // detected obstacle
int vehicle_end{-1}; // facing end of the obstacle
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not change Mover!

bool LoadTypeChange{false}; // indicates load type was changed
std::string LoadQuantity; // jednostki miary
int LoadStatus = 0; //+1=trwa rozladunek,+2=trwa zaladunek,+4=zakończono,0=zaktualizowany model
bool LoadTypeChange{false}; // indicates load type was changed
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not change Mover!


// double CouplerForce(int const End, double dt);
// void CollisionDetect(int const End, double const dt); //
double CouplerForce(int const End, double dt);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine :)

// which aren't part of the same consist
// vehicles which aren't part of the same consist
auto const safevelocitylimit{15.0};
auto const selfvx{std::cos(Rot.Rz) * V};
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fcking ai slop - revert mover changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement TrainSets

2 participants