Compare commits

...

2 Commits

Author SHA1 Message Date
Sam
7dde7b3e1f Reduce max visual width of food from 10 to 8 and adjust rendering size calculation for improved visual consistency
Some checks failed
Build Simulation and Test / Run All Tests (push) Failing after 31s
2025-06-16 15:36:23 -05:00
Sam
3253bebe9c Adjust acceleration scale and clamp linear acceleration limits for improved physics simulation 2025-06-16 15:36:01 -05:00
2 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ FOOD_SPAWNING = True
RANDOM_SEED = 0 RANDOM_SEED = 0
# Vector visualization settings # Vector visualization settings
ACCELERATION_SCALE = 1000 ACCELERATION_SCALE = 100
VELOCITY_SCALE = 50 VELOCITY_SCALE = 50
ANGULAR_ACCELERATION_SCALE = 50 ANGULAR_ACCELERATION_SCALE = 50
ARROW_TIP_SIZE = 5 ARROW_TIP_SIZE = 5

View File

@ -88,7 +88,7 @@ class FoodObject(BaseEntity):
:param position: The position of the food. :param position: The position of the food.
""" """
super().__init__(position, Rotation(angle=0)) super().__init__(position, Rotation(angle=0))
self.max_visual_width: int = 10 self.max_visual_width: int = 8
self.decay: int = 0 self.decay: int = 0
self.decay_rate: int = 1 self.decay_rate: int = 1
self.max_decay = 200 self.max_decay = 200
@ -156,7 +156,7 @@ class FoodObject(BaseEntity):
screen, screen,
(255 - self.normalize_decay_to_color(), 0, 0), (255 - self.normalize_decay_to_color(), 0, 0),
camera.world_to_screen(*self.position.get_position()), camera.world_to_screen(*self.position.get_position()),
int(3 * camera.zoom) int((self.max_visual_width // 2) * camera.zoom)
) )
def __repr__(self) -> str: def __repr__(self) -> str:
@ -302,7 +302,7 @@ class DefaultCell(BaseEntity):
# 3. Combine all forces # 3. Combine all forces
total_linear_accel = output_data["linear_acceleration"] total_linear_accel = output_data["linear_acceleration"]
total_linear_accel = max(-0.1, min(0.02, total_linear_accel)) total_linear_accel = max(-0.1, min(0.1, total_linear_accel))
# 4. Convert to world coordinates # 4. Convert to world coordinates
x_component = total_linear_accel * math.cos(math.radians(self.rotation.get_rotation())) x_component = total_linear_accel * math.cos(math.radians(self.rotation.get_rotation()))