Tune RandomTileTickRate, and include random tile counter in chunk serialization.
This commit is contained in:
@@ -79,6 +79,7 @@ namespace CaveGame::Core
|
||||
[[nodiscard]] std::array<TileID, ChunkSize * ChunkSize> DataContiguous() const;
|
||||
|
||||
void write(Buffer& buf) {
|
||||
write_u32(buf, tiles_with_random_tick_count);
|
||||
write_f32(buf, cell.x);
|
||||
write_f32(buf, cell.y);
|
||||
|
||||
@@ -89,15 +90,13 @@ namespace CaveGame::Core
|
||||
}
|
||||
}
|
||||
|
||||
void read(Buffer& buf)
|
||||
{
|
||||
void read(Buffer& buf) {
|
||||
tiles_with_random_tick_count = read_u32(buf);
|
||||
cell.x = read_f32(buf);
|
||||
cell.y = read_f32(buf);
|
||||
|
||||
for (int x = 0; x < ChunkSize; x++)
|
||||
{
|
||||
for (int y = 0; y < ChunkSize; y++)
|
||||
{
|
||||
for (int x = 0; x < ChunkSize; x++) {
|
||||
for (int y = 0; y < ChunkSize; y++) {
|
||||
SetTile(x, y, (TileID) read_u8(buf));
|
||||
}
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ namespace CaveGame::Core {
|
||||
Event<> OnNextDay;
|
||||
Event<> OnAutosave;
|
||||
|
||||
constexpr static unsigned int RandomTileTickCoefficient = 100;
|
||||
constexpr static unsigned int RandomTileTickCoefficient = 128;
|
||||
constexpr static float PeriodicAutosaveIntervalSeconds = 30.f;
|
||||
World() = default;
|
||||
~World() = default;
|
||||
|
Reference in New Issue
Block a user