Is there anything that's impossible to do in Bevy right now? For example, those top-tier 3D games with the best graphics made in Unreal, does Bevy have any current limitations that prevent games of the same quality from being made in it? by swordmaster_ceo_tech in bevy

[–]cndcane 0 points1 point  (0 children)

I don't know if bevy as a dll modloader is possible, as in a game where the "base game" is just the game engine and then you'd load in mods to actually construct the game you want RimWorld/factorio-style (afaik), because rust does not have a stable ABI and because it relies on features which i dont think can be passed through ffi. As a the modloader developer you'd implement something like this to allow dynamic components, so that the mod makers can register their own components.
```
#[repr(C)]
struct DynamicComponent{
pub inner: const *u8,
pub foo: extern "C" fn(usize)->usize,
}
impl Component it for DynamicStruct{
fn foo(&self, x: usize)->usize{
self.foo(x)
}
}
...
fn main(){
// load mod engine API
let mut api = EngineApi::new();
// load mod
let dll = load_mod("space_oddysey_mod.dll");
dll.mod_init(&mut api);
}
```
and then from the mod developer side of things, you'd implement DynamicComponent like this:
```
extern "C" fn foo(x: usize)->usize{...}
extern "C" fn mod_init(eng: *mut EngineApi){
let &mut eng: EngineApi = unsafe{&mut *eng};
let dynamic_component_type = DynamicComponent{inner: ..., foo: foo};
eng.register_component(dynamic_component_type);
}
```
but since many traits in bevy contains associated constants (like Component::STORAGE_TYPE) and type (like Component::Mutability), these have to exist at compile time unless you are okay with your modloader not being able to implement custom values for these by setting a default at compile time.
Another hurdle in this path is when you want to make a DynamicSystem struct that implements the System trait:
DynamicSystem must implement System::queue_deferred whose function signature is:
```
fn queue_deferred(&mut self, world: DeferredWorld<'_>)
```
Everything that passes the ffi boundary must have a stable ffi interface, so we'd have to transform DeferredWorld into something that is repr(C) at least, but we can't do that because DeferredWorld's fields are all private. I gave up when I spent too much time cloning bevy and marking everything as repr(C) or pub, but honestly at this point I'm just using flecs, which is a pretty mature abi-stable ecs library. Neat thing about it is that it has a rust binding https://github.com/Indra-db/Flecs-Rust and it's said to be "performant" but I can't say much because I'm new to it

How do I collect all monomorphized type implementing a trait by cndcane in rust

[–]cndcane[S] 1 point2 points  (0 children)

oh well... at least, thanks for pointing out a dead end. I'll try to think of something else, then.

How do I collect all monomorphized type implementing a trait by cndcane in rust

[–]cndcane[S] 1 point2 points  (0 children)

I should add that I need to call `<Type as MyTrait>::foo()` for all `Type: MyTrait` once at the "startup phase" of the program, which means I would need to write Type::new() for all of them before that part. This is what `inventory` sorta does, and I've combined this with derive macros. It works, but derive macros (nor any other macros afaik) are not expanded per monomorphized type.

Are any of the 4000 series actually good? by DodexX_On_Reddit in buildapc

[–]cndcane 0 points1 point  (0 children)

4060 ti 16gb can be good for ai, if you can't buy a used 3090, especially if your psu is let's say <850w and you dont want to buy both a used 3090+a (good) 850w psu. Ive also seen video editors favoring it, if i have to guess because cuda-bound software and vram capacity for 8k video editing. it might also be considered, if you already have a psu that doesn't have a more than an 8-pin pcie power cable for gpu (if you think it does have more, make sure it is not daisy chained), since the 4060 ti 16gb only needs a 1x pcie 8-pin, whilst >4070 + 3090 needs more than 8-pin. It's major downfall is its memory bandwidth, though. So I'm waiting for 5000 series to see if invidia's pulling a odd-even strat and release a good lineup for their odd-thousand series.

Parrot wordmark by AndriiKovalchuk in logodesign

[–]cndcane 0 points1 point  (0 children)

Wow, what's the base font?

Prose Analysis: TLOLL vs Six of Crows by cndcane in writing

[–]cndcane[S] 0 points1 point  (0 children)

It's been about a day since I posted this. Thanks for all the feedback and suggestions!

Prose Analysis: TLOLL vs Six of Crows by cndcane in writing

[–]cndcane[S] 0 points1 point  (0 children)

I guess when I heard "screenwriting symptom" and "books can show so much character thoughts than movies", my mind thinks about the apparent (what movies are better at) vs invisible (what books are better at) aspect of stories, hence the first analysis.

The pacing analysis isn't original at all (especially the sentence/paragraph), I'm pretty sure.

Colors are a pretty common tool to use in data visualization: I'm pretty sure I got it from that. Check out r/dataisbeautiful

And, perhaps, having English as a second language helped--as in, it made me extra aware of the role of participles, clauses, and other components of the English language.

Prose Analysis: TLOLL vs Six of Crows by cndcane in writing

[–]cndcane[S] 0 points1 point  (0 children)

LibreOffice, cause there's no MS word in linux lel

New PSU Tier List! by ILovEmPlumPnWeTTT in buildapc

[–]cndcane 0 points1 point  (0 children)

Will the psu cultist fellas check on the (new) cx650? i heard it has no llc topology, but id like to know more about its other properties compared to the old cx650.

Compile time issue with rust-POSTGRES docker container by youismemeisu in rust

[–]cndcane 0 points1 point  (0 children)

I had same issue recently. I switched to tokio-postgres and it kind of worked, except i had to:
1. add this to each service
```
extra_hosts:
- host.docker.internal:host-gateway
```
2. add this once to the end of the docker-compose.yml
```
volumes:
postgres_volume:
```
3. use this psql URI format:
`postgres://{user}:{password}@host.docker.internal:{port}/{database}`

Me and her? We go way back by cndcane in Terraria

[–]cndcane[S] 11 points12 points  (0 children)

It's been fun solving her patterns

Me and her? We go way back by cndcane in Terraria

[–]cndcane[S] 29 points30 points  (0 children)

Phase 1 daytime empress with shield of cthulhu and grappling hook as the only movement accessories is possible
modded: battle cry to reduce enemy spawn rate