cormac-obrien / richter Goto Github PK
View Code? Open in Web Editor NEWA modern Quake engine.
Home Page: http://c-obrien.org/richter/
License: MIT License
A modern Quake engine.
Home Page: http://c-obrien.org/richter/
License: MIT License
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 Box
ing).
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.
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
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?
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"
???
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.
Do you have a GitHub repository for the GSoC project? If so, could you provide us with the link to the project?
Have you continued committing code or opening issues to the GSoC project after GSoC? (Yes / No) If so, code, issues or both?
Have you continued committing code or opening issues to other OSS projects after GSoC? (Yes / No) If so, code, issues or both?
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
Might make sense to just use nom
for this as well.
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?
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.
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.
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.
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
$
This may affect other window managers as well.
hi
how can i add amazon boys and grirls clothing dataset to cornac
This is the major tracking issue for all client-side console commands.
alias
-- implemented in 2044803bind
-- implemented in 6b23e61bf
cd
centerview
clear
cmd
color
com1
/ com2
connect
-- implemented in e389a52disconnect
-- implemented in e389a52echo
-- implemented in c17b72fexec
-- implemented in 9cf091dflush
god
help
impulse
-- implemented in 76a43a5menu_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 e389a52record
restart
save
say
say_team
sizedown
sizeup
slist
soundlist
startdemos
status
stop
stopdemo
stopsound
stuffcmds
tell
test
test2
timerefresh
timedemo
toggleconsole
-- implemented in 4efa19etogglemenu
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.
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.
The official guideline from the Rust project is to .gitignore
Cargo.lock
only when building a library. Since richter is intended as an end user binary (or set of binaries), it should include the lockfile in the repository.
This sometimes results in a crash when arrowing from a longer line to a shorter one.
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.
It has been deprecated: announcement.
Looks like this is blocked by docopt/docopt.rs#128. I will follow up in this issue when they have a new release ready.
$ 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.
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"
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.
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:
richter/src/bin/quake-client/main.rs
Line 125 in 506504d
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!
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?
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.
The Cargo.toml
file has a comment that states that you temporarily used a version of winit
with a bug fix. However, this bug fix has already been merged: https://github.com/rust-windowing/winit/pull/1524/files. So, that dependency can be updated
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.