-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolved Conflicts: .gitignore README.md
- Loading branch information
Showing
406 changed files
with
35,157 additions
and
20,024 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Forces git CRLF->LF behaviour | ||
* text=auto | ||
|
||
# Files that git should treat as binary | ||
*.dll binary | ||
*.png binary | ||
*.jpg binary | ||
*.jpeg binary | ||
*.ego binary | ||
*.exe binary | ||
*.ogg binary | ||
*.wav binary | ||
*.obj binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
The MIT License (MIT) | ||
Copyright (c) 2016 OctoAwesome Community | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 OctoAwesome Community | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
56 changes: 56 additions & 0 deletions
56
OctoAwesome/Design Documents/Serverprotokol_Solution_Design_Document.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Network / Multiplayer | ||
|
||
## Protokoll | ||
|
||
### Ablaufplan | ||
|
||
__Handshake__ | ||
|
||
1. Client sicht: | ||
1. Auf Multiplayer klicken | ||
2. Eventuell Optional nach Nickname abfragen -> Settings evtl. generell? Vlt. bei Spielstart direkt abfragen | ||
3. Hostname des Zielservers eingeben | ||
|
||
--- | ||
|
||
4. Verbindungsaufbau mit TCP -> das steht bereits quasi | ||
5. "LogIn-Command" beinhaltet: Nickname, Client-Version, Avatar, Modliste | ||
6. Warte auf Bestätigung | ||
7. Bei Fehler fehlerhandling bei Bestätigung: | ||
* Daten des Servers prüfen | ||
* Wenn fehler dann melden | ||
|
||
2. Server sicht: | ||
1. Client verbindet sich | ||
2. Wartet auf Login-Command | ||
3. Prüft Daten aus Command | ||
4. Sende Bestätigung (Serverversion) oder Fehler | ||
|
||
__Gameprotokoll__ | ||
|
||
1. Client sicht: | ||
1. WHOAMI: Wer bin ich? was bin ich? wo bin ich? warum bin ich? und wenn ja wie viele? | ||
2. Chunkabonnement. | ||
|
||
3. Wenn chunk nicht mehr benötigt wird dann Chunkdeabonnement. | ||
4. Empfängt update paket => aktuallisieren der chunks | ||
5. Sende update paket | ||
|
||
2. Server sicht: | ||
1. Bekommt ein WHOAMI: nachgucken der Daten und dann initial antworten | ||
* Position | ||
* Weltinformation (Planetmetadaten) | ||
2. Chunkabonnement: zurücksenden der Chunkdaten und client zur "aboliste" des chunks hinzufügen | ||
3. Chunkdeabonnement: client aus "aboliste" entfernen. | ||
4. Updatepaket bei änderung eines Chunks | ||
5. Empfängt update paket: | ||
* Prüft update paket auf plausibilität | ||
* Wenn nicht plausibel verwerfen und Update packet senden (des aktuellen chunks) | ||
|
||
## Nächste Schritte | ||
|
||
1. Neuer Button für die UI | ||
2. Zielserver eintippmöglichkeit | ||
3. WHOAMI implementieren | ||
4. Client: eine Simulation starten => "keine eigene Map generiert" | ||
5. Client: NetworkPersistentManager implementieren der mit Server kommuniziert |
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Oops, something went wrong.
Binary file removed
BIN
-4.79 KB
OctoAwesome/OctoAwesome.Basics/Assets/OctoAwesome.Basics/Blocks/oven.png
Diff not rendered.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using OctoAwesome.Noise; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace OctoAwesome.Basics.Biomes | ||
{ | ||
public abstract class BiomeBase : IBiome | ||
{ | ||
public IPlanet Planet { get; private set; } | ||
|
||
public List<IBiome> SubBiomes { get; protected set; } | ||
|
||
public INoise BiomeNoiseGenerator { get; protected set; } | ||
|
||
public float MinValue { get; protected set; } | ||
|
||
public float MaxValue { get; protected set; } | ||
|
||
public float ValueRangeOffset { get; protected set; } | ||
|
||
public float ValueRange { get; protected set; } | ||
|
||
public BiomeBase(IPlanet planet, float minValue, float maxValue, float valueRangeOffset, float valueRange) | ||
{ | ||
SubBiomes = new List<IBiome>(); | ||
Planet = planet; | ||
MinValue = minValue; | ||
MaxValue = maxValue; | ||
ValueRangeOffset = valueRangeOffset; | ||
ValueRange = valueRange; | ||
} | ||
|
||
public virtual float[,] GetHeightmap(Index2 chunkIndex) | ||
{ | ||
float[,] values = new float[Chunk.CHUNKSIZE_X, Chunk.CHUNKSIZE_Y]; | ||
|
||
chunkIndex = new Index2(chunkIndex.X * Chunk.CHUNKSIZE_X, chunkIndex.Y * Chunk.CHUNKSIZE_Y); | ||
|
||
float[,] heights = BiomeNoiseGenerator.GetTileableNoiseMap2D(chunkIndex.X, chunkIndex.Y, Chunk.CHUNKSIZE_X, Chunk.CHUNKSIZE_Y, Planet.Size.X * Chunk.CHUNKSIZE_X, Planet.Size.Y * Chunk.CHUNKSIZE_Y); | ||
|
||
for (int x = 0; x < Chunk.CHUNKSIZE_X; x++) | ||
{ | ||
for (int y = 0; y < Chunk.CHUNKSIZE_Y; y++) | ||
{ | ||
values[x, y] = (heights[x, y] / 2 + 0.5f) * ValueRange + ValueRangeOffset; | ||
} | ||
} | ||
|
||
return values; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,18 @@ | ||
using OctoAwesome.Noise; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace OctoAwesome.Basics.Biomes | ||
{ | ||
class FlatlandBiome : IBiome | ||
{ | ||
|
||
public IPlanet Planet { get; private set; } | ||
|
||
public List<IBiome> SubBiomes { get; private set; } | ||
|
||
public INoise BiomeNoiseGenerator { get; private set; } | ||
|
||
public float MinValue { get; private set; } | ||
|
||
public float MaxValue { get; private set; } | ||
|
||
public float ValueRangeOffset { get; private set; } | ||
|
||
public float ValueRange { get; private set; } | ||
|
||
public FlatlandBiome(IPlanet planet, float minValue, float maxValue, float valueRangeOffset, float valueRange) | ||
{ | ||
this.BiomeNoiseGenerator = new SimplexNoiseGenerator(planet.Seed + 2) { FrequencyX = 1f / 256, FrequencyY = 1f / 256, Persistance = 0.25f, Octaves = 3, Factor = 1f }; | ||
this.Planet = planet; | ||
this.MinValue = minValue; | ||
this.MaxValue = maxValue; | ||
this.ValueRangeOffset = valueRangeOffset; | ||
this.ValueRange = valueRange; | ||
} | ||
|
||
public float[,] GetHeightmap(Index2 chunkIndex) | ||
{ | ||
float[,] values = new float[Chunk.CHUNKSIZE_X , Chunk.CHUNKSIZE_Y]; | ||
|
||
chunkIndex = new Index2(chunkIndex.X * Chunk.CHUNKSIZE_X, chunkIndex.Y * Chunk.CHUNKSIZE_Y); | ||
|
||
float[,] heights = BiomeNoiseGenerator.GetTileableNoiseMap2D(chunkIndex.X, chunkIndex.Y, Chunk.CHUNKSIZE_X , Chunk.CHUNKSIZE_Y, Planet.Size.X * Chunk.CHUNKSIZE_X , Planet.Size.Y * Chunk.CHUNKSIZE_Y ); | ||
|
||
for (int x = 0; x < Chunk.CHUNKSIZE_X ; x++) | ||
{ | ||
for (int y = 0; y < Chunk.CHUNKSIZE_Y ; y++) | ||
{ | ||
values[x, y] = (heights[x, y] / 2 + 0.5f) * ValueRange + ValueRangeOffset; | ||
} | ||
} | ||
return values; | ||
} | ||
} | ||
} | ||
using OctoAwesome.Noise; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace OctoAwesome.Basics.Biomes | ||
{ | ||
class FlatlandBiome : BiomeBase | ||
{ | ||
public FlatlandBiome(IPlanet planet, float minValue, float maxValue, float valueRangeOffset, float valueRange) | ||
: base(planet, minValue, maxValue, valueRangeOffset, valueRange) | ||
{ | ||
BiomeNoiseGenerator = new SimplexNoiseGenerator(planet.Seed + 2) { FrequencyX = 1f / 256, FrequencyY = 1f / 256, Persistance = 0.25f, Octaves = 3, Factor = 1f }; | ||
|
||
} | ||
} | ||
} |
72 changes: 17 additions & 55 deletions
72
OctoAwesome/OctoAwesome.Basics/Biomes/HighMountainBiome.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,17 @@ | ||
using OctoAwesome.Noise; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace OctoAwesome.Basics.Biomes | ||
{ | ||
class HighMountainBiome : IBiome | ||
{ | ||
|
||
public IPlanet Planet { get; private set; } | ||
|
||
public List<IBiome> SubBiomes { get; private set; } | ||
|
||
public INoise BiomeNoiseGenerator { get; private set; } | ||
|
||
public float MinValue { get; private set; } | ||
|
||
public float MaxValue { get; private set; } | ||
|
||
public float ValueRangeOffset { get; private set; } | ||
|
||
public float ValueRange { get; private set; } | ||
|
||
public HighMountainBiome(IPlanet planet, float minValue, float maxValue, float valueRangeOffset, float valueRange) | ||
{ | ||
this.BiomeNoiseGenerator = new SimplexNoiseGenerator(planet.Seed + 2) { FrequencyX = 1f / 256, FrequencyY = 1f / 256, FrequencyZ = 1f / 256, Persistance = 0.5f, Octaves = 6, Factor = 1f }; | ||
this.Planet = planet; | ||
this.MinValue = minValue; | ||
this.MaxValue = maxValue; | ||
this.ValueRangeOffset = valueRangeOffset; | ||
this.ValueRange = valueRange; | ||
} | ||
|
||
public float[,] GetHeightmap(Index2 chunkIndex) | ||
{ | ||
|
||
float[,] values = new float[Chunk.CHUNKSIZE_X, Chunk.CHUNKSIZE_Y]; | ||
|
||
chunkIndex = new Index2(chunkIndex.X * Chunk.CHUNKSIZE_X, chunkIndex.Y * Chunk.CHUNKSIZE_Y); | ||
|
||
float[,] heights = BiomeNoiseGenerator.GetTileableNoiseMap2D(chunkIndex.X, chunkIndex.Y, Chunk.CHUNKSIZE_X, Chunk.CHUNKSIZE_Y, Planet.Size.X * Chunk.CHUNKSIZE_X, Planet.Size.Y * Chunk.CHUNKSIZE_Y); | ||
|
||
for (int x = 0; x < Chunk.CHUNKSIZE_X; x++) | ||
{ | ||
for (int y = 0; y < Chunk.CHUNKSIZE_Y; y++) | ||
{ | ||
values[x, y] = (heights[x, y] / 2 + 0.5f) * ValueRange + ValueRangeOffset; | ||
} | ||
} | ||
return values; | ||
} | ||
} | ||
} | ||
using OctoAwesome.Noise; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace OctoAwesome.Basics.Biomes | ||
{ | ||
class HighMountainBiome : BiomeBase | ||
{ | ||
public HighMountainBiome(IPlanet planet, float minValue, float maxValue, float valueRangeOffset, float valueRange) | ||
: base(planet, minValue, maxValue, valueRangeOffset, valueRange) | ||
{ | ||
BiomeNoiseGenerator = new SimplexNoiseGenerator(planet.Seed + 2) { FrequencyX = 1f / 256, FrequencyY = 1f / 256, FrequencyZ = 1f / 256, Persistance = 0.5f, Octaves = 6, Factor = 1f }; | ||
} | ||
} | ||
} |
Oops, something went wrong.