Commit Graph

468 Commits

Author SHA1 Message Date
Joshua Barretto
6992194ad4 Better surface swimming, no underwater sprites 2020-08-12 21:15:53 +01:00
Imbris
893da3622a Merge branch 'scott-c/particles' into 'master'
Particles

See merge request veloren/veloren!1156
2020-08-09 17:09:43 +00:00
jshipsey
9ff5c23cf0 readd sneak 2020-08-08 13:47:32 -04:00
scott-c
a0107d5cda fix rebase 2020-08-08 19:26:52 +08:00
Joshua Barretto
7c31baef6f Added outcome system, sound effects 2020-08-08 19:26:48 +08:00
Monty Marz
142b386628 address comments 2020-08-08 00:13:00 -04:00
Imbris
2608217e83 Make clippy happy, fmt even though it is set to fmt on save in my
editor...."
2020-08-08 01:16:35 +02:00
Imbris
2faa1cd6c1 Add info message in chat about group chat when joining a group 2020-08-08 01:16:35 +02:00
Imbris
a7df000a6f Fireballs no longer damage group members 2020-08-08 01:16:35 +02:00
Imbris
390d289d35 Add timeout's to group invites, and configurable limit to group size
Fix a few group bugs, enable invite timeout and group limits in ui
2020-08-08 01:16:35 +02:00
Monty Marz
1eb671e1a6 Update CHANGELOG.md, german locale 2020-08-08 01:15:58 +02:00
Monty Marz
f2ed7efced group button and menu logic changes
group member panels

health bar text

text shadows and scaling

cleanup, don't show the player panel

social window assets
2020-08-08 01:14:19 +02:00
Imbris
3a22b3694d New group UI functions 2020-08-08 01:14:19 +02:00
Imbris
0a8f148559 Fixes and tweaks for groups 2020-08-08 01:12:35 +02:00
Monty Marz
d9e3937a82 Basic UI
Basic ui for groups and group window
2020-08-08 01:12:35 +02:00
Imbris
6aba810517 Add key to select entities 2020-08-08 01:09:02 +02:00
Imbris
10c3d01466 Add basic group functionality (no voxygen wiring yet) 2020-08-08 01:09:01 +02:00
Marcel Märtens
7f97baca70 switch to auth that doesn't use agent 2020-07-31 01:05:01 +02:00
Marcel Märtens
0d5e61c4b6 update auth to newest version 2020-07-29 19:28:22 +02:00
Marcel Märtens
96cde882ef update auth to the newest version and remove useless dep 2020-07-29 00:05:23 +02:00
Marcel Märtens
6c59caf8e1 make prometheus optional in network and fix a panic in the server
- an extra interface `new_with_regisitry` was created to make sure the interface doesn't depend on the features
2020-07-15 16:45:49 +02:00
Joshua Barretto
8d6b442193 Crafting 2020-07-14 20:11:39 +00:00
Marcel Märtens
6db9c6f91b fix a followup bug, after a protocol fail now Participant is closed, including all streams, so we get the stream errors.
We MUST handle them and we are not allowed to act on a stream after it failed, as i am to lazy to change the structure to ensure the client to be imeadiatly dropped i added a AtomicBool to it.
2020-07-13 13:03:35 +02:00
Marcel Märtens
9d32e3f884 proper voxygen connect and code cleanups:
- voxygen abort when the server has a invalid veloren_network handshake, e.g. by outdated version instead of try again
- rename Network `Address` to `ProtocolAddr` as sugested by zest as it's a combination of Protocol and std::io::Addr
- remove the manual byte arrays in `protocols.rs` with something more nice
2020-07-13 13:03:20 +02:00
Marcel Märtens
041349be48 Switch API to return Participant rather than Arc<Participant>
- API behavior switched!
 - the `Network` no longer holds a copy of participant, thus if the return of `connect` (before `Arc<Participant>, now `Participant`) got dropped, the `Participant::Drop` is triggered!
 - you can close a Participant async via `Particiant::disconnect()`, no more need to know the network at this point
 - the `Network::Drop` will check and drop not yet disconnected Participants.
 - you can compare Participants via PartialEq, if they are true they point to the same endpoint (it checks remote_pid)
   - Note: multiple Participants are only supported in theory, wont work yet

Additionally:
 - fix some `debug!`
 - veloren-client will now drop the participant gracefully on shutdown
 - rename `error` to `debug` when 2 times Bparticipant shutdown is called, as it is to be expected in a async runtime
2020-07-13 13:03:14 +02:00
Marcel Märtens
9ae1d8474f dropping participant on client disconnect clients 2020-07-13 13:03:07 +02:00
Kai
6b771b8dca Add a clientside check to only allow freefly camera for admins 2020-07-11 13:59:47 -07:00
Ben Wallis
6ca6e2d646 Removed rounding from ping delta and added weighted rolling average ping calculation 2020-07-11 15:39:31 +01:00
Songtronix
5b57072064 fix: use correct specs(-idvs) versions
related to torvus
2020-07-09 19:46:30 +02:00
Marcel Märtens
c212de00c2 updated dependencies and fixed stuff
- replace serde_derive by feature of serde
   incl. source code modifications to compile
 - reduce futures-timer to "2.0" to be same as async_std
 - update notify
 - removed mio, bincode and lz4 compress in common as networking is now in own crate
   btw there is a better lz4 compress crate, which is newer than 2017
 - update prometheus to 0.9
 - can't update uvth yet due to usues
 - hashbrown to 7.2 to only need a single version
 - libsqlite3 update
 - image didn't change as there is a problem with `image 0.23`
 - switch old directories with newer directories-next
 - no num upgrade as we still depend on num 0.2 anyways
 - rodio and cpal upgrade
 - const-tewaker update
 - dispatch (untested) update
 - git2 update
 - iterations update
2020-07-07 09:43:49 +02:00
Imbris
8d39f27458 Upgrade hashbrown 2020-07-06 03:15:06 -04:00
Imbris
c2d6d00b00 point to github specs to access PairedStorage type, fix Loadout sync spam 2020-07-06 01:56:02 -04:00
Forest Anderson
e73ec7a4d2 Added spawning test dummy 2020-07-03 16:53:04 -04:00
Marcel Märtens
15ff58cd6a simple fmt in order to make the replacement commit as simple as possible 2020-07-03 13:11:44 +02:00
Marcel Märtens
4e92c0160e network layer switch, doing the stuff that might confict.
- mostly its the message handling put now in a async wrapper
 - add some fixes to pass without warnings and make clippy happy
 - some network error handling is ignored, this can be improved but is no blocker
2020-07-03 13:11:38 +02:00
Marcel Märtens
77c90b2c7c doing a simple 1:1 swap out network coding
this is the part which prob has less Merge conflics and is easy to rebase
the next commit will have prob alot of merge conflics
followed by a fmt commit
2020-07-03 13:11:31 +02:00
Monty Marz
89400264dc Loot ChatType, Update german translation, map zooming 2020-07-01 19:05:44 +00:00
Marcel Märtens
6535fa5744 fix various clippy issues 2020-07-01 00:37:06 +02:00
Ben Wallis
dc1844b489 Moved sfx from common to voxygen 2020-06-28 18:16:22 +01:00
Forest Anderson
201f513737 Fixed meta chattype error on master 2020-06-28 17:10:01 +00:00
Forest Anderson
9246e34c1b Merge branch 'CapsizeGlimmer/chat_modes' into 'master'
Capsize glimmer/chat modes

Closes #217

See merge request veloren/veloren!1043
2020-06-28 14:35:39 +00:00
Ben Wallis
a9d3f984f0 Implemented loot pickup chat messages and the option for playing different sounds for picked up items
* Added chat message when an item is picked up
* Changed InventoryUpdateEvent::Collected to InventoryUpdateEvent::Collected(Item) to facilitate the client being aware of what was picked up
* Added SfxInventoryEvent enum to allow different sounds to be used based on the item type. The RON mapping/de-serialization doesn't support matching on structs so we have to give it fixed enum values which are determined in TryFrom<&InventoryUpdateEvent> for SfxEvent
* Refactored InventoryManip::Pickup arm of match in inventory_manip::handle_inventory for clarity/better warning messages
* Fixed a bug that prevented the CollectFailed event from being raised when a player's inventory is full
* Added a panic for the situation where an item is pushed into the players inventory and then the deletion of the entity fails as this would indicate an item dupe bug - this could potentially be reworked to pull the item back from the player's inventory but this seems like there's be a more correct transactional way to do this.
* Added two temporary sounds to prove the per-item sound functionality (pickup sounds for Swords and Staffs)
2020-06-28 13:05:28 +01:00
Forest Anderson
2665159790 Fixing errors after rebase 2020-06-27 19:12:12 -04:00
CapsizeGlimmer
883d9acf30 cargo fmt 2020-06-27 17:43:46 -04:00
CapsizeGlimmer
3d29c3254a Add setting for displaying character names in chat. Placate cargo clippy. 2020-06-27 17:43:46 -04:00
CapsizeGlimmer
b04810cae5 misc chat mode changes 2020-06-27 17:40:03 -04:00
CapsizeGlimmer
5ad212b7ed Add chat types for offline, online. Implement Pfau's fixes 2020-06-27 17:40:03 -04:00
CapsizeGlimmer
b7d7696d89 Implement MR!1043 changes suggested by Imbris 2020-06-27 17:20:26 -04:00
CapsizeGlimmer
34acc4ddf3 Players are removed from social menu when logged out. 2020-06-27 17:20:26 -04:00
CapsizeGlimmer
aabf9d7b21 fix chat-cli name formatting. 2020-06-27 17:20:26 -04:00
CapsizeGlimmer
4117f2f2a8 cargo fmt; changelog 2020-06-27 17:03:55 -04:00
CapsizeGlimmer
22315a6e1d Added shortcut for chat commands /g=>/group, /s=>/say, /w=>/world, etc. 2020-06-27 17:03:30 -04:00
CapsizeGlimmer
289ef5d6b2 Move message processing and chat bubbles to the client 2020-06-27 16:42:26 -04:00
CapsizeGlimmer
0b2a3ebe8b Re-implement names in chat. It is done client-side now and /alias changes are retroactive. 2020-06-27 16:42:25 -04:00
CapsizeGlimmer
b08d717eac Rework chat processing 2020-06-27 16:29:03 -04:00
CapsizeGlimmer
702a21302c Base implementation of /group /faction /say /region 2020-06-27 16:26:02 -04:00
Joshua Barretto
b46e080ade Added server-side maximum view distance setting 2020-06-25 18:46:04 +01:00
Imbris
6501611372 Merge branch 'shandley/character-loading' into 'master'
Move character DB ops off the main thread

See merge request veloren/veloren!1075
2020-06-25 16:16:15 +00:00
Songtronix
f44df23935 feat: add server whitelist 2020-06-24 17:36:19 +02:00
Shane Handley
255ad97289 - Move the remaining character data loading to the message/thread formatharacter list actions
- Handle/notify the client of errors during character load by returning to character select with the error, clean up client and server states
- Add player_uuid check when loading character data.
2020-06-24 11:47:41 +10:00
Marcel Märtens
9485b45e70 switch to tracing stlye and enhance logs with usefull information
- Updated CHANGELOG
- reduce dependencies
- found out that we have alot of duplicate coding... alot...
2020-06-22 09:53:15 +02:00
Kevin Glasson
589254e4ab Convert all other veloren crates to use tracing
- Completely removed both `log` and `pretty_env_logger` and replaced
with `tracing` and `tracing_subscriber` where necessary.

- Converted all `log::info!(...)` et al. statements to just use the
shorthand macro i.e. `info!`. This was mostly to make renaming easier.
2020-06-21 23:19:41 +08:00
Kevin Glasson
19c2bf1181 Add hotbar state persistence.
Persist the hotbar state to disk by writing it out to a `profile.ron`
situated next to the existing `settings.ron`. There are individual
profiles for every character on every server. On creation of a new
character the default hotbar state will be `[None; 10]` i.e. the hotbar
will be empty.

Resolves: https://gitlab.com/veloren/veloren/-/issues/577
2020-06-19 08:00:21 +08:00
scott-c
88d68df2c0 Remove wield requirement to swap loadout 2020-06-17 21:34:58 +08:00
Justin Shipsey
2f896849d4 Wield glider instead of weapon when attempting glide wield, change behavior when running into walls to not drop out of gliding 2020-06-16 21:32:39 +00:00
Ben Wallis
c1c968f479 Globally suppressed clippy lint option_map_unit_fn for #587 2020-06-14 16:48:07 +00:00
Ben Wallis
8ed2109bcf Fixed suppressed clippy warnings for #587 - collapsible_if 2020-06-12 20:34:54 +01:00
Marcel Märtens
0e59ee901e dependency reduction:
- authc no longer uses reqwest
 - image only supports PNG
 - replace routille with tiny_http
 - several other dependencies
 - cargo upgrade
 - following improvement was measured on R7 1700X:
   before:
    - cargo build: 3076.73s user / 4:45 total / 589 dependencies
    - cargo test: 6118.38s user / 7:30 total / 959 dependencies
   after:
    - cargo build: 2680.54s user / 4:05 total / 480 dependencies
    - cargo test: 5351.81s user / 7:04 total / 791 dependencies
 - added xMAC94x to CODEOWNERS for Cargo.toml, he will protect them from now on and hit people with evil looks ;)
2020-06-11 20:55:34 +02:00
Ben Wallis
950c62efc6 Suppressed all existing clippy warnings in preparation for fixes as part of #587 2020-06-10 22:01:42 +01:00
S Handley
e0633a238e Update CHANGELOG and a TODO, fix safer deserialisation for inventory
data.
2020-06-04 11:44:33 +00:00
scott-c
bfd97cac7e Fix build error 2020-06-01 22:04:44 +08:00
scott-c
7eb1b2c263 Add level up network event 2020-06-01 22:04:44 +08:00
scott-c
730399b5f4 Add character select network event 2020-06-01 22:04:44 +08:00
scott-c
136bf271b8 Fix social list having incorrect player count 2020-06-01 22:04:44 +08:00
scott-c
c23183b1ca Add character name and level to social window 2020-06-01 22:04:44 +08:00
Justin Shipsey
ea07d744a7 orientation animation 2020-05-27 06:41:55 +00:00
Marcel Märtens
ec03c4518a Change the version number to 0.6 2020-05-16 00:50:40 +02:00
CapsizeGlimmer
0a723614f9 Popup message when setting waypoint 2020-05-14 16:56:10 +00:00
Shane Handley
e852e0cfab - Update the stats of characters individually, reverting the change with
big combined updates.
- Add a timer to the stats persistence system and change the frequency
that it runs to 10s
- Seperate the loading of character data for the character list during
selection, and the full data we will grab during state creation. Ideally
additional persisted bits can get returned at the same point and added
to the ecs within the same block.
2020-05-13 09:14:09 +10:00
Shane Handley
7c6c9f4302 Stats persistence
- Update client code to use persisted stats
- Add a system for stats persistence
- Add a basic scheduler to control duration between execution of
persistence systems
2020-05-13 09:14:08 +10:00
CapsizeGlimmer
49d1225823 Tab completion code review suggestions 2020-05-11 18:02:21 -04:00
CapsizeGlimmer
9d118b55a0 Fixed player list tab completion 2020-05-10 19:17:17 -04:00
S Handley
5a13b54cbf - Load characters after login.
- Make the character screen load with an empty character list from the server, send event to the server for character creation with data, but not yet saving them to the DB.
- Working but messy character saving to DB
- Add the character_data to the client, rather than keep it in the GLobalState.
2020-05-09 15:41:25 +00:00
CapsizeGlimmer
4e7f8c686a Equipped lanterns now provide an illumination effect. 2020-05-04 15:15:31 +00:00
Imbris
c1c09dce1b Enable unequipping as well as equipping to specific slots 2020-04-12 18:41:06 +02:00
Imbris
0b932ae99a Use new slot widget for armor slots 2020-04-12 18:40:53 +02:00
AdamWhitehurst
f515cc70be Documentation for swap_loadout 2020-04-01 07:30:18 -07:00
Imbris
b3791a2b4e Upgrade vek version so that it actually uses the patch 2020-03-30 19:44:51 -04:00
Imbris
df5a7ef0e3 split toggle events 2020-03-27 21:32:30 -04:00
Imbris
3889ec7292 climbing tweaks, fix triple strike overflow, fix Last<CharacterState>
not registered
2020-03-25 02:05:28 -04:00
Imbris
6ba158b7e1 Input handling changes 2020-03-25 01:38:37 -04:00
Adam Whitehurst
db8d89a4d9 * rename CharacterState equals() -> same_variant() 2020-03-22 05:46:09 -07:00
Imbris
41c424ac13 Optimized uses of emitters, cleanup 2020-03-22 00:49:46 -04:00
Imbris
1a484410ca Delete Vel and Ori on the client when they are removed on the server 2020-03-18 17:01:51 -04:00
timokoesters
87acc01d48 Readd ranged and debug boost. Add bouncing while running in first person 2020-03-16 12:32:57 +01:00
timokoesters
aa963b7686 Merge remote-tracking branch 'origin/master' into clientstates 2020-03-15 15:27:06 +01:00
S Handley
bc692c0101 Add audio and chat message feedback when the player attempts to collect something while thier inventory is full. 2020-03-11 10:30:59 +00:00
Imbris
a4eaeb1da6 Merge branch 'imbris/se-latency' into 'master'
Rearrange some operations in the server tick to reduce clientside latency of ServerEvent mediated effects

See merge request veloren/veloren!840
2020-03-10 23:21:57 +00:00
Capucho
16e4214a52 Switch states instead of popping 2020-03-10 20:34:50 +00:00
Capucho
5fe9521233 Fix the spam on disconnect 2020-03-10 20:34:50 +00:00
Capucho
9d805a745e Proper fix to the logout timeout problem using Disconnect ACK 2020-03-10 20:34:50 +00:00
Capucho
d8ba63ffdc Janky fix of the logout timeout problem 2020-03-10 20:34:50 +00:00
Imbris
7132ef4136 Rearrange some operations in the server tick to reduce clientside latency of ServerEvent mediated effects 2020-03-09 22:31:24 -04:00
Acrimon
bc39b78173 Rebased. 2020-03-08 23:02:15 +01:00
Imbris
a04c1b1d1d Add uid to Player component
fix: world examples
2020-03-08 22:58:38 +01:00
Imbris
6cc07270ac improve(login): more precise error handling during login 2020-03-08 22:56:59 +01:00
Acrimon
08b4cc5fc3 Update auth to use new hashing scheme. 2020-03-08 22:56:34 +01:00
Songtronix
ac5ff453cc improve(voxygen): error handling while connecting 2020-03-08 22:54:49 +01:00
Acrimon
7db0ff0b8c Update chat-cli to work properly.
Update reqwest to 0.10.0
2020-03-08 22:54:15 +01:00
Imbris
8ef1251dc2 Add warning prompt for untrusted auth servers, move some auth code into 2020-03-08 22:51:37 +01:00
Acrimon
403deecc6d Server auth handling improvements. 2020-03-08 22:49:47 +01:00
Songtronix
50b845d1c3 :/ and reactivated the password field 2020-03-08 22:34:06 +01:00
Adam Whitehurst
096d3b691e Merge master 2020-03-07 12:49:15 -08:00
Capucho
a97b694dfe Groundwork for fixing #36 and rewrite of client timeouts so that they don't use Instant and Duration 2020-03-05 18:38:39 +00:00
S Handley
b0ca85069b Piggyback on the InventoryUpdate events and attach some additional event info so that we can detect why the inventory update was triggered, and emit an associated sfx event that matches it. 2020-03-04 10:09:48 +00:00
timokoesters
0bc07a0835 Merge remote-tracking branch 'origin/master' into clientstates 2020-02-03 22:02:32 +01:00
Marcel Märtens
dae31ae5b6 apply new rustfmt - touching alot of files 2020-02-01 21:39:39 +01:00
Marcel Märtens
dd21235ff8 Apply prefixes to veloren source, espacially comments, so that reformating wont make it unreadable,
especially enumerations and other source code in errosions file
2020-02-01 21:37:36 +01:00
Marcel Märtens
e960c2233b Change the version number to 0.5 2020-01-31 17:26:45 +01:00
Joshua Barretto
e391d6e4fd Added no-assets feature to common 2020-01-27 22:41:30 +00:00
Joshua Yanovski
3383e991e7 Erosion cleanup, part 1.
Covers all files touched by MR that are not in world/src/sim.
2020-01-23 18:18:17 +01:00
Joshua Yanovski
1358f1dffa Changes to worldgen, adding more sedmient etc. 2020-01-23 18:18:14 +01:00
Joshua Yanovski
14e4dfb53f Re-fix map orientation. 2020-01-23 18:18:13 +01:00
Joshua Yanovski
e91578ffdb Cargo fmt most things (except erosion.rs). 2020-01-23 18:18:12 +01:00
Joshua Yanovski
9520ef4f6d Implement sending world map across the network. 2020-01-23 18:18:11 +01:00
Imbris
3c8d0a3bb9 fix typo, replace u32 with Vec3<u8> in light propagation queue 2020-01-19 16:03:27 -05:00
timokoesters
ae1fa5e4c4 improvement: fog doesn't go back and forth anymore 2020-01-19 16:03:27 -05:00
Adam Whitehurst
d82e93b39f Merge master and build 2020-01-16 05:27:30 -08:00
Piotr Korgól
e1adf40856 Improvement: Replace all '..=b' with '..b + 1' 2020-01-12 15:46:53 +01:00
Monty Marz
851d7858e6 Scrolling Combat Text (SCT) 2020-01-10 00:33:38 +00:00
AdamWhitehurst
de36e75264 Fix imports, update matches 2020-01-08 11:31:42 -08:00
Imbris
ede05c47b0 fix(char screen induced ghosts):
Adds removing extra components and deleting entities clientside when
going back to the character screen. Also, simplifies ClientState by
removing the Dead variant and removing ClientMsg::StateRequest in favor
of more specific ClientMsg variants.
2019-12-31 16:38:13 -05:00
Imbris
ec3e075020 fix(player list): Show players not in range on the player list
fix(overflow): Stops including block updates that fail (since chunks
don't exist on the client) in `TerrainUpdates` (which would trigger
meshing of those nonexistent chunks). Furthermore, removes
remeshing of chunks with block updates if those chunks don't have all their
neighbours (since those wouldn't be meshed in the first place).
2019-12-29 20:51:05 -05:00
Imbris
b2752d2419 Cutout unnecessary Resource syncing machinery and Tracker trait 2019-12-20 22:51:35 -05:00
Imbris
d341073a44 Upgrade to specs 0.15.1 2019-12-20 22:48:14 -05:00
Imbris
e49cafafbf Actually send deletion messages 2019-12-20 22:48:14 -05:00
Imbris
71cce03f29 Move sync code into common submodule 2019-12-20 22:37:12 -05:00
Imbris
609e0f23bf Stop global syncing of entity creation 2019-12-20 22:37:12 -05:00
Songtronix
2f93dd2c38 adjust logging level 2019-11-22 19:12:58 +01:00
Shane Handley
4df7e95331
Add a TODO regarding the future plan for the connection timeout setting. 2019-11-06 21:34:19 +01:00
Shane Handley
15c725bfde
Address code review points:
- Clarify caffeine fueled comment
- Be better at comparing Instant's, and catch the 0 seconds case to say
Goodbye to the user
- Switch println for 'info!'
2019-11-06 21:34:18 +01:00
Shane Handley
fe9ad3fa19
Network timeout updates
- Bugfix: Check whether the server response (pong) is greater than the timeout period, rather than the ping (which will always fire regardless of connection status) This was causing the timeout error event to never fire.

- Feature: Send the player notifications to the chat window that they will be kicked due to disconnection for 6 seconds before kicking them back to the main menu.
2019-11-06 21:34:14 +01:00
soruh
6dfa146484 Mitgated RUSTSEC-2019-0014 by updating noise and
disabling its default features, specifically `image`,
which had the vulnerability.
2019-11-05 11:14:39 +00:00
timokoesters
20248a4818
feat: store items as RON files
When a new item is created, a ron file will be used as a template
2019-10-24 23:47:26 +02:00
Imbris
2703c8afe1 Move serverside client to a component and communications into server ecs systems 2019-10-23 23:50:06 -04:00
Imbris
53ddbec527 Actually fix region removal panic, update fuzzy chunk location, sync entity removal when unloading chunks, region size constant tweak 2019-10-23 22:43:02 -04:00
Imbris
b09bddda79 Make clients subscribed to nearby regions and only send physics updates from those regions. 2019-10-23 22:43:02 -04:00
Acrimon
6f532a7a37 Drastically improved error messages in client and server. 2019-10-23 18:38:09 +02:00
Songtronix
fffffff536 fix(crash): overflowing the stack 2019-10-18 14:19:02 +02:00
Songtronix
5b716515bb change(githash): provide date and hash 2019-10-18 15:32:55 +02:00
Joshua Yanovski
8ae2692b6e 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-10-16 11:39:41 +00:00
Marcel Märtens
20c520a044 Change the version number to 0.4 2019-10-10 15:48:01 +02:00
Nicolas
6e4d556073 Add max chat message length
Fixes #115
Credit to @scorpion9979 for the previous implementation (https://gitlab.com/veloren/veloren/merge_requests/215)
2019-10-04 16:14:54 +02:00
Acrimon
03bf74f414 Updated toolchain version and a bunch of deps. 2019-10-03 17:19:22 -04:00
Joshua Barretto
dff67e1c41 Added block collection, improved controls for it 2019-09-26 00:15:07 +01:00
Joshua Yanovski
b4ad76372b 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
Joshua Barretto
3f2e22f039 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
haslersn
b26043b0e6 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 @ d322384bec | Morton Order @ ec8a7caf42 | 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
haslersn
1796c09ca1 common: Rework volume API
See the doc comments in `common/src/vol.rs` for more information on
the API itself.

The changes include:

* Consistent `Err`/`Error` naming.
  * Types are named `...Error`.
  * `enum` variants are named `...Err`.
* Rename `VolMap{2d, 3d}` -> `VolGrid{2d, 3d}`. This is in preparation
  to an upcoming change where a “map” in the game related sense will
  be added.
* Add volume iterators. There are two types of them:
  * _Position_ iterators obtained from the trait `IntoPosIterator`
    using the method
    `fn pos_iter(self, lower_bound: Vec3<i32>, upper_bound: Vec3<i32>) -> ...`
    which returns an iterator over `Vec3<i32>`.
  * _Volume_ iterators obtained from the trait `IntoVolIterator`
    using the method
    `fn vol_iter(self, lower_bound: Vec3<i32>, upper_bound: Vec3<i32>) -> ...`
    which returns an iterator over `(Vec3<i32>, &Self::Vox)`.
  Those traits will usually be implemented by references to volume
  types (i.e. `impl IntoVolIterator<'a> for &'a T` where `T` is some
  type which usually implements several volume traits, such as `Chunk`).
  * _Position_ iterators iterate over the positions valid for that
    volume.
  * _Volume_ iterators do the same but return not only the position
    but also the voxel at that position, in each iteration.
* Introduce trait `RectSizedVol` for the use case which we have with
  `Chonk`: A `Chonk` is sized only in x and y direction.
* Introduce traits `RasterableVol`, `RectRasterableVol`
  * `RasterableVol` represents a volume that is compile-time sized and has
    its lower bound at `(0, 0, 0)`. The name `RasterableVol` was chosen
    because such a volume can be used with `VolGrid3d`.
  * `RectRasterableVol` represents a volume that is compile-time sized at
    least in x and y direction and has its lower bound at `(0, 0, z)`.
    There's no requirement on he lower bound or size in z direction.
    The name `RectRasterableVol` was chosen because such a volume can be
    used with `VolGrid2d`.
2019-09-06 15:43:31 +02:00
Imbris
52d84248ec Remove all warnings 2019-09-04 19:03:49 -04:00
timokoesters
ecbf7cad5b Remove old code 2019-08-31 09:00:20 +02:00
timokoesters
9a832dd56b Move std::mem::discriminant into new method 2019-08-30 22:51:46 -04:00
timokoesters
b99bac87db Make npcs roll correctly 2019-08-30 22:50:53 -04:00
timokoesters
77a48c61a1 Fix rolling for the player 2019-08-30 22:50:53 -04:00
timokoesters
637b4642d8 Split animations 2019-08-30 22:50:53 -04:00
timokoesters
bd8e71c5aa
Rename activate_inventory_slot to use_inventory_slot 2019-08-30 22:46:45 +02:00
timokoesters
6e1c78e5d5
Add debug mode item giving speed boost in look_dir on click 2019-08-29 19:44:28 +02:00
timokoesters
155605841b
Use comp::Stats to store Equipment, make char weapon selection work 2019-08-29 19:44:28 +02:00
timokoesters
c4879307af
Update to github vek repo 2019-08-26 13:12:45 +02:00
timokoesters
a715a84ea7
Implement unstoppable rolling 2019-08-26 13:12:42 +02:00
timokoesters
5d5ccd7b99
Move from state components to single CharaterState struct
This makes split animations easy and improves overall code quality
2019-08-26 13:12:34 +02:00
Joshua Yanovski
c02f2a7f9e Fixes to worldgen and adding a debug command.
Humidity and temperature are now indexed to uniform altitude *over land
chunks* (and water chunks adjacent to land) rather than over the whole
range of altitude.  This is necessary in order to satisfy the uniformity
conditions of the formula for weighted sum CDF.

Additionally, fixes the computation of whether a tree should be
generated or not.  Previously, it was using a source of randomness
scaled to use much less than the full 0-1 range; this has been resolved.
This makes for much nicer and more gradual transitions between densities
and reduces the amount of completely barren landscapes, while also
making forests larger.

Finally, this commit adds a server command, debug_column, which returns
some useful debug information about a column given an x and y
coordinate.  This is useful for debugging worldgen.
2019-08-26 11:52:25 +02:00
Acrimon
a41cf1a83d Disabled unsafe using lint level. 2019-08-19 14:39:23 +02:00
Acrimon
b4a46f3e6e Finished switch to hashbrown. 2019-08-11 22:38:28 +02:00
Acrimon
22f318833c Migrate client to hashbrown. 2019-08-11 21:54:20 +02:00
telastrus
07d3384b01 fixed the silent kick, made it actually proper 2019-08-08 17:58:36 -04:00
telastrus
66e254db7f actually removed printlns 2019-08-08 12:09:14 -04:00
telastrus
35a3f67e19 ran cargo fmt 2019-08-08 12:05:38 -04:00
telastrus
de2082469d auth done, no popup yet 2019-08-08 12:01:15 -04:00
telastrus
f2ed2870c6 90% there 2019-08-08 11:23:58 -04:00
telastrus
6d94d43021 still compiles 2019-08-07 23:56:02 -04:00
telastrus
157c4816b3 laying the groundwork 2019-08-07 15:42:44 -04:00
Piotr Korgól
d3f2ca69a4 Change the version number to 0.3 2019-08-04 13:53:59 +02:00
Dominik Broński
f644b6ab89 Revert "Merge branch 'imbris/upgrade_specs' into 'master'"
This reverts merge request !375
2019-08-01 23:32:33 +00:00
Imbris
5f56657f6c Upgrade specs to 0.15 2019-08-01 18:09:13 -04:00
Joshua Barretto
39fc1d6b71 Added entity pickup, changed item model 2019-08-01 09:12:00 +01:00
Joshua Barretto
b3cae2f3dd Added better item manipulation 2019-08-01 09:09:26 +01:00
Joshua Barretto
31f8794c39 Started work on inventory manipulation 2019-08-01 09:09:26 +01:00
Joshua Barretto
123a78552a Fixed block-hopping on edges, added correct inventory slots 2019-08-01 09:09:26 +01:00
Joshua Barretto
5bb7998d5a Added inventory sync messages and InventoryUpdate component 2019-08-01 09:09:26 +01:00
timokoesters
b695a63e98 Send different physics components individually 2019-07-30 13:35:16 +02:00
Acrimon
ee49ebe807 Update rand, log and scan_fmt 2019-07-29 13:42:26 +00:00
timokoesters
5aa864ee58
Update most dependencies 2019-07-28 22:47:23 +02:00
tommy
95b5f4acfb Added private, broadcast, and game_state messages 2019-07-26 07:29:37 -04:00
tommy
cc6aa6f33d Adds colour to tells in chat box #194 2019-07-26 07:29:37 -04:00
Nero
53086cb3b2 Nero/light offsets 2019-07-25 20:51:20 +00:00
Joshua Barretto
1dc654dde7 Added object entities 2019-07-21 19:22:49 +01:00
Songtronix
de2dbcef45 add global git hash constant 2019-07-21 17:45:31 +00:00
Joshua Barretto
ce327445a7 Send block diffs instead of entire chunks on block change 2019-07-20 16:41:03 +01:00
Songtronix
ed0d842e57 Mark InvalidAlias Message as to be done 2019-07-17 18:32:01 +02:00