Code Monkey home page Code Monkey logo

osp-magnum's People

Contributors

capital-asterisk avatar ehwhoami avatar haennes avatar jonesmz avatar kwiesmueller avatar venuskan avatar z-adams avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

osp-magnum's Issues

Test resource naming with multiple data folders

Right now, all the assets are in one big folder, which precludes a lot of name/path issues.

The current way that assets are loaded does not account for situations where two different folders might have a file. The current image loading, for instance, does not disambiguate between images because the resource map uses the filename alone, not the whole path, as the key. This isn't an issue for now, but I just wanted to make a note of it since it'll need to be tackled eventually. It should be pretty easy to build a random, complicated directory structure and fill it with files that have the same name, which should quickly (and spectacularly) reveal what changes need to be made.

Rename Sat-prefixed classes

These classes implement the ITypeSatellite interface. A single ITypeSatellite implementation represents all instances of a type of Satellite. It is easy to get confused and think that a SatVehicle is a single instance of a vehicle, but it's not.

This use to be the case, but as the universe was converted to an ECS, data of specific instances was split into UComp structs.

Change the prefix from "Sat" to "Type". Also, Remove the prefix from the filenames entirely.

Classes to change:

  • osp::universe::SatActiveArea
  • osp::universe::SatVehicle
  • planeta::universe::SatPlanet

Improve SysHierarchy::hierarchy_traverse()

"Additionally, consider changing your hierarchy_traverse function to return decltype(auto), and have it return the result of your functor, that would let you change your lambda to return {EHierarchyTraverseStatus::Stop, ent} or {EHierarchyTraverseStatus::Continue, entt::null}

If you write your function carefully (Or your lambda, depending on how crafty your metaprogramming game is) your hierarchy_traverse() function can serve double duty.

In the lazy way, you just always have your hierarchy_traverse() function return the second member of the thing returned from the lambda, and for lambdas that don't want to return anything, just have them return like nullptr or something.

In the crafty way, you have your hierarchy_traverse function return a tuple that represents all of the return values from the lambda except for index 0 (e.g. a tuple suffix).

If you write your hierarchy_traverse function carefully, there's very little cost to doing this. E.g. returning a tuple<EHierarchyTraverseStatus, std::reference_wrapper<>, std::reference_wrapper<>,....>, where the cost is basically just shuffling pointers around, which the compiler will heavily optimize for you cause of templates.

Originally posted by @jonesmz in #36 (comment)

Runtime error in Trade::AbstractImporter::image2D()

Guinea pig again here.

After today pull (and applying staged changes eliminating exhaust plumes), program crashed. Below is output from Gnu Debugger, including backtrace:

Found 7 nodes
Found node: part_spamcan
PART!
Adding obj to Part: part_spamcan
Adding obj to Part: attach_bottom
Adding obj to Part: attach_top
Adding obj to Part: col_notacylinder
obj: col_notacylinder is a "cylinder" collider
Adding obj to Part: Cylinder
obj: Cylinder uses mesh: OSPData/adera/spamcan:Cylinder.001
Base Tex: spamcanhd
Metal/rough texture: Material Metallic
JSON machines!
test: UserControl
Read config 'type' : (string)
test: Rocket
Read config 'thrust' : 1000 (real)
Read config 'type' : (string)
test: FreeEnergyGenerator
Read config 'type' : (string)
Found node: Lamp
Found node: Camera
Mesh: OSPData/adera/spamcan:Cylinder.001
Loading image: spamcanhd
Trade::AbstractImporter::image2D(): implementation is not allowed to use a custom Array deleter

Program received signal SIGABRT, Aborted.
0x00007ffff75d1615 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff75d1615 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff75ba862 in abort () from /usr/lib/libc.so.6
#2  0x0000555555655ed9 in Magnum::Trade::AbstractImporter::image2D(unsigned int, unsigned int) ()
#3  0x000055555567e588 in Magnum::Trade::AnyImageImporter::doImage2D(unsigned int, unsigned int) ()
#4  0x0000555555655fab in Magnum::Trade::AbstractImporter::image2D(unsigned int, unsigned int) ()
#5  0x00005555556bba8c in Magnum::Trade::TinyGltfImporter::doImage2D(unsigned int, unsigned int) ()
#6  0x0000555555655fab in Magnum::Trade::AbstractImporter::image2D(unsigned int, unsigned int) ()
#7  0x00005555555c1e73 in load_a_bunch_of_stuff() ()
#8  0x000055555557cd8c in main ()

Windows CI is broken: Compiling Debug instead of Release

CI for Windows started failing today. Github changed something, and now the artifact release steps are broken. I suspect that the files are now built into a different directory. The build itself works completely fine.

Windows build working before:
https://github.com/TheOpenSpaceProgram/osp-magnum/actions/runs/673978536

Exact same build but now doesn't work:
https://github.com/TheOpenSpaceProgram/osp-magnum/actions/runs/723539396

Changes are needed in windows.yml

Crash during flight on pressing left Shift key

Version: fresh (commit ad0de75)
Recreation: run, type "flight", type 'v' (to focus on first ship), then left shift. Edit: similar crash happens if I focus on second ship and type 'z' (also tested 'x' and 'c').
Console output:
osp-magnum: /home/ja/Public/Programs/osp-magnum/src/../3rdparty/entt/src/entt/entity/registry.hpp:991: auto entt::basic_registry< <template-parameter-1-1> >::try_get(entt::basic_registry< <template-parameter-1-1> >::entity_type) [with Component = {adera::active::machines::MachineContainer}; Entity = osp::active::ActiveEnt; entt::basic_registry< <template-parameter-1-1> >::entity_type = osp::active::ActiveEnt]: Assertion valid(entity)' failed.`
Backtrace:

#0  0x00007ffff7441ef5 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff742b862 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff742b747 in __assert_fail_base.cold () from /usr/lib/libc.so.6
#3  0x00007ffff743a646 in __assert_fail () from /usr/lib/libc.so.6
#4  0x000055555557ce89 in entt::basic_registry<osp::active::ActiveEnt>::try_get<adera::active::machines::MachineContainer> (
    this=0x7ffff00f9e50, entity=(unknown: 0xfffff))
    at /home/ja/Public/Programs/osp-magnum/src/../3rdparty/entt/src/entt/entity/registry.hpp:991
#5  0x000055555557cecc in osp::active::ActiveScene::reg_try_get<adera::active::machines::MachineContainer> (
    this=0x7ffff00f9e40, ent=(unknown: 0xfffff)) at /home/ja/Public/Programs/osp-magnum/src/./osp/Active/ActiveScene.h:141
#6  0x000055555557a7ae in adera::active::machines::SysMachineRocket::update_physics (this=0x7ffff021fd90, rScene=...)
    at /home/ja/Public/Programs/osp-magnum/src/adera/Machines/Rocket.cpp:128
#7  0x000055555557a374 in operator() (__closure=0x7ffff021ff70, rScene=...)
    at /home/ja/Public/Programs/osp-magnum/src/adera/Machines/Rocket.cpp:84
#8  0x000055555557be43 in std::__invoke_impl<void, adera::active::machines::SysMachineRocket::SysMachineRocket(osp::active::ActiveScene&)::<lambda(osp::active::ActiveScene&)>&, osp::active::ActiveScene&>(std::__invoke_other, struct {...} &) (
    __f=...) at /usr/include/c++/10.2.0/bits/invoke.h:60
#9  0x000055555557bd18 in std::__invoke_r<void, adera::active::machines::SysMachineRocket::SysMachineRocket(osp::active::ActiveScene&)::<lambda(osp::active::ActiveScene&)>&, osp::active::ActiveScene&>(struct {...} &) (__fn=...)
    at /usr/include/c++/10.2.0/bits/invoke.h:110
#10 0x000055555557bbef in std::_Function_handler<void(osp::active::ActiveScene&), adera::active::machines::SysMachineRocket::SysMachineRocket(osp::active::ActiveScene&)::<lambda(osp::active::ActiveScene&)> >::_M_invoke(const std::_Any_data &, osp::active::ActiveScene &) (__functor=..., __args#0=...) at /usr/include/c++/10.2.0/bits/std_function.h:291
#11 0x00005555555a7b23 in std::function<void (osp::active::ActiveScene&)>::operator()(osp::active::ActiveScene&) const (
    this=0x7ffff021ff70, __args#0=...) at /usr/include/c++/10.2.0/bits/std_function.h:622
#12 0x00005555555a5b59 in osp::FunctionOrder<void (osp::active::ActiveScene&)>::call<osp::active::ActiveScene&>(osp::active::ActiveScene&) (this=0x7ffff00f9ed0) at /home/ja/Public/Programs/osp-magnum/src/osp/Active/../FunctonOrder.h:154
#13 0x00005555555a35ae in osp::active::ActiveScene::update (this=0x7ffff00f9e40)
    at /home/ja/Public/Programs/osp-magnum/src/osp/Active/ActiveScene.cpp:196
#14 0x0000555555645258 in testapp::OSPMagnum::drawEvent (this=0x7ffff0000b60)
    at /home/ja/Public/Programs/osp-magnum/src/test_application/OSPMagnum.cpp:86
#15 0x0000555555666ed1 in Magnum::Platform::Sdl2Application::mainLoopIteration (this=0x7ffff0000b60)
    at /home/ja/Public/Programs/osp-magnum/3rdparty/magnum/src/Magnum/Platform/Sdl2Application.cpp:974
#16 0x0000555555666450 in Magnum::Platform::Sdl2Application::exec (this=0x7ffff0000b60)
    at /home/ja/Public/Programs/osp-magnum/3rdparty/magnum/src/Magnum/Platform/Sdl2Application.cpp:802
#17 0x00005555556495da in testapp::test_flight (pMagnumApp=std::unique_ptr<testapp::OSPMagnum> = {...}, rOspApp=..., 
    args=...) at /home/ja/Public/Programs/osp-magnum/src/test_application/flight.cpp:154
#18 0x000055555565bf04 in std::__invoke_impl<void, void (*)(std::unique_ptr<testapp::OSPMagnum, std::default_delete<testapp::OSPMagnum> >&, osp::OSPApplication&, Magnum::Platform::Sdl2Application::Arguments), std::reference_wrapper<std::unique_ptr<testapp::OSPMagnum, std::default_delete<testapp::OSPMagnum> > >, std::reference_wrapper<osp::OSPApplication>, Magnum::Platform::Sdl2Application::Arguments> (
    __f=@0x555555a0f978: 0x555555649191 <testapp::test_flight(std::unique_ptr<testapp::OSPMagnum, std::default_delete<testapp::OSPMagnum> >&, osp::OSPApplication&, Magnum::Platform::Sdl2Application::Arguments)>)
    at /usr/include/c++/10.2.0/bits/invoke.h:60
#19 0x000055555565bdce in std::__invoke<void (*)(std::unique_ptr<testapp::OSPMagnum, std::default_delete<testapp::OSPMagnum> >&, osp::OSPApplication&, Magnum::Platform::Sdl2Application::Arguments), std::reference_wrapper<std::unique_ptr<testapp::OSPMagnum, std::default_delete<testapp::OSPMagnum> > >, std::reference_wrapper<osp::OSPApplication>, Magnum::Platform::Sdl2Application::Arguments> (
    __fn=@0x555555a0f978: 0x555555649191 <testapp::test_flight(std::unique_ptr<testapp::OSPMagnum, std::default_delete<testap--Type <RET> for more, q to quit, c to continue without paging--c
p::OSPMagnum> >&, osp::OSPApplication&, Magnum::Platform::Sdl2Application::Arguments)>) at /usr/include/c++/10.2.0/bits/invoke.h:95
#20 0x000055555565bcc5 in std::thread::_Invoker<std::tuple<void (*)(std::unique_ptr<testapp::OSPMagnum, std::default_delete<testapp::OSPMagnum> >&, osp::OSPApplication&, Magnum::Platform::Sdl2Application::Arguments), std::reference_wrapper<std::unique_ptr<testapp::OSPMagnum, std::default_delete<testapp::OSPMagnum> > >, std::reference_wrapper<osp::OSPApplication>, Magnum::Platform::Sdl2Application::Arguments> >::_M_invoke<0ul, 1ul, 2ul, 3ul> (this=0x555555a0f958) at /usr/include/c++/10.2.0/thread:264
#21 0x000055555565bc46 in std::thread::_Invoker<std::tuple<void (*)(std::unique_ptr<testapp::OSPMagnum, std::default_delete<testapp::OSPMagnum> >&, osp::OSPApplication&, Magnum::Platform::Sdl2Application::Arguments), std::reference_wrapper<std::unique_ptr<testapp::OSPMagnum, std::default_delete<testapp::OSPMagnum> > >, std::reference_wrapper<osp::OSPApplication>, Magnum::Platform::Sdl2Application::Arguments> >::operator() (this=0x555555a0f958) at /usr/include/c++/10.2.0/thread:271
#22 0x000055555565bc2a in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(std::unique_ptr<testapp::OSPMagnum, std::default_delete<testapp::OSPMagnum> >&, osp::OSPApplication&, Magnum::Platform::Sdl2Application::Arguments), std::reference_wrapper<std::unique_ptr<testapp::OSPMagnum, std::default_delete<testapp::OSPMagnum> > >, std::reference_wrapper<osp::OSPApplication>, Magnum::Platform::Sdl2Application::Arguments> > >::_M_run (this=0x555555a0f950) at /usr/include/c++/10.2.0/thread:215
#23 0x00007ffff7802bc4 in std::execute_native_thread_routine (__p=0x555555a0f950) at /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:80
#24 0x00007ffff7f8d299 in start_thread () from /usr/lib/libpthread.so.0
#25 0x00007ffff7504153 in clone () from /usr/lib/libc.so.6

Decouple MachineRocket and SysExhaustPlume

"...rocket and plumes both depend on each other. Rockets have to initialize the plumes, and plumes are reading MachineRockets specifically.

A possible solution would be to add a new component for plume engine power, in the same entity as MachineRocket. MachineRocket can then write its throttle value into it. This allows other systems aside that aren't rockets to use plumes."

Originally posted by @Capital-Asterisk in #36 (comment)

Separate Transform component into translation, rotation, and scale components

At this point this may be a minor optimization, but it's best to change it sooner as there will be more code to change if left for later.

ACompTransform consists of a 4x4 float matrix, which is 64 bytes. Many systems (like in-game gravity) only need to read the translation: just 3 of the 16 floats. This means systems can waste 80% of the memory they read, and miss out out on a few potential compiler optimizations. Also, some entities just don't need rotation or scale: camera entity doesn't need scale, billboard-rendered entity doesn't need rotation.

A separate translation component can simply be a Vector3. The rotation component can be a 3x3 matrix, quaternion, or something else. Scale can also be a Vector3, or combined into the rotation component as a 3x3 matrix. Whichever should be chosen is open for discussion.

One important thing to note is that the transform for drawing is a separate component calculated per-frame: ACompDrawTransform. This exists with the intention of drawing interpolated frames between physics frames.

Enums for stock shaders

Right now, shaders are described by an ACompShader which stores a function pointer that is used to invoke the shader on some entity. The downside to this arrangement is that it leaks graphics API dependence slightly into the rest of the codebase. For now, the default Phong shader is fallen back on when the function pointer value is nullptr, but a better approach described by @Capital-Asterisk would be to create an enumeration of stock shader types like

enum class EShader
{
    Phong = 0,
    PBR = 1,
    Planet = 2,
    ChemRocketExhaust = 3,
    JetEngineExhaust = 4,
    Skybox =  5,
    // ...
};

and provide an interface that accepts the enum when the user attaches a shader:

reg.emplace<ACompVisible>(ent);
reg.emplace<ACompShader>(ent, EShader::Phong);

which may be achieved by an ACompShader constructor like

ACompShader::ACompShader(EShader shader)
{
    switch (shader)
    {
    case EShader::Phong:
        m_drawFnc = osp::shader::Phong::draw_entity;
        return;
    case EShader::PBR:
        // ...
    }
}

or some similar approach.

Specialized shaders whose function need not be exposed to the user (e.g. compute shaders) do not need to be included in the EShader enum.

Abstract GL resource compilation away from systems

Right now, SysVehicle::part_instantiate has code that attempts to get the resources required by the vehicle, and if they don't yet exist, attempts to compile them from image/mesh data in resource packs. This pattern is repeated consistently in several places in the repo, and will likely continue to be common. We may therefore want to consider abstracting this resource check away, so that systems can call a single function to fetch the required data without having to manually check for and/or compile the GL resources every time.

Change a bunch of std::bind to lambdas

Classes that use the FunctionOrder, most of them being system classes named "SysSomething," have something that look like this in their constructor:

DebugCameraController::DebugCameraController(active::ActiveScene &scene,
                                             active::ActiveEnt ent) :
// ... stuff here
 m_updatePhysicsPost(scene.get_update_order(), "dbg_cam", "physics", "",
                std::bind(&DebugCameraController::update_physics_post, this)),
// ... more stuff here

What does this mean??? This constructs a FunctionOrderHandle member (named m_updatePhysicsPost) with an std::function as an argument, adding the function to the update order of the scene. This is saying that the update_physics_post function of this specific instance of DebugCameraController will be called after the "physics" update.

All of these should be changed to a lambda instead, as std::bind is hard to read and is discouraged:

m_updatePhysicsPre(scene.get_update_order(), "dbg_cam_pre", "", "physics",
                [this] { this->update_physics_pre(); }),

Crash on Exit command while window still opened

Maybe it's not a bug, not a serious one (as I presume, command line is temporary, for debugging only), but maybe is (if placed in code intended to stay longer in project). Here is output from Gnu Debugger, since Exit command. This build is debug one, bactrace output is considerable larger.
(BTW minor inconvenience - logs can interrupt typed text, as You can see).

exFloating origin translation!
it
Application must be closed to destroy universe.
Magnum Application closed
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ScrollInputHandle is dead
MouseMovementHandle is dead
[Thread 0x7fffe17fa640 (LWP 6682) exited]
[Thread 0x7fffe1ffb640 (LWP 6681) exited]
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
ButtonControlHandle is dead
[Thread 0x7fffe27fc640 (LWP 6680) exited]
[Thread 0x7fffe2ffd640 (LWP 6679) exited]
[Thread 0x7fffe37fe640 (LWP 6678) exited]
[Thread 0x7fffe3fff640 (LWP 6677) exited]
[Thread 0x7fffe8a5f640 (LWP 6676) exited]
[Thread 0x7ffff71ca640 (LWP 6675) exited]
corrupted size vs. prev_size

Thread 1 "osp-magnum" received signal SIGABRT, Aborted.
0x00007ffff7441615 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7441615 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff742a862 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff74835e8 in __libc_message () from /usr/lib/libc.so.6
#3  0x00007ffff748b27a in malloc_printerr () from /usr/lib/libc.so.6
#4  0x00007ffff748c176 in unlink_chunk.constprop () from /usr/lib/libc.so.6
#5  0x00007ffff748c305 in malloc_consolidate () from /usr/lib/libc.so.6
#6  0x00007ffff748cb30 in _int_free () from /usr/lib/libc.so.6
#7  0x00005555555ec89a in Corrade::Containers::Implementation::CallDeleter<char, void (*)(char*, unsigned long)>::operator()
    (this=0x7fffffffe0a7, deleter=0x0, data=0x5555572428c0 "P\a\237UUU", size=3145728)
    at /home/ja/Public/Programs/osp-magnum/3rdparty/corrade/src/Corrade/Containers/Array.h:60
#8  0x00005555555e9bae in Corrade::Containers::Array<char, void (*)(char*, unsigned long)>::~Array (this=0x5555559e4560, 
    __in_chrg=<optimized out>) at /home/ja/Public/Programs/osp-magnum/3rdparty/corrade/src/Corrade/Containers/Array.h:392
#9  0x00005555555e693c in Magnum::Trade::ImageData<2u>::~ImageData (this=0x5555559e4520, __in_chrg=<optimized out>)
    at /home/ja/Public/Programs/osp-magnum/3rdparty/magnum/src/Magnum/Trade/ImageData.h:106
#10 0x00005555555f769e in osp::Resource<Magnum::Trade::ImageData<2u> >::~Resource (this=0x5555559e4520, 
    __in_chrg=<optimized out>) at /home/ja/Public/Programs/osp-magnum/src/osp/Resource/Resource.h:81
#11 0x00005555555f76be in std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > >::~pair (this=0x5555559e4500, __in_chrg=<optimized out>)
    at /usr/include/c++/10.2.0/bits/stl_pair.h:211
#12 0x00005555555f76ea in __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > > >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > > (
    this=0x5555559edea8, __p=0x5555559e4500) at /usr/include/c++/10.2.0/ext/new_allocator.h:156
#13 0x00005555555f613d in std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > > > >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > > (__a=..., __p=0x5555559e4500) at /usr/include/c++/10.2.0/bits/alloc_traits.h:531
#14 0x00005555555f478d in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > > >::_M_destroy_node (this=0x5555559edea8, __p=0x5555559e44e0) at /usr/include/c++/10.2.0/bits/stl_tree.h:646
#15 0x00005555555f1dfb in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > > >::_M_drop_node (
    this=0x5555559edea8, __p=0x5555559e44e0) at /usr/include/c++/10.2.0/bits/stl_tree.h:654
#16 0x00005555555ef002 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > > >::_M_erase (
    this=0x5555559edea8, __x=0x5555559e44e0) at /usr/include/c++/10.2.0/bits/stl_tree.h:1921
#17 0x00005555555eefdf in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > con--Type <RET> for more, q to quit, c to continue without paging--c
st, osp::Resource<Magnum::Trade::ImageData<2u> > > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > > >::_M_erase (this=0x5555559edea8, __x=0x5555559eea90) at /usr/include/c++/10.2.0/bits/stl_tree.h:1919
#18 0x00005555555eefdf in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > > >::_M_erase (this=0x5555559edea8, __x=0x5555559eda60) at /usr/include/c++/10.2.0/bits/stl_tree.h:1919
#19 0x00005555555ec91c in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > > >::~_Rb_tree (this=0x5555559edea8, __in_chrg=<optimized out>) at /usr/include/c++/10.2.0/bits/stl_tree.h:991
#20 0x00005555555e9c32 in std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osp::Resource<Magnum::Trade::ImageData<2u> >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Resource<Magnum::Trade::ImageData<2u> > > > >::~map (this=0x5555559edea8, __in_chrg=<optimized out>) at /usr/include/c++/10.2.0/bits/stl_map.h:302
#21 0x00005555555ec9e4 in osp::Package::GroupTypeRes<Magnum::Trade::ImageData<2u> >::~GroupTypeRes (this=0x5555559edea0, __in_chrg=<optimized out>) at /home/ja/Public/Programs/osp-magnum/src/osp/Resource/Package.h:139
#22 0x00005555555eca0c in osp::Package::GroupTypeRes<Magnum::Trade::ImageData<2u> >::~GroupTypeRes (this=0x5555559edea0, __in_chrg=<optimized out>) at /home/ja/Public/Programs/osp-magnum/src/osp/Resource/Package.h:139
#23 0x00005555555b96d6 in std::default_delete<osp::Package::GroupType>::operator() (this=0x5555559edf68, __ptr=0x5555559edea0) at /usr/include/c++/10.2.0/bits/unique_ptr.h:85
#24 0x00005555555bbe46 in std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> >::~unique_ptr (this=0x5555559edf68, __in_chrg=<optimized out>) at /usr/include/c++/10.2.0/bits/unique_ptr.h:361
#25 0x00005555555bb2b4 in std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > >::~pair (this=0x5555559edf60, __in_chrg=<optimized out>) at /usr/include/c++/10.2.0/bits/stl_pair.h:211
#26 0x00005555555bb2d4 in __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > > > >::destroy<std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > > > (this=0x5555559ed440, __p=0x5555559edf60) at /usr/include/c++/10.2.0/ext/new_allocator.h:156
#27 0x00005555555ba3f7 in std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > > > > >::destroy<std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > > > (__a=..., __p=0x5555559edf60) at /usr/include/c++/10.2.0/bits/alloc_traits.h:531
#28 0x00005555555b959d in std::_Rb_tree<unsigned int, std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > >, std::_Select1st<std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > > > >::_M_destroy_node (this=0x5555559ed440, __p=0x5555559edf40) at /usr/include/c++/10.2.0/bits/stl_tree.h:646
#29 0x00005555555b86bb in std::_Rb_tree<unsigned int, std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > >, std::_Select1st<std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > > > >::_M_drop_node (this=0x5555559ed440, __p=0x5555559edf40) at /usr/include/c++/10.2.0/bits/stl_tree.h:654
#30 0x00005555555e134e in std::_Rb_tree<unsigned int, std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > >, std::_Select1st<std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > > > >::_M_erase (this=0x5555559ed440, __x=0x5555559edf40) at /usr/include/c++/10.2.0/bits/stl_tree.h:1921
#31 0x00005555555e1294 in std::_Rb_tree<unsigned int, std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > >, std::_Select1st<std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > > > >::~_Rb_tree (this=0x5555559ed440, __in_chrg=<optimized out>) at /usr/include/c++/10.2.0/bits/stl_tree.h:991
#32 0x00005555555e0ff0 in std::map<unsigned int, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::unique_ptr<osp::Package::GroupType, std::default_delete<osp::Package::GroupType> > > > >::~map (this=0x5555559ed440, __in_chrg=<optimized out>) at /usr/include/c++/10.2.0/bits/stl_map.h:302
#33 0x00005555555e103c in osp::Package::~Package (this=0x5555559ed440, __in_chrg=<optimized out>) at /home/ja/Public/Programs/osp-magnum/src/osp/Resource/Package.h:93
#34 0x00005555555e105c in std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package>::~pair (this=0x5555559ed420, __in_chrg=<optimized out>) at /usr/include/c++/10.2.0/bits/stl_pair.h:211
#35 0x00005555555e1088 in __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package> > >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package> > (this=0x5555559aa8c0 <g_osp>, __p=0x5555559ed420) at /usr/include/c++/10.2.0/ext/new_allocator.h:156
#36 0x00005555555e0e81 in std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package> > > >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package> > (__a=..., __p=0x5555559ed420) at /usr/include/c++/10.2.0/bits/alloc_traits.h:531
#37 0x00005555555e0c23 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package> >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package> > >::_M_destroy_node (this=0x5555559aa8c0 <g_osp>, __p=0x5555559ed400) at /usr/include/c++/10.2.0/bits/stl_tree.h:646
#38 0x00005555555e0839 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package> >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package> > >::_M_drop_node (this=0x5555559aa8c0 <g_osp>, __p=0x5555559ed400) at /usr/include/c++/10.2.0/bits/stl_tree.h:654
#39 0x00005555556400ee in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package> >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package> > >::_M_erase (this=0x5555559aa8c0 <g_osp>, __x=0x5555559ed400) at /usr/include/c++/10.2.0/bits/stl_tree.h:1921
#40 0x000055555563f48e in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package> >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package> > >::~_Rb_tree (this=0x5555559aa8c0 <g_osp>, __in_chrg=<optimized out>) at /usr/include/c++/10.2.0/bits/stl_tree.h:991
#41 0x000055555563f052 in std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osp::Package, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osp::Package> > >::~map (this=0x5555559aa8c0 <g_osp>, __in_chrg=<optimized out>) at /usr/include/c++/10.2.0/bits/stl_map.h:302
#42 0x00005555556434e2 in osp::OSPApplication::~OSPApplication (this=0x5555559aa8c0 <g_osp>, __in_chrg=<optimized out>) at /home/ja/Public/Programs/osp-magnum/src/./osp/OSPApplication.h:35
#43 0x00007ffff7443db7 in __run_exit_handlers () from /usr/lib/libc.so.6
#44 0x00007ffff7443f5e in exit () from /usr/lib/libc.so.6
#45 0x00007ffff742c159 in __libc_start_main () from /usr/lib/libc.so.6
#46 0x000055555556b4ae in _start ()

Get the compiler flag situation under control

Each compiler and platform and build type may need a different set of flags. Currently our main CMakeLists.txt allows for clang/GCC settings to be passed to MSVC in debug builds. Causing failures.

Use DependRes's ability to store a not-yet-loaded resource in PlumeEffect; PrototypePart

Ideally this [PlumeEffectData::meshName] should be DependRes. I'm aware this does have the issue of meshes not being added to the Package yet, but there is a not-yet-implemented solution to this. Note that osp::Resource<> has an m_loaded bool variable. This is intended to be set false for placeholder resources that are initialized empty. If something needs a resource that isn't loaded yet, it can initialize an empty one, where it can be loaded later.

Originally posted by @Capital-Asterisk in #36 (comment)

Get rid of std::cout and use some sort of logger

There's std::couts all over the place. A proper logger or some sort should've been added earlier. Magnum or Corrade might have one built-in. There's many ways to do this, and also get rid of useless undescriptive prints because they're mostly just annoying.

Zoom does not zoom well, change to a log scale.

The scroll wheel zooms in and out annoyingly slow, so to improve the zoom, we can switch the scroll to a log scale.

Something like this:
double new_zoom = scroll_amount^constant * current_zoom would make it scroll much faster.

Beef up the the FunctionOrder class

The FunctionOrder class:

After getting pissed at 'post update, update, pre update' from other game engines, and also KSP's TimingManager class, I decided to create the FunctionOrder class.

It calls a sequence of functions in a specific order, sorting them correctly based "before/after" rules. It handles cases like "this function must be called after the wire update, but before the physics update."

https://github.com/TheOpenSpaceProgram/osp-magnum/blob/3f11db3/src/osp/FunctonOrder.h

If we have std::functions A, B, and C, AfterABeforeB, AfterC, BeforeA with variable names explaining when the function should be called:

FunctionOrder<void(void)> order;
std::function A, B, C, AfterABeforeB, AfterC, BeforeA;

//...

order.add("A",              "",     "",     A);
order.add("B",              "",     "",     B);
order.add("C",              "",     "",     C);
order.add("AfterABeforeB",  "A",    "B",    AfterABeforeB);
order.add("AfterC",         "C",    "",     AfterC);
order.add("BeforeA",        "",     "A",    BeforeA);

Calling order.call() will be equivalent to:

BeforeA();
A();
AfterABeforeB();
B();
C();
AfterC();

Also note that functions in the order are reference counted, and order.add returns an RAII "FunctionOrderHandle" so technically the above code is invalid. The code that removes the functions when their ref count goes to 0 is not yet implemented.

FunctionOrder has no dependencies specific to OSP, and can be used for other projects.

Use in OSP

The function order used by ActiveScene (aliased as UpdateOrder) calls ECS system functions.

Running the list_upd command while the application is running will list all the update functions called, with // comments added in to explain what they do

> list_upd
Update order:
* mach_usercontrol // MachineUserControl read user input
* wire // Wire propagation (not implemented)
* dbg_cam_vmod // DebugCameraController self-destruct function
* vehicle_modification // Handles new/removed/separated parts from vehicles
* planet_geo // PlanetA colliders and mesh update
* ff_gravity // Gravity ForceField apply forces
* mach_rocket // MachineRocket reads wire and applies forces
* physics // Physics World Update
* areascan // ActiveArea checks for Satellites to activate
* planet_phys // blank function 
* dbg_cam // DebugCameraController camera movement

Most of these functions will iterate through components, except for dbg_ ones.

It is also used for rendering, aliased as RenderOrder.

Beefing it up:

It's Incomplete:

First off, this class is still incomplete. Reference counting doesn't do anything. There are also cases when it cannot insert a function because it's not able to re-order existing functions; for example:

order.add("A",          "",     "",     A);
order.add("BeforeA1",   "",     "A",    BeforeA1);
order.add("BeforeA2",   "",     "A",    BeforeA2);

// order inside:
// * BeforeA1
// * BeforeA2
// * A

// BeforeA1 and BeforeA2 has to be swapped for this function to be inserted.
// This is not yet implemented
order.add("AfterBeforeA2_BeforeBeforeA1", "BeforeA2", "BeforeA1", whatever);

Flexibility / Tagging:

Functions have things in common, such as ff_gravity and mach_rocket which both apply forces. What if a function needed to run only after all the forces have been applied? It shouldn't know anything about ff_gravity or mach_rocket, and their order isn't even guaranteed. It would be best to have some sort tag assigned to ff_gravity and mach_rocket that rules can be applied to. Maybe instead of having rules per-function, have tags that have rules, where these tags can be applied to the functions.

Multithreading

A benefit of ECS is that it's really easy to multithread, and that was in mind while writing this class. Some functions can be called at the same time without racing or interfering with each other. If two functions can be swapped without affecting the order, then they can be run in parallel.

Even better, it's possible to list per-function which components they read and write to. This turns out to be very similar to something developers of Overwatch have tried. This whole presentation is worth watching, but this part in particular: https://youtu.be/W3aieHjyNvw?t=2657

It may also be a good idea to pass the number of threads a system can used to the function calls, so that the optimal number of cores can be used.

It wouldn't be the simple old FunctionOrder anymore after changes like this.

Produce statically linked (within reason) builds on all platforms.

E.g., currently many parts of the linux build are shared libraries, even libs from our own source repository.

jonesmz@ymir ~/build-osp-magnum-Desktop-Debug/bin $ ldd osp-magnum
        linux-vdso.so.1 (0x00007ffe53ba6000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fdce092d000)
        libdNewton_d.so => /home/jonesmz/build-osp-magnum-Desktop-Debug/3rdparty/newton-dynamics/lib/libdNewton_d.so (0x00007fdce0901000)
        libdScene_d.so => /home/jonesmz/build-osp-magnum-Desktop-Debug/3rdparty/newton-dynamics/lib/libdScene_d.so (0x00007fdce086b000)
        libdModel_d.so => /home/jonesmz/build-osp-magnum-Desktop-Debug/3rdparty/newton-dynamics/lib/libdModel_d.so (0x00007fdce085e000)
        libdVehicle_d.so => /home/jonesmz/build-osp-magnum-Desktop-Debug/3rdparty/newton-dynamics/lib/libdVehicle_d.so (0x00007fdce081e000)
        libSDL2-2.0d.so.0 => /home/jonesmz/build-osp-magnum-Desktop-Debug/Debug/lib/libSDL2-2.0d.so.0 (0x00007fdce05b7000)
        libGLX.so.0 => /usr/lib64/libGLX.so.0 (0x00007fdce0583000)
        libOpenGL.so.0 => /usr/lib64/libOpenGL.so.0 (0x00007fdce0557000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fdce0551000)
        libdAnimation_d.so => /home/jonesmz/build-osp-magnum-Desktop-Debug/3rdparty/newton-dynamics/lib/libdAnimation_d.so (0x00007fdce0542000)
        libdCustomJoints_d.so => /home/jonesmz/build-osp-magnum-Desktop-Debug/3rdparty/newton-dynamics/lib/libdCustomJoints_d.so (0x00007fdce04f1000)
        libnewton_d.so => /home/jonesmz/build-osp-magnum-Desktop-Debug/3rdparty/newton-dynamics/lib/libnewton_d.so (0x00007fdce04b3000)
        libdgPhysics_d.so => /home/jonesmz/build-osp-magnum-Desktop-Debug/3rdparty/newton-dynamics/lib/libdgPhysics_d.so (0x00007fdce02bc000)
        libdContainers_d.so => /home/jonesmz/build-osp-magnum-Desktop-Debug/3rdparty/newton-dynamics/lib/libdContainers_d.so (0x00007fdce02a7000)
        libdMath_d.so => /home/jonesmz/build-osp-magnum-Desktop-Debug/3rdparty/newton-dynamics/lib/libdMath_d.so (0x00007fdce028c000)
        libdgCore_d.so => /home/jonesmz/build-osp-magnum-Desktop-Debug/3rdparty/newton-dynamics/lib/libdgCore_d.so (0x00007fdce01e6000)
        libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/libstdc++.so.6 (0x00007fdcdff7e000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fdcdfe3c000)
        libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/libgcc_s.so.1 (0x00007fdcdfe22000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fdcdfc65000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fdce101b000)
        libdbus-1.so.3 => /usr/lib64/libdbus-1.so.3 (0x00007fdcdfc14000)
        libunwind.so.8 => /usr/lib64/libunwind.so.8 (0x00007fdcdfbf6000)
        libunwind-x86_64.so.8 => /usr/lib64/libunwind-x86_64.so.8 (0x00007fdcdfbd6000)
        libpulse-simple.so.0 => /usr/lib64/libpulse-simple.so.0 (0x00007fdcdfbcf000)
        libpulse.so.0 => /usr/lib64/libpulse.so.0 (0x00007fdcdfb75000)
        libGLdispatch.so.0 => /usr/lib64/libGLdispatch.so.0 (0x00007fdcdfabd000)
        libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007fdcdf962000)
        libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007fdcdf8a5000)
        libpulsecommon-13.0.so => /usr/lib64/pulseaudio/libpulsecommon-13.0.so (0x00007fdcdf815000)
        libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007fdcdf7e8000)
        librt.so.1 => /lib64/librt.so.1 (0x00007fdcdf7de000)
        liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fdcdf7aa000)
        libzstd.so.1 => /usr/lib64/libzstd.so.1 (0x00007fdcdf6b7000)
        libgcrypt.so.20 => /usr/lib64/libgcrypt.so.20 (0x00007fdcdf564000)
        libX11-xcb.so.1 => /usr/lib64/libX11-xcb.so.1 (0x00007fdcdf55f000)
        libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007fdcdf540000)
        libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007fdcdf535000)
        libXtst.so.6 => /usr/lib64/libXtst.so.6 (0x00007fdcdf52a000)
        libsndfile.so.1 => /usr/lib64/libsndfile.so.1 (0x00007fdcdf483000)
        libasyncns.so.0 => /usr/lib64/libasyncns.so.0 (0x00007fdcdf47c000)
        libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007fdcdf477000)
        libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007fdcdf46f000)
        libgpg-error.so.0 => /usr/lib64/libgpg-error.so.0 (0x00007fdcdf446000)
        libbsd.so.0 => /usr/lib64/libbsd.so.0 (0x00007fdcdf428000)
        libuuid.so.1 => /lib64/libuuid.so.1 (0x00007fdcdf41e000)
        libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007fdcdf406000)
        libFLAC.so.8 => /usr/lib64/libFLAC.so.8 (0x00007fdcdf3b9000)
        libvorbis.so.0 => /usr/lib64/libvorbis.so.0 (0x00007fdcdf37d000)
        libvorbisenc.so.2 => /usr/lib64/libvorbisenc.so.2 (0x00007fdcdf2d0000)
        libopus.so.0 => /usr/lib64/libopus.so.0 (0x00007fdcdf249000)
        libogg.so.0 => /usr/lib64/libogg.so.0 (0x00007fdcdf23d000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fdcdf223000)
        libmd.so.0 => /usr/lib64/libmd.so.0 (0x00007fdcdf213000)
        libmvec.so.1 => /lib64/libmvec.so.1 (0x00007fdcdf1e7000)

[Linux] Crash on startup (memory dump)

Downloaded and built according to instructions on the Wiki. Has built fine. But after run, there is following console message:

Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/spamcan.sturdy.gltf
Error: couldn't open file: OSPData/adera/spamcan.sturdy.gltf
Found Trade::AbstractImporter::object3DCount(): no file opened

and crash.
I checked twice, this (and other) file are present in the "build" directory. I run main executable from both root project directory and from build directory with the same result. Few months ago I tried it too, with identical result.
System: Arch Linux, up-to-date.
Debug messages from GNU Debugger:

(gdb) run
Starting program: /home/ja/Public/Programs/osp-magnum/build/bin/osp-magnum
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/spamcan.sturdy.gltf
Error: couldn't open file: OSPData/adera/spamcan.sturdy.gltf
Found Trade::AbstractImporter::object3DCount(): no file opened

Program received signal SIGABRT, Aborted.
0x00007ffff7341615 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007ffff7341615 in raise () from /usr/lib/libc.so.6
#1 0x00007ffff732a862 in abort () from /usr/lib/libc.so.6
#2 0x00007ffff7b4060a in Magnum::Trade::AbstractImporter::object3DCount() const ()
from /home/ja/Public/Programs/osp-magnum/build/Release/lib/libMagnumTrade.so.2
#3 0x00005555555b836c in load_a_bunch_of_stuff() ()
#4 0x0000555555576151 in main ()

Clean, black window and other flight surprises

So, after disabling exhaust plumes (although probably most visually fun part of the game), I was able to see main game window... which was essencialy black. Moreover, mouse cursor started to move discontinuously, as with heavy CPU load. It was surprising, as my system monitor displayed CPU load at 1-2%. I tried to click&drag, but the only response was console messages. Clicking to close window worked, but console prompt didnt appeared. But typing "exit" still worked. Here is full console output since flight command:

flight
Platform: can't get Xft.dpi property for virtual DPI scaling, falling back to physical DPI
Renderer: Mesa DRI Intel(R) HD Graphics 2000 (SNB GT1) by Intel Open Source Technology Center
OpenGL version: 3.3 (Core Profile) Mesa 20.3.3
Using optional features:
GL_ARB_ES2_compatibility
GL_ARB_direct_state_access
GL_ARB_get_texture_sub_image
GL_ARB_invalidate_subdata
GL_ARB_multi_bind
GL_ARB_robustness
GL_ARB_separate_shader_objects
GL_ARB_texture_filter_anisotropic
GL_ARB_texture_storage
GL_ARB_texture_storage_multisample
GL_ARB_vertex_array_object
GL_KHR_debug
Using driver workarounds:
no-layout-qualifiers-on-old-glsl
mesa-dsa-createquery-except-pipeline-stats
mesa-forward-compatible-line-width-range
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
MouseMovementHandle created
ScrollInputHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
activatin a planet!!!!!!!!!!!!!!!!11
loadin a vehicle!
Machine: FreeEnergyGenerator Not found
Machine: FreeEnergyGenerator Not found
MachineRocket 13's associated plume: 17
Machine: FreeEnergyGenerator Not found
MachineRocket 18's associated plume: 19
Machine: FreeEnergyGenerator Not found
MachineRocket 22's associated plume: 23
Machine: FreeEnergyGenerator Not found
MachineRocket 26's associated plume: 27
Machine: FreeEnergyGenerator Not found
MachineRocket 30's associated plume: 31
Machine: FreeEnergyGenerator Not found
MachineRocket 34's associated plume: 35
Machine: FreeEnergyGenerator Not found
MachineRocket 38's associated plume: 39
Machine: FreeEnergyGenerator Not found
MachineRocket 42's associated plume: 43
Machine: FreeEnergyGenerator Not found
MachineRocket 46's associated plume: 47
Machine: FreeEnergyGenerator Not found
Connected Throttle to Throttle
Connected AttitudeControl to Gimbal
Connected AttitudeControl to Orient
Connected Throttle to Throttle
Connected AttitudeControl to Orient
Connected Throttle to Throttle
Connected AttitudeControl to Orient
Connected Throttle to Throttle
Connected AttitudeControl to Orient
Connected Throttle to Throttle
Connected AttitudeControl to Orient
Connected Throttle to Throttle
Connected AttitudeControl to Orient
Connected Throttle to Throttle
Connected AttitudeControl to Orient
Connected Throttle to Throttle
Connected AttitudeControl to Orient
Connected Throttle to Throttle
Initializing planet
Planet initialized, now making colliders

  • completed chunk collider: 0
  • completed chunk collider: 1
  • completed chunk collider: 2
  • completed chunk collider: 3
  • completed chunk collider: 4
  • completed chunk collider: 5
  • completed chunk collider: 6
  • completed chunk collider: 7
  • completed chunk collider: 8
  • completed chunk collider: 9
  • completed chunk collider: 10
  • completed chunk collider: 11
  • completed chunk collider: 12
  • completed chunk collider: 13
  • completed chunk collider: 14
  • completed chunk collider: 15
  • completed chunk collider: 16
  • completed chunk collider: 17
  • completed chunk collider: 18
  • completed chunk collider: 19
    Planet colliders done
    sensitive button pressed
    HOLD
    sensitive button pressed
    RELEASE
    sensitive button pressed
    HOLD
    sensitive button pressed
    RELEASE
    Magnum Application closed
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ScrollInputHandle is dead
    MouseMovementHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead
    ButtonControlHandle is dead

exit
explosion Universe destroyed!

I'm glad to be able to help even if only this way. I'm very sad there is virtually nothing open source similar to KSP or Orbiter. In desperation I started my own project recently, but it's very difficult for me to push it forward.

Add unit tests

Adding a unit testing library, such as Boost.Test or gtest, and testing the systems and other things, will be helpful to guarantee behavior.

Clang tidy / clang analyzer reports -- low hanging fruit, should be fixed.

/home/jonesmz/osp-magnum/src/newtondynamics_physics/SysNewton.cpp: In static member function โ€˜static void ospnewton::SysNewton::update_world(osp::active::ActiveScene&)โ€™:
/home/jonesmz/osp-magnum/src/newtondynamics_physics/SysNewton.cpp:139:52: warning: โ€˜entt::basic_registry< >::size_type entt::basic_registry< >::remove_if_exists(entt::basic_registry< >::entity_type) [with Component = {ospnewton::ACompNwtBody}; Entity = osp::active::ActiveEnt; entt::basic_registry< >::size_type = long unsigned int; entt::basic_registry< >::entity_type = osp::active::ActiveEnt]โ€™ is deprecated: Use ::remove instead [-Wdeprecated-declarations]
139 | rReg.remove_if_exists(ent);
| ^
In file included from /home/jonesmz/osp-magnum/src/./osp/Active/activetypes.h:32,
from /home/jonesmz/osp-magnum/src/./osp/Active/physics.h:28,
from /home/jonesmz/osp-magnum/src/newtondynamics_physics/SysNewton.h:28,
from /home/jonesmz/osp-magnum/src/newtondynamics_physics/SysNewton.cpp:26:
/home/jonesmz/osp-magnum/src/../3rdparty/entt/src/entt/entity/registry.hpp:746:15: note: declared here
746 | size_type remove_if_exists(const entity_type entity) {
| ^~~~~~~~~~~~~~~~
/home/jonesmz/osp-magnum/src/adera/SysExhaustPlume.cpp: In static member function โ€˜static void adera::active::SysExhaustPlume::update_plumes(osp::active::ActiveScene&)โ€™:
/home/jonesmz/osp-magnum/src/adera/SysExhaustPlume.cpp:134:74: warning: โ€˜entt::basic_registry< >::size_type entt::basic_registry< >::remove_if_exists(entt::basic_registry< >::entity_type) [with Component = {osp::active::ACompVisible}; Entity = osp::active::ActiveEnt; entt::basic_registry< >::size_type = long unsigned int; entt::basic_registry< >::entity_type = osp::active::ActiveEnt]โ€™ is deprecated: Use ::remove instead [-Wdeprecated-declarations]
134 | rScene.get_registry().remove_if_exists(plumeEnt);
| ^
In file included from /home/jonesmz/osp-magnum/src/./osp/Active/activetypes.h:32,
from /home/jonesmz/osp-magnum/src/./osp/Active/physics.h:28,
from /home/jonesmz/osp-magnum/src/adera/SysExhaustPlume.h:26,
from /home/jonesmz/osp-magnum/src/adera/SysExhaustPlume.cpp:25:
/home/jonesmz/osp-magnum/src/../3rdparty/entt/src/entt/entity/registry.hpp:746:15: note: declared here
746 | size_type remove_if_exists(const entity_type entity) {
| ^~~~~~~~~~~~~~~~
In file included from /home/jonesmz/osp-magnum/src/test_application/main.cpp:54:
/home/jonesmz/osp-magnum/3rdparty/corrade/src/Corrade/Utility/Arguments.h:173:30: warning: โ€˜Corrade::Utility::Argumentsโ€™ declared with greater visibility than the type of its field โ€˜Corrade::Utility::Arguments::_entriesโ€™ [-Wattributes]
173 | class CORRADE_UTILITY_EXPORT Arguments {
| ^~~~~~~~~
/home/jonesmz/osp-magnum/src/test_application/universes/vehicles.cpp:220:16: warning: Value stored to 'rotZ_090' during its initialization is never read [deadcode.DeadStores]
Quaternion rotZ_090 = Quaternion::rotation(qtrTurn, Vector3{0, 0, 1});
^~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jonesmz/osp-magnum/src/test_application/universes/vehicles.cpp:221:16: warning: Value stored to 'rotZ_180' during its initialization is never read [deadcode.DeadStores]
Quaternion rotZ_180 = Quaternion::rotation(2 * qtrTurn, Vector3{0, 0, 1});
^~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jonesmz/osp-magnum/src/test_application/universes/vehicles.cpp:222:16: warning: Value stored to 'rotZ_270' during its initialization is never read [deadcode.DeadStores]
Quaternion rotZ_270 = Quaternion::rotation(3 * qtrTurn, Vector3{0, 0, 1});
^~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
/home/jonesmz/osp-magnum/src/osp/Active/SysRender.cpp:63:15: warning: Value stored to 'aspectRatio' during its initialization is never read [deadcode.DeadStores]
float aspectRatio = screenSize.x() / screenSize.y();
^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/home/jonesmz/osp-magnum/src/adera/Machines/RCSController.cpp:158:10: warning: Value stored to 'view' during its initialization is never read [deadcode.DeadStores]
auto view = rScene.get_registry().view();
^~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/home/jonesmz/osp-magnum/src/test_application/DebugObject.cpp:287:13: warning: Value stored to 'posRelative' during its initialization is never read [deadcode.DeadStores]
Vector3 posRelative = xform.translation() - xformTgt.translation();
^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jonesmz/osp-magnum/src/test_application/DebugObject.cpp:321:10: warning: Value stored to 'viewActive' during its initialization is never read [deadcode.DeadStores]
auto viewActive = rReg.view();
^~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
/home/jonesmz/osp-magnum/src/newtondynamics_physics/SysNewton.cpp:326:5: warning: 1st function call argument is an uninitialized value [core.CallAndMessage]
NewtonBodySetMatrix(pBody, entTransform.m_transform.data());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/home/jonesmz/osp-magnum/src/osp/Active/SysVehicle.cpp:354:10: warning: Value stored to 'view' during its initialization is never read [deadcode.DeadStores]
auto view = rScene.get_registry()
^~~~ ~~~~~~~~~~~~~~~~~~~~~
/home/jonesmz/osp-magnum/src/osp/Active/SysVehicle.cpp:545:31: warning: Value stored to 'child' during its initialization is never read [deadcode.DeadStores]
ActiveEnt child = rScene.reg_get(partEnt)
^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.

Arcball Camera

Rotating the camera around in-flight feels a bit weird, as the current implementation directly adds mouse delta x/y to camera yaw/pitch.

See CameraController.cpp line 331

The way to rotate around in 3D space without an "up" appears to be the "Arcball." There exists an example for Magnum, as well as many other useful resources on how to implement it, such as this OpenGL tutorial. Ideally this is a simple self-contained task, but may also call upon other improvements elsewhere in the project wherever lacking.

The state of the Arcball can be stored in ACompCameraController.

Also a good idea to rename the "ui_rmb" control to something like "camera_orbit" or something similar, as controls are intended to be rebound to different buttons.

Problem with loading assets again

Also, a crash

> flight
> Platform: can't get Xft.dpi property for virtual DPI scaling, falling back to physical DPI
Renderer: Mesa DRI Intel(R) HD Graphics 4600 (HSW GT2) by Intel Open Source Technology Center
OpenGL version: 4.5 (Core Profile) Mesa 20.2.6
Using optional features:
    GL_ARB_ES2_compatibility
    GL_ARB_direct_state_access
    GL_ARB_get_texture_sub_image
    GL_ARB_invalidate_subdata
    GL_ARB_multi_bind
    GL_ARB_robustness
    GL_ARB_separate_shader_objects
    GL_ARB_texture_filter_anisotropic
    GL_ARB_texture_storage
    GL_ARB_texture_storage_multisample
    GL_ARB_vertex_array_object
    GL_KHR_debug
Using driver workarounds:
    no-layout-qualifiers-on-old-glsl
    mesa-implementation-color-read-format-dsa-explicit-binding
    mesa-dsa-createquery-except-pipeline-stats
    mesa-forward-compatible-line-width-range
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
MouseMovementHandle created
ScrollInputHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
ButtonControlHandle created
loadin a vehicle!
ERROR: could not find plume anchor for MachineRocket 3
Machine type: FreeEnergyGenerator Not found
Connected Throttle to Throttle
Connected AttitudeControl to Gimbal
loadin a vehicle!
ERROR: could not find plume anchor for MachineRocket 11
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 16
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 21
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 26
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 31
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 36
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 41
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 46
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 51
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 56
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 61
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 66
Machine type: FreeEnergyGenerator Not found
Connected Throttle to Throttle
Connected AttitudeControl to Gimbal
loadin a vehicle!
ERROR: could not find plume anchor for MachineRocket 72
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 77
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 82
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 87
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 92
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 97
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 102
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 107
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 112
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 117
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 122
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 127
Machine type: FreeEnergyGenerator Not found
Connected Throttle to Throttle
Connected AttitudeControl to Gimbal
loadin a vehicle!
ERROR: could not find plume anchor for MachineRocket 133
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 138
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 143
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 148
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 153
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 158
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 163
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 168
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 173
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 178
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 183
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 188
Machine type: FreeEnergyGenerator Not found
Connected Throttle to Throttle
Connected AttitudeControl to Gimbal
loadin a vehicle!
ERROR: could not find plume anchor for MachineRocket 194
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 199
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 204
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 209
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 214
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 219
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 224
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 229
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 234
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 239
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 244
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 249
Machine type: FreeEnergyGenerator Not found
Connected Throttle to Throttle
Connected AttitudeControl to Gimbal
loadin a vehicle!
ERROR: could not find plume anchor for MachineRocket 255
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 260
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 265
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 270
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 275
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 280
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 285
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 290
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 295
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 300
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 305
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 310
Machine type: FreeEnergyGenerator Not found
Connected Throttle to Throttle
Connected AttitudeControl to Gimbal
loadin a vehicle!
ERROR: could not find plume anchor for MachineRocket 316
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 321
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 326
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 331
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 336
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 341
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 346
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 351
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 356
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 361
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 366
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 371
Machine type: FreeEnergyGenerator Not found
Connected Throttle to Throttle
Connected AttitudeControl to Gimbal
loadin a vehicle!
ERROR: could not find plume anchor for MachineRocket 377
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 382
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 387
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 392
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 397
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 402
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 407
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 412
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 417
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 422
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 427
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 432
Machine type: FreeEnergyGenerator Not found
Connected Throttle to Throttle
Connected AttitudeControl to Gimbal
loadin a vehicle!
ERROR: could not find plume anchor for MachineRocket 438
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 443
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 448
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 453
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 458
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 463
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 468
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 473
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 478
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 483
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 488
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 493
Machine type: FreeEnergyGenerator Not found
Connected Throttle to Throttle
Connected AttitudeControl to Gimbal
loadin a vehicle!
ERROR: could not find plume anchor for MachineRocket 499
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 504
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 509
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 514
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 519
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 524
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 529
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 534
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 539
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 544
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 549
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 554
Machine type: FreeEnergyGenerator Not found
Connected Throttle to Throttle
Connected AttitudeControl to Gimbal
loadin a vehicle!
ERROR: could not find plume anchor for MachineRocket 560
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 565
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 570
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 575
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 580
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 585
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 590
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 595
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 600
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 605
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 610
Machine type: FreeEnergyGenerator Not found
ERROR: could not find plume anchor for MachineRocket 615
Machine type: FreeEnergyGenerator Not found
Connected Throttle to Throttle
Connected AttitudeControl to Gimbal
New mass: 1200
New mass: 1200
New mass: 1200
New mass: 1200
New mass: 1200
New mass: 1200
New mass: 1200
New mass: 1200
New mass: 1200
New mass: 1200
New mass: 150
sensitive button pressed
switch to new vehicle
sensitive button pressed
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
sensitive button pressed
RELEASE
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
HOLD
sensitive button pressed
RELEASE
sensitive button pressed
osp-magnum: /home/jonesmz/osp-magnum/src/../3rdparty/entt/src/entt/entity/registry.hpp:924: auto entt::basic_registry< <template-parameter-1-1> >::try_get(entt::basic_registry< <template-parameter-1-1> >::entity_type) [with Component = {adera::active::machines::MachineContainer}; Entity = osp::active::ActiveEnt; entt::basic_registry< <template-parameter-1-1> >::entity_type = osp::active::ActiveEnt]: Assertion `valid(entity)' failed.
Aborted (core dumped)

Consider moving part configs to separate files to ease difficulty config; localization

Putting part configs in the .sturdy.gltf sounded like a good idea at first, but considering things like difficulty settings, language localization, and upgrades, it would be better to put part configs in separate files.
It sounds like we're approaching some kind of patch-based system for machine configs. The configs that BlueprintMachine store will patch over the configs of the PrototypeMachine. It might make sense to make some functions that easily combines these configs.

#57 (review)

All "systems" should be marked noexcept

Unless, of course, we want to allow this for some reason.

The noexcept keyword allows the compiler to omit a bunch of extra code that would normally be generated for a function. It's a performance optimization.

Additionally, lots of standard container types enable faster code paths if constructors and assignment operators are noexcept.

Improve Wiring system

The wiring system is a core feature that connects a vehicle's Machines together, similar to a circuit simulator.

See: https://github.com/TheOpenSpaceProgram/OpenSpaceProgram/blob/master/docs/Technical.md#wiring

Problem:

The current implementation is incomplete; and so far, it is not friendly to the cache, generally hard to use, and doesn't properly utilize the ECS. Data stored by wire values also use std::variant, which may not be the best solution.

Machines are large classes that store WireInputs and WireOutputs classes as members. WireOutputs use Magnum's linked list to connect to multiple WireInputs. These store pointers to the Machine components. Storing pointers or references to ECS components is not a good idea, as the buffers they're in can reallocate.

The reallocation issue is dealt with by having a complicated move constructors, where WireInputs and WireOutputs must be moved explicitly to update the pointer to the new location. These move constructors are also rather expensive, as each WireOutput moved has to update every input connected to it.

There is also the possibility of requiring multiple outputs connected to one input. For example, multiple rocket abort triggers (explosion detectors on parts) connected to a single abort input (trigger launch escape system).

Possible solution:

Store the wire value (previously in WireOutput) in a new ACompWireNode component. WireInputs and WireOutputs can just be an entity (id) that an ACompWireNode is part of. ACompWireNode will also store a list of the entities of connected inputs and their propagate functions.

Data type of wire value:

See #49 (comment)

Make all Systems static

Systems in ECS are suppose to be functions, but here they're polymorphic instances of classes (osp::active::IDynamicSystem). This wasn't a good design choice on my end in the first place. Having the system class store state leads to complications, such as unnecessary coupling (that can be fixed only with virtual functions).

The original intention for dynamic systems, was enabling systems to link together and call each others member functions. This isn't needed, systems should communicate with each other through only components.

OOP decouples systems through virtual interfaces. Pseudo-code example:

// Imaginary rocket that needs the physics engine to apply thrust
anyPhysicsEngine->apply_force(rigidBody, thrust);
// Physics engine functions are called right away

DOD decouples systems through common data. Pseudo-code example:

// Imaginary rocket that needs the physics engine to apply thrust
genericRigidBodyData.force += thrust;
// Physics engine reads the data later on when its system updates

The m_scene member in most system classes isn't needed. UpdateOrderHandle_t can be stored in some container in ActiveScene with an identifier

For example: SysFFGravity, dealing with gravity force fields looks like this:

class SysFFGravity : public SysForceField // SysForceField is empty class right now
{
public:

    static const std::string smc_name;

    SysFFGravity(ActiveScene &scene);
    ~SysFFGravity() = default;

    void update_force(ActiveScene& rScene);

private:

    ActiveScene &m_scene;

    UpdateOrderHandle_t m_updateForce;
};

When it can be refactored to this:

class SysFFGravity : public SysForceField
{
public:

    static const std::string smc_name;

    static void update_force(ActiveScene& rScene);
};

Crash on shader compilation: "GLSL 4.30 is not supported."

As previous issue was fixed (or workarounded), I was able to get access to osp-magnum command line, but again - unable to play. Here is my console log:

Found 7 nodes
Found node: part_spamcan
PART!
Adding obj to Part: part_spamcan
Adding obj to Part: attach_bottom
Adding obj to Part: attach_top
Adding obj to Part: col_notacylinder
obj: col_notacylinder is a collider
Adding obj to Part: Cylinder
obj: Cylinder uses mesh: OSPData/adera/spamcan:Cylinder.001
Base Tex: spamcanhd
Metal/rough texture: Material Metallic
JSON machines!
test: UserControl
test: Rocket
test: FreeEnergyGenerator
Found node: Lamp
Found node: Camera
Mesh: OSPData/adera/spamcan:Cylinder.001
Loading image: spamcanhd
Loading image: Material Metallic
Found 7 nodes
Found node: part_stomper
PART!
Adding obj to Part: part_stomper
Adding obj to Part: col_capsule
obj: col_capsule is a collider
Adding obj to Part: col_engineCollider
obj: col_engineCollider is a collider
Adding obj to Part: col_fuselageCylinder
obj: col_fuselageCylinder is a collider
Adding obj to Part: col_xFinCollider
obj: col_xFinCollider is a collider
Adding obj to Part: col_zFinCollider
obj: col_zFinCollider is a collider
Adding obj to Part: Rocket
obj: Rocket uses mesh: OSPData/adera/stomper:Cylinder.002
Base Tex: stomper
Metal/rough texture: stomper_metal-stomper_rough
JSON machines!
test: UserControl
test: Rocket
test: FreeEnergyGenerator
Mesh: OSPData/adera/stomper:Cylinder.002
Loading image: stomper
Loading image: stomper_metal-stomper_rough
Found 4 nodes
Found node: part_phCapsule
PART!
Adding obj to Part: part_phCapsule
Adding obj to Part: attach_bottom_capsule
Adding obj to Part: capsule
obj: capsule uses mesh: OSPData/adera/ph_capsule:Cylinder.001
Base Tex: ph_base
No metal/rough texture found for capsule
Adding obj to Part: col_capsule
obj: col_capsule is a collider
JSON machines!
test: UserControl
test: FreeEnergyGenerator
Mesh: OSPData/adera/ph_capsule:Cylinder.001
Loading image: ph_base
Found 5 nodes
Found node: part_phFuselage
PART!
Adding obj to Part: part_phFuselage
Adding obj to Part: attach_bottom_fuselage
Adding obj to Part: attach_top_fuselage
Adding obj to Part: col_tank
obj: col_tank is a collider
Adding obj to Part: fuselage
obj: fuselage uses mesh: OSPData/adera/ph_fuselage:Cylinder
Base Tex: ph_base
No metal/rough texture found for fuselage
JSON machines!
test: FreeEnergyGenerator
Mesh: OSPData/adera/ph_fuselage:Cylinder
Loading image: ph_base
resource already exists
Found 5 nodes
Found node: part_phEngine
PART!
Adding obj to Part: part_phEngine
Adding obj to Part: attach_top_eng
Adding obj to Part: col_eng
obj: col_eng is a collider
Adding obj to Part: engine
obj: engine uses mesh: OSPData/adera/ph_engine:Cylinder.002
Base Tex: ph_base
No metal/rough texture found for engine
Adding obj to Part: fx_plume_phPlume
JSON machines!
test: Rocket
test: FreeEnergyGenerator
Mesh: OSPData/adera/ph_engine:Cylinder.002
Loading image: ph_base
resource already exists
Found 2 nodes
Found node: plume_phPlume
Plume! Node "plume_phPlume"
Mesh: OSPData/adera/ph_plume:Cylinder.003
Found 4 nodes
Found node: part_phLinRCS
PART!
Adding obj to Part: part_phLinRCS
Adding obj to Part: fx_plume_phRCSplume
Adding obj to Part: linrcsblk
obj: linrcsblk uses mesh: OSPData/adera/ph_rcs:Cube
Base Tex: ph_base
No metal/rough texture found for linrcsblk
Adding obj to Part: linrcsnozzle
obj: linrcsnozzle uses mesh: OSPData/adera/ph_rcs:Cylinder.004
Base Tex: ph_base
No metal/rough texture found for linrcsnozzle
JSON machines!
test: RCSController
test: Rocket
test: FreeEnergyGenerator
Mesh: OSPData/adera/ph_rcs:Cube
Mesh: OSPData/adera/ph_rcs:Cylinder.004
Loading image: ph_base
resource already exists
Found 2 nodes
Found node: plume_phRCSplume
Plume! Node "plume_phRCSplume"
Mesh: OSPData/adera/ph_rcs_plume:Cylinder.005
Resource loading complete

Created simple solar system
OSP-Magnum Temporary Debug CLI
Choose a test universe:

  • simple - Simple test planet and vehicles (default)
  • moon - Simulate size and gravity of real world moon

Start Application:

  • flight - Create an ActiveArea and start Magnum

Other things to type:

  • list_uni - List Satellites in the universe
  • list_ent - List Entities in active scene
  • list_upd - List Update order from active scene
  • help - Show this again
  • exit - Deallocate everything and return memory to OS

simple
explosion Universe destroyed!
Created simple solar system
list_uni
SATELLITE: ""

  • Type: Planet
  • Position: [0, -307200, 0]
    SATELLITE: "Placeholder Mk. I"
  • Type: Vehicle
  • Trajectory: N3osp8universe14TrajStationaryE
  • Position: [112640, 0, 0]

list_ent
Can't do that yet, start the magnum application first!
flight
Platform: can't get Xft.dpi property for virtual DPI scaling, falling back to physical DPI
Renderer: Mesa DRI Intel(R) HD Graphics 2000 (SNB GT1) by Intel Open Source Technology Center
OpenGL version: 3.3 (Core Profile) Mesa 20.3.3
Using optional features:
GL_ARB_ES2_compatibility
GL_ARB_direct_state_access
GL_ARB_get_texture_sub_image
GL_ARB_invalidate_subdata
GL_ARB_multi_bind
GL_ARB_robustness
GL_ARB_separate_shader_objects
GL_ARB_texture_filter_anisotropic
GL_ARB_texture_storage
GL_ARB_texture_storage_multisample
GL_ARB_vertex_array_object
GL_KHR_debug
Using driver workarounds:
no-layout-qualifiers-on-old-glsl
mesa-dsa-createquery-except-pipeline-stats
mesa-forward-compatible-line-width-range
GL::Shader::compile(): compilation of vertex shader 1 failed with the following message:
0:1(10): error: GLSL 4.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.50, 3.30, 1.00 ES, and 3.00 ES
GL::Shader::compile(): compilation of fragment shader 2 failed with the following message:
0:1(10): error: GLSL 4.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.50, 3.30, 1.00 ES, and 3.00 ES
Assertion GL::Shader::compile({vert, frag}) failed at /home/ja/Public/Programs/osp-magnum/src/adera/Shaders/PlumeShader.cpp:65

Is GLSL 4.30 not backward compatibile or so?
Edit: I checked glxinfo output, but I'm not sure what it really means, seems to be ambiguous:

(...)
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 2000 (SNB GT1)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 20.3.3
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
(...)
OpenGL version string: 3.0 Mesa 20.3.3
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
(...)
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 20.3.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
(...)

Generate installers for Mac OS and Windows

For Windows, one program that I'm aware of is WiX, which may or may not be the right choice.

For MacOS X, we'll need to support some kind of package signing to allow the installer to run.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.