Skip to content

Commit

Permalink
Balancing pass
Browse files Browse the repository at this point in the history
Increased game time limit to 600 seconds
Adjusted spawn curve to start decreasing a set time before max game time. This time is an export var set from the customer spawner node
Taking orders now slightly angers player
Placing orders gives smaller boost than before
Customers waiting to order will now grumble once they have been waiting for at least half of their max wait time
  • Loading branch information
666Savior committed Oct 30, 2021
1 parent 9c11090 commit eebd742
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion game/Game.gd
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func _ready() -> void:

func _process(delta: float) -> void:
DebugOverlay.display("fps %d" % Performance.get_monitor(Performance.TIME_FPS))
DebugOverlay.display("BrAIn %.2f" % temper)
#DebugOverlay.display("BrAIn %.2f" % temper)

if Input.is_action_just_pressed("menu"):
back_to_menu()
Expand Down
2 changes: 1 addition & 1 deletion game/Game.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ displayed_description = ""
[node name="Game" type="Node"]
script = ExtResource( 5 )
level_scene = ExtResource( 7 )
game_duration = 200
game_duration = 600
passive_effects = [ SubResource( 1 ) ]

[node name="MusicPlayerTension" type="AudioStreamPlayer" parent="."]
Expand Down
7 changes: 7 additions & 0 deletions game/customer/FSM/states/waiting_to_order.gd
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
extends '../base.gd'

var warning: bool = false

func enter():
.enter()
base_customer.anim_state_machine.travel("wait_register")
base_customer.max_waiting_timer.start()
warning = false
base_customer.add_icon(base_customer.possible_icons.wait_chill)
base_customer._face_focus_direction(base_customer.allocated_spot)
func exit():
Expand All @@ -13,10 +15,15 @@ func exit():
func _physics_process(delta):
if not active:
return

if base_customer.barista_took_order:
FSM.change_state(FSM.waiting_for_order)
return

if inverse_lerp(0, base_customer.max_waiting_timer.wait_time, base_customer.max_waiting_timer.time_left) < 0.5 and !warning:
warning = true
base_customer.grumble()

#If the customer is waiting to ask for order, it will wait for the ask_spot to be free
if is_instance_valid(base_customer.allocated_spot):
if not base_customer.allocated_spot.is_in_group(base_customer.spots_collection.spot_names[base_customer.spots_collection.ask_food_spot]):
Expand Down
14 changes: 10 additions & 4 deletions game/customer/spawner/CustomerSpawner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ onready var spawn_timer:Timer = $SpawnTimer
var time_passed = 0
export var randomize_time:bool = true
export (int, 0, 120) var random_seconds:int = 10
export var endgame_decline_offset: int # offset from the max game time when spawn rate starts decreasing
var waiting:bool = false

var game_manager_node:Node

var increasing_difficulty:bool = true
var decreasing_difficulty:bool = false
var current_max_customers = 0
var global_max_customers = 7 #Won't override the available seats

Expand Down Expand Up @@ -75,15 +77,19 @@ func _ready():
else:
printerr("[CustomerSpawner] Could not find the Game node, customers will not spawn ", get_stack())


#Increase the difficulty (customer limit) by 1 until the limit is reached, then decrease by 1 until 0
func _on_RampDifficultyTimer_timeout()->void:
if increasing_difficulty:
current_max_customers+=1
print_debug("[CustomerSpawner] Increased limit of customers ", current_max_customers)
if current_max_customers > global_max_customers:
if current_max_customers == global_max_customers:
increasing_difficulty = false
else:
if current_max_customers > 0:
elif !decreasing_difficulty and game_manager_node.time_elapsed >= game_manager_node.game_duration - endgame_decline_offset:
decreasing_difficulty = true
elif decreasing_difficulty:
if current_max_customers > 5:
print_debug("[CustomerSpawner] Decreased limit of customers ", current_max_customers)
current_max_customers-=1
elif current_max_customers > 0:
print_debug("[CustomerSpawner] Decreased limit of customers ", current_max_customers)
current_max_customers-=2
1 change: 1 addition & 0 deletions level/CafeNavmesh.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ material/0 = null

[node name="CustomerSpawner" parent="Navigation" index="10" instance=ExtResource( 4 )]
customer_scenes = [ ExtResource( 5 ) ]
endgame_decline_offset = 150

[node name="SpawnSpot" parent="Navigation" index="11" instance=ExtResource( 2 )]
transform = Transform( 0.623337, 0, 0, 0, 1, 0, 0, 0, 0.459076, 7.1, 1.679, -4.9 )
Expand Down
2 changes: 1 addition & 1 deletion level/Fridge.gd
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func set_using():
yield(tween, "tween_completed")
animation_player.play("drinkBeverage")
yield(animation_player, "animation_finished")
cold_beverage.queue_free()
barista.carry_attachment.remove_child(cold_beverage)

# TODO: convert this into speech baloons
func eprint(text: String):
Expand Down
2 changes: 1 addition & 1 deletion level/Register.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[sub_resource type="Resource" id=1]
script = ExtResource( 4 )
duration = 2.0
outcome_temper_delta = 2.0
outcome_temper_delta = -0.25
displayed_name = "Take order"

[sub_resource type="BoxShape" id=2]
Expand Down
2 changes: 1 addition & 1 deletion level/ServingTray.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[sub_resource type="Resource" id=1]
script = ExtResource( 8 )
duration = 0.0
outcome_temper_delta = 0.5
outcome_temper_delta = 0.0
displayed_name = "Put cup on the tray"

[sub_resource type="CubeMesh" id=2]
Expand Down

0 comments on commit eebd742

Please sign in to comment.