Jump to content

reepblue

Developers
  • Posts

    2,490
  • Joined

  • Last visited

Posts posted by reepblue

  1. If Josh is ok with it, it would be cool if someone can port the code into this code base. I'm not sure I should be the one that should be doing this. My networking experience is nil and I don't have a good way of testing this.

  2. When resizing the grid in the editor, I notice that the reported grid sizes go by the following.

    • 5.0mm
    • 1.0
    • 2.0
    • 4.0
    • 8.0
    • 16.0
    • 32.0
    • 64.0
    • 1.3
    • 2.6
    • 5.1
    • 10.2

    I dunno if this is just visual but I've ran into an issue with brushes no longer being on the grid when making geometry and I'm under the impression this is the cause. 

    While I'm here, placing models doesn't feel right like it was in Leadwerks. I'm having issues placing models exactly where I want them. This seems to be the issue of the drag and drop system. To guarantee the model is on the grid, I have to set the position to 0,0,0 and then everything seems to work as intended. 

    I should point out that most of my trouble is working with the 2D grid viewports. 

  3. On 11/1/2023 at 4:06 AM, klepto2 said:

    One thing that comes into my mind is: why doing a pause generally. The easiest solution might be to don't pause at all and leave it up to the developer. As a reference the ingame consoles in most games don't pause (i can't really think of any game which pauses the game in this case)

    This will be fixed in the next update. The console will no longer pause the game. It will instead change the Action Set to null before storing the previous set. Then it'll reapply the last Action Set when it's closed. I tried making it swap Action Sets based on what window was selected but I got weird results. I think it's time to make an in-game one and only have this as a fallback.

    You'll now be able to set mouse cursor types to an Action Set. It'll tell the application to swap cursors when SetActionSet() is called. If one isn't set, the default cursor will be used.

    controller->SetActionSetCursor("InGameControls", CURSOR_NONE);

    The only thing that'll pause your game is if you press the assigned Pause action key. Not even Terminate will pause the game.

  4. Sometime in the near future, I would like to give materials custom tags like I can for entities. This way I can mark a material to a surface type (concrete, metal, plastic, etc) , where it's intended to be used (space ship, shopping mall, etc) or any flags I want to apply to it (eg nocyclone).

    Then sometime later, I wish to search materials via tags. 

    • Upvote 2
  5. I'm getting a Seek error with my game system, but this code should reproduce it with the map file below.

    #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/saveloadparent.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;
    }

     

    saveloadparent.zip

  6. I've been watching a few tutorials from other engine and the trend is that people like to visually construct things. 

    Right now, to make a first-person player one would.

    1. Create a Pivot in the scene.
    2. Attach the FPSController component. 

    Now, this is all well and good, but things can be complicated for the non-programmer type. I'm experimenting with an approach that the user "builds" their player out of multiple components.

    1. Place a Pivot or Model for the player.
    2. Create a camera and parent it to the player entity having the end user set the height of the camera in the editor.
    3. Attach a FPSController component that ONLY handles controller movement and gets the camera reference via GetChild().
    4. End user can attach multiple components to the camera such as custom look controls, HUD, etc.
    5. User would ideally save this as a prefab, but this isn't in the current build of the editor yet. 

    I've already created two components with this approach, and I can already tell you it's so much easier to segregate functionality. 

  7. Might as well get this started now although it's not going to be useful for a while.

    Github

    I mostly copied and pasted code from Cyclone. All it supports right now. is the overlay, stats and achievements. I used my own class with achievements for Cyclone because the one in the Leadwerks API held up the achievement notification until the application was closed. To be honest, the overlay and achievements is what most people want anyway. 

    The Steamworks API can be a chore to work with. I hope to streamline this in the future. 

    • Like 6
  8. Pushed out an update.

    • Settings.bat has $PROJECTNAME token so the template system will swap it with the name of the project (untested)
    • Both Debug and Release builds are Windowed applications to have a cleaner appearance launching from the editor. 
    • Replaced CallCMDWindow() function with what @klepto2 posted above. (Launch the app with -cmd to make the console window.)
    • Prevented empty strings being sent through the console event. 
    • Terminate() now asks if you really mean to force close the application. Sorta annoying but it feels much cleaner. Now you know if your game closes without asking, it's decently a crash. (To close the game without a confirmation, just emit EVENT_QUIT. Terminate is only used to get you out of a sticky situation.)
    • Added a note about UAC and the Component Preprocessor. 

     

    15 hours ago, klepto2 said:

    closing the console window doesn't resume the scene

    This is kind of tricky to do since we need to store the previous pause state and I'm not sure where to store it. The softlock is due to the stock Components not being setup to unpause the game. 

     

    15 hours ago, klepto2 said:

    Using the sample scene (don't know if this is a bug in UltraEngine or the template) saving a quick save and reloading disables the door component. The close or open state works, but after the closing or opening the trigger will not work anymore

    Must be the component/engine. The system just calls World::Save()/World::Load() functions. 

     

    15 hours ago, klepto2 said:

    Some ideas for the template itself:

    • Try to add some more samples showing the intended workflow (e.g.: Main-Menu, loading and saving, in game options)
    • Provide an in game console which did not need an actual window. (the console is very nice, but it is a bit of the mainstream if another window is opening, especially when the app is running in full screen)

    In due time. This went from being something you dropped in your existing project to a full template. I decided to go this route because adding all the files was tedious, and it helps prevent any conflicts Josh may want to push out. 

     

    6 hours ago, Josh said:

    Also, if you can build the preprocessor with Ultra App Kit you will get a much smaller executable.

    Just set up a UAK project. I had to change a few things so I'm gonna battle test it before releasing it. But yes, went from 20MB to 744KB! 

  9. My guess is that Windows is blocking the direct execution because it's a foreign app.  Manually run the application tell UAC to trust the app. 

    Or build try building the Preprocessor from the GitHub and use your version. Ether way, I didn't factor that into account. 🫢

  10. A few changes:

    • This is now installable as a Template. Copy the "C++ Game" into the engine's Template folder and create a new project off of that. I didn't redistribute any SDK files so right now the start.ultra map will not work unless you were to copy over the stock components yourself. 
    • Removed start.ultra from the config's start map to prevent said issues. 
    • Visual Studio project is now included with all files added. 
    • My Component Preprocesor is now being used to make the component registration much more seamless. 
    • The app icon is now orange.
    • Fixed any issues causing build errors. 

    Some things I'm considering:

    • Create a new start.ultra map to override the stock one.
    • Ship my own components making use of the rest of the system. 
    • I've got more developer textures. I was going to ship it in its own package. I'm not sure including it would more help or bother people. 
    • Editing the template solution is really annoying. I might revive my premake setup. This will really help when Ultra Engine goes multiplatform. 

     

    • Like 1
  11. This simple application will scan your Components directory and create a function that'll register all your components in the engine. Use this in your Pre-Build event and then call the RegisterComponents() on top of your main entry. 

    I didn't battle test this yet, but it seems to work. 

    You are free to fork it, improve it, etc via GitHub

    You can download the exe here.

    • Like 3
  12. 14 minutes ago, Josh said:

    Your little command language looks cool. This is probably more useful than exposing full Lua programming.

    What are the extents/limitations of the syntax? Is it just "command arg1, arg2, arg3?"

    One of the things I don't like is that you need to cut the full line of text by spaces every time. The system I had for Cyclone only had the arguments available in a vector.  This is a limitation of the Event System, but having it event based makes commands less static and it's way easier to do component based commands.

    One thing I still don't like thats in both systems is you need to do size checks on the argument vector before using it to prevent crashing. Other than that, it's a canvas for the programmer to do whatever they need done. 

  13. Although cxxopts looks interesting, I wanted to stay exclusive to the engine's API for this. I didn't want to do anything that could/would change the workflow of how things are normally done with the engine.

    I might consider separating the logs by type though, I already have it sorted by colors at this point. 

  14. Move the camera to the bottom edge of the framebuffer. 0,0 should be the top left of the screen. Then you can use the size of the framebuffer to position the sprite wherever you want like if you were using the Interface class. 

    local size = framebuffer:GetSize()
    cam2:SetPosition(size.x * 0.5, size.y * 0.5f)

     

  15. You're not setting your cam2 or your sprite to a new render layer.

    Not much of a Lua user, but try this.

    --Get the displays
    local displays = GetDisplays()
    
    --Create window
    local window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[1])
    
    --Create framebuffer
    local framebuffer = CreateFramebuffer(window)
    
    --Create world
    local world = CreateWorld()
    
    --env map
    local specmap = LoadTexture("./Materials/Environment/Default/specular.dds")
    local diffmap = LoadTexture("./Materials/Environment/Default/diffuse.dds")
    world:SetEnvironmentMap(specmap, ENVIRONMENTMAP_BACKGROUND)
    world:SetEnvironmentMap(specmap, ENVIRONMENTMAP_SPECULAR)
    world:SetEnvironmentMap(diffmap, ENVIRONMENTMAP_DIFFUSE)
    
    --[[load map
    local mapname = "Maps/scene1.ultra"
    local cl = CommandLine()
    if type(cl["map"]) == "string" then mapname = cl["map"] end
    local scene = LoadMap(world, mapname)
    --]]
    
    --Create light
    local light = CreateBoxLight(world)
    light:SetRange(-10, 10)
    light:SetArea(15, 15)
    light:SetRotation(45, 35, 0)
    light:SetColor(2)
    
    --Load a font
    local font = LoadFont("Fonts/arial.ttf")
    local fontsize = 36
    
    
    -- Create a camera
    local camera = CreateCamera(world,PROJECTION_PERSPECTIVE)
    camera:SetClearColor(0.125)
    camera:SetPosition(0, 5, 0)
    
    --Create second camera
    local cam2 = CreateCamera(world,PROJECTION_ORTHOGRAPHIC)
    cam2:SetPosition(0, 0, 0)
    cam2:SetClearMode(CLEAR_DEPTH)
    cam2:SetRenderLayers(1)
    
    -- Create sprite
    local sprite = CreateSprite(world, font,"HEY YOU !",fontsize) 
    sprite:SetColor(1, 1, 1, 1)
    sprite:SetPosition(0, 0, 0)
    sprite:SetRenderLayers(1)
    
    --Camera controls to look around
    require 'Components/Player/CameraControls'
    camera:AddComponent(CameraControls)
    
    --main loop
    while not window:KeyDown(KEY_ESCAPE) do 
        world:Update()
        world:Render(framebuffer)
    end

    This should spawn the sprite in the center of the screen.

  16. Was playing with this. This truly makes it super easy to get skyboxes into Ultra Engine! 

    If you place the extension within the Engine's Tool Directory, you can use this script to launch the application right from the editor which is much more convenient.

    --[[
        This extention is intended to be used with Klepto2's PBR Texture Generator
        https://www.ultraengine.com/community/topic/62344-pbr-texture-generator/
    ]]--
    local extension = {}
    extension.toolpath = "/Tools/PBRTextureGen/UltraPBRTextureGen.exe"
    
    function extension.hook(event, extension)
        if event.id == EVENT_WIDGETACTION then
            RunFile(AppDir()..extension.toolpath)
        end
    end
    
    --------------------------------------------------------------------
    -- Add menu item
    --------------------------------------------------------------------
    
    local menu = program.menu:FindChild("Scripting", false)
    if menu == nil then
        Print("Error: Could not find \"Scripting\" menu.")
        return
    end
    
    if menu ~= nil then
        local submenu = menu:FindChild("Generate", false)
        if submenu == nil then
            submenu = CreateMenu("Generate", menu)
        end
        extension.menuitem = CreateMenu("PBR Texture Generator", submenu)
    end
    
    ListenEvent(EVENT_WIDGETACTION, extension.menuitem, extension.hook, extension)

     

    • Like 3
  17. One thing I noticed when making an extension to the editor is that Windows gets really annoying when saving anything manually to the Program Files folder. Another thing is that you may want certain extensions for specific projects. 

    Maybe move "global" extensions to the user Documents folder, and then have the editor also read extensions within the project folder if it doesn't already. 

    On that note, I also think the blacklist filter should also be extended to be project based with an entry defined within the Ultra.json file. Maybe I don't want to see .dds files in a project that I want to use .basis files, etc.

×
×
  • Create New...