Compare commits

..

5 commits

Author SHA1 Message Date
yuni 26ec38e9ce cargo fmt 2024-10-03 06:08:51 +02:00
yuni 212f62fbc6 mute suffocation sound when sfx is muted 2024-10-03 06:08:20 +02:00
yuni f583200b13 don't play suffocation sound in god mode 2024-10-03 06:08:12 +02:00
yuni 108efd0e55 unlimited energy in god mode 2024-10-03 05:59:50 +02:00
yuni 5da66a5b15 README: remove "still in development" 2024-10-03 05:56:57 +02:00
6 changed files with 80 additions and 52 deletions

View file

@ -14,7 +14,7 @@ OutFly is an atmospheric, open world, realistic 3D space game that throws you in
Imagine a blend of [Fallout](https://en.wikipedia.org/wiki/Fallout_%28series%29) and [Outer Wilds](https://en.wikipedia.org/wiki/Outer_Wilds), where you are free to explore the breathtaking expanse of the Jupiter system and discover what life could be like after hundreds of years of space colonization. Imagine a blend of [Fallout](https://en.wikipedia.org/wiki/Fallout_%28series%29) and [Outer Wilds](https://en.wikipedia.org/wiki/Outer_Wilds), where you are free to explore the breathtaking expanse of the Jupiter system and discover what life could be like after hundreds of years of space colonization.
This game aims to respect the player as much as possible. It doesn't waste your time: Despite the vastness of space, nothing takes too long. Speed cheats are active by default, allowing you to visit places you normally couldn't, without passing out from the g-forces. There are no anxiety-causing features (apart of, maybe, space itself), no loading screens, nothing to micromanage, not even save games. You can plunge into the game any time you feel like it, and it's up to you whether you just want to soak in the beautiful scenery, engage with the survival mechanics [still in development], or dive into the game story [still in development]. And finally, it's not just DRM-free but completely open source, allowing you to tinker on any part of the game to your liking. This game aims to respect the player as much as possible. It doesn't waste your time: Despite the vastness of space, nothing takes too long. Speed cheats are active by default, allowing you to visit places you normally couldn't, without passing out from the g-forces. There are no anxiety-causing features (apart of, maybe, space itself), no loading screens, nothing to micromanage, not even save games. You can plunge into the game any time you feel like it, and it's up to you whether you just want to soak in the beautiful scenery, engage with the survival mechanics, or dive into the game story [still in development]. And finally, it's not just DRM-free but completely open source, allowing you to tinker on any part of the game to your liking.
Source code: https://codeberg.org/outfly/outfly Source code: https://codeberg.org/outfly/outfly

View file

@ -287,6 +287,7 @@ pub fn update_power(
let mut power_down = false; let mut power_down = false;
let d = time.delta_seconds(); let d = time.delta_seconds();
for (mut battery, mut engine) in &mut q_battery { for (mut battery, mut engine) in &mut q_battery {
if !settings.god_mode {
if settings.flashlight_active { if settings.flashlight_active {
battery.power -= POWER_DRAIN_FLASHLIGHT[prefs.flashlight_power] * d; // 2.4MW battery.power -= POWER_DRAIN_FLASHLIGHT[prefs.flashlight_power] * d; // 2.4MW
if battery.power <= 0.0 { if battery.power <= 0.0 {
@ -330,6 +331,7 @@ pub fn update_power(
if power_down { if power_down {
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::PowerDown)); ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::PowerDown));
} }
}
let reactor = POWER_GAIN_REACTOR[settings.reactor_state]; let reactor = POWER_GAIN_REACTOR[settings.reactor_state];
battery.power = (battery.power + reactor * d).clamp(0.0, battery.capacity); battery.power = (battery.power + reactor * d).clamp(0.0, battery.capacity);
if battery.overloaded_recovering && battery.power > battery.capacity * 0.5 { if battery.overloaded_recovering && battery.power > battery.capacity * 0.5 {
@ -343,7 +345,14 @@ pub fn update_physics_lifeforms(
time: Res<Time>, time: Res<Time>,
settings: Res<Settings>, settings: Res<Settings>,
id2pos: Res<game::Id2Pos>, id2pos: Res<game::Id2Pos>,
mut query: Query<(&mut LifeForm, &mut HitPoints, &mut Suit, &LinearVelocity, &Position, Option<&Player>)>, mut query: Query<(
&mut LifeForm,
&mut HitPoints,
&mut Suit,
&LinearVelocity,
&Position,
Option<&Player>,
)>,
) { ) {
let d = time.delta_seconds(); let d = time.delta_seconds();
for (mut lifeform, mut hp, mut suit, velocity, pos, player) in query.iter_mut() { for (mut lifeform, mut hp, mut suit, velocity, pos, player) in query.iter_mut() {

View file

@ -267,6 +267,7 @@ pub fn play_zoom_sfx(
} }
pub fn play_gasp_sfx( pub fn play_gasp_sfx(
settings: Res<Settings>,
player: Query<&actor::Suit, With<actor::Player>>, player: Query<&actor::Suit, With<actor::Player>>,
mut ew_sfx: EventWriter<PlaySfxEvent>, mut ew_sfx: EventWriter<PlaySfxEvent>,
q_audiosinks: Query<(&audio::Sfx, &AudioSink)>, q_audiosinks: Query<(&audio::Sfx, &AudioSink)>,
@ -276,8 +277,12 @@ pub fn play_gasp_sfx(
if *sfxtype != Sfx::Gasp { if *sfxtype != Sfx::Gasp {
continue; continue;
} }
if suit.oxygen <= 0.0 { if suit.oxygen <= 0.0 && !settings.god_mode {
if settings.mute_sfx {
sink.set_volume(0.0);
} else {
sink.set_volume(0.6); sink.set_volume(0.6);
}
sink.play(); sink.play();
} else { } else {
if !sink.is_paused() { if !sink.is_paused() {

View file

@ -691,7 +691,12 @@ pub fn apply_input_to_player(
actor::EngineType::Monopropellant, actor::EngineType::Monopropellant,
sinks.get(&audio::Sfx::Thruster), sinks.get(&audio::Sfx::Thruster),
), ),
(1.0, 1.0, actor::EngineType::Ion, sinks.get(&audio::Sfx::Ion)), (
1.0,
1.0,
actor::EngineType::Ion,
sinks.get(&audio::Sfx::Ion),
),
]; ];
let seconds_to_max_vol = 0.05; let seconds_to_max_vol = 0.05;
let seconds_to_min_vol = 0.05; let seconds_to_min_vol = 0.05;

View file

@ -488,8 +488,16 @@ pub fn update_menu(
} }
MenuAction::ToggleAR => { MenuAction::ToggleAR => {
let onoff = bool2string(settings.hud_active); let onoff = bool2string(settings.hud_active);
let p = if settings.hud_active { actor::POWER_DRAIN_AR } else { 0.0 }; let p = if settings.hud_active {
let w = if p > 0.0 { format!(" ({p}W)") } else { String::from("") }; actor::POWER_DRAIN_AR
} else {
0.0
};
let w = if p > 0.0 {
format!(" ({p}W)")
} else {
String::from("")
};
text.sections[i].value = format!("Augmented Reality: {onoff}{w} [TAB]\n"); text.sections[i].value = format!("Augmented Reality: {onoff}{w} [TAB]\n");
} }
MenuAction::ModLightAmp => { MenuAction::ModLightAmp => {
@ -508,7 +516,11 @@ pub fn update_menu(
_ => "ERROR", _ => "ERROR",
}; };
let p = actor::POWER_DRAIN_THRUSTER[prefs.thruster_boost]; let p = actor::POWER_DRAIN_THRUSTER[prefs.thruster_boost];
let w = if p > 0.0 { format!(" ({p}W)") } else { String::from("") }; let w = if p > 0.0 {
format!(" ({p}W)")
} else {
String::from("")
};
text.sections[i].value = format!("Thruster Boost: {state}{w}\n"); text.sections[i].value = format!("Thruster Boost: {state}{w}\n");
} }
MenuAction::ModReactor => { MenuAction::ModReactor => {
@ -519,7 +531,11 @@ pub fn update_menu(
_ => "ERROR", _ => "ERROR",
}; };
let p = actor::POWER_GAIN_REACTOR[settings.reactor_state]; let p = actor::POWER_GAIN_REACTOR[settings.reactor_state];
let w = if p > 0.0 { format!(" (+{p}W)") } else { String::from("") }; let w = if p > 0.0 {
format!(" (+{p}W)")
} else {
String::from("")
};
text.sections[i].value = format!("Reactor: {state}{w}\n"); text.sections[i].value = format!("Reactor: {state}{w}\n");
} }
MenuAction::ChangeARAvatar => { MenuAction::ChangeARAvatar => {
@ -541,11 +557,7 @@ pub fn update_menu(
text.sections[i].value = format!("\nCamera: {onoff} [C]\n"); text.sections[i].value = format!("\nCamera: {onoff} [C]\n");
} }
MenuAction::ToggleShadows => { MenuAction::ToggleShadows => {
let onoff = if settings.shadows_sun { let onoff = if settings.shadows_sun { "High" } else { "Low" };
"High"
} else {
"Low"
};
text.sections[i].value = format!("Shadows: {onoff}\n"); text.sections[i].value = format!("Shadows: {onoff}\n");
} }
_ => {} _ => {}

View file

@ -232,10 +232,7 @@ pub fn pos_offset_for_orbiting_body(
} }
/// Assumes the "front" (as seen in blender) is pointing at the orbited mass /// Assumes the "front" (as seen in blender) is pointing at the orbited mass
pub fn rotation_for_orbiting_body( pub fn rotation_for_orbiting_body(orbit_distance: f64, mass: f64) -> f64 {
orbit_distance: f64,
mass: f64,
) -> f64 {
if let Ok(epoch) = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) { if let Ok(epoch) = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) {
let orbital_period = nature::simple_orbital_period(mass, orbit_distance); let orbital_period = nature::simple_orbital_period(mass, orbit_distance);
let now = epoch.as_secs_f64() + ORBIT_TIME_OFFSET; let now = epoch.as_secs_f64() + ORBIT_TIME_OFFSET;