development #12

Merged
s452701 merged 9 commits from development into master 2021-06-21 17:12:29 +02:00
26 changed files with 31 additions and 31 deletions
Showing only changes of commit 43e97b6614 - Show all commits

View File

@ -1,9 +1,8 @@
import pygame
from settings import SCREEN_WIDTH, SCREEN_HEIGHT
from survival.camera import Camera
from survival.components.inventory_component import InventoryComponent
from survival.game_map import GameMap
from survival.game.game_map import GameMap
from survival.generators.building_generator import BuildingGenerator
from survival.generators.player_generator import PlayerGenerator
from survival.generators.resource_generator import ResourceGenerator

View File

@ -13,7 +13,7 @@ class DecisionTree:
self.vec = None
def build(self, depth: int):
path = os.path.join("..", "data.txt")
path = os.path.join("../..", "data.txt")
samples = list()
results = list()

View File

@ -6,7 +6,7 @@ from survival.components.direction_component import DirectionChangeComponent
from survival.components.moving_component import MovingComponent
from survival.components.position_component import PositionComponent
from survival.components.resource_component import ResourceComponent
from survival.enums import Direction
from survival.game.enums import Direction
from survival.esper import World

View File

@ -4,8 +4,8 @@ from matplotlib import pyplot as plt
from survival.components.learning_component import LearningComponent
from survival.components.position_component import PositionComponent
from survival.enums import Direction
from survival.graph_search import Action
from survival.game.enums import Direction
from survival.ai.graph_search import Action
class LearningUtils:

View File

@ -1,4 +1,4 @@
from survival.enums import Direction
from survival.game.enums import Direction
class DirectionChangeComponent:

View File

@ -1,4 +1,4 @@
from survival.enums import Direction
from survival.game.enums import Direction
class PositionComponent:

View File

@ -1,4 +1,4 @@
from survival.image import Image
from survival.game.image import Image
class SpriteComponent:

View File

@ -1,4 +1,4 @@
from survival.biomes.biome_preset import BiomePreset
from survival.game.biomes.biome_preset import BiomePreset
class BiomeData:

View File

@ -1,7 +1,7 @@
import random
from typing import List
from survival.tile import Tile
from survival.game.tile import Tile
class BiomePreset:

View File

@ -1,10 +1,10 @@
from survival.components.position_component import PositionComponent
from survival.components.resource_component import ResourceComponent
from survival.entity_layer import EntityLayer
from survival.game.entity_layer import EntityLayer
from survival.esper import World
from survival.graph_search import graph_search
from survival.ai.graph_search import graph_search
from survival.settings import AGENT_VISION_RANGE
from survival.tile_layer import TileLayer
from survival.game.tile_layer import TileLayer
class GameMap:

View File

@ -6,7 +6,7 @@ import pygame
class Image:
def __init__(self, filename='', pos=(0, 0), scale=1, surface=None):
if surface is None:
self.texture = pygame.image.load(os.path.join('..', 'assets', filename)).convert_alpha()
self.texture = pygame.image.load(os.path.join('../', 'assets', filename)).convert_alpha()
else:
self.texture = surface
self.image = self.texture

View File

@ -1,6 +1,6 @@
from survival.generators.tile_generator import TileGenerator
from survival.image import Image
from survival.tile import Tile
from survival.game.image import Image
from survival.game.tile import Tile
class TileLayer:

View File

@ -3,7 +3,7 @@ import pygame.font
from survival import settings
from survival.components.inventory_component import InventoryComponent
from survival.generators.resource_type import ResourceType
from survival.image import Image
from survival.game.image import Image
class UserInterface:

View File

@ -3,10 +3,10 @@ import random
from pathlib import Path
from typing import List
from survival.biomes.biome_data import BiomeData
from survival.biomes.biome_preset import BiomePreset
from survival.biomes.noise import generate_noise
from survival.tile import Tile
from survival.game.biomes.biome_data import BiomeData
from survival.game.biomes.biome_preset import BiomePreset
from survival.game.biomes.noise import generate_noise
from survival.game.tile import Tile
class TileGenerator:

View File

@ -1,5 +1,4 @@
from survival import esper, PlayerGenerator, ResourceGenerator, SCREEN_WIDTH, SCREEN_HEIGHT, GameMap, \
Camera
from survival import esper, PlayerGenerator, ResourceGenerator, SCREEN_WIDTH, SCREEN_HEIGHT
from survival.components.consumption_component import ConsumptionComponent
from survival.components.direction_component import DirectionChangeComponent
from survival.components.inventory_component import InventoryComponent
@ -10,6 +9,8 @@ from survival.components.position_component import PositionComponent
from survival.components.resource_component import ResourceComponent
from survival.components.time_component import TimeComponent
from survival.esper import World
from survival.game.camera import Camera
from survival.game.game_map import GameMap
from survival.generators.resource_type import ResourceType
from survival.settings import PLAYER_START_POSITION, STARTING_RESOURCES_AMOUNT
from survival.systems.automation_system import AutomationSystem

View File

@ -4,7 +4,7 @@ from survival import esper
from survival.components.on_collision_component import OnCollisionComponent
from survival.components.moving_component import MovingComponent
from survival.components.position_component import PositionComponent
from survival.enums import Direction
from survival.game.enums import Direction
class CollisionSystem(esper.Processor):

View File

@ -1,7 +1,7 @@
from survival import esper
from survival.components.position_component import PositionComponent
from survival.components.sprite_component import SpriteComponent
from survival.user_interface import UserInterface
from survival.game.user_interface import UserInterface
class DrawSystem(esper.Processor):

View File

@ -10,9 +10,9 @@ from survival.components.moving_component import MovingComponent
from survival.components.position_component import PositionComponent
from survival.components.learning_component import LearningComponent
from survival.components.time_component import TimeComponent
from survival.graph_search import Action
from survival.learning_utils import get_state, LearningUtils
from survival.model import LinearQNetwork, QTrainer
from survival.ai.graph_search import Action
from survival.ai.learning_utils import get_state, LearningUtils
from survival.ai.model import LinearQNetwork, QTrainer
MAX_MEMORY = 100_000
BATCH_SIZE = 1000

View File

@ -3,8 +3,8 @@ from survival.components.direction_component import DirectionChangeComponent
from survival.components.movement_component import MovementComponent
from survival.components.moving_component import MovingComponent
from survival.components.position_component import PositionComponent
from survival.enums import Direction
from survival.graph_search import graph_search, Action
from survival.game.enums import Direction
from survival.ai.graph_search import graph_search, Action
from survival.systems.input_system import PathfindingComponent