2185 Commits

Author SHA1 Message Date
Joshua Barretto
4b8d9e08b9 Merge branch 'sharp/cancel-chunk-gen' into 'master'
Allow canceling chunk generation.

See merge request veloren/veloren!499
2019-09-16 19:15:47 +00:00
Joshua Yanovski
743e48110f Addressing code review. 2019-09-16 15:11:47 +02:00
Imbris
0ceb49d4fc Merge branch 'imbris/optional-deps' into 'master'
Make some voxygen dependencies optional

See merge request veloren/veloren!498
2019-09-16 03:57:57 +00:00
Joshua Yanovski
4fb851263c Continue instead of breaking. 2019-09-16 04:18:40 +02:00
Joshua Yanovski
c4eae2e1b1 Fixing more rustfmt errors. 2019-09-16 04:05:36 +02:00
Joshua Yanovski
661b9aee72 Fixing rustfmt. 2019-09-16 04:01:05 +02:00
Joshua Yanovski
00b3f4e4f4 Fixing previous commit. 2019-09-16 03:54:32 +02:00
Joshua Yanovski
d5c441767f Fixing previous commit. 2019-09-16 03:51:08 +02:00
Joshua Yanovski
f5c4000b1b Allow canceling chunk generation.
Currently we only do this when no players are in range of the chunk.  We
also send the first client who posted the chunk a message indicating
that it's canceled, the hope being that this will be a performance win
in single player mode since you don't have to wait three seconds to
realize that the server won't generate the chunk for you.

We now check an atomic flag for every column sample in a chunk.  We
could probably do this less frequently, but since it's a relaxed load it
has essentially no performance impact on Intel architectures.
2019-09-16 03:41:33 +02:00
Imbris
75859c89ef Make some voxygen dependencies optional 2019-09-15 17:03:33 -04:00
Imbris
edc252592e Merge branch 'arashout/213-settings-crash' into 'master'
Add code path for invalid settings file

See merge request veloren/veloren!428
2019-09-13 03:45:23 +00:00
Imbris
34577a7b86 Fix always returning the default settings 2019-09-12 23:37:28 -04:00
Arash Outadi
1451889365 Run cargo fmt 2019-09-12 22:47:51 -04:00
Arash Outadi
8ddac925a6 Add code path for invalid settings file 2019-09-12 22:47:50 -04:00
Forest Anderson
f3635dbfe0 Merge branch 'angelonfira/fix-readme-arch-formatting' into 'master'
Fixed AUR formatting

See merge request veloren/veloren!496
2019-09-11 21:14:22 +00:00
Forest Anderson
71e22e8a12 Fixed AUR formatting 2019-09-11 17:08:52 -04:00
Forest Anderson
19b9890dc6 Merge branch 'tim74/veloren-packaging-status' into 'master'
Add Fedora installation info

See merge request veloren/veloren!493
2019-09-11 19:29:54 +00:00
Forest Anderson
b4dbf05659 Added Mckol's arch info 2019-09-11 14:59:51 -04:00
Artem
b7805e3ab7 Add Fedora installation info 2019-09-11 14:59:51 -04:00
Imbris
598409d9c9 Merge branch 'haslersn/bugfix/default-pos-iterator' into 'master'
Bugfix: DefaultPosIterator now starts at lower_bound

See merge request veloren/veloren!492
2019-09-11 02:47:02 +00:00
haslersn
c7a1bbc00f Bugfix: DefaultPosIterator now starts at lower_bound
Previosly the first iteration was skipped.
2019-09-11 01:48:28 +02:00
Marcel
d3357646c5 Merge branch 'prometheus' into 'master'
Fix panic if starting singleplayer twice without closing the game

See merge request veloren/veloren!491
2019-09-10 13:33:42 +00:00
Marcel Märtens
a2914c17f5 Fix panic if starting singleplayer twice without closing the game
reduce costs for metrics by checking chunks only every 100th tick
add metrics for "server start time" and ingame "time of day"
2019-09-10 15:22:34 +02:00
Joshua Barretto
943336cc59 Merge branch 'zesterer/more-movement' into 'master'
More Movement

See merge request veloren/veloren!471
2019-09-09 19:11:40 +00:00
Joshua Barretto
e6d8b4b8d8 Exponential interpolation for linear damping
With an additional approximation to allow for the same size jumps given different framerates.
2019-09-09 19:11:40 +00:00
Marcel
f81a654bc1 Merge branch 'prometheus' into 'master'
Prometheus

See merge request veloren/veloren!486
2019-09-09 09:04:03 +00:00
Marcel Märtens
b0ff977297 adjust metrics to rebased Chunks 2019-09-09 10:47:40 +02:00
Marcel Märtens
bdea219d82 switch from hyper http to rouille for http server 2019-09-09 10:07:25 +02:00
Marcel Märtens
ae51f9f9dd update version, revert from static prometheus back to normal because static doesnt supprot registries, and implement most of the metrics except for entity count 2019-09-09 09:54:30 +02:00
Marcel Märtens
2b344e9d94 first implementation of prometheus in veloren for git hash, tick times, chunks loaded, player online, entity count and light count 2019-09-09 09:48:44 +02:00
Joshua Barretto
89b637e94e Merge branch 'fix-jump-height' into 'master'
Fix jump height

See merge request veloren/veloren!485
2019-09-08 15:50:08 +00:00
Joshua Barretto
5986d4e76b Merge branch 'telastrus/vol-fix' into 'master'
Footstep volume fix

See merge request veloren/veloren!489
2019-09-08 15:47:52 +00:00
Geno
58ad2e4d82 Footstep volume fix 2019-09-08 15:47:52 +00:00
Forest Anderson
132020af23 Merge branch 'angelonfira/bump-gfx-device-gl-to-allow-new-nightly' into 'master'
Bumped version

See merge request veloren/veloren!490
2019-09-08 15:34:17 +00:00
Forest
ed88db8213 Updated cargo lock 2019-09-08 11:28:56 -04:00
Forest
a519727548 Bumped version 2019-09-08 11:15:46 -04:00
Joshua Barretto
3eed74986a Merge branch 'scott-c/fix-performance-regression' into 'master'
Fix performance regression; simplify FigureKey

See merge request veloren/veloren!483
2019-09-08 12:01:45 +00:00
scott-c
5edd544f69 Fix performance regression; simplify FigureKey 2019-09-08 19:52:57 +08:00
Forest Anderson
d867bce9c5 Merge branch 'angelonfira/parallelize-ci-better' into 'master'
Changed stages

See merge request veloren/veloren!488
2019-09-07 16:35:10 +00:00
Forest Anderson
95b16c32ab Changed stages 2019-09-07 16:35:10 +00:00
Andrew Pritchard
32a8ceab94 Merge branch 'fix-jump-height' into 'fix-jump-height'
Fix jump height

See merge request veloren/veloren!477
2019-09-07 12:48:49 +00:00
Timo Koesters
f241bc6b82 Merge branch 'timo-attack' into 'master'
Fix wolfs not attacking and adjust movement while attacking

See merge request veloren/veloren!484
2019-09-07 10:25:57 +00:00
timokoesters
e5e29b490b
Make npcs attack in a smarter way 2019-09-07 12:16:55 +02:00
timokoesters
57111af0a7
Fix audio 2019-09-07 11:46:21 +02:00
Joshua Barretto
5dbc0b830e Merge branch 'haslersn/block-groups' into 'master'
common: Rework `Chunk` and `Chonk` implementation

See merge request veloren/veloren!475
2019-09-07 09:14:54 +00:00
Forest Anderson
b68a663386 Merge branch 'revert-d71f2ebf' into 'master'
Revert "Merge branch 'angelonfira/bump-toolchain-sept' into 'master'"

See merge request veloren/veloren!482
2019-09-06 20:19:14 +00:00
Forest Anderson
b7c2d8bdec Revert "Merge branch 'angelonfira/bump-toolchain-sept' into 'master'"
This reverts merge request !481
2019-09-06 20:17:57 +00:00
Forest Anderson
0ddc12699c Merge branch 'angelonfira/bump-toolchain-sept' into 'master'
Bump toolchain

See merge request veloren/veloren!481
2019-09-06 19:05:51 +00:00
Forest Anderson
3ffbfabdf7 Bump toolchain 2019-09-06 15:02:48 -04:00
haslersn
db691b37d1 common: Rework Chunk and Chonk implementation
Previously, voxels in sparsely populated chunks were stored in a `HashMap`.
However, during usage oftentimes block accesses are followed by subsequent
nearby voxel accesses. Therefore it's possible to provide cache friendliness,
but not with `HashMap`.

The previous merge request [!469](https://gitlab.com/veloren/veloren/merge_requests/469)
proposed to order voxels by their morton order (see https://en.wikipedia.org/wiki/Z-order_curve ).
This provided excellent cache friendliness. However, benchmarks showed that
the required indexing calculations are quite expensive. Particular results
on my _Intel(R) Core(TM) i7-7500U CPU @ 2.70 GHz_ were:

| Benchmark                                | Before this commit @ d322384becac | Morton Order @ ec8a7caf42ba | This commit          |
| ---------------------------------------- | --------------------------------- | --------------------------- | -------------------- |
| `full read` (81920 voxels)               | 17.7ns per voxel                  | 8.9ns per voxel             | **3.6ns** per voxel  |
| `constrained read` (4913 voxels)         | 67.0ns per voxel                  | 40.1ns per voxel            | **14.1ns** per voxel |
| `local read` (125 voxels)                | 17.5ns per voxel                  | 14.7ns per voxel            | **3.8ns** per voxel  |
| `X-direction read` (17 voxels)           | 17.8ns per voxel                  | 25.9ns per voxel            | **4.2ns** per voxel  |
| `Y-direction read` (17 voxels)           | 18.4ns per voxel                  | 33.3ns per voxel            | **4.5ns** per voxel  |
| `Z-direction read` (17 voxels)           | 18.6ns per voxel                  | 38.2ns per voxel            | **5.4ns** per voxel  |
| `long Z-direction read` (65 voxels)      | 18.0ns per voxel                  | 37.7ns per voxel            | **5.1ns** per voxel  |
| `full write (dense)` (81920 voxels)      | 17.9ns per voxel                  | **10.3ns** per voxel        | 12.4ns per voxel     |

This commit (instead of utilizing morton order) replaces `HashMap` in the
`Chunk` implementation by the following data structure:

The volume is spatially subdivided into groups of `4*4*4` blocks. Since a
`Chunk` is of total size `32*32*16`, this implies that there are `8*8*4`
groups. (These numbers are generic in the actual code such that there are
always `256` groups. I.e. the group size is chosen depending on the desired
total size of the `Chunk`.)

There's a single vector `self.vox` which consecutively stores these groups.
Each group might or might not be contained in `self.vox`. A group that is
not contained represents that the full group consists only of `self.default`
voxels. This saves a lot of memory because oftentimes a `Chunk` consists of
either a lot of air or a lot of stone.

To track whether a group is contained in `self.vox`, there's an index buffer
`self.indices : [u8; 256]`. It contains for each group

* (a) the order in which it has been inserted into `self.vox`, if the group
    is contained in `self.vox` or
* (b) 255, otherwise. That case represents that the whole group consists
    only of `self.default` voxels.

(Note that 255 is a valid insertion order for case (a) only if `self.vox` is
full and then no other group has the index 255. Therefore there's no
ambiguity.)

Rationale:

The index buffer should be small because:

* Small size increases the probability that it will always be in cache.
* The index buffer is allocated for every `Chunk` and an almost empty `Chunk`
    shall not consume too much memory.

The number of 256 groups is particularly nice because it means that the index
buffer can consist of `u8`s. This keeps the space requirement for the index
buffer as low as 4 cache lines.
2019-09-06 18:20:15 +02:00