Jump to content

reepblue

Developers
  • Posts

    2,505
  • Joined

  • Last visited

Posts posted by reepblue

  1. 17 hours ago, Josh said:

    Fixed.

    I removed the fog settings because fog is a per-camera settings and the other stuff is all per-world.

    I am not sure how fog and post-effects should be handled yet. Intuitively it seems like they would be set for the world, but I need to determine the rules that are in place for cameras that are created in code and in the scene, and whether cameras should have their own individual settings for these, and how that interacts with the per-map setting.

    I mean, it was the same thing in Leadwerks and although confusing at first, I understood how it worked after a while.

    I think the map should store the fog/post effect information and then the end user should be able to apply them in the load function of their component. It might be too much, but that's just a quick idea I had.

  2. 1. Create a json component file with these contents.

    {
        "component":
        {
            "properties":
            [
                {
                    "name": "filter",
                    "label": "Filter",
                    "value": ""
                },
                {
                    "name": "size",
                    "label": "Size",
                    "value": [0.0, 0.0, 0.0]
                }
            ]
        }
    }

    2. Create an entity and attach the component script to it.

    3. Change both values to anything.

    4. Create a new entity, attach the same component.

    You should see that "Size" is back to 0,0,0, but the "Filter" property got carried over from the first entity. 

    • Thanks 1
  3. 9 minutes ago, Josh said:

    Oh, okay it just looks like the ambient light is not being saved in the game save.

    As I mentioned here, a lot of scene properties don't get saved from the editor. Not sure if this carries over to user saves.

    But can't wait to try this. I've been very conservative about making components because I couldn't test reloading them.

  4. 1 hour ago, Josh said:

    I don't see anything wrong. I ran the program, pressed F5, then pressed F6. Nothing bad happened.

    If I had a dollar for every time I forgot to register my components, I would have enough money to quit my job to play with Ultra Engine all day.

    You're correct, that example alone does not do anything (Minus make the ground darker for some reason). Registering the component that's used in the map should cause the crash.

    #include "UltraEngine.h"
    using namespace UltraEngine;
    
    #include "Components/Player/CameraControls.hpp"
    
    int main(int argc, const char* argv[])
    {
        RegisterComponent<CameraControls>();
    
        //Get the displays
        auto displays = GetDisplays();
    
        //Create a window
        auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);
    
        //Create a world
        auto world = CreateWorld();
    
        //Create a framebuffer
        auto framebuffer = CreateFramebuffer(window);
    
        //Load scene
        auto scene = LoadMap(world, "Maps/savetest2.ultra");
    
        //Main loop
        while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
        {
            if (window->KeyHit(KEY_F5))
            {
                //Save the starting scene to a file
                scene->Save("game.sav");
            }
    
            //Reload the starting scene when space key is pressed
            if (window->KeyHit(KEY_F6))
            {
                scene->Reload("game.sav");
            }
    
            world->Update();
            world->Render(framebuffer);
        }
        return 0;
    }

     

    • Thanks 1
  5. An awful bug I discovered when I wanted something to stop spinning when the speaker was done playing a 30 second clip.

    #include "UltraEngine.h"
    using namespace UltraEngine;
    
    int main(int argc, const char* argv[])
    {
        //Get the displays
        auto displays = GetDisplays();
    
        //Create a window
        auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);
    
        //Create a world
        auto world = CreateWorld();
    
        //Create a framebuffer
        auto framebuffer = CreateFramebuffer(window);
    
        //Create a camera
        auto camera = CreateCamera(world);
        camera->SetClearColor(0.125);
        camera->SetFov(70);
        camera->SetPosition(0, 0, -3);
        camera->Listen();
    
        //Create a light
        auto light = CreateBoxLight(world);
        light->SetRotation(35, 45, 0);
        light->SetRange(-10, 10);
    
        //Create a box
        auto box = CreateBox(world);
        box->SetColor(0, 0, 1);
    
        //Sound
        bool hasplayed = false;
        auto sound = LoadSound("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Sound/notification.wav");
        auto speaker = CreateSpeaker(sound);
        //speaker->SetLooping(true);
        speaker->SetPosition(box->GetPosition(true));
        speaker->SetRange(10);
    
        //Main loop
        while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
        {
            //Play when space key is pressed
            if (window->KeyHit(KEY_SPACE))
            {
                speaker->Play();
            }
    
            if (speaker->GetState() == SPEAKER_STOPPED && hasplayed)
            {
                hasplayed = false;
                Print("THE SPEAKER HAS STOPPED!!");
            }
            else if (speaker->GetState() == SPEAKER_PLAYING)
            {
                Print("playing");
                hasplayed = true;
            }
    
            //Move and turn with the arrow keys - best experienced with headphones
            if (window->KeyDown(KEY_UP)) camera->Move(0, 0, 0.1);
            if (window->KeyDown(KEY_DOWN)) camera->Move(0, 0, -0.1);
            if (window->KeyDown(KEY_LEFT)) camera->Turn(0, -1, 0);
            if (window->KeyDown(KEY_RIGHT)) camera->Turn(0, 1, -0);
    
            world->Update();
            world->Render(framebuffer);
        }
        return 0;
    }

     

  6. On 10/1/2023 at 5:19 PM, Josh said:

    The example you posted works without incident.

    This example causes my issue.

    #include "UltraEngine.h"
    using namespace UltraEngine;
    
    int main(int argc, const char* argv[])
    {
        //Get the displays
        auto displays = GetDisplays();
    
        //Create a window
        auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);
    
        //Create a world
        auto world = CreateWorld();
    
        //Create a framebuffer
        auto framebuffer = CreateFramebuffer(window);
    
        //Load scene
        auto scene = LoadMap(world, "Maps/savetest2.ultra");
    
        //Main loop
        while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
        {
            if (window->KeyHit(KEY_F5))
            {
                //Save the starting scene to a file
                scene->Save("game.sav");
            }
    
            //Reload the starting scene when space key is pressed
            if (window->KeyHit(KEY_F6))
            {
                scene->Reload("game.sav");
            }
    
            world->Update();
            world->Render(framebuffer);
        }
        return 0;
    }

     

    savetest2.zip

  7.  

    Some of these you probably heard me talk about before but:

    • Please add back Shift+Drag for copying., I use this all the time when shelling out maps in Leadwerks.
    • A way to generate materials without needing a texture first. (I went to create a basic glass texture from the editor, and I couldn't just make a material with its alpha set to 0.5.)
    • Some indication of forward on models/entities like an arrow or a line when selected.
    • The ability to turn Instant Creation off. As I've mentioned before, I like to frame my brushes before I make them, and I use it as a ruler for getting size dimensions.
    • Tool tips for the toolbar buttons telling you what they are along with their hotkey. 
    • An "Editor Only" shader for making tool textures like triggers.
    • A way to make Strip Lights. 😭

     

    • Upvote 6
    • "Show grid on brushes" can't be turned off. The effect doesn't disable nor does the setting save,
    • It seems nothing in the Environment tab doesn't transfer to the game. Some of the options save, others reset to default when you reload the map in the editor.
    • Probe reflections don't save within the map. 
    • There's no scene tree icon for Sprite.
    • When the "View Mode" changes for the Sprite, the viewport should redraw.
    • Sometimes, brushes refuse to snap back to the grid no matter the size of the grid. Not sure how to reproduce this to be honest, but it's annoying when it happens.
    • Like 1
  8. 4 hours ago, Josh said:

    I have temporarily disabled post-processing effects in the editor. Please confirm that this solves all your rendering problems.

    Much better. I can now make things without being easily interrupted. 

    This also fixes the asset browser too. 

  9. 15 minutes ago, Josh said:

    It appears that my GUI system is painting on top of the viewport window when it draws to the underlying window. Not sure how that is possible, but it should be solvable.

    This is what it looks like to me too. A good example is resizing the icons and seeing the shapes populate in the viewports. 

  10. 4 hours ago, Josh said:

    I found a 6600 at Best Buy, and those are probably pretty close to the 6800 so I can get that and test it later this week.

    What's important is you now in your hand have a AMD GPU! Hold on to it. Although players choose Nvidia 9 times out of 10 for Windows Gaming PCs, the tide might turn AMD for more affordable card for gaming. Plus, AMD GPUs are by far a popular choice for Linux users. Plus, the Steam Deck uses and AMD APU. 

    • Like 1
×
×
  • Create New...