Initial godot commit
Signed-off-by: fly <merspieler@alwaysdata.com>
This commit is contained in:
parent
3993e1e667
commit
ab7a579e18
12 changed files with 272 additions and 3 deletions
BIN
aids/BOB-map.jpg
Normal file
BIN
aids/BOB-map.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 94 KiB |
2
godot/.gitattributes
vendored
Normal file
2
godot/.gitattributes
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Normalize EOL for all files that Git considers text files.
|
||||
* text=auto eol=lf
|
2
godot/.gitignore
vendored
Normal file
2
godot/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Godot 4+ specific ignores
|
||||
.godot/
|
87
godot/data/default.json
Normal file
87
godot/data/default.json
Normal file
|
@ -0,0 +1,87 @@
|
|||
{
|
||||
"firstStart": 1,
|
||||
"money": 10000000,
|
||||
"trains": {
|
||||
"VT 101": {
|
||||
"type": "Integral",
|
||||
"protections": ["PZB", "LZB"],
|
||||
"paxSecond": 152,
|
||||
"paxStanding": 200,
|
||||
"paxFirst": 12,
|
||||
"currentLocation": "München Hbf"
|
||||
},
|
||||
"VT 102": {
|
||||
"type": "Integral",
|
||||
"protections": ["PZB", "LZB"],
|
||||
"paxSecond": 152,
|
||||
"paxStanding": 200,
|
||||
"paxFirst": 12,
|
||||
"currentLocation": "München Hbf"
|
||||
},
|
||||
"VT 103": {
|
||||
"type": "Integral",
|
||||
"protections": ["PZB", "LZB"],
|
||||
"paxSecond": 152,
|
||||
"paxStanding": 200,
|
||||
"paxFirst": 12,
|
||||
"currentLocation": "München Hbf"
|
||||
}
|
||||
},
|
||||
"stations": {
|
||||
"München Hbf": {
|
||||
"owned": 0,
|
||||
"platforms": 36,
|
||||
"changeTime": 8
|
||||
},
|
||||
"München Donnersbergerbrücke": {
|
||||
"owned": 0,
|
||||
"platforms": 4,
|
||||
"changeTime": 3
|
||||
}
|
||||
},
|
||||
"tracks": [
|
||||
{
|
||||
"from": "München Hbf",
|
||||
"to": "München Donnersbergerbrücke",
|
||||
"distance": 1400,
|
||||
"maxSpeed": 70
|
||||
}
|
||||
],
|
||||
"schedules": {
|
||||
"type": "RB",
|
||||
"runs": [
|
||||
{
|
||||
"train": "Integral",
|
||||
"units": 3,
|
||||
"stops": [
|
||||
{
|
||||
"station": "München Hbf",
|
||||
"departure": [10,0],
|
||||
"waitForDelayed": []
|
||||
},
|
||||
{
|
||||
"station": "München Donnersbergerbrücke",
|
||||
"departure": [11,0],
|
||||
"waitForDelayed": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"train": "Integral",
|
||||
"units": 3,
|
||||
"stops": [
|
||||
{
|
||||
"station": "München Donnersbergerbrücke",
|
||||
"departure": [11,0],
|
||||
"waitForDelayed": []
|
||||
},
|
||||
{
|
||||
"station": "München Hbf",
|
||||
"departure": [12,0],
|
||||
"waitForDelayed": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
0
godot/data/stations.json
Normal file
0
godot/data/stations.json
Normal file
0
godot/data/tracks.json
Normal file
0
godot/data/tracks.json
Normal file
10
godot/data/trains.json
Normal file
10
godot/data/trains.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"Integral": {
|
||||
"maxSpeed": 140,
|
||||
"electric": 0,
|
||||
"defaultProtections": ["PZB", "LZB"],
|
||||
"defaultPaxSecond": 152,
|
||||
"defaultPaxStanding": 200,
|
||||
"defaultPaxFirst": 12
|
||||
}
|
||||
}
|
43
godot/main.gd
Normal file
43
godot/main.gd
Normal file
|
@ -0,0 +1,43 @@
|
|||
extends Node
|
||||
const SAVE_JSON := "user://save.json"
|
||||
const DEFAULT_JSON := "res://data/default.json"
|
||||
|
||||
var gameData = {}
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
var trains : Dictionary = load("res://data/trains.json").data
|
||||
#var tracks : Dictionary = load("res://data/tracks.json").data
|
||||
#var stations : Dictionary = load("res://data/stations.json").data
|
||||
gameData = loadGame(DEFAULT_JSON)
|
||||
if gameData.firstStart == 1:
|
||||
gameData.firstStart = 0
|
||||
#TODO first start add popup
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
|
||||
func loadGame(fileName):
|
||||
var file = FileAccess.open(fileName, FileAccess.READ)
|
||||
var input = file.get_as_text()
|
||||
var json = JSON.new()
|
||||
var ret = JSON.parse_string(input)
|
||||
if typeof(ret) == TYPE_DICTIONARY:
|
||||
return ret
|
||||
else:
|
||||
print("Invalid gameData loaded from file %s" % fileName)
|
||||
return null
|
||||
|
||||
func saveGame(fileName):
|
||||
var saveData = JSON.stringify(gameData)
|
||||
var file = FileAccess.open(fileName, FileAccess.WRITE)
|
||||
file.store_string(saveData)
|
||||
|
||||
|
||||
func _on_save_pressed():
|
||||
saveGame(SAVE_JSON)
|
||||
|
||||
func _on_load_pressed():
|
||||
loadGame(SAVE_JSON)
|
64
godot/management_ui.tscn
Normal file
64
godot/management_ui.tscn
Normal file
|
@ -0,0 +1,64 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://dgp4berdasity"]
|
||||
|
||||
[ext_resource type="Script" path="res://main.gd" id="1_l2k6r"]
|
||||
|
||||
[node name="Management UI" type="CanvasLayer"]
|
||||
script = ExtResource("1_l2k6r")
|
||||
|
||||
[node name="MenuBar" type="MenuBar" parent="."]
|
||||
offset_right = 1153.0
|
||||
offset_bottom = 32.0
|
||||
|
||||
[node name="Trains" type="MenuButton" parent="MenuBar"]
|
||||
layout_mode = 0
|
||||
offset_right = 8.0
|
||||
offset_bottom = 8.0
|
||||
toggle_mode = false
|
||||
text = "Trains"
|
||||
|
||||
[node name="Schedules" type="MenuButton" parent="MenuBar"]
|
||||
layout_mode = 0
|
||||
offset_left = 56.0
|
||||
offset_top = 1.0
|
||||
offset_right = 142.0
|
||||
offset_bottom = 32.0
|
||||
toggle_mode = false
|
||||
text = "Schedules
|
||||
"
|
||||
|
||||
[node name="Lines" type="MenuButton" parent="MenuBar"]
|
||||
layout_mode = 0
|
||||
offset_left = 142.0
|
||||
offset_right = 191.0
|
||||
offset_bottom = 31.0
|
||||
toggle_mode = false
|
||||
text = "Lines"
|
||||
|
||||
[node name="Stations" type="MenuButton" parent="MenuBar"]
|
||||
layout_mode = 0
|
||||
offset_left = 191.0
|
||||
offset_top = 1.0
|
||||
offset_right = 262.0
|
||||
offset_bottom = 32.0
|
||||
toggle_mode = false
|
||||
text = "Stations"
|
||||
|
||||
[node name="Save" type="MenuButton" parent="MenuBar"]
|
||||
layout_mode = 0
|
||||
offset_left = 262.0
|
||||
offset_top = 1.0
|
||||
offset_right = 306.0
|
||||
offset_bottom = 32.0
|
||||
toggle_mode = false
|
||||
text = "Save"
|
||||
|
||||
[node name="Load" type="MenuButton" parent="MenuBar"]
|
||||
layout_mode = 0
|
||||
offset_left = 306.0
|
||||
offset_top = 1.0
|
||||
offset_right = 352.0
|
||||
offset_bottom = 32.0
|
||||
text = "Load"
|
||||
|
||||
[connection signal="pressed" from="MenuBar/Save" to="." method="_on_save_pressed"]
|
||||
[connection signal="pressed" from="MenuBar/Load" to="." method="_on_load_pressed"]
|
39
godot/menu.tscn
Normal file
39
godot/menu.tscn
Normal file
|
@ -0,0 +1,39 @@
|
|||
[gd_scene format=3 uid="uid://840ka7h3akdn"]
|
||||
|
||||
[node name="Menu" type="CanvasLayer"]
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -124.5
|
||||
offset_right = 124.5
|
||||
offset_bottom = 23.0
|
||||
grow_horizontal = 2
|
||||
text = "Welcome to Open Train Ops Sim"
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="."]
|
||||
offset_left = 248.0
|
||||
offset_top = 74.0
|
||||
offset_right = 912.0
|
||||
offset_bottom = 230.0
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
text = "You're taking over $TrainCompany.
|
||||
For now, you've got 2 lines and 3 vehicles to work with.
|
||||
Good luck!"
|
||||
|
||||
[node name="Button" type="Button" parent="RichTextLabel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -56.0
|
||||
offset_top = 21.0
|
||||
offset_right = 57.0
|
||||
offset_bottom = 71.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "Lets Go!"
|
16
godot/project.godot
Normal file
16
godot/project.godot
Normal file
|
@ -0,0 +1,16 @@
|
|||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=5
|
||||
|
||||
[application]
|
||||
|
||||
config/name="OpenTrainOpsSim"
|
||||
run/main_scene="res://management_ui.tscn"
|
||||
config/features=PackedStringArray("4.2", "Forward Plus")
|
||||
boot_splash/bg_color=Color(0, 0, 0, 1)
|
12
ideas
12
ideas
|
@ -5,24 +5,27 @@ Tracks:
|
|||
Single/Double and of that 1 or 2 side by side
|
||||
Max speed by surroundings (No 300km/h at Geislingen Steige) for expansion
|
||||
Max speed currently allowed
|
||||
Train protection (None, PZB, LZB, ETCS) -> Influence on max speed
|
||||
Train protection (None, PZB, LZB (about 5x price of PZB), ETCS (about price of PZB)) -> Influence on max speed
|
||||
Track protection (None, signals, derail, switch) -> Influence on max speed
|
||||
Electrified
|
||||
Passing tracks
|
||||
|
||||
Stations:
|
||||
Attributes:
|
||||
Change times (A) platform dependent
|
||||
Number of Platforms with length
|
||||
Owned
|
||||
(A) comfort features such as launge and station wifi
|
||||
|
||||
Trains:
|
||||
Attributes:
|
||||
Name
|
||||
Capacity (pax)
|
||||
Capacity (pax), Capacity 1st class
|
||||
Dis/embark speed (pax/min)
|
||||
Max speed (km/h)
|
||||
Electric
|
||||
Supported protection system
|
||||
Supported protection system (afterwards install of ETCS depending on train 50k - 250k)
|
||||
Double/Multi traction?
|
||||
(A) Configuration dependent capacity
|
||||
(A) Configuration dependent comfort features (1st class, wifi, bord restaurant)
|
||||
(A) Acceleration/Deceleration speed
|
||||
|
@ -35,6 +38,7 @@ Schedules:
|
|||
Planed arrival time
|
||||
Planed departure time
|
||||
Waiting for delayed connection (Yes, no, how long? dependent on connecting type)
|
||||
Flügeln
|
||||
|
||||
Construction:
|
||||
Takes time, sometimes delay. Offer multiple construction companies with different deals -> cost, duration and hidden to the player: delays, cost increase
|
||||
|
@ -50,8 +54,10 @@ Events:
|
|||
Accidents. Frequent accidents may cause sticker laws regarding protections -> potential retrofit needed!
|
||||
Offer to take over infrastructure (you need to buy it or there's some high initial maintenance cost
|
||||
Offer to build a new infra line from scratch
|
||||
Other operators wanting to run trains on your tracks
|
||||
|
||||
Game:
|
||||
Loading saves
|
||||
Starting new games
|
||||
Settings
|
||||
Set company name
|
||||
|
|
Loading…
Add table
Reference in a new issue