Commit Graph

362 Commits

Author SHA1 Message Date
Bryant Deters
ff5b8e440d scan_fmt -> 0.2.6 2021-03-15 17:48:21 -05:00
Avi Weinstock
a71bacdce0 Add machinery for storing component buffers for interpolation. 2021-03-14 23:20:47 -04:00
Christof Petig
15b11d9154 Implement /price_list (work in progress), stub for /buy and /sell
remove outdated economic simulation code

remove old values, document

add natural resources to economy

Remove NaturalResources from Place (now in Economy)

find closest site to each chunk

implement natural resources (the distance scale is wrong)

cargo fmt

working distance calculation

this collection of natural resources seem to make sense, too much Wheat though

use natural resources and controlled area to replenish goods

increase the amount of chunks controlled by one guard to 50

add new professions and goods to the list

implement multiple products per worker

remove the old code and rename the new code to the previous name

correctly determine which goods guards will give you access to

correctly estimate the amount of natural resources controlled

adapt to new server API

instrument tooltips

Now I just need to figure out how to store a (reference to) a closure

closures for tooltip content generation

pass site/cave id to the client

Add economic information to the client structure
(not yet exchanged with the server)

Send SiteId to the client, prepare messages for economy request
Make client::sites a HashMap

Specialize the Crafter into Brewer,Bladesmith and Blacksmith

working server request for economic info from within tooltip

fully operational economic tooltips
I need to fix the id clash between caves and towns though

fix overlapping ids between caves and sites

display stock amount

correctly handle invalid (cave) ids in the request

some initial balancing, turn off most info logging

less intrusive way of implementing the dynamic tool tips in map

further tooltip cleanup

further cleanup, dynamic tooltip not fully working as intended

correctly working tooltip visibility logic

cleanup, display labor value

separate economy info request in a separate translation unit

display values as well

nicer display format for economy

add last_exports and coin to the new economy

do not allocate natural resources to Dungeons (making town so much larger)

balancing attempt

print town size statistics

cargo fmt (dead code)

resource tweaks, csv debugging

output a more interesting town (and then all sites)

fix the labor value logic (now we have meaningful prices)

load professions from ron (WIP)

use assets manager in economy

loading professions works

use professions from ron file

fix Labor debug logic

count chunks per type separately
(preparing for better resource control)

better structured resource data

traders, more professions (WIP)

fix exception when starting the simulation

fix replenish function
TODO:
- use area_ratio for resource usage (chunks should be added to stock, ratio on usage?)
- fix trading

documentation clean up

fix merge artifact

Revise trader mechanic

start Coin with a reasonable default

remove the outdated economy code

preserve documentation from removed old structure

output neighboring sites (preparation)

pass list of neighbors to economy

add trade structures

trading stub

Description of purpose by zesterer on Discord

remember prices (needed for planning)

avoid growing the order vector unboundedly

into_iter doesn't clear the Vec, so clear it manually

use drain to process Vecs, avoid clone

fix the test server

implement a test stub (I need to get it faster than 30 seconds to be more useful)

enable info output in test

debug missing and extra goods

use the same logging extension as water, activate feature

update dependencies

determine good prices, good exchange goods

a working set of revisions

a cozy world which economy tests in 2s

first order planning version

fun with package version

buy according to value/priority, not missing amount

introduce min price constant, fix order priority

in depth debugging

with a correct sign the trading plans start to make sense

move the trade planning to a separate function

rename new function

reorganize code into subroutines (much cleaner)

each trading step now has its own function

cut down the number of debugging output

introduce RoadSecurity and Transportation

transport capacity bookkeeping

only plan to pay with valuable goods, you can no longer stockpile unused options
(which interestingly shows a huge impact, to be investigated)

Coin is now listed as a payment (although not used)

proper transportation estimation (although 0)

remove more left overs uncovered by viewing the code in a merge request

use the old default values, handle non-pileable stocks directly before increasing it
(as economy is based on last year's products)

don't order the missing good multiple times
also it uses coin to buy things!

fix warnings and use the transportation from stock again

cargo fmt

prepare evaluation of trade

don't count transportation multiple times

fix merge artifact

operational trade planning
trade itself is still misleading

make clippy happy

clean up

correct labor ratio of merchants (no need to multiply with amount produced)

incomplete merchant labor_value computation

correct last commit

make economy of scale more explicit

make clippy happy (and code cleaner)

more merchant tweaks (more pop=better)

beginning of real trading code

revert the update of dependencies

remove stale comments/unused code

trading implementation complete (but untested)

something is still strange ...

fix sign in trading

another sign fix

some bugfixes and plenty of debugging code

another bug fixed, more to go

fix another invariant (rounding will lead to very small negative value)

introduce Terrain and Territory

fix merge mistakes
2021-03-14 03:18:32 +00:00
Marcel Märtens
c1d6b1ac75 handle ticks in a seperate thread that tui on botclient 2021-03-12 11:08:24 +01:00
Marcel Märtens
e001b2cac2 move botclient to client/src/bin/bot
start it with:
 - (cd client && RUST_BACKTRACE=full RUST_LOG=trace VELOREN_USERDATA_STRATEGY=executable cargo run --bin bot --features="bin_bot")
2021-03-12 09:28:24 +01:00
Avi Weinstock
7301182695 Draft of botclient. 2021-03-12 09:28:21 +01:00
Marcel Märtens
728bff610b Allow HTTP auth servers again.
only `localhost` are allowed in a release build.
 when debug assertions are on, others are also allowed.

This change undoes the changes to the settings, so compared to master, there is no effect
2021-03-11 17:24:52 +01:00
Marcel Märtens
a98e72c391 Auth requests are now done async, the register system is fetching it, via a PendingLogin component
The auth server no longer allows the protocol to be specified. we enforce `https` for the auth server, so DO NOT provide a auth url with `https://` but without.
correct is now `auth.veloren.net`
incorrect is: `https://auth.veloren.net`
2021-03-11 17:05:02 +01:00
Marcel Märtens
b151a246c3 update specs to get rid of old deps 2021-03-10 13:22:17 +01:00
Bryan Quigley
506adb4eec Stop requiring specfici euc version (was done to hold back vek version)
Then ran cargo update
2021-03-09 15:53:24 -08:00
Marcel Märtens
d7df741671 update dependencies, including removal of some tracy deps as they are get through common/tracy 2021-03-09 20:17:29 +01:00
Marcel Märtens
4ebfbdde0f Move Specs code to own common_ecs create, put tracy and macros into common_base 2021-03-09 00:54:01 +01:00
Marcel Märtens
c515fece28 Implement a VSystem trait that can be implemented by Systems.
It will autodo some things, like track start and time and export those in system metrics
Add a origin and implement it for all Systems in Veloren
2021-03-08 11:51:04 +01:00
Joshua Barretto
e42be14a37 Updated lockfile dependencies 2021-03-07 16:55:58 +00:00
Joshua Barretto
862cd5fe49 fmt 2021-03-07 14:25:03 +00:00
Joshua Barretto
7d94c3600f New town layouts, initial progress 2021-03-07 14:25:02 +00:00
Joshua Barretto
82a25e49ef Began integrating procgen trees 2021-03-07 14:25:00 +00:00
Joshua Yanovski
2dd7089e52 Bring vek up to date so we can bump rustc (hopefully). 2021-03-04 05:46:59 +01:00
Sam
3d57db9485 Test fix for torvus 2021-02-23 14:38:58 -05:00
ccgauche
4b1c033f6e Added scopeguard to protect against unwind 2021-02-23 13:58:13 +01:00
ccgauche
267e7d8b4c Finalized Retrieve API 2021-02-22 23:59:41 +01:00
ccgauche
06aa7ab70c Retrieves added + New ECS memory layout for plugins 2021-02-22 23:59:32 +01:00
ccgauche
1597fcc79e Fixed the plugin compilation and added comments
TODO: Remove compilation errors on WASM side (while using common).
2021-02-22 23:59:25 +01:00
Marcel Märtens
3f5c64bec0 Client::new can now resolve DNS requests, better networking error messages 2021-02-22 17:35:19 +01:00
Marcel Märtens
514d5db038 Update Network Protocol
- now last digit version is compatible 0.6.0 will connect to 0.6.1
 - the TCP DATA Frames no longer contain START field, as it's not needed
 - the TCP OPENSTREAM Frames will now contain the BANDWIDTH field
 - MID is not Protocol internal

Update network
 - update API with Bandwidth

Update veloren
 - introduce better runtime and `async` things that are IO bound.
 - Remove `uvth` and instead use `tokio::runtime::Runtime::spawn_blocking`
 - remove futures_execute from client and server use tokio::runtime::Runtime instead
 - give threads a Name
2021-02-22 17:34:55 +01:00
Caelan
82c33d9ccb Backdate coreaudio-sys for OSX cross toolchain compatibility
See https://github.com/RustAudio/coreaudio-sys/issues/48
2021-02-19 15:46:36 -08:00
Marcel Märtens
03af9937cf Stabelize Network again:
- completly switch to Bytes, even in api. speed up TCP by fak 2
 - improve benchmarks
 - speed up mpsc metrics
 - gracefully handle shutdown by interpreting Ok(0) as tokio::tcpstream closed now.
 - fix hotloop in participants by adding `Some(n)` to fix endless handing.
 - fix closing bug by closing streams after `recv_mgr` is shutdown even if now shutdown is triggered locally.
 - fix prometheus
 - no longer throw when a `Stream` is dropped while participant still receives a msg for it.
 - fix the bandwith handling, TCP network send speed is up to 1.5GiB/s while recv is 150MiB/s
 - add documentation
 - tmp require rt-multi-threaded in client for tokio, to not fail cargo check

this is prob stable, i tested over 1 hour.
after that some optimisations in priomgr.
and impl. propper bandwith.
Speed is up to 2GB/s write and 150MB/s recv on a single core

sync add documentation
2021-02-17 19:37:48 +01:00
Marcel Märtens
ea8ab1ce7a Great improvements to the codebase:
- better logging in network
 - we now notify the send of what happened in recv in participant.
 - works with veloren master servers
 - works in singleplayer, using a actual mid.
 - add `mpsc` in whole stack incl tests
 - speed up internal read/write with `Bytes` crate
 - use `prometheus-hyper` for metrics
 - use a metrics cache
2021-02-17 16:15:00 +01:00
Marcel Märtens
9884019963 COMPLETE REDESIGN of network crate
- Implementing a async non-io protocol crate
    a) no tokio / no channels
    b) I/O is based on abstraction Sink/Drain
    c) different Protocols can have a different Drain Type
       This allow MPSC to send its content without splitting up messages at all!
       It allows UDP to have internal extra frames to care for security
       It allows better abstraction for tests
       Allows benchmarks on the mpsc variant
       Custom Handshakes to allow sth like Quic protocol easily
 - reduce the participant managers to 4: channel creations, send, recv and shutdown.
   keeping the `mut data` in one manager removes the need for all RwLocks.
   reducing complexity and parallel access problems
 - more strategic participant shutdown. first send. then wait for remote side to notice recv stop, then remote side will stop send, then local side can stop recv.
 - metrics are internally abstracted to fit protocol and network layer
 - in this commit network/protocol tests work and network tests work someway, veloren compiles but does not work
 - handshake compatible to async_std
2021-02-17 12:39:47 +01:00
Marcel Märtens
5aa1940ef8 get rid of async_std::channel
switch to `tokio` and `async_channel` crate.
I wanted to do tokio first, but it doesnt feature Sender::close(), thus i included async_channel
Got rid of `futures` and only need `futures_core` and `futures_util`.

Tokio does not support `Stream` and `StreamExt` so for now i need to use `tokio-stream`, i think this will go in `std` in the future

Created `b2b_close_stream_opened_sender_r` as the shutdown procedure does not need a copy of a Sender, it just need to stop it.

Various adjustments, e.g. for `select!` which now requieres a `&mut` for oneshots.

Future things to do:
 - Use some better signalling than oneshot<()> in some cases.
 - Use a Watch for the Prio propergation (impl. it ofc)
 - Use Bounded Channels in order to improve performance
 - adjust tests coding

bring tests to work
2021-02-17 12:38:53 +01:00
Marcel Märtens
1b77b6dc41 Initial switch to tokio for network, minimum working example. 2021-02-17 12:37:59 +01:00
Caelan
dda4931f46 Clean and update dependencies
* Remove tweak feature
 * Remove const-tweaker
 * Update tiny_http
 * Update bitvec to 0.21.0
 * Downgrade euc to avoid conflict with vek 0.12.0
 * Require exactly vek 0.12.0
 * Update all other dependencies automatically based on these changes
 * Update gilrs to latest at the request of Ada Lovegirls
 * Update meshing benchmarks to new criterion API
2021-02-17 01:27:06 -08:00
Joshua Barretto
4d19308612 Merge branch 'lboklin/quat-ori' into 'master'
Redefine Ori as a quaternion

See merge request veloren/veloren!1755
2021-02-16 22:39:11 +00:00
Lippy13
23d2a7ca10 Fix compile error under Windows 2021-02-10 03:38:01 +00:00
Ludvig Böklin
582ddfc3cd Ori: add tests, rename to_vec() => look_vec(); Dir: add methods, normalize on rot 2021-02-09 13:52:03 +01:00
Imbris
357cb26e05 Update native_dialog to 0.5.2 2021-02-07 00:48:57 -05:00
James Melkonian
1d8496ea21 Move agent system to server 2021-02-06 06:15:25 +00:00
jiminycrick
8b97199245 Update rand dependency 2021-01-26 20:35:08 -08:00
Imbris
adaea096d2 Update winit and iced 2021-01-23 01:09:33 -05:00
Acrimon
b464a1876e
update itertools for voxygen 2021-01-20 16:00:08 +01:00
Acrimon
9f16a946ee
update a few deps 2021-01-20 15:53:58 +01:00
Ben Wallis
aef2637288 Refactored loadout to have public functions for each slot instead of requiring callers to use the _INDEX consts 2021-01-08 19:12:09 +00:00
ccgauche
885c0b3b2c Update lock 2021-01-08 16:57:29 +01:00
Joshua Barretto
1604616768 Merge branch 'ccgauche/new-wasmer-backend' into 'master'
ccgauche/new wasmer backend

See merge request veloren/veloren!1644
2021-01-08 08:48:31 +00:00
ccgauche
06ffe61219 Added feature flag
changed field name to size
2021-01-08 08:48:30 +00:00
Joshua Barretto
a4b9230f03 fixed Cargo.lock conflict
Fixed `crossbeam-queue` being referenced  twice in the lockfile
2021-01-07 20:25:12 +00:00
jiminycrick
aceac9e205 Upgrade noise eliminating old rand dependency 2021-01-05 10:10:47 -08:00
Acrimon
e76474463a
update authc 2020-12-28 16:42:40 +01:00
Benoît du Garreau
989683d2d3 Improve world::Index 2020-12-17 12:08:04 +01:00
Benoît du Garreau
0cf164f33a Use assets_manager to load assets 2020-12-17 12:06:07 +01:00