Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Solid bevy game template for 3d RPG/shooter games

License

Apache-2.0 and 2 other licenses found

Licenses found

Apache-2.0
LICENCE-APACHE
MIT
LICENCE-MIT
CC0-1.0
LICENSE-CC0
NotificationsYou must be signed in to change notification settings

olekspickle/bevy_new_3d_rpg

Repository files navigation

wip-12-first-demo.mp4
wip-11-neat-esc-back-behavior.mp4
wip-9-follow-the-sun.mp4
wip-5-scale-crouch.mp4

This template is based on the awesomeBevyFlock 2D template featuring out of the box builds for:

  • Windows
  • Linux
  • macOS
  • Web (Wasm)This template is a great way to get started if you aim to build new 3D RPGBevy game!It is not as simple as bevy_new_2d which is aimed to an easy start. It focuses to have a rather solid structure to be able to carry the weight of big projects and uses cargo workspaces for that. It adds a bit of complexity, but for big projects it's unavoidable, and this is an example of aflat architercture.Start with abasic project andCI / CD that can deploy toitch.io.You cantry this template in your browser!

Best way to start

Installcargo-generate orbevy_cli and run:

cargo generate olekspickle/bevy_new_3d_rpg -n my-rpg# or with bevy_clibevy new -t=olekspickle/bevy_new_3d_rpg my-rpg

Features:

  • flat cargo workspace based project structure for game logic crates that can grow and be maintainable
  • import and usage of game mechanics and parameters from .ron (config, credits) (kudos to Caudiciform)
  • simple asset loading based onbevy_asset_loader with loading from path addition (kudos to Caudiciform)
  • third person camera withbevy_third_person_camera
  • solid keyboard & gamepad mapping to ui & game actions usingbevy_enhanced_input
  • simple scene with colliders and rigid bodies usingavian3d
  • simple player movement usingbevy_tnua
  • simple skybox sun cycle usingbevy atmosphere example, with daynight and nimbus modes
  • featuring rig and animations usingUniversal Animation Library from quaternius
  • experimental sound withbevy_seedling based on Firewheel audio engine (which will probably replace bevy_audio), withhighly experimental audio stutter fix for web
  • consistent Esc back navigation in gameplay and menu via stacked modals (kudos for the idea to skyemakesgames)
  • serialize and save settings
  • audio, video and keys rebind tabs in settings (currently not really working)
  • easy drop in scene integration using awesomeskein with a simple scene

TODOs (prioritized)

  • add basic mood change per zone
  • implement different music states(exploration, combat)
  • custom font replace example using pre-loaded font
  • sky background instead of just void lol
  • Movement sfx: jump, dash, sprint
  • spatial audio demo: boombox emitting background music
  • Jump with timer(tricky with tnua jump in air counter)
  • small door/portal demo
  • split screen for coop
  • vault on objects if they are reachable
  • climbing
  • do not rotate player on aim(silly bug, check it out - release aim looking to the floor)
  • basic fighting: punch, kick, take weapon
  • weapon select wheel
  • bow
  • rifle

Write your game

The best way to get started is to play around with the code you find insrc/game/.This template comes with a basic project structure that you may find useful:

Project structure

PathDescription
src/main.rsApp entrypoint where system plugins and window set up
assetsAsset directory
cratesA contained ordered way to improve compile times
crates/asset_loadingA high-level way to load collections of asset handles as resources
crates/modelsData source for the game: inputs, markers, timers
crates/audioMarker components for sound effects and music, bus setup
crates/screensSplash/title/gameplay and other screen related systems and ui
crates/sceneScene setup, skybox
crates/gameGame mechanics & content
crates/playerPlayer control & animation
crates/uiReusable UI widgets & game color pallet control

Feel free to move things around however you want, though.

Run your game

Makefile

There are some helpful commands inMakefile to simplify build optionsBut generally running your game locally is very simple:

  • make run if you havecmake
  • Usebevy run withbevy_cli orcargo run to run a native dev build.
  • Use this command to run a web dev build to run audio in separate thread to avoid audio stuttering:
bevy run web --headers="Cross-Origin-Opener-Policy:same-origin" --headers="Cross-Origin-Embedder-Policy:credentialless"
Running release builds
- Use `bevy run --release` to run a native release build.
  • Usebevy run --release web to run a web release build.
Installing Linux dependencies

If you're using Linux, make sure you've installed Bevy'sLinux dependencies.Note that this template enables Wayland support, which requires additional dependencies as detailed in the link above.Wayland is activated by using thebevy/wayland feature in theCargo.toml.

(Optional) Improving compile times

.cargo/config.toml contains documentation on how to set up your environment to improve compile times.

WARNING: if you work in a private repository, please be aware that macOS and Windows runners cost more build minutes.For public repositories the workflow runners are free!

Release your game

This template usesGitHub workflows to run tests and build releases.Check therelease-flow

Known issues

There are some known issues in Bevy that can require arcane workarounds.

My audio is stuttering on web

This template uses firewheel experimental audio runnign in the separate worker thread, so it should not be happening, but if you experience it nevertheless, here are a few tips:

  • If you're using materials, you should force your render pipelines toload at the start of the game
  • Optimize your game as much as you can to keep its FPS high.
  • Apply the suggestions from the blog post [Workaround for the Choppy Music in Bevy Web Builds].
  • Advise your users to try a Chromium-based browser if there are still issues.

My game window flashes white for a split second when I start the game on Windows

The game window is created before the GPU is ready to render everything.This means that it'll start with a white screen for a few frames.The workaround is tospawn the Window hidden and onlymake it visible a few frames later

My character or camera movement is choppy

Choppy character movement is often caused by movement updates being tied to the frame rate.See thephysics_in_fixed_timestep example for how to fix this.

Choppy camera movement is almost always caused by the camera being tied too tightly to a moving target position.You can usesmooth_nudge to make your camera smoothly approach its target position instead.

Credits

Theassets in this repository are all 3rd-party. See the seecredits for more information.

License

The source code in this repository is licensed under any of the following at your option:

Bevy Compatibility

bevybevy_new_3d_rpg
0.16main,0.1.4

About

Solid bevy game template for 3d RPG/shooter games

Topics

Resources

License

Apache-2.0 and 2 other licenses found

Licenses found

Apache-2.0
LICENCE-APACHE
MIT
LICENCE-MIT
CC0-1.0
LICENSE-CC0

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp