Jump to content

martyj

Members
  • Posts

    544
  • Joined

  • Last visited

Posts posted by martyj

  1. Window::Active is not defined in Linux.

    This code seems to provide the same functionality and would be a great addition to the Linux build.

     

    ::Window focused;
    int revert_to;
    
    XGetInputFocus(this->window->display, &focused, &revert_to);
    
    return focused == this->window->handle;

     

  2. So originally I was using Awesomium to render my UI. Currently they no longer offer a release candidate of their software, which is putting a big hamper on my transition to Linux.

    I was wondering if anyone had any tips/tricks to setting up CEF in their project.

    No matter how I setup my project I cannot get it to link against libcef.so.

    Has anyone else used CEF?

    Thanks,
    Marty

  3. I'm trying to get my game to compile via CMake and I am getthing this error

    /usr/bin/ld: /home/martyj/.steam/steam/steamapps/common/Leadwerks/Library/Linux/Debug/Leadwerks.a(Window.linux.o): undefined reference to symbol 'XdbeAllocateBackBufferName'
    //usr/lib/x86_64-linux-gnu/libXext.so.6: error adding symbols: DSO missing from command line

    Here is my library list

    target_link_libraries(WorldFactions
            m
            "${SHORT_PATH_LINK}/Linux/Debug/Leadwerks.a"
            dl
            openal
            GL
            GLU
            ${SHORT_PATH_LINK}/Linux/libsteam_api.so
            X11
            pthread)
    

     

    Any help with this would be great.

    Thanks,
    Marty

  4. My hardware:
    CPU: AMD Ryzen 7 1700X

    GPU: Nvidia 980 TI.

    I modified by build process to optimize the build for speed and removed debugging information, and this doubles the FPS to 30-45. But considering my GPU I would expect a much higher FPS. My screen resolution is 95% of 1080p.

    Dropping my resolution doesn't help with framerate as well.

    Polygon count: 500k

    Shadow polygon count: 420k

    Batches: 520

     

  5. 1 hour ago, tournamentdan said:

     @martyj What kind of miners do you have? There are people all over the world buying older equipment. 

    Right now I have 78 of the bitmain s9. Which is a little over 1ph.

    I mined the alt-coins back in the day. Protoshares was the major one that I use to mine. CPU only, so I have 30 servers in Dell bladecenters.

    Mining bitcoin has never been profitable for me. Only the alt-coins.

    • Like 1
  6. I've been in the bitcoin days since 2014. At my peak mining I had 4 bitcoin. Sold it to pay for 30 servers which are now collecting dust in my basement.

    That being said, right now we're in a bubble and it's going to crash back down to probably $5k.

    I still have 0.02984 bitcoin from my mining days that I don't plan on selling. I would have had more but BTC-E had issues and that's where I had my coin.

    I think the technology is going to last. It has huge potentials, not just at a currency level but from a business point of view. Businesses spend millions to do accounting and reconciling of invoices and checks. With bitcoin it's fairy straight forward who received what and from who. It would be a huge game changer as far as accounting is concerned in business.

    From a currency point of view I see it eventually hitting 1M per coin. Probably in about 20 years or so. The US economy IMO is also at a bubble, I see crypto currencies getting traction as more economic struggles happen.

  7. For one off linux programs I usually just do gcc executions myself.

    You could do a makefile.
     

    To get it to install on Linux I would install libenet-dev

    Then make this code change

     #include "enet-1.3.1/include/enet/enet.h" -> #include <enet/enet.h>


    Then just run g++

    g++ josh_enet_prog.pp -lenet


    Afterwards the program can be run via "./a.out"

    Passing a -o option to g++ you can specify the output name as well
     

    g++ enet.c -lenet -o myamazingprogram

     

  8. Yea you would have to run that via a service.

    For a quick hack, I usually run programs like that via screen via the command line. I think web hosts that have CPanel also offer ssh access. I don't know though.

    I'd recommend a sleep of like 20 milliseconds. 5 seconds sleep would cause a lot of lag for connections and could cause dropped packets with a lot of clients hitting your server.
     

  9. If the game tries to connect to the IP via port 80, apache/nginx would handle the requests.

    Why are you running a program every 5 seconds? Why not just having it run consistently? If you're doing what I think you are doing you'd probably be best running a program as a Linux service using something like systemd.

    That way it can continuously run listing for connections and negotiating the NAT passthrough.

  10. You could run it via a cronjob. CPanel supports cronjobs I believe. Every 5 seconds is kind of too often for a cron task though. They have a once a minute setup, but you can fake it by running 20 of them with sleeps between each process call. Something like this:
     

    ./execEnet
    sleep 5
    ./execEnet
    sleep 5
    .....

    For failures you could even setup to email you once upon failure.



    If you're looking for a dedicated server solution I recommend Linode.

    https://www.linode.com/?r=676ae2c48255ad95cf5ef53c0651f9c59d908541

    For OS I recommend Ubuntu as it is the easiest to setup and maintain.


    I have a few dedicated servers that I run if you want to try some things without spending money. Hit me up in a PM if you're interested.

     

    • Upvote 1
  11. I don't personally think the do-while loop is that useful. Hence why it hasn't been used.

    In my whole 6.5 years of professional software development, I can only recall using it once.

    The same code for Leadwerks is there as the easiest possible way to show an example of the desired method call such as Entity::SetPosition

    Complicating it with structures for learning purposes will just complicate these examples IMO.

  12. Ah very well could be hitting the memory limit.

    I didn't think of the process as being 32 bit only having access to 2.3 Gb of ram.

    I'll try Instance instead.

    So as far as the vegetation system goes, for these items I'm only using the vegetation system for layout. Instead of manually copying an entity all over my map, I'll use the easy vegetation system to layout my entities.

    I'm running a 1024x1024 terrain size.

  13. In Leadwerks 4.4 when running Model::Copy on an entity several times the game will crash.
     

    The code:

    World* world = World::GetCurrent();
    	if (world->terrain == NULL)
    	{
    		return;
    	}
    
    	std::map<std::string, std::string> vegNameEntMap = {
    		{ "fallowdeer", "Deer" },
    	};
    
    	int vegCount = world->terrain->CountVegetationLayers();
    	for (int i = 0; i < vegCount; i++)
    	{
    		VegetationLayer* layer = world->terrain->GetVegetationLayer(i);
    		std::string modelPath = layer->modelpath;
    
    		std::string parentName = "";
    		System::Print(modelPath);
    		for (auto it = vegNameEntMap.begin(); it != vegNameEntMap.end(); it++)
    		{
    			if (modelPath.find(it->first) != std::string::npos)
    			{
    				parentName = it->second;
    				break;
    			}
    		}
    
    		if (parentName.size() == 0)
    		{
    			continue;
    		}
    
    		// Hide Layer
    		layer->viewrange = 0;
    
    		Entity* model = world->FindEntity(parentName);
    		if (model == NULL)
    		{
    			continue;
    		}
    
    		Vec3 scale = model->GetScale();
    
    		AABB aabb = world->aabb;
    		std::vector<Mat4> instances;
    		layer->GetInstancesInAABB(aabb, instances);
    		System::Print("Loading Layer: " + parentName + " of Size: " + std::to_string(instances.size()));
    		for (unsigned int j = 0; j < instances.size(); j++)
    		{
    			Mat4 instance = instances[j];
    			Entity* copy = model->Copy(true, false);
    			copy->SetMatrix(instance, true);
    
    			copy->SetScale(scale);
    		}
    	}

    The program seems to consistently crash around 1.7 GB of RAM used.

    If I replace the code in the loop with this it also crashes:

    Entity* copy = Model::Load(modelPath);
    copy->SetMatrix(instance, true);
    
    copy->SetScale(scale);

    You can download my project here: (200Mb)

    (Removed)

     

    I plan to use this code for having wild animals roam my land. Using the vegetation system to place different interactable entities such as Trees or Animals.

     

  14. Hmm, must have been the case.

    When I tested it with very rough terrain it works as expected.

    Maybe you might have some tips as to what I'm trying to solve?

    I'm working on a custom Character Controller to not use a lot of CPU. I'm trying to align an entity to the slope of the ground based upon its position. I plan on doing this in two phases.

    1. If the Character is far from the player, but not far enough that it is clipped, I plan on using the terrain's normal for rotation.
    2. If the Character is close to the player, use World::Pick to get the info based upon a possible model collision.

    To get the rotation for X and Z I do the following:

    Vec3 i = Vec3(1, 0, 0);
    Vec3 k = Vec3(0, 0, 1);
    
    double xAngle = 90-Math::ACos(i.Dot(terrainNoraml));
    double zAngle = 90-Math::ACos(k.Dot(terrainNoraml));
    this->GetEntity()->SetRotation(Vec3(xAngle, rotation.y, zAngle), true);

    I think the only thing left to do is to rotate the normal vector based upon the Character's rotation.

    Is there a better way to do this?
     

×
×
  • Create New...