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.
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

View file

@ -287,48 +287,50 @@ pub fn update_power(
let mut power_down = false;
let d = time.delta_seconds();
for (mut battery, mut engine) in &mut q_battery {
if settings.flashlight_active {
battery.power -= POWER_DRAIN_FLASHLIGHT[prefs.flashlight_power] * d; // 2.4MW
if battery.power <= 0.0 {
power_down = true;
settings.flashlight_active = false;
for mut flashlight_vis in &mut q_flashlight {
*flashlight_vis = Visibility::Hidden;
if !settings.god_mode {
if settings.flashlight_active {
battery.power -= POWER_DRAIN_FLASHLIGHT[prefs.flashlight_power] * d; // 2.4MW
if battery.power <= 0.0 {
power_down = true;
settings.flashlight_active = false;
for mut flashlight_vis in &mut q_flashlight {
*flashlight_vis = Visibility::Hidden;
}
}
}
}
if settings.hud_active {
let mut hud_drain = POWER_DRAIN_AR;
hud_drain += POWER_DRAIN_LIGHTAMP[prefs.light_amp];
battery.power -= hud_drain * d;
if battery.power <= 0.0 {
power_down = true;
ew_game.send(GameEvent::SetAR(Turn::Off));
for mut flashlight_vis in &mut q_flashlight {
*flashlight_vis = Visibility::Hidden;
if settings.hud_active {
let mut hud_drain = POWER_DRAIN_AR;
hud_drain += POWER_DRAIN_LIGHTAMP[prefs.light_amp];
battery.power -= hud_drain * d;
if battery.power <= 0.0 {
power_down = true;
ew_game.send(GameEvent::SetAR(Turn::Off));
for mut flashlight_vis in &mut q_flashlight {
*flashlight_vis = Visibility::Hidden;
}
}
}
}
let drain = POWER_DRAIN_THRUSTER[prefs.thruster_boost];
let boosting = !battery.overloaded_recovering
&& prefs.thruster_boost != 2
&& (prefs.thruster_boost == 1 || engine.currently_matching_velocity);
if boosting {
if battery.power > drain * d * 100.0 {
engine.current_boost_factor = THRUSTER_BOOST_FACTOR[prefs.thruster_boost];
if engine.currently_firing {
battery.power -= drain * d;
let drain = POWER_DRAIN_THRUSTER[prefs.thruster_boost];
let boosting = !battery.overloaded_recovering
&& prefs.thruster_boost != 2
&& (prefs.thruster_boost == 1 || engine.currently_matching_velocity);
if boosting {
if battery.power > drain * d * 100.0 {
engine.current_boost_factor = THRUSTER_BOOST_FACTOR[prefs.thruster_boost];
if engine.currently_firing {
battery.power -= drain * d;
}
} else {
power_down = true;
battery.overloaded_recovering = true;
engine.current_boost_factor = 1.0;
}
} else {
power_down = true;
battery.overloaded_recovering = true;
engine.current_boost_factor = 1.0;
}
} else {
engine.current_boost_factor = 1.0;
}
if power_down {
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::PowerDown));
if power_down {
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::PowerDown));
}
}
let reactor = POWER_GAIN_REACTOR[settings.reactor_state];
battery.power = (battery.power + reactor * d).clamp(0.0, battery.capacity);
@ -343,7 +345,14 @@ pub fn update_physics_lifeforms(
time: Res<Time>,
settings: Res<Settings>,
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();
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(
settings: Res<Settings>,
player: Query<&actor::Suit, With<actor::Player>>,
mut ew_sfx: EventWriter<PlaySfxEvent>,
q_audiosinks: Query<(&audio::Sfx, &AudioSink)>,
@ -276,8 +277,12 @@ pub fn play_gasp_sfx(
if *sfxtype != Sfx::Gasp {
continue;
}
if suit.oxygen <= 0.0 {
sink.set_volume(0.6);
if suit.oxygen <= 0.0 && !settings.god_mode {
if settings.mute_sfx {
sink.set_volume(0.0);
} else {
sink.set_volume(0.6);
}
sink.play();
} else {
if !sink.is_paused() {

View file

@ -691,7 +691,12 @@ pub fn apply_input_to_player(
actor::EngineType::Monopropellant,
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_min_vol = 0.05;

View file

@ -488,8 +488,16 @@ pub fn update_menu(
}
MenuAction::ToggleAR => {
let onoff = bool2string(settings.hud_active);
let p = if settings.hud_active { actor::POWER_DRAIN_AR } else { 0.0 };
let w = if p > 0.0 { format!(" ({p}W)") } else { String::from("") };
let p = if settings.hud_active {
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");
}
MenuAction::ModLightAmp => {
@ -508,7 +516,11 @@ pub fn update_menu(
_ => "ERROR",
};
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");
}
MenuAction::ModReactor => {
@ -519,7 +531,11 @@ pub fn update_menu(
_ => "ERROR",
};
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");
}
MenuAction::ChangeARAvatar => {
@ -541,11 +557,7 @@ pub fn update_menu(
text.sections[i].value = format!("\nCamera: {onoff} [C]\n");
}
MenuAction::ToggleShadows => {
let onoff = if settings.shadows_sun {
"High"
} else {
"Low"
};
let onoff = if settings.shadows_sun { "High" } else { "Low" };
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
pub fn rotation_for_orbiting_body(
orbit_distance: f64,
mass: f64,
) -> f64 {
pub fn rotation_for_orbiting_body(orbit_distance: f64, mass: f64) -> f64 {
if let Ok(epoch) = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) {
let orbital_period = nature::simple_orbital_period(mass, orbit_distance);
let now = epoch.as_secs_f64() + ORBIT_TIME_OFFSET;