Jump to content

Ultra Engine testing


Josh
 Share

Recommended Posts

I still don't see where you saw it. 🤪 What you bought was a dummy subscription plan I was using for testing.

I refunded your purchase. I admire your determination!

  • Sad 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

2 minutes ago, Josh said:

I still don't see where you saw it. 🤪 What you bought was a dummy subscription plan I was using for testing.

I refunded your purchase. I admire your determination!

Seem subscription item are gone now, I can't find now....
Maybe I just purchase same time your team testing...

  • Sad 1
Link to comment
Share on other sites

 

I still had a terrible time getting the component system to work. It still doesn't seem to work out of the box.

First had to add a set of quotes around my path as it had a space in it. After deleting the Component files and doing a full rebuild, I got it to compile. 

I think the header out of the box should have blank definitions for the Actor and Component class. This way the first Component to be written is enjoyable with Intelisense. 

 

  • Upvote 2

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

Update

  • Entity::Control never really stuck for me, it's called Entity::SetInput now
  • Gamepad API changed to be more consistent with the rest of the API, documentation is already updated
  • Other small fixes here and there
  • Like 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

1 hour ago, reepblue said:

I still had a terrible time getting the component system to work. It still doesn't seem to work out of the box.

First had to add a set of quotes around my path as it had a space in it. After deleting the Component files and doing a full rebuild, I got it to compile. 

I think the header out of the box should have blank definitions for the Actor and Component class. This way the first Component to be written is enjoyable with Intelisense. 

I found that the class name must be exactly the same as the name of the component header file. Maybe the preprocessor can be made smarter here.

I uploaded a dummy ComponentSystem.h file that declares the actor and component classes so at least intellisense sees those.

The way I see this working eventually is the client app will monitor the project folder and run the precompiler whenever a file in Source/Components changes. That way intellisense will update when a file is saved instead of just on the builds.

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

There is a Model::Clear() method that will remove all meshes leaving a single empty Lod. You can do this and then add the meshes in that you want it to use.

  • Like 1
  • Thanks 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

Update

I am doing Lods by distance, not screen size. I found the latter was unpredictable. You would have an object popping in and out just by rotating it, it makes no sense at all to do things that way.

  • Like 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

With the latest version i get the following when a Terrain is in the scene:

Program: ...s\Shadow\Documents\Ultra Engine\Environment\Environment_d.exe
File: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include\vector
Line: 1748

Expression: vector subscript out of range
>	Environment_d.exe!std::vector<class UltraCull::CullingLOD,class std::allocator<class UltraCull::CullingLOD> >::operator[](unsigned __int64)	Unbekannt
 	Environment_d.exe!UltraCull::CullingModel::Draw(class std::shared_ptr<class UltraCull::CameraVisibilityList> &,class std::map<class std::shared_ptr<class UltraRender::RenderMesh>,class std::shared_ptr<class UltraCull::SurfaceBatch>,struct std::less<class std::shared_ptr<class UltraRender::RenderMesh> >,class std::allocator<struct std::pair<class std::shared_ptr<class UltraRender::RenderMesh> const ,class std::shared_ptr<class UltraCull::SurfaceBatch> > > > &,class std::shared_ptr<class UltraCull::CullingWorld>,class std::shared_ptr<class UltraCull::CullingBuffer>,class std::shared_ptr<class UltraCull::CullingCamera>,class std::shared_ptr<class UltraRender::RenderCamera>,bool,int)	Unbekannt
 	Environment_d.exe!UltraCull::CullingNode::Draw(class std::shared_ptr<class UltraCull::CameraVisibilityList> &,class std::map<class std::shared_ptr<class UltraRender::RenderMesh>,class std::shared_ptr<class UltraCull::SurfaceBatch>,struct std::less<class std::shared_ptr<class UltraRender::RenderMesh> >,class std::allocator<struct std::pair<class std::shared_ptr<class UltraRender::RenderMesh> const ,class std::shared_ptr<class UltraCull::SurfaceBatch> > > > &,class std::shared_ptr<class UltraCull::CullingWorld>,class std::shared_ptr<class UltraCull::CullingBuffer>,class std::shared_ptr<class UltraCull::CullingCamera>,class std::shared_ptr<class UltraRender::RenderCamera>,bool,int)	Unbekannt
 	Environment_d.exe!UltraCull::CullingTerrain::Draw(class std::shared_ptr<class UltraCull::CameraVisibilityList> &,class std::map<class std::shared_ptr<class UltraRender::RenderMesh>,class std::shared_ptr<class UltraCull::SurfaceBatch>,struct std::less<class std::shared_ptr<class UltraRender::RenderMesh> >,class std::allocator<struct std::pair<class std::shared_ptr<class UltraRender::RenderMesh> const ,class std::shared_ptr<class UltraCull::SurfaceBatch> > > > &,class std::shared_ptr<class UltraCull::CullingWorld>,class std::shared_ptr<class UltraCull::CullingBuffer>,class std::shared_ptr<class UltraCull::CullingCamera>,class std::shared_ptr<class UltraRender::RenderCamera>,bool,int)	Unbekannt
 	Environment_d.exe!UltraCull::CullingOctreeNode::DrawEntities(class std::shared_ptr<class UltraCull::CameraVisibilityList> &,class std::map<class std::shared_ptr<class UltraRender::RenderMesh>,class std::shared_ptr<class UltraCull::SurfaceBatch>,struct std::less<class std::shared_ptr<class UltraRender::RenderMesh> >,class std::allocator<struct std::pair<class std::shared_ptr<class UltraRender::RenderMesh> const ,class std::shared_ptr<class UltraCull::SurfaceBatch> > > > &,class std::shared_ptr<class UltraCull::CullingWorld>,class std::shared_ptr<class UltraCull::CullingBuffer>,class std::shared_ptr<class UltraCull::CullingCamera>,class std::shared_ptr<class UltraRender::RenderCamera>,class UltraEngine::Vec3 const &,int,int,bool,int)	Unbekannt
 	Environment_d.exe!UltraCull::CullingOctreeNode::Draw(class std::shared_ptr<class UltraCull::CameraVisibilityList> &,class std::map<class std::shared_ptr<class UltraRender::RenderMesh>,class std::shared_ptr<class UltraCull::SurfaceBatch>,struct std::less<class std::shared_ptr<class UltraRender::RenderMesh> >,class std::allocator<struct std::pair<class std::shared_ptr<class UltraRender::RenderMesh> const ,class std::shared_ptr<class UltraCull::SurfaceBatch> > > > &,class std::shared_ptr<class UltraCull::CullingWorld>,class std::shared_ptr<class UltraCull::CullingBuffer>,class std::shared_ptr<class UltraCull::CullingCamera>,class std::shared_ptr<class UltraRender::RenderCamera>,class UltraEngine::Vec3 const &,int,bool,bool,int)	Unbekannt
 	Environment_d.exe!UltraCull::CullingCamera::BuildVisibilityLists(class std::shared_ptr<class UltraCull::CullingWorld>,class std::shared_ptr<class UltraCull::CullingBuffer>,class std::shared_ptr<class UltraCull::VisibilityList>)	Unbekannt
 	Environment_d.exe!UltraCull::CullingWorld::BuildVisibilityLists(class std::shared_ptr<class UltraCull::CullingBuffer>,class std::shared_ptr<class UltraCull::CullingWorld>)	Unbekannt
 	Environment_d.exe!UltraCull::CullingThreadManager::Update(bool)	Unbekannt
 	Environment_d.exe!UltraCore::ThreadManager::EntryPoint(class std::shared_ptr<class UltraEngine::Object>)	Unbekannt
 	Environment_d.exe!UltraEngine::Thread::thread_function(void *)	Unbekannt
 	ucrtbased.dll!00007fffce663010()	Unbekannt
 	kernel32.dll!00007ff86b7374b4()	Unbekannt
 	ntdll.dll!00007ff86bde26a1()	Unbekannt

 

  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Link to comment
Share on other sites

Update

This is very very impressive because it means if you just stick to some simple rules, all your games have automatic save state serialization. A game like Concealment would really benefit from this.

  • Like 3

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

Small but simple addition to the CameraControls Component:

class CameraControls : public Component
{
public:
    bool freelookstarted = false;
	float mousesmoothing = 0.0f;
	float mouselookspeed = 1.0f;
	float movespeed = 4.0f;
	Vec2 freelookmousepos;
	Vec3 freelookrotation;
	Vec2 lookchange;
	Vec2 multiplier = Vec2(10.0,0.25);

	KeyCode key_slowdown = KEY_CONTROL;
	KeyCode key_speedup = KEY_SHIFT;
	KeyCode key_up = KEY_E;
	KeyCode key_down = KEY_Q;
	KeyCode key_left = KEY_A;
	KeyCode key_right = KEY_D;
	KeyCode key_forward = KEY_W;
	KeyCode key_backward = KEY_S;

	bool freelookMode = true;

	virtual void Update()
    {
		auto window = ActiveWindow();
		if (window == NULL) return;

		if (freelookMode)
		{
			if (!freelookstarted)
			{
				freelookstarted = true;
				freelookrotation = entity->GetRotation(true);
				freelookmousepos = window->GetMouseAxis();
			}
			auto newmousepos = window->GetMouseAxis();
			lookchange.x = lookchange.x * mousesmoothing + (newmousepos.y - freelookmousepos.y) * 100.0f * mouselookspeed * (1.0f - mousesmoothing);
			lookchange.y = lookchange.y * mousesmoothing + (newmousepos.x - freelookmousepos.x) * 100.0f * mouselookspeed * (1.0f - mousesmoothing);
			if (Abs(lookchange.x) < 0.001f) lookchange.x = 0.0f;
			if (Abs(lookchange.y) < 0.001f) lookchange.y = 0.0f;
			if (lookchange.x != 0.0f or lookchange.y != 0.0f)
			{
				freelookrotation.x += lookchange.x;
				freelookrotation.y += lookchange.y;
				entity->SetRotation(freelookrotation, true);
			}
			freelookmousepos = newmousepos;
		}

		float speed = movespeed / 60.0f;
		if (window->KeyDown(key_speedup))
		{
			speed *= multiplier.x;
		}
		else if (window->KeyDown(key_slowdown))
		{
			speed *= multiplier.y;
		}

		if (window->KeyDown(key_up)) entity->Translate(0, speed, 0);
		if (window->KeyDown(key_down)) entity->Translate(0, -speed, 0);
		if (window->KeyDown(key_right)) entity->Move(speed, 0, 0);
		if (window->KeyDown(key_left)) entity->Move(-speed, 0, 0);
		if (window->KeyDown(key_forward)) entity->Move(0, 0, speed);
		if (window->KeyDown(key_backward)) entity->Move(0, 0, -speed);
    }
}; 

It let you configure the keys for moving, the speed factors for slowdown or speedup and lets you suspend the freelookmode.

  • Like 1
  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Link to comment
Share on other sites

Just a few things I encountered and currently evaluating how this could be solved. 

Background: I want to add a very basic ocean material (or water material) which first mimics the shallow water of Leadwerks Engine. Therefore, I have checked your animated texture blog post : https://www.ultraengine.com/community/blogs/entry/2715-animated-textures/

What i noticed: the current shaders don't support animations, and I guess this is due to the changes in the material pipeline. Artifacts of this are still in the "base.vert.glsl" and I was able to recreate them, but the "fragment.glsl" just uses 2d Texture lookups currently and the Texture_Animation Def is not passed to the fragment stage.

If i understand it correctly the refraction is a deffered step, after everything is rendered, so technically it is a posteffect running before all other posteffects and takes the transparent objects as an input and calculates the refraction based on the material. So back to my thinking: Water or every other liquid doesn't have fixed alpha levels. so just setting the alpha of an object just works for very rare edgecases like a glass or the fluid in the glass (very thin layers of liquids). Maybe it would be possible to set some kind of function to the refraction-step: where the real transparency is based on the real thickness of the current medium (based on the view dependend ray from the surface to the underling depth).

image.thumb.png.bbb51c355b7ec8cedd45871999cc0638.png

 

 

  • Upvote 1
  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Link to comment
Share on other sites

On 11/27/2022 at 1:51 PM, Josh said:

Gamepad API changed to be more consistent with the rest of the API, documentation is already updated

Does the gamepad emit events like the keyboard/mouse? I think it should for when the controller is connected, disconnected, each button press and events when each axis hits it's maximum value.

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

I don't know if there is any type of event emitted in Windows when a gamepad is connected. Internally, the system works by querying the state. So I don't know if there is a way to make a gamepad "wake up" the machine when it is paused waiting for an event.

https://learn.microsoft.com/en-us/windows/win32/api/xinput/nf-xinput-xinputgetstate

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

I mean like have the engine itself emit an event. From my research, there are is nothing in WinAPI for polling XInput.

If you were to emit an engine event in the update function based on conditions, that would be helpful. Only issue is that you'd need to poll the update function somewhere else.

This will make it easier to do things like have the game paused if a controller is disconnected.

I also have an idea to port my existing input code to use the Ultra API which is why I'm asking.

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

When you call WaitEvent(), the program goes to sleep until the system emits an event. There's no way to force it awake, so plugging in a controller would not do anything.

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

@klepto2Yes, the transparency/refraction does a lot, but water could use some extra features.

I believe all the components are present in the refraction shader so that a new shader could handle depth-based transparency and foam in shallow water. These would require that transparency refraction be turned on for that camera.

  • 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

  • Josh changed the title to Ultra Engine testing
  • Josh locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...