Jump to content

StOneDOes

Members
  • Posts

    86
  • Joined

  • Last visited

Posts posted by StOneDOes

  1.  

    I'm playing around with some of the example code, starting with Terrain. I've taken and run the exact sample code from the following page:
    https://www.ultraengine.com/learn/CreateTerrain?lang=cpp

    There appears to be some visual artifacting with the multiple textures. Removing the displacement map from the texture did not solve it. However it does not occur if I just apply a single texture.
    I took a short video sample to demonstrate this.

    My PC Information : Windows 10
    CPU    - AMD Ryzen 9 3900X 12 Core @3.8GHz
    GFX    - AMD Radeon RX 6600 XT (with latest driver installed from https://www.amd.com/en/support/graphics/amd-radeon-6000-series/amd-radeon-6600-series/amd-radeon-rx-6600-xt)
    RAM    - Corsair Vengeance RGB PRO 16GB DDR4 @3200MHz

    Thank you

     

  2. 22 hours ago, GorzenDev said:

    as far as i know that is the only way.

     

    Hmm okay, but do you have any idea as to why it may be causing break points when I compile and run in release mode (At exactly when I assign the function pointer to the widget)? Because strangely enough it only happens *most* of the time ... sometimes it can run just fine, but runs fine every time in debug mode.

  3. Sorry to bump this but I really was hoping to get some advice here. Is there any current setup in C++ for some type of event handling with widget's other than what I've tried already? I was hoping for a better way, but also when compiling in Release Mode assigning a function pointer as a member variable to a Widget causes break points.

  4. Thanks mate, sounds good to me. That's what I was thinking in terms of having a multidimensional array - at this stage I believe I'm only going to be using a flat terrain, which I may change later. Perhaps I'll try something more advanced in a further version of the game where footpaths can possible be more so painted on, and use more complex terrain as well. Maybe that spline tools could be very useful for me one day.

  5. 15 minutes ago, Portal 2 GLaDOS said:

    Since no one has responded to me I decided to get a refund, I assume the engine will just stop being updated and I wont get my moneys worth like Thirsty Panther.

    Sorry to hear. But perhaps you should have read more into the dev blog that was posted - it's clear that it's going to be updated constantly.

  6. 11 hours ago, Josh said:

    This is not yet officially supported, but you want to use the GUI image commands.  A GUI may be created on a window (which you guys don't need, but I do to make the Leadwerks 5 editor) or on a context.  Depending on which is used, the image class will either use textures or OS commands to produce the same results.

    Okay thank you for the heads up.  Also your suggestion works fine:

    Image *image = gui->LoadImageA( "Materials/GUI/button1.tex" );
    widget->SetImage( image );
    widget->Redraw();

    The only issue I've run into now is that Leadwerks is automatically resizing my button image into multiples of 64. I also can't find a way to rescale the image. Is there a way around this?

  7. Hi guys,

    Trying to get your take on the correct usage of the Image class. I'm trying to change the image of a widget using SetImage(). It seems that the documentation is incomplete, missing the Image class (unless I've missed it :S). Through trying to use this class, I've noticed that Image::Load() has been commented out in Window.win32.h (perhaps it was not finished?).

    I instead tried something like:

    wstring str = L"Materials/GUI/button1.tex";
    
    Image *image = new Image();
    image->Initialize( str );

    Which exited my program after attempting a run, not sure why. 

    Log:

    Quote

    The thread 0x2600 has exited with code 1 (0x1).
    The thread 0x12e0 has exited with code 1 (0x1).
    The thread 0x14e8 has exited with code 1 (0x1).
    The thread 0x3030 has exited with code 1 (0x1).
    The thread 0x382c has exited with code 1 (0x1).
    The thread 0x2574 has exited with code 1 (0x1).
    The thread 0x28e4 has exited with code 1 (0x1).
    The thread 0x2120 has exited with code 1 (0x1).
    The thread 0x53ac has exited with code 1 (0x1).
    The thread 0xe58 has exited with code 1 (0x1).
    The thread 0x3f0c has exited with code 1 (0x1).
    Detected memory leaks!
    Dumping objects ->
    {122} normal block at 0x0D3BA260, 16384 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {120} normal block at 0x0D3B6230, 16384 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {119} normal block at 0x0D3E8890, 16384 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {118} normal block at 0x0D3E4860, 16384 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {112} normal block at 0x0179AF20, 16384 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {111} normal block at 0x12121008, 16384 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {110} normal block at 0x0D39FBA8, 16384 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {109} normal block at 0x0D3DC7B0, 32896 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {108} normal block at 0x121282A8, 65664 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {107} normal block at 0x01792E70, 32896 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {106} normal block at 0x12118F58, 32896 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {105} normal block at 0x0D397AF8, 32896 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {104} normal block at 0x12140928, 98368 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {98} normal block at 0x017A35A8, 8 bytes long.
     Data: < [z     > 04 5B 7A 01 8B 84 9D 01 
    {92} normal block at 0x017A37A0, 8 bytes long.
     Data: < Zz     > 10 5A 7A 01 8B 84 9D 01 
    {91} normal block at 0x017A5968, 2688 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    {89} normal block at 0x017B9FC8, 336 bytes long.
     Data: <cccccccccccccccc> 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 
    Object dump complete.

     

  8. 6 hours ago, Portal 2 GLaDOS said:

    That'll be free too? Great, glad I'll get the same treatment as you in being able to get new versions over time.

    Panther was referring to having already bought the engine, and then getting the free updates.

    • Like 1
  9. 1 hour ago, gamecreator said:

    As far as I can tell, none of the widget or GUI commands have C++ examples, which is a little disappointing.  I tried to get it working here but it was buggy at the time: https://www.leadwerks.com/community/topic/16418-gui-commands-meant-to-be-cumulative/
    Not sure if Josh ever fixed it or if I was even using it right.

    Cool, thanks for this ... I realised that GUI::Create() has 2 other overloads earlier, but I'm not sure why I didn't try using context instead of the window. Using context instead seems to solve my problem (also Enable() and Show() are not necessary - from my example). Now I'll try some event research and see if I can get some stuff working.

    EDIT:

    Cool, and it works:

    if( EventQueue::Peek() )
        {
            Event event = EventQueue::Wait();
    
            if( event.id == Event::WidgetAction )
            {
                //do stuff here
            }
        }

    And then from here, I can edit Widget.h to store a function pointer which I can assign when creating the widget, and then call from it from inside the above, like so:

    Object *source = event.source;
    
    Widget *widget = dynamic_cast<Widget*>( source );
    widget->function();

    Thoughts on this?

  10. Hi guys,

    I'm trying to get the hang of drawing a GUI but falling rather short on actually getting anything to draw correctly. Right now I can create a button, but it only renders for a single frame when i hover the mouse over it and un-hover. So this leads me to believe that I need to perhaps render it every frame?

    Here's a test example:

    #include <Leadwerks.h>
    using namespace Leadwerks;
    
    int main( int argc,const char *argv[] )
    {
        Window *window = Window::Create( "Some game", 100, 100, 400, 400, Window::Titlebar );
        Context *context = Context::Create( window );
    
        GUI *gui = GUI::Create( window );
        Widget *button = Widget::Create( "Some Button", 100, 100, 100, 100, gui->GetBase(), "Scripts/GUI/Button.lua" );
    
        button->Enable();
        button->Show();
    
        while( !window->Closed() )
        {
            //button->Draw( 100, 100, 100, 100 );
            context->Sync( true, 60.f );
        }
    
        context->Release();
        window->Release();
    
        return 0;
    
    }

    Now, if I uncomment the Draw function I get an exception thrown on the following line.

    Thanks in advance for any help.

     

    EDIT:

    Just found this useful thread: https://www.leadwerks.com/community/topic/16487-understanding-new-gui-widgets/

     

    Would calling Button::Redraw() every frame be the right way to go about this?

    And while I'm here, is there also a way to hook the event of button press in c++ or does it have to be done with lua?

  11. Hi guys,

    Just wondering how to go about having multiple instances of the same actual model? Let's take a model of a fence for example - if every time I wish to deploy a fence, if I call Model::Load() will Leadwerks actually load this model every time? Or will it load it once, store it, and return a copy of it for me?

    Or do I need to set up my own system that loads each model I need once, which returns a copy each time I need one?

    Thank you.

  12. Hi guys,

     

    What sort of technique would you recommend in order for building a footpath in a game like rollercoaster tycoon? I would like to be able to click with the mouse and place a footpath tile. Would decals be the right way to go here? Would they be efficient enough, since there could be (hypothetically) somewhat hundreds of tiles on screen at a time?

     

    Thank you.

  13. Hi there, 

    I'm hoping to start a bit of a conversation regarding multiplayer game concepts using LE. I have read a few threads regarding multiplayer but there are not that many going in to depth, but then I've also seen some videos of what some people have managed implement (such as synced vehicle physics). My game isn't quite at the multiplayer stage yet, but hopefully I'll have a lot of it planned by the time it comes around.

    Firstly, I'd like to point out the fact that I like how LE uses a simple "do it yourself" messaging system, as oppose to having that extra layer on top that does the job for you. Not only the more you do yourself the more you learn, but the control over it so much better if your trying to create something like an information bubble.

    Sending and receiving basic messages from connection, to chat, kicked, banned etc. are a simple case. But syncing other life in the world becomes more difficult. After working with the Half Life 1 engine for several years I've picked up a few ideal concepts. What I've gathered is, sending messages to update a player's coordinates every time they move is a lost cause. Sending a key press to the server and have the server simulate the player's movement appears like an optimal way to go. The player will press the forward key, and that key press would be sent to the server, and with the server knowing the player's spawn location, it would be able to simulate movement based on this key press. The only catch I've found so far, is when setting an entity to use CharacterPhysics, you use SetInput() to control them. Assuming this is the right way to go, how would you send a key press message to the server if the player input is controlled by the engine? Or is there a more effective way?

    Then you also have vehicle physics. I don't have a lot of experience with LE yet, so I'll also put forward this question - does the physics engine have any randomisation in it? Or, if I crashed one vehicle into another, at the exact same spot, same angle, exact same force, will it result in the exact same physical reaction each time? This knowledge would also help fill the gap.

    Please share any ideas that your happy to give away.

    Thanks in advance.

  14. On 26/07/2017 at 5:00 PM, Josh said:

    You can retrieve more than one message per loop, which allows the server to catch up if a bunch are received at once.

    Is there a particular way to do this? Or are you suggesting something like while( client->update() != nullptr ) { ... } ?

  15. 14 hours ago, Einlander said:

    A connection is a message that it needs to send. IIRC it will do nothing until the client calls update.

    Thanks for this. You were right, after calling Update() on the client, the server received the connect message, and the connect messag appeared on the Client end as well.

  16. 2 hours ago, Einlander said:

    I think the client needs to have it's own while loop with a Update() call. 

    Thanks for your reply. That will be implemented on the client end when I'm ready, but shouldn't that only be required to actually receive a message from the server? I like to ensure things work step by step, so at the moment I want confirmation that there is an established connection.

  17. Hi guys,

    I expected the new multiplayer system to be rather easy to use, as I've done manual connection and message sending before, but I can't seem to receive the connect message on the server end. I run the server application first, and then then the client application many seconds later, both on the same PC, but pMessage is always null. I'm also receiving a value in pPeer on the client end, so it seems like there is a successful connection. Can anyone see where I have gone wrong here?

    Here's what I have at the moment.

    Server:

    int main()
    {
    	Window *pWindow = Window::Create( "Server", 100, 100, 400, 200, Window::Titlebar );
    	Server *pServer = Server::Create();
    
    	Message *pMessage;
    
    	while( true )
    	{
    		if( pWindow->Closed() || pWindow->KeyHit( VK_ESCAPE ) )
    			break;
    
    		pMessage = pServer->Update();
    
    		if( pMessage == nullptr )
    			continue;
    
    		if( pMessage->id == Message::Connect )
    		{
    			cout << "Player connected to the game." << endl;
    		}
    
    		pMessage->Release();
    		pMessage = nullptr;
    	}
    
    	pServer->Release();
    	pWindow->Release();
    
    	return 0;
    }

     

    Client:

    bool App::Start()
    {
    	m_pWindow = Window::Create( "Client", 100, 100, 800, 600, Window::Titlebar );
    	
    	Client *pClient = Client::Create();
    	Peer *pPeer = pClient->Connect( "127.0.0.1" );
    
    	return true;
    }

     

    Thanks in advance.

×
×
  • Create New...