Giter Club home page Giter Club logo

richter's People

Contributors

bors[bot] avatar cormac-obrien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

richter's Issues

Introduce a better syntax for console commands

Currently, console commands have to be registered with extremely clumsy syntax:

cmd_registry.insert("command_name", Box::new(move |args| {
    // body goes here
});

A more elegant syntax might provide named arguments while hiding some of the implementation details (e.g. the Boxing).

util::read_cstring() should handle errors properly

Currently, util::read_cstring() unwraps the result of its read_until() call and returns the result of the String::from_utf8() call. This will be an issue with networking -- clients could DoS the server simply by not null-terminating a string. This may be solved with a ValidationError or some similar type which signals that a client provided invalid data but that the server should not stop.

error: could not compile `richter` (lib) due to previous error; 14 warnings emitted

I'm getting the following error when I do cargo run --bin quake-client. Before this error, I was getting this error #56, which I solved by installing ninja with winget. Before that, I was getting a similar error, which I solved by install cmake. I am on Windows 11.

PS C:\Users\me\Desktop\richter\src\bin> cargo run --bin quake-client
   Compiling gfx-hal v0.8.0
   Compiling shaderc-sys v0.6.3
   Compiling time v0.1.45
   Compiling thread_local v0.3.6
   Compiling aho-corasick v0.6.10
   Compiling arrayvec v0.7.4
   Compiling utf8-ranges v1.0.5
   Compiling claxon v0.4.3
   Compiling itoa v1.0.9
   Compiling hound v3.5.0
   Compiling structopt v0.3.26
   Compiling failure v0.1.8
   Compiling winit v0.22.2 (https://github.com/chemicstry/winit?branch=optional_drag_and_drop#6e7df749)
   Compiling env_logger v0.5.13
   Compiling cgmath v0.17.0
   Compiling num v0.1.42
   Compiling png v0.16.8
   Compiling rand v0.7.3
   Compiling nom v5.1.3
   Compiling futures v0.3.28
   Compiling serde_json v1.0.104
   Compiling regex v0.2.11
   Compiling uluru v2.2.0
   Compiling chrono v0.4.26
   Compiling strum v0.18.0
   Compiling bumpalo v3.13.0
   Compiling rodio v0.11.0 (https://github.com/RustAudio/rodio?rev=82b4952#82b49524)
   Compiling gfx-auxil v0.9.0
   Compiling gfx-backend-empty v0.8.0
   Compiling gfx-backend-vulkan v0.8.0
   Compiling gfx-backend-dx12 v0.8.0
   Compiling gfx-backend-dx11 v0.8.0
   Compiling wgpu-core v0.8.2
   Compiling wgpu v0.8.1
   Compiling shaderc v0.6.3
   Compiling richter v0.1.0 (C:\Users\me\Desktop\richter)
warning: unused import: `iter::FromIterator`
 --> src\client\render\ui\hud.rs:1:33
  |
1 | use std::{collections::HashMap, iter::FromIterator};
  |                                 ^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `arrayvec::ArrayVec`
  --> src\client\render\ui\hud.rs:22:5
   |
22 | use arrayvec::ArrayVec;
   |     ^^^^^^^^^^^^^^^^^^

warning: unused import: `std::cell::RefCell`
 --> src\client\render\ui\mod.rs:8:5
  |
8 | use std::cell::RefCell;
  |     ^^^^^^^^^^^^^^^^^^

warning: unused imports: `DynamicUniformBufferBlock`, `QuadUniforms`, `self`, `util::any_slice_as_bytes`
  --> src\client\render\ui\mod.rs:19:59
   |
19 |                 quad::{QuadRenderer, QuadRendererCommand, QuadUniforms},
   |                                                           ^^^^^^^^^^^^
20 |             },
21 |             uniform::{self, DynamicUniformBufferBlock},
   |                       ^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^
...
25 |     common::{console::Console, util::any_slice_as_bytes},
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: `InnerSpace`, `Vector2`
 --> src\client\render\warp.rs:5:14
  |
5 | use cgmath::{InnerSpace, Vector2, Vector3};
  |              ^^^^^^^^^^  ^^^^^^^

warning: unused imports: `model::Model`, `net::SignOnStage`
   --> src\client\render\mod.rs:102:9
    |
102 |         model::Model,
    |         ^^^^^^^^^^^^
103 |         net::SignOnStage,
    |         ^^^^^^^^^^^^^^^^

warning: unused import: `InnerSpace`
   --> src\client\render\mod.rs:111:19
    |
111 | use cgmath::{Deg, InnerSpace, Vector3, Zero};
    |                   ^^^^^^^^^^

warning: unused import: `Duration`
   --> src\client\render\mod.rs:112:24
    |
112 | use chrono::{DateTime, Duration, Utc};
    |                        ^^^^^^^^

warning: unused import: `BufReader`
  --> src\client\sound\mod.rs:26:16
   |
26 |     io::{self, BufReader, Cursor, Read},
   |                ^^^^^^^^^

warning: unused import: `chrono::Duration`
  --> src\common\bsp\load.rs:40:5
   |
40 | use chrono::Duration;
   |     ^^^^^^^^^^^^^^^^

warning: unused import: `std::path::PathBuf`
  --> src\common\mod.rs:38:5
   |
38 | use std::path::PathBuf;
   |     ^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> src\lib.rs:19:12
   |
19 | #![feature(drain_filter)]
   |            ^^^^^^^^^^^^

warning: use of deprecated method `std::error::Error::description`: use the Display impl or to_string()
   --> src\common\bsp\mod.rs:173:42
    |
173 |             BspError::Io(ref err) => err.description(),
    |                                          ^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated method `std::error::Error::description`: use the Display impl or to_string()
  --> src\common\net\mod.rs:98:42
   |
98 |             NetError::Io(ref err) => err.description(),
   |                                          ^^^^^^^^^^^

warning: unreachable expression
   --> src\server\mod.rs:956:9
    |
954 |         todo!("SV_CheckWaterTransition");
    |         -------------------------------- any code following this expression is unreachable
955 |
956 |         Ok(())
    |         ^^^^^^ unreachable expression
    |
    = note: `#[warn(unreachable_code)]` on by default

For more information about this error, try `rustc --explain E0554`.
warning: `richter` (lib) generated 14 warnings
error: could not compile `richter` (lib) due to previous error; 14 warnings emitted

Where can I find the `id1` directory?

The README says

This works for demos in the PAK archives (e.g. demo1.dem) or any demos you happen to have placed in the id1 directory.

Where can I find this directory?

This may seem obvious to you but not to me.

I installed Quake through Steam. In the installation folder, I have this folder D:\SteamLibrary\steamapps\common\Quake\Id1. Is this the directory you're referring to? That directory contains some .PAK files indeed. In any case, it's spelled differently (uppercase) and so we need to change the code or rename the folder.

I tried to run

cargo +nightly run --bin quake-client --base-dir "D:\SteamLibrary\steamapps\common\Quake"

or

cargo +nightly run --bin quake-client --target-dir "D:\SteamLibrary\steamapps\common\Quake"

But this doesn't seem to work because it can't find the ld1 folder, even if I rename the string in the code.

Moreover, what do you mean by "demos"? Where can we find them?

Cant compile shaderc-rs due to python

On linux ubuntu and im totally stuck.

Running 'python --version' gives 3.8.10 . I alrdy aliased 'python' to 'python3' so it should be fine.

Then running cargo build gives:

warning: Checking for system installed libraries. Use --features = build-from-source to disable this behavior
warning: System installed library not found. Falling back to build from source

error: failed to run custom build command for shaderc-sys v0.6.3

Caused by:
process didn't exit successfully: /home/andy/rust/richter/target/debug/build/shaderc-sys-f89ed4c0ddc2d59e/build-script-build (exit status: 101)
--- stdout
cargo:warning=Checking for system installed libraries. Use --features = build-from-source to disable this behavior
cargo:warning=System installed library not found. Falling back to build from source

--- stderr
thread 'main' panicked at '

couldn't find required command: "python"

???

Understanding the outcomes of Google Summer of Code

Dear Cormac O'Brien,

I am a Ph.D. student at the University of São Paulo (Brazil). We would like to understand how and how much Open Source Communities benefit from participating in Google Summer of Code (GSoC). We believe that your experience in GSoC is valuable and could help us achieve that. In a 1-minute questionnaire, we would like to know:

Concerning the project entitled "Implementing Mac OS 9 support" developed in GSoC 2015.

  1. Do you have a GitHub repository for the GSoC project? If so, could you provide us with the link to the project?

  2. Have you continued committing code or opening issues to the GSoC project after GSoC? (Yes / No) If so, code, issues or both?

  3. Have you continued committing code or opening issues to other OSS projects after GSoC? (Yes / No) If so, code, issues or both?

  4. Could we use aggregate data from your participation in GSoC and other OSS projects in our research?

The following link contains a sample of our work and how we would use your data:
https://ieeexplore.ieee.org/document/8094410/

Regards,

Jefferson

OS X SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING Unsupported?

OS X 10.15.3 w/ Radeon Pro 5300M — SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING seems to report as Unsupported

     Running `target/release/quake-client --demo demo.dem`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: UnsupportedFeature(SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING)', /Users/dnwe/.cargo/git/checkouts/wgpu-rs-40ea39809c03c5d8/08497ce/src/backend/direct.rs:516:118
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::result::unwrap_failed
   9: wgpu::backend::direct::<impl wgpu::Context for wgpu_core::hub::Global<wgpu_core::hub::IdentityManagerFactory>>::adapter_request_device
  10: wgpu::Adapter::request_device
  11: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  12: std::thread::local::LocalKey<T>::with
  13: futures_executor::local_pool::block_on
  14: quake_client::main
  15: std::rt::lang_start::{{closure}}
  16: std::rt::lang_start_internal
  17: main

It's strange as wgpu seems to claim Metal on macOS 10.13+ should be supported for this:
https://github.com/gfx-rs/wgpu/blob/11b3a95671d096aae2eac0d187be5472b5ab91c0/wgpu-types/src/lib.rs#L172-L184

Is this something you've seen before?

couldn't find required command: "ninja"

I'm getting the following error if I execute cargo run --bin quake-client under src/bin on Windows 11.

The following warnings were emitted during compilation:                                                                                      

warning: System installed library not found.  Falling back to build from source

error: failed to run custom build command for `shaderc-sys v0.6.3`

Caused by:
  process didn't exit successfully: `C:\Users\me\Desktop\richter\target\debug\build\shaderc-sys-0be2fae614d70684\build-script-build` (exit code: 101)
  --- stdout
  cargo:warning=System installed library not found.  Falling back to build from source

  --- stderr
  thread 'main' panicked at '

  couldn't find required command: "ninja"

  ', C:\Users\me\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shaderc-sys-0.6.3\build\cmd_finder.rs:50:13
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

I'm not familiar with ninja. I was getting a similar error before but for cmake, so I installed cmake. I suppose I also need to install ninja, but given that I am unfamiliar with it, I'd like first to understand why I need to do it and what the recommended way to install this tool on Windows is.

more lasers; fireballs

this engine is severely lacking the ability to create lasers. I am also disappointed in the lack of any fireball functionality. good luck marketing this engine to any gamedevs in 2018.

Adhere to Rust read/write naming conventions

The Read and Write traits in the standard library generally follow this convention:

  • src.read(&dst) reads data from src into dst
  • dst.write(&src) writes data to dst from src

Similarly, the ReadBytesExt and WriteBytesExt traits of byteorder read from and write to the caller, respectively.

Currently, some functions in the Richter API do not follow this convention. For instance, net::Cmd::write_content() writes data from the calling object instead of writing to it. Ideally, functions with this problem should be renamed to avoid confusion.

Can't compile because of `wgpu-core`

on running rustup run nightly cargo build:

$ rustup run nightly cargo build
   Compiling wgpu-core v0.8.1
   Compiling shaderc-sys v0.6.3
   Compiling shaderc v0.6.3
error[E0597]: `desc_set` does not live long enough
    --> /home/leonard/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.8.1/src/device/mod.rs:1773:26
     |
1773 |                     set: desc_set.raw_mut(),
     |                          ^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
...
1794 |     }
     |     -
     |     |
     |     `desc_set` dropped here while still borrowed
     |     borrow might be used here, when `write_map` is dropped and runs the `Drop` code for type `BTreeMap`
     |
     = note: values in a scope are dropped in the opposite order they are defined

For more information about this error, try `rustc --explain E0597`.
error: could not compile `wgpu-core` due to previous error
$

Implement all client console commands

This is the major tracking issue for all client-side console commands.

  • alias -- implemented in 2044803
  • bind -- implemented in 6b23e61
  • bf
  • cd
  • centerview
  • clear
  • cmd
  • color
  • com1 / com2
  • connect -- implemented in e389a52
  • disconnect -- implemented in e389a52
  • echo -- implemented in c17b72f
  • exec -- implemented in 9cf091d
  • flush
  • god
  • help
  • impulse -- implemented in 76a43a5
  • menu_keys
  • menu_load
  • menu_main
  • menu_multiplayer
  • menu_options
  • menu_quit
  • menu_save
  • menu_setup
  • menu_singleplayer
  • menu_video
  • messagemode
  • messagemode2
  • net_stats
  • path
  • pause
  • ping
  • play
  • playdemo
  • playvol
  • pointfile
  • profile
  • quit
  • reconnect -- implemented in e389a52
  • record
  • restart
  • save
  • say
  • say_team
  • sizedown
  • sizeup
  • slist
  • soundlist
  • startdemos
  • status
  • stop
  • stopdemo
  • stopsound
  • stuffcmds
  • tell
  • test
  • test2
  • timerefresh
  • timedemo
  • toggleconsole -- implemented in 4efa19e
  • togglemenu
  • unbind
  • unbindall
  • version
  • vid_describecurrentmode
  • vid_describemode
  • vid_describemodes
  • vid_mode
  • vid_nummodes
  • vid_testmode
  • wait

This list is unlikely to be comprehensive and may contain commands that are actually server-side. Feel free to submit corrections.

Suggestion: Implement HDR shading with tonemapping

In my project where I've been rendering Quake 2 maps (https://github.com/Vurich/goeld) I implemented tonemapping, by rendering everything to Rg11b10Float and then using an implementation of ACES tonemapping on the luminance value of each pixel (shader here). This makes the whole world look way better, and I can't recommend it enough - especially since you've already got a post-processing step. It makes everything in shadow a lot easier to see, and makes the image more cohesive overall. Check out some of the screenshots in the readme. You may need to play with the gamma and intensity amounts until you get something that looks pretty good, but it shouldn't be too tough to implement. Modern HDR rendering uses adaptive gamma, but old games designed their maps around having a single gamma value so you don't need to implement anything like that.

Choose new graphics backend

Tomaka has officially dropped support for Glium, which means we need a new graphics backend. Vulkano looks the most promising, despite being a switch from OpenGL to Vulkan.

NoSuchFile("gfx/palette.lmp")

$ cargo run --release --bin quake-client -j2 -- --connect 198.74.54.53:27964

...

INTEL-MESA: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoSuchFile("gfx/palette.lmp")', src/client/render/palette.rs:34:54
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I suppose this is because I didnt add the original resources from quake 3, but I cant find any instructions how to do that. Do I have to dump it directly into the richter folder?

Edit: Okay I figured it out, Quake 1 files go into the id folder inside the repo. But then I just get to a terminal with many errors, and no clue how to load a map or anything.

Could not build shaders : cmake missing

On ubuntu, cloned devel and ran 'cargo build'. Got this :

The following warnings were emitted during compilation:

warning: Checking for system installed libraries. Use --features = build-from-source to disable this behavior
warning: System installed library not found. Falling back to build from source

error: failed to run custom build command for shaderc-sys v0.6.3

Caused by:
process didn't exit successfully: /home/andy/rust/richter/target/debug/build/shaderc-sys-f89ed4c0ddc2d59e/build-script-build (exit status: 101)
--- stdout
cargo:warning=Checking for system installed libraries. Use --features = build-from-source to disable this behavior
cargo:warning=System installed library not found. Falling back to build from source

--- stderr
thread 'main' panicked at '

couldn't find required command: "cmake"

Missing `/music` folder prevents engine from loading level

If the id1 folder does not contain a /music subfolder with music files (which is the case for most distributions of Quake 1), the engine does not load a level, and instead just shows the console. IMHO in case the music is missing the game should log a warning and move on.

The engine prints the following to stdout:

ERROR 2022-09-11T11:56:41Z: quake_client::game: Failed to load sound: No such music track: track02

This should not be a hard error, and from reading the code I don't understand why it prevents the level from loading.

Problem with max_push_constant_size at 256 with my vulkan device

Hi, I'm trying to upgrade Richter to wgpu 0.11 version. (by the way, congratulations on the name of the project, it took me a while to understand it but then it made me smile).

You can find my efforts here: https://github.com/CatCode79/richter

the problem is that my device, using vulkan api, only supports up to 128 bytes of push constants, while Richter uses up to 256 bytes: a Matrix4x4 (so 128 bytes) + other values ​​sometime.

For me who do not know the code it is not trivial to solve this thing.
The limits per vulkan for that variable are a minimum of 128 in the official documentation.

Here the line:

max_push_constant_size: 256,

Is there a chance the code could support the 128 byte limit or will it stay that way?

Thanks for your project: I like it a lot!
bye!

Is this project dead?

It seems that this interesting project is dead. No commit has been done for a long time. There's the Antiquake fork, but the activity there's also low. Do you plan to continue to work on this or can this be considered abandoned?

Ensure type/memory safety in QuakeC bytecode interpreter

The original Quake's bytecode interpreter is extremely memory-unsafe. There is no runtime type checking or bounds checking. While this is probably much faster than a safer system, it's guaranteed to be a nightmare to debug.

Because the original engine effectively loads progs.dat directly into memory as one large block, it should be possible to determine the type of every memory location and validate each instruction to ensure instructions are only interacting with data of the correct type.

Because operands are given as memory offsets in 4-byte increments and not as identifiers, runtime memory accesses will still be unsafe, either by std::mem::transmute()ing the data at the given offset to the correct type or by reinterpreting memory as a &[u8] and reading/writing primitives with byteorder. A better system will be assessed once load-time argument validation is finished.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.