Ideen zur Karte sammeln #42

Closed
opened 2025-10-21 18:06:06 +02:00 by lassel · 1 comment
lassel commented 2025-10-21 18:06:06 +02:00 (Migrated from git.sopranium.de)
No description provided.
yide commented 2025-10-28 16:44:34 +01:00 (Migrated from git.sopranium.de)

1.Data-Driven World Generation (Real-World Fidelity):Concept: The map is not manually placed or purely random, but is programmatically generated by reading a external data source. For example, the world map.

2.Modular and High-Performance Rendering (Frustum Culling):
Concept: To manage the massive tile count (over 1.7 million tiles) efficiently, the game uses Frustum Culling.Implementation: The DrawGameObjects method only calculates and draws the tiles currently visible on the screen (startX to endX). This dramatically reduces the GPU load and is essential for maintaining a stable 60 FPS.

3.Visual Detail via Fixed Pseudorandomness (No Repetition):
Concept: To avoid the visual monotony of repetitive textures, the map introduces weighted, randomized details while maintaining a fixed world layout.
Implementation: The system uses a high-quality hash function (Noise(x, y)) driven by tile coordinates to generate a fixed pseudorandom value. This value is then used in a weighted sampling loop (e.g., 50% chance for tile_grass_01 vs. 10% for tile_grass_02) to assign texture variations, eliminating visible patterns.

4.Dynamic Gameplay Coupling (Terrain Interaction):Concept: The map is not just a passive background; its attributes directly affect player mechanics.Implementation:Impassable Terrain: The GetTileIdAtWorldPosition method checks the movement destination, preventing the player and dash moves from entering Ocean tiles (ID 0).Dynamic Accessibility: The system integrates Temperature Data (TemperatureTiles) to create a conditional mechanic: Ocean tiles below 0 degrees are treated as passable terrain (frozen water), changing the map's fundamental rules in real-time.

`private int GetTileIdAtWorldPosition(Vector2 worldPosition)
{

    int tileX = (int)Math.Floor(worldPosition.X / TILE_SIZE);
    int tileY = (int)Math.Floor(worldPosition.Y / TILE_SIZE);

   
    if (tileX >= 0 && tileX < _mapWidthInTiles && tileY >= 0 && tileY < _mapHeightInTiles)
    {
       
        int arrayIndex = tileY * _mapWidthInTiles + tileX;
    
        if (arrayIndex >= 0 && arrayIndex < _groundLayer.Length)
        {
            return _groundLayer[arrayIndex];
        }
    }


    return 0; 
}`
1.Data-Driven World Generation (Real-World Fidelity):Concept: The map is not manually placed or purely random, but is programmatically generated by reading a external data source. For example, the world map. 2.Modular and High-Performance Rendering (Frustum Culling): Concept: To manage the massive tile count (over 1.7 million tiles) efficiently, the game uses Frustum Culling.Implementation: The DrawGameObjects method only calculates and draws the tiles currently visible on the screen (startX to endX). This dramatically reduces the GPU load and is essential for maintaining a stable 60 FPS. 3.Visual Detail via Fixed Pseudorandomness (No Repetition): Concept: To avoid the visual monotony of repetitive textures, the map introduces weighted, randomized details while maintaining a fixed world layout. Implementation: The system uses a high-quality hash function (Noise(x, y)) driven by tile coordinates to generate a fixed pseudorandom value. This value is then used in a weighted sampling loop (e.g., 50% chance for tile_grass_01 vs. 10% for tile_grass_02) to assign texture variations, eliminating visible patterns. 4.Dynamic Gameplay Coupling (Terrain Interaction):Concept: The map is not just a passive background; its attributes directly affect player mechanics.Implementation:Impassable Terrain: The GetTileIdAtWorldPosition method checks the movement destination, preventing the player and dash moves from entering Ocean tiles (ID 0).Dynamic Accessibility: The system integrates Temperature Data (TemperatureTiles) to create a conditional mechanic: Ocean tiles below 0 degrees are treated as passable terrain (frozen water), changing the map's fundamental rules in real-time. `private int GetTileIdAtWorldPosition(Vector2 worldPosition) { int tileX = (int)Math.Floor(worldPosition.X / TILE_SIZE); int tileY = (int)Math.Floor(worldPosition.Y / TILE_SIZE); if (tileX >= 0 && tileX < _mapWidthInTiles && tileY >= 0 && tileY < _mapHeightInTiles) { int arrayIndex = tileY * _mapWidthInTiles + tileX; if (arrayIndex >= 0 && arrayIndex < _groundLayer.Length) { return _groundLayer[arrayIndex]; } } return 0; }`
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ufr/sopra10#42
No description provided.