Jump to content

reepblue

Developers
  • Posts

    2,490
  • Joined

  • Last visited

Posts posted by reepblue

  1. Can the installer create a System Environment Variable for where Ultra Engine is installed? I think this will help make installing tools and sharing C++ projects easier if we can just reference something like %ULTRAENGINEPATH% in batch scripts or the PropertiesSheet.props file. 

    This is now more important as there's the Steam install and the standalone version. 

  2. Notice that components attached to entities with a parent don't save properly. I've ran into an issue where my camera (Which is a child of a pivot) rotation doesn't save automatically. I tried to patch this within the component, but then I noticed that the Load function is skipped when the scene is reloaded. Saving works fine.

    This example shows how the component load function is skipped on a scene reload call.

    #include "UltraEngine.h"
    using namespace UltraEngine;
    
    class TestComponent : public Component
    {
    public:
        TestComponent()
        {
            name = "TestComponent";
        }
    
        void Start()
        {
            Print("Start");
        }
    
        shared_ptr<Component> TestComponent::Copy()
        {
            return std::make_shared<TestComponent>(*this);
        }
    
        virtual bool Load(table& properties, shared_ptr<Stream> binstream, shared_ptr<Map> scene, const LoadFlags flags)
        {
            Print("Loading TestComponent");
            return true;
        }
    
        virtual bool Save(table& properties, shared_ptr<Stream> binstream, shared_ptr<Map> scene, const SaveFlags flags)
        {
            Print("Saving TestComponent");
            return true;
        }
    };
    
    int main(int argc, const char* argv[])
    {
        RegisterComponent<TestComponent>();
    
        if (AllocConsole())
        {
            freopen("conin$", "r", stdin);
            freopen("conout$", "w", stdout);
            freopen("conout$", "w", stderr);
        }
    
        //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 = CreateMap();
        auto camera = CreateCamera(world);
    
        auto ent1 = CreatePivot(world);
        scene->entities.push_back(ent1);
        auto ent2 = CreatePivot(world);
        ent2->SetParent(ent1);
        ent2->AddComponent<TestComponent>();
        scene->entities.push_back(ent2);
    
        //Main loop
        while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
        {
            if (window->KeyHit(KEY_F5))
            {
                //Save the starting scene to a file
                Print("Saving...");
                scene->Save("game.sav");
            }
    
            //Reload the starting scene when space key is pressed
            if (window->KeyHit(KEY_F6))
            {
                Print("Loading....");
                scene->Reload("game.sav");
            }
    
            world->Update();
            world->Render(framebuffer);
        }
        return 0;
    }
  3. As first mentioned here.

    Normals don't return the right value with GetWorld()->Pick() on brushes. It's fine with models. 

    	auto end = LoadModel(GetEntity()->GetWorld(),"Models/Developer/Widgets/normal.gltf");
    	auto p0 = GetEntity()->GetPosition(true);
    	auto p1 = TransformPoint(0, 0, viewdistance, GetEntity(), NULL);
    	pickinfo = GetEntity()->GetWorld()->Pick(p0, p1, radius, true);
    	bool lookingatvoid = !pickinfo.success;
    
    	if (!lookingatvoid)
    	{
    		// Set the end point to the position.
    		end->SetPosition(pickinfo.position);
    		end->SetRotation(0, GetEntity()->GetRotation(true).y, 0);
    		end->AlignToVector(pickinfo.normal);
    	}

    image.thumb.png.4d07ea4ccd8919ff74506ca3a2bb9ef7.png

    Wanted to make this it's own thread so it doesn't get forgotten. 

  4. On the subject of a widget, I think it's more important for the 3D viewport than the 2D viewports. I love moving things around in the 2D viewport, but in 3D, it can get a little sloppy.

    I mostly liked the widgets because they automatically showed the origin point and the entity's rotation (In local mode) without anything else being needed. 

    • Like 2
  5. 9 hours ago, Josh said:

    When dragging a model into the 3D viewport, if it is dropped onto an existing surface, the final position will now be rounded off to the grid size. I am not 100% satisfied with this behavior, but I don't know yet how to round it to the grid size while staying aligned to the plane of the picked position / normal.

    I got to play with it and my first reaction was:

    iFunny :)

    The example models snap right into place where I want it to go. It feels so much better. For uniformed models, this is perfect, but I understand not every model is like this. Making brushes seems much better, but it might be a placebo effect. I'll have to play with it more. 

    But I was the only one complaining about this, I guess let's see if anyone else finds this a step forward or backward.

  6. Most of the time, I place objects in the 2D view since it's closer to the File Browser panel. Maybe that should be more grid locked than the 3D view port? One of the few reasons I would use the 3D view to place objects would be to place objects on surfaces having the model's align to the surfaces normal which doesn't seem to be in the editor currently afaik. 

    Also one feature (or bug) I don't like is when you place an object on the Top 2D grid view and the item gets placed on it's side. It's like the Top grid viewport is being handled the same way as Back/Side.

    I'll try to play with your changes tonight and get back to you.

  7. Thought so (It's still a bug tho).

    27 minutes ago, Josh said:

    If we want the position to be rounded to the grid, then it is probably necessary to take into consideration the picked normal.

    This is why I thought it was the normal messing this up. Read this too fast. 

    While the current system is correct I don't think it feels right. In Leadwerks, placing models in the scene snaps the model to the nearest grid point. This felt great especially when the model's origin accommodated the model. I don't want to manually type in the entity's position to get it back on the grid. 

    This is what I want in the new editor with the option to turn it off for more natural placement of objects for rocks and such. 

  8. 18 minutes ago, Josh said:

    When you drag a model onto the surface it does a pick to see if something is hit, and if so it drops the model in the picked position.

    Ok, this makes sense why it's not working as intended. I don't think the AlignToVector/pickinfo.normal on brushes is working as intended. 

    This is my visual result on a model:

    image.thumb.png.73f43768bb0631790f88d310a3a909b9.png

    Same code on the brush

    image.thumb.png.4d07ea4ccd8919ff74506ca3a2bb9ef7.png

    All I'm doing is:

    	auto end = LoadModel(GetEntity()->GetWorld(),"Models/Developer/Widgets/normal.gltf");
    	auto p0 = GetEntity()->GetPosition(true);
    	auto p1 = TransformPoint(0, 0, viewdistance, GetEntity(), NULL);
    	pickinfo = GetEntity()->GetWorld()->Pick(p0, p1, radius, true, InteractionPickFilter);
    	bool lookingatvoid = !pickinfo.success;
    
    	if (!lookingatvoid)
    	{
    		// Set the end point to the position.
    		end->SetPosition(pickinfo.position);
    		end->SetRotation(0, GetEntity()->GetRotation(true).y, 0);
    		end->AlignToVector(pickinfo.normal);
    	}

    Edit: Maybe it doesn't have anything to do with it? It's a bug regardless..

  9. 16 minutes ago, DirectXY said:

    Now Radeon on Blender is for me a constant crash and miss. I can't get it to work. So I stick with Cycles.

    Cycles are fine since Leadwerks uses Blinn-Phong shading. I usually just bake the AO and everything else I do is in gimp. I'm not a professional artist! :D

    Also, you might find this helpful.

     

    • Upvote 1
  10. New build is up.

    This has the hands-off approach to pausing and the new SetActionSetCursor function for the game controller. Bug fixes and other small adjustments have are also included.

    There is also commented code for the Console as I was experimenting with how it should work. I've reached the conclusion that the Console Window will be enabled by a macro define by default. The next step regarding this is to restructure how UI Elements can work. You should be able to draw the same UIElement with the Interface or in Vulkan. This will also be useful for the settings too. 

    Last, the Preprocessor application is the UAK version cutting down in file sizes.  

    • Like 1
  11. 6 hours ago, Josh said:

    I don't plan to include the Steamworks library in Ultra, if it can be avoided.

    Well, the git repo is open to anyone. Maybe people will contribute to it. I personally just need Acheivements/Stats, Leaderboards, and Steam Input and I'm happy, but I get that people might need more. I can look into porting some of your code into this in the future. 

  12. I personally don't think a 1.0 release can't exist without proper grid snapping. I found level editing frustrating with the model's origin not snapping to the grid. This was way better in Leadwerks.

    Also, not being able to see the origin point is also unhelpful. If we can just get a sphere drawn at the model's origin when it's selected, that would be great.

    • Upvote 2
×
×
  • Create New...