Skip to content

Traveling Time Handling

Cromha edited this page Mar 8, 2024 · 1 revision

Introduction

Since PR #74, traveling now takes a little bit of time, making travel more challenging, and also making the game last longer. You may know that map points are considered to be 1 square mile big.

Explanation

So, when you travel, you have a small task bar appearing, that lasts around a second. The time that is task bar finish to complete is called the traveling time. The traveling time is determined by this piece of code, located in the time_handling.py class:

# Constants
TRAVELING_WAIT = (1 / 7.3)

def traveling_wait(traveling_coefficient):
    traveling_time = traveling_coefficient * TRAVELING_WAIT
    logger_sys.log_message(f"INFO: Running traveling waiting time: {traveling_time * 5} seconds of wait")
    cout("...", end="\r")
    time.sleep(traveling_time)
    cout("ø..", end="\r")
    time.sleep(traveling_time)
    cout(".ø.", end="\r")
    time.sleep(traveling_time)
    cout("..ø", end="\r")
    time.sleep(traveling_time)
    cout("...")
    time.sleep(traveling_time)

As you can see, there's a constant traveling time, which is equal to approximately .136986. There's also a variable that can change, that can increase of decrease the time traveling.


Here's the second piece of code that determines this second variable, located in the main.py class:

# Calculating traveling coefficient, depending
# on the player inventory size and its mounts
# stats, if he has one
global traveling_coefficient
traveling_coefficient = 1

player_inventory_weight = len(player["inventory"]) / 100
traveling_coefficient += player_inventory_weight
if player["current mount"] != " ":
    mount_mph = player["mounts"][player["current mount"]]["mph"]
    traveling_coefficient -= mount_mph / 100

As you can see, the traveling_coefficient is determined by your 'inventory weight', which is equal to the number of items in your inventory, divided by 100. The traveling coefficient variable, who's by default 1, gets increased by your 'inventory weight'. If you're currently riding a mount, this mount mph stat, divided by 100 will decrease the traveling coefficient variable.

Clone this wiki locally