29 Commits

Author SHA1 Message Date
Kirill 0162084e53 Refactor state management; update unlock logic and enhance signal bindings in scene 2026-09-01 23:53:05 +03:00
Kirill 2f4b6a98d8 Refactor production logic to use state amounts; update calculate_max_producible function to accept default desired amount 2026-09-01 21:29:07 +03:00
Kirill d90f8693c9 Update Godot core rules to version 4.7; refactor production logic and add entity batch processing 2026-08-31 23:51:07 +03:00
Kirill e870c96879 Add 'binds' key to state dictionary for enhanced state management 2026-08-30 22:31:24 +03:00
Kirill e531e7d9b6 Refactor item management and unlock logic; remove unused item update list and signal 2026-08-28 00:07:18 +03:00
Kirill 57cc023558 Implement item unlocking mechanism and refactor save functionality; update scene timer node 2026-08-27 23:04:56 +03:00
Kirill 23929e3651 Refactor owniverse state management; replace evolution class with state handling and update cycle logic 2026-08-25 00:26:31 +03:00
Kirill 829aadca2d Update version to 0.6.27 and increment version code to 143; refactor resource paths in scene files
Android / android (push) Successful in 30s
2026-08-20 22:58:24 +03:00
Kirill 30486616f8 Update version to 0.6.26 and increment version code to 142
Android / android (push) Successful in 30s
2026-08-20 22:55:01 +03:00
Kirill d9a2679af4 Replace pressed burger button image and update resource path in world.tscn 2026-08-20 22:54:42 +03:00
Kirill 4f57c37572 Update version to 0.6.25 and increment version code to 141; replace burger button image
Android / android (push) Successful in 30s
2026-08-20 22:45:22 +03:00
Kirill e4a0dd2d13 Add new spirituality trend indicator image
Android / android (push) Successful in 30s
2026-08-20 22:29:11 +03:00
Kirill 0a10cff0fa Refactor code structure for improved readability and maintainability 2026-08-20 22:28:03 +03:00
Kirill e4cf5bdad0 Add new button images for time adjustment in the top menu 2026-08-20 22:27:36 +03:00
Kirill 645751cd23 Add new button images for time adjustment in the top menu 2026-08-20 22:26:57 +03:00
Kirill b92a49821d Update version to 0.6.23 and increment version code to 139; add unique IDs to UI nodes
Android / android (push) Successful in 31s
2026-08-20 22:19:19 +03:00
Kirill 3a91528e95 Bump version to 0.6.22 and increment version code to 138
Android / android (push) Successful in 30s
2026-08-20 22:11:09 +03:00
Kirill 3c37be2a8e Add new PNG assets for time and speed UI components 2026-08-20 22:10:40 +03:00
Kirill 544b5f4f56 Add new time speed icons for UI 2026-08-20 22:10:22 +03:00
Kirill cc9de54d42 Bump version to 0.6.21 and increment version code to 137
Android / android (push) Successful in 31s
2026-08-20 21:55:23 +03:00
Kirill e76414ce17 Refactor code structure for improved readability and maintainability 2026-08-20 21:54:45 +03:00
Kirill 68c2b4f25d Refactor code structure for improved readability and maintainability 2026-08-20 21:54:32 +03:00
Kirill 78946f1bb4 Bump version to 0.6.20 and increment version code to 136
Android / android (push) Successful in 32s
2026-08-20 21:41:23 +03:00
Kirill 0d1671fe8f Update project icon reference in configuration file 2026-08-20 21:40:48 +03:00
Kirill ea35017aa0 Bump version to 0.6.19 and increment version code to 135
Android / android (push) Successful in 29s
2026-08-20 21:20:08 +03:00
Kirill 0db24fec60 Refactor background and starry sky layer scripts; move to new directory structure 2026-08-20 21:19:47 +03:00
Kirill b2a18c9c41 Refactor code structure for improved readability and maintainability 2026-08-20 21:19:30 +03:00
Kirill 16ec80929c Bump version to 0.6.18 and increment version code to 134; update Android workflow configuration
Android / android (push) Successful in 31s
2026-08-20 21:11:46 +03:00
Kirill 3536e25d52 Update version to 0.6.17 and increment version code to 133; enhance Android build workflow
Android / android (push) Successful in 27s
2026-08-20 21:05:22 +03:00
30 changed files with 517 additions and 231 deletions
+9 -3
View File
@@ -1,13 +1,19 @@
--- ---
name: Godot 4.4 Core Rules name: Godot 4.7 Core Rules
priority: high priority: high
--- ---
Ты — senior Godot 4.4 GDScript разработчик. Ты — senior Godot 4.7 GDScript разработчик.
- Use Godot 4.7+ API.
- Do not use Godot 3.x syntax or APIs.
- Follow the existing project architecture and coding style.
- Do not introduce unnecessary abstractions.
- Do not modify unrelated files.
- Всегда используй Godot 4.4+ API.
- Пиши строго типизированный код (`var health: int = 100`, `: Array[Node]` и т.д.). - Пиши строго типизированный код (`var health: int = 100`, `: Array[Node]` и т.д.).
- Предпочитай Signals вместо проверки в _process. - Предпочитай Signals вместо проверки в _process.
- Используй @export, @export_range, @export_enum, @onready. - Используй @export, @export_range, @export_enum, @onready.
- Composition over deep inheritance. - Composition over deep inheritance.
- Менеджеры и автолоады выноси в отдельные singleton'ы. - Менеджеры и автолоады выноси в отдельные singleton'ы.
+1
View File
@@ -0,0 +1 @@
- use spaces not tabs for indentation
+23 -2
View File
@@ -12,17 +12,27 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
lfs: true
- name: Godot version - name: Godot version
run: godot --version run: godot --version
- name: Prepare Godot - name: Prepare Godot
run: | run: |
rm -rf .godot rm -rf .godot
mkdir -p build
godot \
--headless \
--path . \
--editor \
--quit \
--verbose
- name: Build APK - name: Build APK
run: | run: |
mkdir -p build
godot \ godot \
--headless \ --headless \
--path . \ --path . \
@@ -35,6 +45,17 @@ jobs:
--export-release "Android" \ --export-release "Android" \
build/app.apk build/app.apk
- name: Check imported resources
run: |
echo "=== PNG imports ==="
find .godot/imported -iname '*habitable*' -o -iname '*civ2*'
echo "=== PNG files ==="
ls -lh ui/4-life/habitable_planet.png
ls -lh ui/4-life/civ2.png
- name: Verify APK - name: Verify APK
run: | run: |
test -f build/app.apk test -f build/app.apk
+1 -1
View File
@@ -110,7 +110,7 @@ architectures/armeabi-v7a=false
architectures/arm64-v8a=true architectures/arm64-v8a=true
architectures/x86=false architectures/x86=false
architectures/x86_64=false architectures/x86_64=false
version/code=132 version/code=143
version/name="" version/name=""
package/unique_name="com.KIDGameProduction.Owniverse" package/unique_name="com.KIDGameProduction.Owniverse"
package/name="Owniverse" package/name="Owniverse"
+2 -6
View File
@@ -8,18 +8,14 @@
config_version=5 config_version=5
[animation]
compatibility/default_parent_skeleton_in_mesh_instance_3d=true
[application] [application]
config/name="Owniverse" config/name="Owniverse"
config/version="0.6.16" config/version="0.6.27"
run/main_scene="uid://bv384dpmvjv8o" run/main_scene="uid://bv384dpmvjv8o"
config/features=PackedStringArray("4.7", "Mobile") config/features=PackedStringArray("4.7", "Mobile")
boot_splash/show_image=false boot_splash/show_image=false
config/icon="uid://do5teb1i7uiuw" config/icon="uid://djiwkyk470qb2"
config/size/borderless=true config/size/borderless=true
config/stretch_mode=0 config/stretch_mode=0
+73 -50
View File
@@ -73,8 +73,8 @@ var g_active_items: Dictionary = {}
var owniverse:Owniverse = Owniverse.new() var owniverse:Owniverse = Owniverse.new()
var owniverse_items: Dictionary[String, OwniverseItem] = {} var owniverse_items: Dictionary[String, OwniverseItem] = {}
var locked_items: Array = []
var item_list_to_update: Dictionary = {}
func set_datetime(value: float): func set_datetime(value: float):
date_time.text = str(snapped(value, 0.1)) date_time.text = str(snapped(value, 0.1))
@@ -82,22 +82,32 @@ func set_datetime(value: float):
#region Item manipulations: update and visibility #region Item manipulations: update and visibility
func add_to_update_list(item_id: String, amount: int) -> void:
if item_list_to_update.has(item_id):
item_list_to_update[item_id] += amount
else:
item_list_to_update[item_id] = amount
func set_owniverse_item_value() -> void: func set_owniverse_item_value() -> void:
for item_id in owniverse.items_to_update: for _item_id in owniverse_items:
if owniverse_items.has(item_id): owniverse_items[_item_id].set_label(owniverse.state.amount[_item_id])
owniverse_items[item_id].set_label(owniverse.items_to_update[item_id])
owniverse.items_to_update = {}
#endregion #endregion
func _unlock_items():
if locked_items.size() == 0: return
var _new_locked_items = []
for _item_id in locked_items:
#print(_item_id ' | ', _entity.unlock)
var _flag_to_unlock = true
for _elem in owniverse.entities[_item_id].unlock:
if owniverse.state.stats.total_amount[_elem] < owniverse.entities[_item_id].unlock[_elem]:
_flag_to_unlock = false
break
if _flag_to_unlock:
owniverse_items[_item_id].set_visible(true)
else:
_new_locked_items.append(_item_id)
locked_items = _new_locked_items
func _on_indicator_pressed(indicator_name: String, page: int = 0): func _on_indicator_pressed(indicator_name: String, page: int = 0):
_set_description(indicator_name, page) _set_description(indicator_name, page)
@@ -160,7 +170,7 @@ func _init_owniverse_items() -> bool:
item.item_activated.connect(item_activated) item.item_activated.connect(item_activated)
owniverse_items[item_id] = item owniverse_items[item_id] = item
return false return false
@@ -169,11 +179,8 @@ func item_activated(item: OwniverseItem) -> void:
_set_item_description(item) _set_item_description(item)
if item.item_id == "S" or item.item_id == "H": if item.item_id == "S" or item.item_id == "H":
owniverse.produce(item.item_id, 100_000) var _value = owniverse.produce_hs(item.item_id, 100_000)
func _unlock_item(item_id: String):
owniverse_items[item_id].set_visible(true)
func _check_counters(delta: float) -> Array: func _check_counters(delta: float) -> Array:
var actions: Array = [] var actions: Array = []
@@ -191,7 +198,7 @@ func _check_counters(delta: float) -> Array:
return actions return actions
#region Swipe #region Swipe and page
func _do_actions(actions: Array) -> void: func _do_actions(actions: Array) -> void:
for action: String in actions: for action: String in actions:
@@ -226,41 +233,21 @@ func _input(event: InputEvent) -> void:
g_counters.swipe.value = 0 g_counters.swipe.value = 0
elif event is InputEventScreenTouch: elif event is InputEventScreenTouch:
pass pass
#endregion
func _ready() -> void:
owniverse.init_enitities()
owniverse.load_data()
_init_owniverse_items()
owniverse.unlock_item.connect(_unlock_item)
g_counters.swipe.sec = 0.2
for pa in page_actions:
page_actions[pa].action_pressed.connect(_page_action_pressed)
page_actions[pa].page_id = pa
func _process(delta: float) -> void:
var year_delta: float = owniverse.add_time_delta(delta)
set_datetime(year_delta)
owniverse.cycle(year_delta)
var actions = _check_counters(delta)
_do_actions(actions)
_set_active_page_actions()
func _set_active_page_actions() -> void: func _set_active_page_actions() -> void:
for pa in page_actions: for pa in page_actions:
if !g_active_items.has(pa): continue if !g_active_items.has(pa): continue
var item_id: String = g_active_items[pa].item_id var item_id: String = g_active_items[pa].item_id
var amount = owniverse.get_available_to_produce(item_id) var entity: OwniverseEntity = owniverse.entities[item_id]
page_actions[pa].set_actions(item_id, amount)
#var amount = owniverse.get_available_to_produce(item_id)
#var amount = owniverse.get_available_to_produce(entity)
var amount = owniverse.calculate_max_producible(entity)
#print(item_id, " : ", amount)
page_actions[pa].set_actions(item_id, amount)
func _page_action_pressed(page_id: int, action_amount: float) -> void: func _page_action_pressed(page_id: int, action_amount: float) -> void:
@@ -273,8 +260,42 @@ func _page_action_pressed(page_id: int, action_amount: float) -> void:
owniverse.produce(item_id, action_amount) owniverse.produce(item_id, action_amount)
#endregion
func _ready() -> void:
var inited_result = owniverse.init_enitities()
locked_items = inited_result.locked_items
owniverse.load_data()
_init_owniverse_items()
g_counters.swipe.sec = 0.2
for pa in page_actions:
page_actions[pa].action_pressed.connect(_page_action_pressed)
page_actions[pa].page_id = pa
func _process(delta: float) -> void:
owniverse.evolute(delta)
set_datetime(owniverse.state.year)
#owniverse.cycle(delta)
#owniverse.cycle_legacy(year_delta)
var actions = _check_counters(delta)
_do_actions(actions)
_set_active_page_actions()
func _change_speed(delta: int) -> void: func _change_speed(delta: int) -> void:
var speed: int = owniverse.change_speed(delta)
owniverse.speed = owniverse.speed + delta
var speed: int = owniverse.speed
var ind: int = 1 var ind: int = 1
for icon in g_speed_icons: for icon in g_speed_icons:
if ind <= speed: if ind <= speed:
@@ -294,7 +315,7 @@ func _change_speed(delta: int) -> void:
func _on_topmenu_button_pressed(ButtonName) -> void: func _on_topmenu_button_pressed(ButtonName) -> void:
print(ButtonName) print("Debug: ", owniverse.state)
#var s: float = 1E15 #var s: float = 1E15
#var z = 1.0 #var z = 1.0
#for i in range(30): #for i in range(30):
@@ -302,5 +323,7 @@ func _on_topmenu_button_pressed(ButtonName) -> void:
#z *= 10 #z *= 10
func _on_save_data() -> void: func _on_unlock_and_save_timeout() -> void:
owniverse.save_data() owniverse.save_data()
_unlock_items()
+1 -1
View File
@@ -2,7 +2,7 @@
[ext_resource type="Script" uid="uid://c2ech05mh56y8" path="res://ui/actions/actions.gd" id="1_cjivn"] [ext_resource type="Script" uid="uid://c2ech05mh56y8" path="res://ui/actions/actions.gd" id="1_cjivn"]
[ext_resource type="FontFile" uid="uid://d3k1ddvv0rmhs" path="res://fonts/Roboto_Condensed/RobotoCondensed-Light.ttf" id="1_lgdyb"] [ext_resource type="FontFile" uid="uid://d3k1ddvv0rmhs" path="res://fonts/Roboto_Condensed/RobotoCondensed-Light.ttf" id="1_lgdyb"]
[ext_resource type="Texture2D" uid="uid://gsclv7fr1rbr" path="res://ui/actions/action_button.png" id="2_cjivn"] [ext_resource type="Texture2D" path="res://ui/actions/action_button.png" id="2_cjivn"]
[node name="Actions" type="HBoxContainer" unique_id=503388208] [node name="Actions" type="HBoxContainer" unique_id=503388208]
custom_minimum_size = Vector2(0, 216) custom_minimum_size = Vector2(0, 216)
+2 -2
View File
@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://dg15dpxiepicb"] [gd_scene format=3 uid="uid://dg15dpxiepicb"]
[ext_resource type="Texture2D" uid="uid://chxxghyul1im7" path="res://ui/border/border-2px.png" id="1_6kaf8"] [ext_resource type="Texture2D" path="res://ui/border/border-2px.png" id="1_6kaf8"]
[node name="Border" type="TextureRect"] [node name="Border" type="TextureRect" unique_id=1148150816]
texture = ExtResource("1_6kaf8") texture = ExtResource("1_6kaf8")
+1 -1
View File
@@ -1,7 +1,7 @@
[gd_scene format=3 uid="uid://d3xjfxwe3w16v"] [gd_scene format=3 uid="uid://d3xjfxwe3w16v"]
[ext_resource type="Script" uid="uid://bxxllddlgurus" path="res://ui/owniverse_item/owniverse_item.gd" id="1_d5xam"] [ext_resource type="Script" uid="uid://bxxllddlgurus" path="res://ui/owniverse_item/owniverse_item.gd" id="1_d5xam"]
[ext_resource type="Texture2D" uid="uid://56w57w6iu3np" path="res://ui/owniverse_item/selected.png" id="2_pbv1j"] [ext_resource type="Texture2D" path="res://ui/owniverse_item/selected.png" id="2_pbv1j"]
[node name="Button" type="Control" unique_id=667620208] [node name="Button" type="Control" unique_id=667620208]
visible = false visible = false
@@ -2,7 +2,7 @@
[ext_resource type="Script" uid="uid://bq7xkdvq4iejn" path="res://world/background/starry_sky_layer.gd" id="1_st4ay"] [ext_resource type="Script" uid="uid://bq7xkdvq4iejn" path="res://world/background/starry_sky_layer.gd" id="1_st4ay"]
[node name="StarrySkyLayer" type="Parallax2D"] [node name="StarrySkyLayer" type="Parallax2D" unique_id=1953063300]
scroll_offset = Vector2(1080, 1920) scroll_offset = Vector2(1080, 1920)
repeat_size = Vector2(1080, 1920) repeat_size = Vector2(1080, 1920)
repeat_times = 3 repeat_times = 3
+351 -139
View File
@@ -1,13 +1,7 @@
extends Node extends Node
class_name Owniverse class_name Owniverse
var evolution: OwniverseEvolution = OwniverseEvolution.new() #var state: State = State.new()
signal unlock_item(item_id: String)
var current_year: float = 0.0
var current_speed: int = 1
var current_speed_in_years: float = 1.0
var entities: Dictionary[String, OwniverseEntity] = {} var entities: Dictionary[String, OwniverseEntity] = {}
var entity_groups: Dictionary[String, Array] = {} var entity_groups: Dictionary[String, Array] = {}
@@ -18,126 +12,334 @@ var items_to_update: Dictionary[String, float] = {}
var auto_production: Array = [] var auto_production: Array = []
var locked_entities: Array = [] var locked_entities: Array = []
var cumulative_amount: Dictionary[String, float] = {} #var cumulative_amount: Dictionary[String, float] = {}
var current_amount: Dictionary[String, float] = {} #var current_amount: Dictionary[String, float] = {}
func cycle(year_delta: float) -> void: # ------------------------------------
# all owniverse activity should be called here
_auto_production(year_delta)
var state: Dictionary = {
'datetime': 0.0,
'year': 0.0,
'speed': 1,
'speed_in_year': 1,
'energy': 1E14,
'batches': {},
'binds': {},
'amount': {},
'stats': {
'total_amount': {},
}
}
var new_state = state.duplicate_deep()
var speed: int:
get:
return state.speed
set(value):
state.speed = clampi(value, 1, Global.SPEED_LIMIT)
state.speed_in_years = pow(10, state.speed - 1)
func evolute(delta: float):
_check_locked_items() _add_time_delta(delta)
# produce and evolute
#new_owniverse.state = state
#new_owniverse.stats = stats
#new_owniverse.entities = entities
#.locked_entities = locked_entities
evolution.update_distribution(current_amount)
#region auto production and evolution
func _auto_production(year_delta: float) -> void: func _add_time_delta(delta: float):
var _cycle_production = {"S": 0.0, "H": 0.0} pass
for entity: OwniverseEntity in auto_production: #new_owniverse.state.datetime = state.datetime \
if current_amount[entity.id] == 0: #+ delta * new_owniverse.state.speed_in_year
continue #
_cycle_production[entity.product_per_year_type] += \ #new_owniverse.state.year = floorf(new_owniverse.state.datetime)
current_amount[entity.id] * entity.product_per_year_amount * year_delta
for item in _cycle_production:
_count_amount(item, _cycle_production[item])
func _get_distribution(source: Dictionary) -> Dictionary:
var distribution: Dictionary = {} # ----------
var total: float = 0
for id in source:
if source[id] != 0:
total += source[id]
distribution[id] = source[id]
for id in distribution:
distribution[id] /= total
return distribution
#endregion
#region Production #region Production
func produce(item_id: String, amount: float) -> void:
var _entity: OwniverseEntity = entities[item_id] ## Produces entities with cost and bind constraints
## @param item_id - entity id to produce
## @param desired_amount - desired quantity to produce
## @return actual amount produced based on available resources
func produce(item_id: String, desired_amount: float) -> float:
# Use special production for S and H
if item_id == "S" or item_id == "H":
return produce_hs(item_id, desired_amount)
var entity_transaction = {}
for elem in _entity.cost:
if current_amount[elem] < amount * _entity.cost[elem]:
return
if _entity.cost[elem] == 0: continue
entity_transaction[elem] = - amount * _entity.cost[elem]
for elem in entity_transaction:
_process_enitity(elem, entity_transaction[elem])
_process_enitity(item_id, amount)
evolution.add(_entity, current_year, amount)
func automated_production(_delta: float) -> void:
for entity_id in auto_production:
var _entity = entities[entity_id]
var _amount_to_produce = int(_entity.amount * _entity.product_per_year_amount * _delta)
func get_available_to_produce(item_id: String) -> float:
var entity: OwniverseEntity = entities[item_id] var entity: OwniverseEntity = entities[item_id]
if entity.cost == {}: return 0
var amount: float = 1E50 if desired_amount <= 0:
for elem in entity.cost: return 0.0
amount = min(floorf(current_amount[elem] / entity.cost[elem]), amount)
return amount var max_producible = calculate_max_producible(entity, desired_amount)
if max_producible <= 0:
return 0.0
apply_costs(entity, max_producible)
apply_binds(item_id, entity, max_producible)
# Add produced entities
_process_enitity(item_id, max_producible)
return max_producible
## Produces S (space) or H (hydrogen) using energy from state.energy
## @param entity_id - entity id to produce ("S" or "H")
## @param value - desired amount to produce
## @return actual amount produced (limited by available energy)
func produce_hs(entity_id: String, value: float) -> float:
if value <= 0:
return 0.0
var to_produce: float = floorf(value)
to_produce = min(to_produce, state.energy)
if to_produce <= 0:
return 0.0
state.energy -= to_produce
_process_enitity(entity_id, to_produce)
state.stats.total_amount[entity_id] = state.stats.total_amount.get(entity_id, 0.0) + to_produce
return to_produce
## Calculates maximum producible amount based on cost and bind constraints
## @param entity - entity to produce
## @param desired_amount - desired quantity
## @return maximum producible amount considering all constraints
func calculate_max_producible(entity: OwniverseEntity, desired_amount: float = 1.0E150) -> float:
var max_producible: float = desired_amount
# Check cost constraints - resources consumed during production
for cost_item in entity.cost:
if entity.cost[cost_item] == 0:
continue
var available = state.amount.get(cost_item, 0.0)
var max_from_cost = floorf(available / entity.cost[cost_item])
max_producible = min(max_producible, max_from_cost)
# Check bind constraints - resources locked by produced entity
for bind_item in entity.bind:
if entity.bind[bind_item] == 0:
continue
var available = state.amount.get(bind_item, 0.0)
var max_from_bind = floorf(available / entity.bind[bind_item])
max_producible = min(max_producible, max_from_bind)
return max_producible
## Applies cost (consumes resources)
## @param entity - entity being produced
## @param amount - amount to produce
func apply_costs(entity: OwniverseEntity, amount: float) -> void:
for cost_item in entity.cost:
if entity.cost[cost_item] == 0:
continue
var cost_amount = amount * entity.cost[cost_item]
_process_enitity(cost_item, -cost_amount)
## Applies bind (locks resources)
## @param item_id - id of entity being produced
## @param entity - entity being produced
## @param amount - amount to produce
func apply_binds(item_id: String, entity: OwniverseEntity, amount: float) -> void:
for bind_item in entity.bind:
if entity.bind[bind_item] == 0:
continue
var bind_amount = amount * entity.bind[bind_item]
# Initialize binds dictionary for this entity if needed
if not state.binds.has(item_id):
state.binds[item_id] = {}
# Record bound amount
state.binds[item_id][bind_item] = bind_amount
# Decrease available amount (lock it)
_process_enitity(bind_item, -bind_amount)
## Computes a normalized distribution of dictionary values (sum equals 1.0)
## @param values - dictionary containing numeric values
## @return dictionary with normalized values, each ranging from 0.0 to 1.0
func _normalize_distribution(values: Dictionary) -> Dictionary:
var normalized_distribution: Dictionary = {}
var distribution_total: float = 0
for id in values:
if values[id] != 0:
distribution_total += values[id]
normalized_distribution[id] = values[id]
for id in normalized_distribution:
normalized_distribution[id] /= distribution_total
return normalized_distribution
#endregion
#region Batches
## Consumes entities from batches based on current year
## Iterates through batches and withdraws amount based on time period:
## - If current_year >= end_year: consume entire batch
## - If current_year in [start_year, end_year): consume proportional amount
## @param entity - entity to consume from
## @param current_year - current year in universe
## @return total amount consumed from all applicable batches
func consume_from_batches(entity: OwniverseEntity, current_year: float) -> float:
var batches = state.batches[entity.id]
var total_consumed: float = 0.0
# Iterate backwards to safely remove completed batches
state.amount[entity.id] = 0
for i in range(batches.size() - 1, -1, -1):
var batch = batches[i]
# Skip batches that haven't started yet
if current_year < batch["start_year"]:
state.amount[entity.id] += batch["amount"]
continue
# If year is past batch end, consume entire batch
if current_year >= batch["end_year"]:
total_consumed += batch["amount"]
batches.remove_at(i)
else:
# Consume proportional amount based on elapsed time
var batch_duration = batch["end_year"] - batch["start_year"]
var time_elapsed = current_year - batch["start_year"]
var proportion = time_elapsed / batch_duration
var consumed_amount = batch["amount"] * proportion
total_consumed += consumed_amount
batch["amount"] -= consumed_amount
state.amount[entity.id] += batch["amount"]
return total_consumed
## Adds entity amount to appropriate batch based on current year
## state.batches[entity_id] contains list of batches with intervals and amounts
## Each batch: {start_year, end_year, amount}
## @param entity_id - id of entity to add
## @param amount - quantity of entity being added
## @param current_year - current year in universe
func add_entity_to_batch(entity: OwniverseEntity, amount: float, current_year: float) -> void:
var batches = state.batches[entity]
# Check if we can add to last batch
var last_batch: Dictionary
if batches.size() > 0:
last_batch = batches[-1]
if batches.size() == 0 or current_year >= last_batch["end_year"]:
# Create new batch based on current_year
last_batch = {
"start_year": current_year,
"end_year": current_year + entity.lifespan_delta,
"amount": amount
}
batches.append(last_batch)
else:
# Add to existing batch
last_batch["amount"] += amount
#endregion
#region ProductionLegacy
#-----
#func _produce_automatically(year_delta: float) -> void:
#var cycle_production = {"S": 0.0, "H": 0.0}
#for entity: OwniverseEntity in auto_production:
#if current_amount[entity.id] == 0:
#continue
#cycle_production[entity.product_per_year_type] += \
#current_amount[entity.id] * entity.product_per_year_amount * year_delta
#for item in cycle_production:
#_count_amount(item, cycle_production[item])
#
#func automated_production(_delta: float) -> void:
#for entity_id in auto_production:
#var entity = entities[entity_id]
#var _amount_to_produce = int(entity.amount * entity.product_per_year_amount * _delta)
#func get_available_to_produce(item_id: String) -> float:
#var entity: OwniverseEntity = entities[item_id]
#if entity.cost == {}: return 0
#var amount: float = 1E50
#for elem in entity.cost:
#amount = min(floorf(current_amount[elem] / entity.cost[elem]), amount)
#return amount
# add to all lists # add to all lists
## Processes entity production/consumption
## @param entity_id - id of entity to process
## @param amount - amount to change (positive for production, negative for consumption)
func _process_enitity(entity_id: String, amount: float) -> void: func _process_enitity(entity_id: String, amount: float) -> void:
if amount == 0: return if amount == 0:
_count_amount(entity_id, amount) return
func _count_amount(entity_id: String, amount: float) -> void:
if amount == 0: return
current_amount[entity_id] += amount # Update state amount
var entity: OwniverseEntity = entities[entity_id] state.amount[entity_id] = state.amount.get(entity_id, 0.0) + amount
if entity.group_as != "":
current_amount[entity.group_as] += amount
if amount < 0: return # Update items to display
items_to_update[entity_id] = state.amount[entity_id]
cumulative_amount[entity_id] += amount
# Handle group updates if entity belongs to a group
var entity = entities[entity_id]
if entity.group_as != "": if entity.group_as != "":
cumulative_amount[entity.group_as] += amount state.amount[entity.group_as] = state.amount.get(entity.group_as, 0.0) + amount
items_to_update[entity.group_as] = state.amount[entity.group_as]
items_to_update[entity_id] = current_amount[entity_id]
func _check_locked_items() -> void: #func _count_amount(entity_id: String, amount: float) -> void:
for entity: OwniverseEntity in locked_entities: #if amount == 0: return
for elem in entity.unlock: #
if cumulative_amount[elem] < entity.unlock[elem]: #current_amount[entity_id] += amount
continue #var entity: OwniverseEntity = entities[entity_id]
#print(entity.id, " ", elem, ":", entity.unlock[elem]) #if entity.group_as != "":
unlock_item.emit(entity.id) #current_amount[entity.group_as] += amount
locked_entities.erase(entity) #
return # SIC! #if amount < 0: return
#
#cumulative_amount[entity_id] += amount
#if entity.group_as != "":
#cumulative_amount[entity.group_as] += amount
#
#items_to_update[entity_id] = current_amount[entity_id]
#endregion #endregion
#region Time #region Time
func add_time_delta(delta) -> float:
var year_delta: float = delta * current_speed_in_years
current_year += year_delta
return current_year
func change_speed(delta: int) -> int:
current_speed = clampi(current_speed + delta, 1, Global.SPEED_LIMIT)
current_speed_in_years = pow(10, current_speed - 1)
return current_speed
#endregion #endregion
@@ -146,69 +348,79 @@ func change_speed(delta: int) -> int:
func load_data() -> bool: func load_data() -> bool:
#var _is_succesfull = false
var game_data: Dictionary = SaveManager.load_data("owniverse", "qwerty") var game_data: Dictionary = SaveManager.load_data("owniverse", "qwerty")
if game_data == {}: if game_data == {}:
return false return false
if !game_data.has_all(["cumulative_amount", "current_amount" if !game_data.has_all(["state"
, "stats"
#, "entity_batches" #, "entity_batches"
, "year", #, "year",
]): ]):
return false return false
#entity_batches = game_data["entity_batches"] #entity_batches = game_data["entity_batches"]
cumulative_amount = game_data["cumulative_amount"] #cumulative_amount = _game_data["cumulative_amount"]
current_amount = game_data["current_amount"] #current_amount = _game_data["current_amount"]
current_year = game_data["year"] #print("loaded ", _game_data)
state = game_data["state"]
#state2 = game_data["state2"]
for item in current_amount: for item in state.amount:
items_to_update[item] = current_amount[item] items_to_update[item] = state.amount[item]
#print("state: ", state)
#print("stats: ", stats)
return true return true
func save_data() -> void: func save_data() -> void:
var game_data: Dictionary = {} var game_data: Dictionary = {}
game_data["year"] = current_year game_data["state"] = state
game_data["cumulative_amount"] = cumulative_amount
game_data["current_amount"] = current_amount
#game_data["entity_batches"] = entity_batches
SaveManager.save_data("owniverse", "qwerty", game_data) SaveManager.save_data("owniverse", "qwerty", game_data)
#print("saved ", game_data, "\n\n\n")
func init_enitities() -> void: func init_enitities() -> Dictionary:
var _auto_production := [] var _result := {
for _entity_id in Global.OwniverseEntities: 'locked_items': [],
var _entity = OwniverseEntity.new(Global.OwniverseEntities[_entity_id]) }
entities[_entity_id] = _entity #var _auto_production := []
for entity_id in Global.OwniverseEntities:
var entity = OwniverseEntity.new(Global.OwniverseEntities[entity_id])
entities[entity_id] = entity
current_amount[_entity_id] = 0 #current_amount[entity_id] = 0
cumulative_amount[_entity_id] = 0 state.stats.total_amount[entity_id] = 0
if _entity.group_as != "": state.amount[entity_id] = 0
current_amount[_entity.group_as] = 0 if entity.lifespan > 0:
cumulative_amount[_entity.group_as] = 0 state.batches[entity] = []
add_entity_to_batch(entity, 0, 0)
if entity.group_as != "":
#current_amount[entity.group_as] = 0
state.amount[entity.group_as] = 0
state.stats.total_amount[entity.group_as] = 0
if _entity.unlock != {}: if entity.unlock != {}:
locked_entities.append(_entity) locked_entities.append(entity)
_result.locked_items.append(entity.id)
evolution.init_entity(_entity) if entity.product_per_year_type != "":
auto_production.append(entity)
if _entity.product_per_year_type != "":
auto_production.append(_entity)
_auto_production.append(_entity.id)
# groups # groups
if _entity.group_as != "": if entity.group_as != "":
if !entity_groups.has(_entity.group_as): if !entity_groups.has(entity.group_as):
entity_groups[_entity.group_as] = [] entity_groups[entity.group_as] = []
entity_groups[_entity.group_as].append(_entity_id) entity_groups[entity.group_as].append(entity_id)
if _entity.event_group != "": if entity.event_group != "":
if !entity_event_groups.has(_entity.event_group): if !entity_event_groups.has(entity.event_group):
entity_event_groups[_entity.event_group] = [] entity_event_groups[entity.event_group] = []
entity_event_groups[_entity.event_group].append(_entity_id) entity_event_groups[entity.event_group].append(entity_id)
#evolution.init_batches(_auto_production) #print("ns: ", new_state)
return _result
#endregion #endregion
+2 -1
View File
@@ -38,10 +38,11 @@ func _init(values: Dictionary) -> void:
unlock = _parse_and_string(values.unlock) unlock = _parse_and_string(values.unlock)
cost = _parse_and_string(values.cost) cost = _parse_and_string(values.cost)
bind = _parse_and_string(values.bind) bind = _parse_and_string(values.bind)
#print(id, " | ", cost, " | ", bind)
mass = float(values.mass) mass = float(values.mass)
space = int(values.space) space = int(values.space)
lifespan = float(values.lifespan) lifespan = float(values.lifespan)
lifespan_delta = lifespan / Global.batch_count / 2 if lifespan > 10 else lifespan lifespan_delta = lifespan / Global.batch_count if lifespan > 10 else lifespan
auto = float(values.auto) auto = float(values.auto)
gamma = float(values.gamma) gamma = float(values.gamma)
blast = int(values.blast) blast = int(values.blast)
@@ -1,11 +1,17 @@
extends Node extends Node
class_name OwniverseEvolution class_name State
const FLOAT_THRESHOLD: float = 1.0E14 const FLOAT_THRESHOLD: float = 1.0E14
# TODO to save !!!
var state: Dictionary = { var data: Dictionary = {
'time': {
'timestamp': 0.0,
'year': 0.0,
},
'timestamp': 0.0,
'year': 0.0, 'year': 0.0,
'speed_in_year': 0,
'energy': 1E14, 'energy': 1E14,
} }
@@ -25,12 +31,32 @@ var evolving_entities: Array[OwniverseEntity] = []
# TODO to save !!! # TODO to save !!!
var batches: Dictionary[String, Array] = {} var batches: Dictionary[String, Array] = {}
# TODO to save !!! # TODO to save !!!
var amount: Dictionary[String, float] = {} var gamount: Dictionary[String, float] = {}
var distribution: Dictionary[String, float] = {} var distribution: Dictionary[String, float] = {}
# new functions
func evolute(prev_state: State, delta: float, current_speed_in_year: float) -> float:
var _new_year: float = _add_year_delta(delta, current_speed_in_year)
if data.year == _new_year:
return data.year
return _new_year
func _add_year_delta(delta: float, current_speed_in_year: float) -> float:
var _new_year:float = floorf(data.year + delta * current_speed_in_year)
#print(data.year, " | ", _new_year, " | ", data)
return _new_year
# end of new functions
func add(entity: OwniverseEntity, year: float, amount: float): func add(entity: OwniverseEntity, year: float, amount: float):
var _batch_array: Array = batches[entity.id] var _batch_array: Array = batches[entity.id]
var _from_year: float = year + entity.lifespan - entity.lifespan_delta var _from_year: float = year + entity.lifespan - entity.lifespan_delta
@@ -106,11 +132,11 @@ func produce(from_year: float, to_year: float):
func produce_hs(entity_id: String, value: float) -> float: func produce_hs(entity_id: String, value: float) -> float:
var _to_produce: float = floorf(value) var _to_produce: float = floorf(value)
amount[entity_id] += _to_produce gamount[entity_id] += _to_produce
# TODO double double math # TODO double double math
if _to_produce > state["energy"]: if _to_produce > data["energy"]:
_to_produce = state["energy"] _to_produce = data["energy"]
state["energy"] -= _to_produce data["energy"] -= _to_produce
return value - _to_produce return value - _to_produce
func produce_auto() -> float: func produce_auto() -> float:
@@ -118,7 +144,7 @@ func produce_auto() -> float:
func init_entity(entity: OwniverseEntity) -> void: func init_entity(entity: OwniverseEntity) -> void:
entities[entity.id] = entity entities[entity.id] = entity
amount[entity.id] = 0.0 gamount[entity.id] = 0.0
if entity.product_per_year_type != "": if entity.product_per_year_type != "":
producing_entities.append(entity) producing_entities.append(entity)
+15 -15
View File
@@ -3,36 +3,36 @@
[ext_resource type="Script" uid="uid://d2wrwichuoncd" path="res://world/background/background.gd" id="1_ifjjt"] [ext_resource type="Script" uid="uid://d2wrwichuoncd" path="res://world/background/background.gd" id="1_ifjjt"]
[ext_resource type="PackedScene" uid="uid://icbk3la71t7h" path="res://world/background/starry_sky_layer.tscn" id="2_behgl"] [ext_resource type="PackedScene" uid="uid://icbk3la71t7h" path="res://world/background/starry_sky_layer.tscn" id="2_behgl"]
[ext_resource type="Script" uid="uid://iiva6x8uo0f2" path="res://stage/stage.gd" id="3_k83x5"] [ext_resource type="Script" uid="uid://iiva6x8uo0f2" path="res://stage/stage.gd" id="3_k83x5"]
[ext_resource type="Texture2D" uid="uid://5f80g4i46ycl" path="res://ui/topmenu/buttons/button.burger.normal.png" id="4_b8tmp"] [ext_resource type="Texture2D" uid="uid://dl7xbd4eltxs1" path="res://ui/topmenu/buttons/button.burger.normal.png" id="4_b8tmp"]
[ext_resource type="Texture2D" uid="uid://caia36a08wlqs" path="res://ui/topmenu/buttons/button.burger.pressed.png" id="5_en1oy"] [ext_resource type="Texture2D" uid="uid://c3odgsgxm8x14" path="res://ui/topmenu/buttons/button.burger.pressed.png" id="5_en1oy"]
[ext_resource type="Texture2D" uid="uid://cjcchycx7biyl" path="res://ui/topmenu/time&speed/timex.png" id="6_pfbnl"] [ext_resource type="Texture2D" uid="uid://bbhvxbpta4yke" path="res://ui/topmenu/time&speed/timex.png" id="6_pfbnl"]
[ext_resource type="FontFile" uid="uid://dtyi81a0phumr" path="res://fonts/Roboto_Condensed/RobotoCondensed-Bold.ttf" id="7_gwdna"] [ext_resource type="FontFile" uid="uid://dtyi81a0phumr" path="res://fonts/Roboto_Condensed/RobotoCondensed-Bold.ttf" id="7_gwdna"]
[ext_resource type="Texture2D" uid="uid://davmv5mwt3mo1" path="res://ui/topmenu/time&speed/speed.png" id="8_h4vgh"] [ext_resource type="Texture2D" uid="uid://cgrpmgnmyycyg" path="res://ui/topmenu/time&speed/speed.png" id="8_h4vgh"]
[ext_resource type="Texture2D" uid="uid://bftfd0d5rkon5" path="res://ui/topmenu/time&speed/time1.png" id="9_kvuv0"] [ext_resource type="Texture2D" uid="uid://bd0poiwetepki" path="res://ui/topmenu/time&speed/time1.png" id="9_kvuv0"]
[ext_resource type="Texture2D" uid="uid://rmdsdkck0vst" path="res://ui/topmenu/buttons/buton.report.normal.png" id="10_sg5c8"] [ext_resource type="Texture2D" uid="uid://d2px6au7uyr6w" path="res://ui/topmenu/buttons/buton.report.normal.png" id="10_sg5c8"]
[ext_resource type="Texture2D" uid="uid://dbhkuw2jshyoh" path="res://ui/topmenu/buttons/buton.report.pressed.png" id="11_vu62d"] [ext_resource type="Texture2D" uid="uid://dgh4rx0nb4wgi" path="res://ui/topmenu/buttons/buton.report.pressed.png" id="11_vu62d"]
[ext_resource type="PackedScene" uid="uid://dg15dpxiepicb" path="res://ui/border/border.tscn" id="12_58wjt"] [ext_resource type="PackedScene" uid="uid://dg15dpxiepicb" path="res://ui/border/border.tscn" id="12_58wjt"]
[ext_resource type="Texture2D" uid="uid://btq70xgqq14od" path="res://ui/pages/Forces.en.png" id="13_dp8ul"] [ext_resource type="Texture2D" uid="uid://btq70xgqq14od" path="res://ui/pages/forces.en.png" id="13_dp8ul"]
[ext_resource type="FontFile" uid="uid://d3k1ddvv0rmhs" path="res://fonts/Roboto_Condensed/RobotoCondensed-Light.ttf" id="14_o7xkw"] [ext_resource type="FontFile" uid="uid://d3k1ddvv0rmhs" path="res://fonts/Roboto_Condensed/RobotoCondensed-Light.ttf" id="14_o7xkw"]
[ext_resource type="FontFile" uid="uid://8s0fv3gfj317" path="res://fonts/Roboto_Condensed/RobotoCondensed-BoldItalic.ttf" id="15_bfrib"] [ext_resource type="FontFile" uid="uid://8s0fv3gfj317" path="res://fonts/Roboto_Condensed/RobotoCondensed-BoldItalic.ttf" id="15_bfrib"]
[ext_resource type="FontFile" uid="uid://derqj4pbwtae6" path="res://fonts/Roboto_Condensed/RobotoCondensed-Italic.ttf" id="16_mip0j"] [ext_resource type="FontFile" uid="uid://derqj4pbwtae6" path="res://fonts/Roboto_Condensed/RobotoCondensed-Italic.ttf" id="16_mip0j"]
[ext_resource type="PackedScene" uid="uid://dwneq2qq5p8ek" path="res://ui/actions/actions.tscn" id="17_ifjjt"] [ext_resource type="PackedScene" uid="uid://dwneq2qq5p8ek" path="res://ui/actions/actions.tscn" id="17_ifjjt"]
[ext_resource type="Texture2D" uid="uid://rqk6n3lcxi32" path="res://ui/indicators/energy/energy.png" id="17_l6135"] [ext_resource type="Texture2D" uid="uid://rqk6n3lcxi32" path="res://ui/indicators/energy/energy.png" id="17_l6135"]
[ext_resource type="Texture2D" uid="uid://bef36h52n7lxb" path="res://ui/indicators/energy/border-energy.png" id="18_uvuuk"] [ext_resource type="Texture2D" uid="uid://bef36h52n7lxb" path="res://ui/indicators/energy/border-energy.png" id="18_uvuuk"]
[ext_resource type="Texture2D" uid="uid://brl8ojsykr5ki" path="res://ui/pages/Resources.en.png" id="19_an6vj"] [ext_resource type="Texture2D" uid="uid://brl8ojsykr5ki" path="res://ui/pages/resources.en.png" id="19_an6vj"]
[ext_resource type="Texture2D" uid="uid://d3nhbp7wvctvf" path="res://ui/indicators/density/density.png" id="20_s3ar6"] [ext_resource type="Texture2D" uid="uid://d3nhbp7wvctvf" path="res://ui/indicators/density/density.png" id="20_s3ar6"]
[ext_resource type="Texture2D" uid="uid://df2nus1pmcc67" path="res://ui/indicators/density/density_crunch.png" id="21_d36xh"] [ext_resource type="Texture2D" uid="uid://df2nus1pmcc67" path="res://ui/indicators/density/density_crunch.png" id="21_d36xh"]
[ext_resource type="Texture2D" uid="uid://bbk74pjqgxe32" path="res://ui/indicators/density/density_rip.png" id="22_vu83j"] [ext_resource type="Texture2D" uid="uid://bbk74pjqgxe32" path="res://ui/indicators/density/density_rip.png" id="22_vu83j"]
[ext_resource type="Texture2D" uid="uid://bm8ae1ffv7xq5" path="res://ui/indicators/density/density_pointer.png" id="23_bcq5b"] [ext_resource type="Texture2D" uid="uid://bm8ae1ffv7xq5" path="res://ui/indicators/density/density_pointer.png" id="23_bcq5b"]
[ext_resource type="Texture2D" uid="uid://c3icljpbnj4fo" path="res://ui/indicators/burnability/burnability.png" id="24_o2i0n"] [ext_resource type="Texture2D" uid="uid://c3icljpbnj4fo" path="res://ui/indicators/burnability/burnability.png" id="24_o2i0n"]
[ext_resource type="Texture2D" uid="uid://sry5js57vds4" path="res://ui/indicators/burnability/burnability_pointer.png" id="25_rur7c"] [ext_resource type="Texture2D" uid="uid://sry5js57vds4" path="res://ui/indicators/burnability/burnability_pointer.png" id="25_rur7c"]
[ext_resource type="Texture2D" uid="uid://bv68o2unxtljh" path="res://ui/pages/Stars.en.png" id="26_y1rwn"] [ext_resource type="Texture2D" uid="uid://bv68o2unxtljh" path="res://ui/pages/stars.en.png" id="26_y1rwn"]
[ext_resource type="Texture2D" uid="uid://brb3hw23smntm" path="res://ui/indicators/explosiveness/explosiveness.png" id="27_4rajv"] [ext_resource type="Texture2D" uid="uid://brb3hw23smntm" path="res://ui/indicators/explosiveness/explosiveness.png" id="27_4rajv"]
[ext_resource type="Texture2D" uid="uid://cno3ktmfxdiig" path="res://ui/indicators/explosiveness/explosiveness_pointer.png" id="28_upe80"] [ext_resource type="Texture2D" uid="uid://cno3ktmfxdiig" path="res://ui/indicators/explosiveness/explosiveness_pointer.png" id="28_upe80"]
[ext_resource type="Texture2D" uid="uid://coqcg8fo4lttb" path="res://ui/pages/Structures.en.png" id="29_0drd1"] [ext_resource type="Texture2D" uid="uid://coqcg8fo4lttb" path="res://ui/pages/structures.en.png" id="29_0drd1"]
[ext_resource type="Texture2D" uid="uid://dxrnqx16lvca3" path="res://ui/indicators/aggression/aggression.png" id="30_bemti"] [ext_resource type="Texture2D" uid="uid://dxrnqx16lvca3" path="res://ui/indicators/aggression/aggression.png" id="30_bemti"]
[ext_resource type="Texture2D" uid="uid://dm87u2ku8wec8" path="res://ui/indicators/aggression/aggression_pointer.png" id="31_x6tg5"] [ext_resource type="Texture2D" uid="uid://dm87u2ku8wec8" path="res://ui/indicators/aggression/aggression_pointer.png" id="31_x6tg5"]
[ext_resource type="Texture2D" uid="uid://gkr4uuva1dmt" path="res://ui/pages/Planets.en.png" id="32_xitqn"] [ext_resource type="Texture2D" uid="uid://gkr4uuva1dmt" path="res://ui/pages/planets.en.png" id="32_xitqn"]
[ext_resource type="Texture2D" uid="uid://bgjcnwl61nu5i" path="res://ui/indicators/trends/trend_bar1.png" id="33_fprte"] [ext_resource type="Texture2D" uid="uid://bgjcnwl61nu5i" path="res://ui/indicators/trends/trend_bar1.png" id="33_fprte"]
[ext_resource type="Texture2D" uid="uid://caiyhk6vv53iu" path="res://ui/indicators/trends/trend_bar2.png" id="34_lnsl1"] [ext_resource type="Texture2D" uid="uid://caiyhk6vv53iu" path="res://ui/indicators/trends/trend_bar2.png" id="34_lnsl1"]
[ext_resource type="Texture2D" uid="uid://dspjxpbpwq52k" path="res://ui/indicators/trends/trend_icon_2.png" id="35_1u5dl"] [ext_resource type="Texture2D" uid="uid://dspjxpbpwq52k" path="res://ui/indicators/trends/trend_icon_2.png" id="35_1u5dl"]
@@ -872,8 +872,8 @@ layout_mode = 2
wait_time = 0.2 wait_time = 0.2
autostart = true autostart = true
[node name="SaveData" type="Timer" parent="Stage" unique_id=1208861837] [node name="Unlock&Save" type="Timer" parent="Stage" unique_id=1208861837]
wait_time = 5.0 wait_time = 2.0
autostart = true autostart = true
[connection signal="timeout" from="Background/Timer" to="Background" method="randomize_parallax"] [connection signal="timeout" from="Background/Timer" to="Background" method="randomize_parallax"]
@@ -890,4 +890,4 @@ autostart = true
[connection signal="pressed" from="Stage/StageRows/PageScroller/HBoxContainer/LifePage/LifeHeader/AggressionIndicator" to="Stage" method="_on_indicator_pressed" binds= ["Aggression", 4]] [connection signal="pressed" from="Stage/StageRows/PageScroller/HBoxContainer/LifePage/LifeHeader/AggressionIndicator" to="Stage" method="_on_indicator_pressed" binds= ["Aggression", 4]]
[connection signal="pressed" from="Stage/StageRows/PageScroller/HBoxContainer/LifePage/LifeHeader/TrendIndicator" to="Stage" method="_on_indicator_pressed" binds= ["Trends", 4]] [connection signal="pressed" from="Stage/StageRows/PageScroller/HBoxContainer/LifePage/LifeHeader/TrendIndicator" to="Stage" method="_on_indicator_pressed" binds= ["Trends", 4]]
[connection signal="timeout" from="Stage/ItemAmountUpdate" to="Stage" method="set_owniverse_item_value"] [connection signal="timeout" from="Stage/ItemAmountUpdate" to="Stage" method="set_owniverse_item_value"]
[connection signal="timeout" from="Stage/SaveData" to="Stage" method="_on_save_data"] [connection signal="timeout" from="Stage/Unlock&Save" to="Stage" method="_on_unlock_and_save_timeout"]