Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to install? #5

Closed
konsumer opened this issue Apr 7, 2021 · 10 comments
Closed

how to install? #5

konsumer opened this issue Apr 7, 2021 · 10 comments
Labels
question Further information is requested

Comments

@konsumer
Copy link

konsumer commented Apr 7, 2021

I am pretty new to rust, but I added this to my Cargo.toml:

[dependencies.bevy]
git = "https://github.com/bevyengine/bevy"
branch = "main"
default-features = false
features = ["bevy_winit", "x11"]

[dependencies.bevy_retro]
git = "https://github.com/katharostech/bevy_retro"
branch = "master"
default-features = true

I get this error when I try to cargo run demo code:

    Updating git repository `https://github.com/bevyengine/bevy`
    Updating git repository `https://github.com/katharostech/bevy_retro`
    Updating crates.io index
    Updating git repository `https://github.com/katharostech/luminance-glow`
    Updating git repository `https://github.com/katharostech/luminance-surfman`
    Updating git repository `https://github.com/GrovesNL/glow.git`
error: failed to select a version for `web-sys`.
    ... required by package `luminance-glow v0.0.0 (https://github.com/katharostech/luminance-glow?branch=master#ca5a0b62)`
    ... which is depended on by `bevy_retro v0.0.0 (https://github.com/katharostech/bevy_retro?branch=master#1642ef8b)`
    ... which is depended on by `pakemon v0.1.0 (/Users/konsumer/Documents/otherdev/pakemon-rust/crates/pakemon)`
versions that meet the requirements `^0.3.48` are: 0.3.50, 0.3.49, 0.3.48

all possible versions conflict with previously selected packages.

  previously selected package `web-sys v0.3.46`
    ... which is depended on by `bevy_app v0.5.0 (https://github.com/bevyengine/bevy?branch=main#bc13d11c)`
    ... which is depended on by `bevy_asset v0.5.0 (https://github.com/bevyengine/bevy?branch=main#bc13d11c)`
    ... which is depended on by `bevy_internal v0.5.0 (https://github.com/bevyengine/bevy?branch=main#bc13d11c)`
    ... which is depended on by `bevy v0.5.0 (https://github.com/bevyengine/bevy?branch=main#bc13d11c)`
    ... which is depended on by `bevy_retro v0.0.0 (https://github.com/katharostech/bevy_retro?branch=master#1642ef8b)`
    ... which is depended on by `pakemon v0.1.0 (/Users/konsumer/Documents/otherdev/pakemon-rust/crates/pakemon)`

failed to select a version for `web-sys` which could resolve this conflict
make: *** [pakemon] Error 101
@zicklag
Copy link
Member

zicklag commented Apr 7, 2021

Hi there! You've got the right idea and, in fact, if I take your cargo depdencies and paste them into a new project it works for me.

Try running cargo update and then running cargo run again and see if that helps. If that still doesn't work try removing your Cargo.lock and running again.

Edit: I updated the above paragraph, I meant to say "try to run cargo update" first.

@zicklag zicklag added the question Further information is requested label Apr 7, 2021
@konsumer
Copy link
Author

konsumer commented Apr 8, 2021

Is it maybe because I am using a workspace?

I tried making a fresh minimal demo app, and got it working right away, so I can look at how to fix my workspace setup. I probly missed some dumb little thing, as I am so new to rust. Seems like the Cargo.lock angle is probly a good thing to look at. Thanks!

Backstory for my issue that may or may not be relevant:

I made the start of a demo game thing in love2d (using lua.) It works ok on a modern computer, but performance is pretty bad, which is super-important, as I am targeting pizero. Dependency-woes (love is great, but other setups in C++ for example require quite a lot from the end-user's system, in terms of installed libs and stuff, which can be tricky on such a low-end device) and being interested in rust (even though I am very new to it) drove me to look for a new 2D framework that will make a more efficient runtime, and be more self-contained (via cargo's awesome dependency management.) It seems like many of the popular rust game libs (quicksilver, ggez, etc) are dying/going into maintenance or have very different ideas about structuring an app (amethyst, for example, seems extremely different than I am used to.) Bevy seems nice, and your lib looks like a great start for a 2D app. I also really like the idea of the same code running on the web as a performant native runtime, so people can try it out on devices other than a pi, without having to install anything, but it will also run really well on the pi.

Giving up, I actually started working on re-architecting the love/lua app a bit to make it perform better, and build for the web (using lovejs) as an alternate path, since I fear I may be taking on too many new things at once to actually get it done. I'd be more psyched about not giving up on rust/bevy/bevy_retro, though. It also may be a lost cause, even with a great deal of tuning.

Vaguely related:

I think I have seen in the bevy docs/site mention of some kind of more dynamic setup (but can't seem to find concrete examples) where there is a kind of scene-graph in a human-readable (seems like JSON) file that can be loaded (and even live-reloaded!) which maybe be a better fit for me (a bit closer to what I am used to, less rust code, more asset-driven game-making.) Is there a way to do this (or similar) with bevy_retro? This might be a good interim baby-step for me.

Anyway, thanks your your help. I will try to fix that workspace.

@konsumer
Copy link
Author

konsumer commented Apr 8, 2021

Update

That totally worked, in my workspace-setup. I got bevy_retro loading, and can draw a sprite to the screen. Thanks again for all your help.

@zicklag
Copy link
Member

zicklag commented Apr 8, 2021

Awesome! Glad you got it working!

@zicklag zicklag closed this as completed Apr 8, 2021
@zicklag
Copy link
Member

zicklag commented Apr 8, 2021

Ah, sorry I forgot to reply to this:

I think I have seen in the bevy docs/site mention of some kind of more dynamic setup (but can't seem to find concrete examples) where there is a kind of scene-graph in a human-readable (seems like JSON) file that can be loaded (and even live-reloaded!) which maybe be a better fit for me (a bit closer to what I am used to, less rust code, more asset-driven game-making.) Is there a way to do this (or similar) with bevy_retro? This might be a good interim baby-step for me.

Here's the bevy scene example which shows how to create scenes that can be loaded from a RON ( Rusty Object Notation, similar in concept to JSON ) file.

It might be a little too verbose for what you're wanting though. It's possible to make your own scene file loaders for like a custom YAML/JSON format, but thats a little bit more involved.

@konsumer
Copy link
Author

konsumer commented Apr 8, 2021

Here's the bevy scene example

Ooh! Yes, that is it. Thank you!

It might be a little too verbose for what you're wanting though.

Really, it looks ok! It seems like it has extra stuff in it that JSON is missing that would be useful. I can work with this! An idea that comes to my head, initially, is get a basic scene loaded from that format, then move anything with simple code that needs interaction. This way I can live-reload my layout and stuff, and tweak things on the fly without recompile until I get it right, then add nice fast logic-code.

Would you say this works well with bevy_retro, or is it like 2 totally separate paradigms? Does this work in wasm, like bevy_retro does? I'd be happy to contribute a good bevy_retro demo, if you think it'd be useful, as I'm trying to figure it out, anyway.

It's possible to make your own scene file loaders for like a custom YAML/JSON format, but that's a little bit more involved.

I might consider this, if I end up making an editor in some other language I am better with (JS, python, lua, etc) but ron seems great!

@zicklag
Copy link
Member

zicklag commented Apr 8, 2021

An idea that comes to my head, initially, is get a basic scene loaded from that format, then move anything with simple code that needs interaction. This way I can live-reload my layout and stuff, and tweak things on the fly without recompile until I get it right, then add nice fast logic-code.

Yeah, I think that would work. :)

Would you say this works well with bevy_retro, or is it like 2 totally separate paradigms?

That would be 100% compatible Bevy Retro. Everything should work the same as they would in normal Bevy, the only difference is the name of the components.

Does this work in wasm, like bevy_retro does?

It should. If it works on desktop it should also work in web, but you might need to enable a BevyScene plugin before it works. I can't remember for sure, so probably just try it first.

I'd be happy to contribute a good bevy_retro demo, if you think it'd be useful, as I'm trying to figure it out, anyway.

I'd be fine with that! As long as it is an innocent theme: nothing gory, suggestive, or something you wouldn't share in a professional setting.

I might consider this, if I end up making an editor in some other language I am better with (JS, python, lua, etc) but ron seems great!

👍 👍

@konsumer
Copy link
Author

konsumer commented Apr 8, 2021

I'd be fine with that! As long as it is an innocent theme: nothing gory, suggestive, or something you wouldn't share in a professional setting.

Totally. I was thinking your theme of radishes, maybe even with the same assets.

Alright, I'll dive in. Thanks again for all your help.

@konsumer
Copy link
Author

konsumer commented Apr 8, 2021

As I am looking at it, and this, I'm still not quite sure how it fits with bevy_retro. Would I use things like CameraBundle and SpriteBundle in the ron, instead of ComponentA and ComponentB?

@zicklag
Copy link
Member

zicklag commented Apr 8, 2021

Totally. I was thinking your theme of radishes, maybe even with the same assets.

Perfect!

As I am looking at it, and this, I'm still not quite sure how it fits with bevy_retro. Would I use things like CameraBundle and SpriteBundle in the ron, instead of ComponentA and ComponentB?

Ah, looking at that again, it looks like I'll need to register the Bevy Retro types with Bevy to make it usable from the scene. I'm going to setup what needs to be done from the Bevy retro side and make an example, probably within the next 9 hours, then I'll comment back here when I've pushed the example.

@katharostech katharostech locked and limited conversation to collaborators Apr 8, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants