Compare commits
No commits in common. "26ec38e9ce4f466bf83f4123469600babc0e5a5d" and "7b5341989972441a4924ecf0437e67e00601df4c" have entirely different histories.
26ec38e9ce
...
7b53419899
|
@ -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, 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 [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.
|
||||||
|
|
||||||
Source code: https://codeberg.org/outfly/outfly
|
Source code: https://codeberg.org/outfly/outfly
|
||||||
|
|
||||||
|
|
79
src/actor.rs
79
src/actor.rs
|
@ -287,50 +287,48 @@ 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 {
|
power_down = true;
|
||||||
power_down = true;
|
settings.flashlight_active = false;
|
||||||
settings.flashlight_active = false;
|
for mut flashlight_vis in &mut q_flashlight {
|
||||||
for mut flashlight_vis in &mut q_flashlight {
|
*flashlight_vis = Visibility::Hidden;
|
||||||
*flashlight_vis = Visibility::Hidden;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if settings.hud_active {
|
}
|
||||||
let mut hud_drain = POWER_DRAIN_AR;
|
if settings.hud_active {
|
||||||
hud_drain += POWER_DRAIN_LIGHTAMP[prefs.light_amp];
|
let mut hud_drain = POWER_DRAIN_AR;
|
||||||
battery.power -= hud_drain * d;
|
hud_drain += POWER_DRAIN_LIGHTAMP[prefs.light_amp];
|
||||||
if battery.power <= 0.0 {
|
battery.power -= hud_drain * d;
|
||||||
power_down = true;
|
if battery.power <= 0.0 {
|
||||||
ew_game.send(GameEvent::SetAR(Turn::Off));
|
power_down = true;
|
||||||
for mut flashlight_vis in &mut q_flashlight {
|
ew_game.send(GameEvent::SetAR(Turn::Off));
|
||||||
*flashlight_vis = Visibility::Hidden;
|
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
|
let drain = POWER_DRAIN_THRUSTER[prefs.thruster_boost];
|
||||||
&& prefs.thruster_boost != 2
|
let boosting = !battery.overloaded_recovering
|
||||||
&& (prefs.thruster_boost == 1 || engine.currently_matching_velocity);
|
&& prefs.thruster_boost != 2
|
||||||
if boosting {
|
&& (prefs.thruster_boost == 1 || engine.currently_matching_velocity);
|
||||||
if battery.power > drain * d * 100.0 {
|
if boosting {
|
||||||
engine.current_boost_factor = THRUSTER_BOOST_FACTOR[prefs.thruster_boost];
|
if battery.power > drain * d * 100.0 {
|
||||||
if engine.currently_firing {
|
engine.current_boost_factor = THRUSTER_BOOST_FACTOR[prefs.thruster_boost];
|
||||||
battery.power -= drain * d;
|
if engine.currently_firing {
|
||||||
}
|
battery.power -= drain * d;
|
||||||
} else {
|
|
||||||
power_down = true;
|
|
||||||
battery.overloaded_recovering = true;
|
|
||||||
engine.current_boost_factor = 1.0;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
power_down = true;
|
||||||
|
battery.overloaded_recovering = true;
|
||||||
engine.current_boost_factor = 1.0;
|
engine.current_boost_factor = 1.0;
|
||||||
}
|
}
|
||||||
if power_down {
|
} else {
|
||||||
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::PowerDown));
|
engine.current_boost_factor = 1.0;
|
||||||
}
|
}
|
||||||
|
if power_down {
|
||||||
|
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);
|
||||||
|
@ -345,14 +343,7 @@ 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 query: Query<(&mut LifeForm, &mut HitPoints, &mut Suit, &LinearVelocity, &Position, Option<&Player>)>,
|
||||||
&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() {
|
||||||
|
|
|
@ -267,7 +267,6 @@ 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)>,
|
||||||
|
@ -277,12 +276,8 @@ pub fn play_gasp_sfx(
|
||||||
if *sfxtype != Sfx::Gasp {
|
if *sfxtype != Sfx::Gasp {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if suit.oxygen <= 0.0 && !settings.god_mode {
|
if suit.oxygen <= 0.0 {
|
||||||
if settings.mute_sfx {
|
sink.set_volume(0.6);
|
||||||
sink.set_volume(0.0);
|
|
||||||
} else {
|
|
||||||
sink.set_volume(0.6);
|
|
||||||
}
|
|
||||||
sink.play();
|
sink.play();
|
||||||
} else {
|
} else {
|
||||||
if !sink.is_paused() {
|
if !sink.is_paused() {
|
||||||
|
|
|
@ -691,12 +691,7 @@ 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;
|
||||||
|
|
30
src/menu.rs
30
src/menu.rs
|
@ -488,16 +488,8 @@ 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 {
|
let p = if settings.hud_active { actor::POWER_DRAIN_AR } else { 0.0 };
|
||||||
actor::POWER_DRAIN_AR
|
let w = if p > 0.0 { format!(" ({p}W)") } else { String::from("") };
|
||||||
} 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 => {
|
||||||
|
@ -516,11 +508,7 @@ 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 {
|
let w = if p > 0.0 { format!(" ({p}W)") } else { String::from("") };
|
||||||
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 => {
|
||||||
|
@ -531,11 +519,7 @@ 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 {
|
let w = if p > 0.0 { format!(" (+{p}W)") } else { String::from("") };
|
||||||
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 => {
|
||||||
|
@ -557,7 +541,11 @@ 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 { "High" } else { "Low" };
|
let onoff = if settings.shadows_sun {
|
||||||
|
"High"
|
||||||
|
} else {
|
||||||
|
"Low"
|
||||||
|
};
|
||||||
text.sections[i].value = format!("Shadows: {onoff}\n");
|
text.sections[i].value = format!("Shadows: {onoff}\n");
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|
|
@ -232,7 +232,10 @@ 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(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) {
|
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;
|
||||||
|
|
Loading…
Reference in a new issue