Jump to content

Ultra Engine testing


Josh
 Share

Recommended Posts

1 hour ago, Josh said:

I have not done any comparisons of this, but from that screenshot it's apparent my approach of using persistent 2D objects has performance that absolutely destroys imGUI's immediate mode method.

It'll probably be a bit faster once those drop shadows are instanced!

One thing imGUI does have out of the box is resizable/moveable panel windows within the context, but can probably make my own with some work. 

Can't wait to try these updates. I have so many ideas.

  • Like 1

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

Respect your decision on the payment model although not one I personally will go for. Happy to further support Leadwerks on Steam however by purchasing the addons, can't wait to see what can be done with it seems a great editor as I couldn't really get on board with Godot and Unity etc.

Link to comment
Share on other sites

This was working last night.  Now the program crashes without fail when parenting the camera to a pivot.

#include "UltraEngine.h"
#include "ComponentSystem.h"

using namespace UltraEngine;

int main(int argc, const char* argv[])
{
    auto displays = GetDisplays();
    auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);
    auto world = CreateWorld();

    auto framebuffer = CreateFramebuffer(window);

    auto camera = CreateCamera(world);
    camera->SetClearColor(0, 0, 1);
    camera->SetFov(70);
    camera->SetPosition(0, 2, -3);

    auto font = LoadFont("Fonts/arial.ttf");
    auto ui = CreateInterface(world, font, framebuffer->size);
    ui->SetRenderLayers(RENDERLAYER_1);
    ui->root->SetColor(0, 0, 0, 0);

    auto terrain = CreateTerrain(world, 512, 512);

    auto player = CreateCylinder(world);
    player->SetMass(1.0f);
    player->SetPhysicsMode(PHYSICS_PLAYER);

    auto cam_pivot = CreatePivot(world);
    cam_pivot->SetParent(player);

    camera->SetParent(cam_pivot);


    auto light = CreateDirectionalLight(world);
    light->SetRotation(35, 45, 0);
    light->SetRange(-10, 10);

    auto floor2 = CreateBox(world, 1000.0f, 0.1f, 1000.0f);

    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {
        float move = 0.0f, strafe = 0.0f;
        if (window->KeyDown(KEY_W) == true) {
            move = 1.0f;
        }
        else if (window->KeyDown(KEY_S) == true) {
            move = -1.0f;
        }

        if (window->KeyDown(KEY_A) == true) {
            strafe = -1.0f;
        }
        else if (window->KeyDown(KEY_D) == true) {
            strafe = 1.0f;
        }
        player->SetInput(0.0f, move, strafe);

        world->Update();
        world->Render(framebuffer);
    }
    return 0;
}

 

Link to comment
Share on other sites

21 minutes ago, toonmad said:

Respect your decision on the payment model although not one I personally will go for. Happy to further support Leadwerks on Steam however by purchasing the addons, can't wait to see what can be done with it seems a great editor as I couldn't really get on board with Godot and Unity etc.

That's fine. What I cannot do is sell you a game engine that will be abandoned in six months, which is what would happen if I sold Ultra under the one-time purchase model, because sales would completely stop after the first month.

  • Like 1
  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

3 minutes ago, SpiderPig said:

This was working last night.  Now the program crashes without fail when parenting the camera to any entity.

Works fine for me?

  • Confused 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

This example throws an error saying lua51.dll is missing.

#include "UltraEngine.h"
#include "ComponentSystem.h"

using namespace UltraEngine;

int main(int argc, const char* argv[])
{
    auto displays = GetDisplays();
    auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);
    auto world = CreateWorld();

    auto framebuffer = CreateFramebuffer(window);

    auto camera = CreateCamera(world);
    camera->SetClearColor(0, 0, 1);
    camera->SetFov(70);
    camera->SetPosition(0, 2, -3);

    auto box = CreateBox(world);
    box->SetField("MyVar", "Hello");

    auto what_is_it = box->GetValue<String>("MyVar");
    

    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {

        world->Update();
        world->Render(framebuffer);
    }
    return 0;
}

 

Link to comment
Share on other sites

I wonder if you would consider adding back the user data member for entities like in Leadwerks?  I find that quite useful, more so than the setting of fields and it wouldn't use lua.  Something like this perhaps?  Just a thought.

shared_ptr<Object> object;
void SetObject(shared_ptr<Object> object) {
	this->object = object;
}

shared_ptr<Object> GetObject() {
	return object;
}

 

Link to comment
Share on other sites

Something else I was playing with last night was loading in additional search paths, so I didn't have to copy and paste assets to test. First I added the following to my Ultra.json file to look like this.

{
	"project": {
		"name": "Sample App",
		"templates": [
			"C++",
			"Common"
		],
		"validationLayers": {
			"debug": [
				"VK_LAYER_KHRONOS_validation"
			],
			"release": []
		},
      
		"packages":
		[
			"../core/core_shaders.zip"
		]
	}
}

This worked for packages, because I used FullPath when loading the package entry. Now I'm wondering if we could load an unpackaged directory the same way. I want it so I only have to update my core directory with the client and have all my projects load all those files. LoadDir only indexes the contents of the directory and not load it within the virtual filesystem.

Would it be possible to make a plugin that does this?

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

Yeah, I can understand that there might be confusion. The current system prioritizes packages before raw contents on the disk. If you have 2 files integrated with the same paths on the same file structure, which file does it actually load? Should the contents of the mod folder take priority over the in-game files? 

As an experiment, I implemented my own with custom load wrappers. Right now, I'm more worried about loading files that aren't there vs overriding my game files. This doesn't affect engine loading calls. If you added mod folder support, it would fix my dilemma. 

	const UltraEngine::WString GetGlobalFile(const UltraEngine::WString& pszFilePath)
	{
		UltraEngine::WString path = pszFilePath;
		if (!path.empty())
		{
			// If we've found it within the game directory, return this path.
			if (UltraEngine::FileType(UltraEngine::CasedPath(path)) != 0 and UltraEngine::FileSize(UltraEngine::CasedPath(path)) != 0) return path;

			// File isn't located where we thougnt it was. Check addional search paths..
			for (const auto& p : m_vSearchPaths)
			{
				auto trypath = UltraEngine::CasedPath(p + L"/" + pszFilePath);
				if (UltraEngine::FileType(trypath) != 0 and UltraEngine::FileSize(trypath) != 0)
				{
					// This is good, break the loop.. 
					path = trypath;
					break;
				}
			}
		}
		return path;
	}

 

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

Just thought I'd mention that very rarely I get errors thrown from the thread manager.  They aren't random, they occur seemingly for stupid reasons - for instance this works fine...

Vec3 offset = Vec3(10.0f, 1.0f, 5.0f);
float scale = 2.0f;
vector<shared_ptr<Entity>> entities;
for (int z = 0; z < 10; z++) {
    for (int x = 0; x < 10; x++) {
        auto e = CreateSphere(world);
        e->SetColor(Random(), Random(), Random());
        e->SetPosition(Vec3((float)x * scale, 0.0f, (float)z * scale) + offset, true);
        e->SetMass(1.0f);

        entities.push_back(e);
    }
}

But if I change to this, it crashes in the thread manager...

e->SetPosition(Vec3((float)x * scale + Random() - 0.5f, 0.0f, (float)z * scale + Random() - 0.5f) + offset, true);

The same code works fine in a new project and in some other projects.   I've had similar cases pop up here an there in my larger projects.  When and If I can pinpoint it further I'll make an example for you Josh.  Right now I'd thought I'd just mention it to see if anyone else has seen something similar yet.

And now after a few more changes elsewhere the loop works again! :blink:

Link to comment
Share on other sites

  • Josh locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...