Skip to content

Commit

Permalink
Merge branch 'release/3.0'
Browse files Browse the repository at this point in the history
Resolved Conflicts:
	.gitignore
	README.md
  • Loading branch information
Gallimathias committed May 8, 2019
2 parents 19914d4 + 85560ba commit 8245961
Show file tree
Hide file tree
Showing 406 changed files with 35,157 additions and 20,024 deletions.
13 changes: 13 additions & 0 deletions .gitattributes
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
45 changes: 37 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,7 @@ _pkginfo.txt
!*.[Cc]ache/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
Expand Down Expand Up @@ -228,11 +225,43 @@ UpgradeLog*.htm
# Microsoft Fakes
FakesAssemblies/

# LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
/OctoAwesome/packages/
# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe
paket-files/

# FAKE - F# Make
.fake/

# JetBrains Rider
.idea/
*.sln.iml

# CodeRush
.cr/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc

# Docfx
_site/
Expand Down
40 changes: 20 additions & 20 deletions LICENSE
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.
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 added OctoAwesome/Design Documents/skizzen.pptx
Binary file not shown.
Diff not rendered.
55 changes: 55 additions & 0 deletions OctoAwesome/OctoAwesome.Basics/Biomes/BiomeBase.cs
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;
}
}
}
72 changes: 18 additions & 54 deletions OctoAwesome/OctoAwesome.Basics/Biomes/FlatlandBiome.cs
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 OctoAwesome/OctoAwesome.Basics/Biomes/HighMountainBiome.cs
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 };
}
}
}
Loading

0 comments on commit 8245961

Please sign in to comment.