Jump to content

StOneDOes

Members
  • Posts

    86
  • Joined

  • Last visited

Everything posted by StOneDOes

  1. Its a reflection of your great work! The engine API is so intuitive; I'm having quite an easy time building my game framework around it. And sure, will do.
  2. This is a little bit closer to what it will look like in terms of scale. The NavAgent class could use a few more controlling functions eg. set how much rotation must be involved to turn the object around before moving in that direction. I could drop some thoughts and feedback into the suggestion box, but I assume you already have this kind of stuff in mind @Josh?
  3. I wouldn't have thought so. Not sure. Ok so CreatePanel() takes x1, y1, height, width (not actually x2 and y2). So if you are looking at this from the perspective of an RTS where you hold click and drag to select multiple units, the point where you click becomes x1 and y1, and where ever the mouse location is once you start dragging the mouse, becomes x2 and y2. But if x1 and y1 is at 200, 200, and x2 and y2 are 100, 100 then it is problematic because you can't have a negative width and height. I can still achieve what I want using some logic, but I'm just suggesting simplicity. Does this make sense?
  4. No stress here - this is just purely for me to learn how to use the fundamentals of the engine; the objects will not be the size of that cylinder ... much smaller . I have some artwork that was created for Leadwerks some years ago so I'm going to start with that and see how it goes.
  5. Legendary, thank you! Although can you please check the speed if you don't mind? I tried SetMaxSpeed() and SetMaxAcceleration() as values all the way up to 5000 but couldn't get the object to move any faster.
  6. Thanks for this. However I'm not able to get it to work at this point. I'm assuming I've got something wrong in CreateNavMesh(). I created a minimal example by basically sticking the terrain sample and navmesh sample together, but can't get that to work either: #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the display list 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(); world->SetAmbientLight(0); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetFov(70); camera->SetPosition(0, 50, 0); camera->SetRotation(45, 0, 0); camera->SetClearColor(0.125); //Sunlight auto light = CreateDirectionalLight(world); light->SetRotation(45, 35, 0); light->SetColor(2); //Create terrain auto terrain = CreateTerrain(world, 512); terrain->LoadHeightmap("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Terrain/512.r16"); terrain->SetScale(1, 100, 1); //Create base material auto ground = CreateMaterial(); auto diffusemap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/river_small_rocks_diff_4k.dds"); auto normalmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/river_small_rocks_nor_gl_4k.dds"); ground->SetTexture(diffusemap, TEXTURE_DIFFUSE); ground->SetTexture(normalmap, TEXTURE_NORMAL); terrain->SetMaterial(ground); //Create paint material auto rocks = CreateMaterial(); diffusemap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k.dds"); normalmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k_dot3.dds"); auto dispmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k_disp.dds"); rocks->SetTexture(diffusemap, TEXTURE_DIFFUSE); rocks->SetTexture(normalmap, TEXTURE_NORMAL); rocks->SetTexture(dispmap, TEXTURE_DISPLACEMENT); //Apply material based on terrain slope for (int x = 0; x < terrain->resolution.x; ++x) { for (int y = 0; y < terrain->resolution.y; ++y) { float slope = terrain->GetSlope(x, y); if (slope > 15.0f) { float wt = Min((slope - 15.0f) / 10.0f, 1.0f); terrain->SetMaterial(x, y, rocks, wt); } } } //Camera controls auto actor = CreateActor(camera); actor->AddComponent<CameraControls>(); //Create navmesh auto navmesh = CreateNavMesh(world, 512, 512, 512, 8, 8); navmesh->Build(); //Create player auto player = CreateCylinder(world, 0.4, 1.8); player->SetColor(0, 0, 1); player->SetPosition( 0.f, 50.f, 0.5 ); player->SetScale( 10.f, 10.f, 10.f ); auto agent = CreateNavAgent(navmesh); player->Attach(agent); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->MouseHit(MOUSE_LEFT)) { auto mousepos = window->GetMousePosition(); auto rayinfo = camera->Pick(framebuffer, mousepos.x, mousepos.y); if (rayinfo.success) { agent->Navigate(rayinfo.position); } } world->Update(); world->Render(framebuffer); } return 0; }
  7. I'm wondering what the correct set of properties/functions are to apply in order to get a player like model to move around the map on my terrain. I assume that first I need to set something that will snap the model to the terrain, and then when it moves I want it to follow the terrain height in a realistic manner - I can do this manually but I assume that it is built it? I'm guessing that I may need a navmesh but haven't really looked into that yet. At this stage I just have a model that I have added an Actor to with a Mover, but that's all.
  8. It would be nice to be able to render basic 2D shapes, in a way such that you can easily resize them at any time, as oppose to having static ones that you programmatically draw into a Pixmap. For example I want to render a 2D rectangle on the UI. At the moment I'm restricted to using CreatePanel() and SetShape(). However this does not allow me to have an x2 and y2 value that are lesser than the x1 and y1 unless I write the additional logic to handle this situation; moving the whole panel to suit it.
  9. StOneDOes

    Editor WIP

    Now your just teasing us Looks good man!
  10. I see, perfect. Thanks man. mViewSquare->SetColor( Vec4( 255.f, 255.f, 255.f, 0.f ), WIDGETCOLOR_BACKGROUND ); mViewSquare->SetColor( Vec4( 255.f, 255.f, 255.f, 255.f ), WIDGETCOLOR_BORDER );
  11. Is it possible to change the border colour of a widget? The other option is to go the way of writing pixels to a Pixmap. As you can see the border on my minimap is black, and I would prefer white or maybe another colour.
  12. The UI label widget appears to ignore the \n newline character, whereas the Text Area widget utilizes it correctly. Is this the expected behaviour? Because for something like on-screen debug info I personally would prefer to have a single widget with all the text assigned to the one label, rather than having eg. 10 label widgets and having to set their positions.
  13. @Josh thank you for the detailed response. Very useful stuff. Something else thats related that I also wanted to ask, can the UI system be used to draw basic shapes eg. square/rectangle? I noticed that you can use Widget::SetShape() but there is no way to set it to to be just an outlined rectangle instead of solid/filled?
  14. Tangents run perpendicular to the normal in the direction of the texture U coordinate, and the bitangent runs perpendicular to the normal and tangent in the direction of texture V coordinate. You need to calculate the TU vector and TV vector, and you can then use these vectors and your cross vectors to derive the tangent and bitangent. I couldn't remember the exact formula, but I think this thread should provide the answer: https://stackoverflow.com/questions/5255806/how-to-calculate-tangent-and-binormal I hope this helps.
  15. Thanks for your help. The one other thing the UI camera also needs to do is Camera::SetClearMode() . I'll need to have a better read of the documentation next time. And thanks Josh for adding the new function so quickly. So now here it is. I guess the only other thing I want to do is delete the camera that snapshots the map. I'm assuming that there is correct engine function for this rather than me explicitly deleting it likely causing a crash? I mean, its not rendering in realtime anyway so it doesn't really matter.
  16. Ah ok well I have not done that. There is a sample here https://www.ultraengine.com/learn/CreateInterface?lang=cpp but I'm sure that there is something else that I would have to do since I now have 2 cameras, right? The snippet I posted is basically just in addition to the terrain sample. If I got back to single camera then perhaps I will post it.
  17. Ok, so hypothetically this should work: //Set camera for minimap snapshot camera->SetPosition( 0.f, 150.f, 0.f ); camera->SetRotation( 90.f, 0.f, 0.f ); camera->SetProjectionMode( CameraProjectionMode::PROJECTION_ORTHOGRAPHIC ); camera->SetRealtime( false ); //Create a render target and render a single frame auto renderTarget = CreateTextureBuffer( 128, 128 ); camera->SetRenderTarget( renderTarget ); camera->Render(); //Setup the UI and assign the new minimap texture auto ui = CreateInterface( window ); auto widget = CreatePanel( 0, 0, 128, 128, ui->root ); widget->SetTexture( renderTarget->GetColorAttachment() ); //Reset the render target camera->SetRealtime( true ); camera->SetRenderTarget( nullptr ); //Main loop However I run into this error before seeing anything: Error: Widget::SetTexture can only be used with a 3D interface Exception thrown at 0x00007FF70C845396 in SG23_d.exe: 0xC0000005: Access violation reading location 0x0000000000000378. I'm not sure why this is the case, because I want a 2D UI, not a 3D one. If I try using a second camera I do not hit an access violation, but I don't see a texture on screen at all (just the scene, no UI) //Set camera for minimap snapshot auto minimapCamera = CreateCamera( world ); minimapCamera->SetPosition( 0.f, 150.f, 0.f ); minimapCamera->SetRotation( 90.f, 0.f, 0.f ); minimapCamera->SetProjectionMode( CameraProjectionMode::PROJECTION_ORTHOGRAPHIC ); minimapCamera->SetRealtime( false ); //Create a render target and render a single frame auto renderTarget = CreateTextureBuffer( 128, 128 ); minimapCamera->SetRenderTarget( renderTarget ); minimapCamera->Render(); //Setup the UI and assign the new minimap texture auto ui = CreateInterface( window ); auto widget = CreatePanel( 0, 0, 128, 128, ui->root ); widget->SetTexture( renderTarget->GetColorAttachment() ); I would expect that if somehow my render to texture failed, that I would still see a grey square on screen? Must have got something wrong. EDIT: I tried just putting a button on the screen, and it seems that the button displays on the screen for about a second then once the terrain loads and appears the button is gone. It is caused by calling world->Render( framebuffer ); .
  18. After rendering a single frame to my render target, how do I reset the render target to the back buffer? Because I don't see a need to use a second camera for this. The main camera should be able to handle this just fine - its not a realtime visual minimap, just a topdown image of the world.
  19. Thanks so much for the fast support! And thanks for providing the other rendering recommendations. I'm downloading the update at the moment. After that I will try and get something working. @SpiderPigthanks for the sample.
  20. Thank you, I'll write this one down.
  21. One of the core things I want to tick off is automatic minimap generation, as my long term goal would involve a procedurally generated terrain. (For now I can manually take a screenshot if I want). To me the ideal way of doing this would be to jump the camera to the center of the terrain, face it down on a 90 angle with an orthographic projection and fit the viewport correctly to the terrain dimensions. From here I would create a render target and render a single frame to this target. From here I should be able to retrieve the image data from the texture by mapping the resource. Here's the problem - I don't know how to map and unmap image resources in Vulkan (can probably look it up), and don't know how to get a pointer to the graphic device. I assume from here that I could feed the raw data into a Pixmap? Or is there a way to directly convert a Texture to a Pixmap without doing any mapping of resources? After that I should be able to use the image as part of the UI and draw other shapes and indicators on top of it, If anyone could offer some advice that would be appreciated, thanks
  22. Its probably a good time though to run some of the example code and have a play around, and see what it can do. This is what I'm doing; I've been searching for about a month for a game engine to use that looks like it was built in this century, can be fully written in C++, is easily controllable, and feels comfortable. Its hard to find the last 3. I've taken a look at Unreal and CryEngine but crossed them off; these big AAA game engines hamstring you by forcing you into stuff like C#, flowcharts/blueprints etc, and make it very difficult to control each aspect that you want, and tries to do everything for you. This SDK feels very comfortable and familiar for me. I started writing my own game engine years ago, and its API is very similar to Ultra so I find Ultra quite intuitive, but basically I gave up somewhere after finishing cascaded shadow mapping because everything became too much of a headache - I'll just leave the hard work to Josh and finally start on a game. I'm looking to create an RTS style game, but lesser control and more unit automation, more single player, because a mere mortal like myself will never be able to compete with StarCraft 2 or this new Stormgate game coming out. To be honest I'm not a big fan of the subscription method of payment, but dev/s need to at least make some money until the engine can get some exposure. Its not that much to pay, but even if I choose not to use it I won't be out of pocket by much
  23. How did you get all of the extra debug information output? Also, it looks like you have indeed also got the same issue on your AMD card?
  24. I'm no expert in this kind of stuff, but I think there's a fair chance that you're right. I've written programs before that generate code and had no issue, but it could be some very specific pattern. I didn't mean to raise any alarm here; it was more just to make you guys aware so that perhaps it could be somehow rectified before it makes any new users concerned. The executable can be submitted to McAfee for further investigation so they can whitelist (?) it.
  25. My McAfee Virus Scan treats preprocessor.exe as a threat. I know this isn't an actual bug with the engine, but I just thought it was worth putting this on your radar:
×
×
  • Create New...