[=;182940]
Ok, good. Does it seem like the amount of tiles have almost no impact, as long as they are off screen, or is the effect just less pronounced? How is the framerate when zoomed all tne way out compared to having say 20*20 tiles in view?
I’m planning on making huge, procedural worlds, and these sorts of things will determine how I go about doing that. Worst case I have the world stored in arrays, and only spawn the tiles just before they enter view, deleting them as they leave. I can check this out myself, of course, but I suspect you have taken more time perfecting your tile spawning algorithm.
[/]
I haven’t messed with the graphical performance since I know I need to fix a few things before worrying about it. Maybe tomorrow I will take a closer look at it to see the different with and without trees, FPS changes at zoom, etc.
[=;182940]
What you are describing sounds like the difference between using the search function in an array as compared to the get function. Using search is comparable to opening every file in a file cabinet until you find the one you’re looking for, while using get is comparable to just checking a single, specific file at an index.
This is the reason why I use get functions almost exclusively, and I suspect this is the reason why my algorithm is reasonably efficient. Still, I will try to compare pathfinding on a small grid to pathfinding on a large grid in a sealed off area and report the results.
[/]
Yeah I use Get as well, and that was how I figured it worked. The person I was talking to does not work with UE4 so he may not have completely understood what I was talking about. I don’t know enough about how things work under the hood to say either way.
[=;182940]
This is with the old loop limit. Increasing the loop limit is of course not that big of a problem. However, when getting close to hitting even the old loop limit, the game freezes noticeably for about a second. For generating a map at the beginning of the game, this might be unproblematic, but for something that will be called several times during the game it is quite jarring. So the loop limit isn’t really the problem here.
[/]
Yeah I was afraid of that. Though, in a turn based game you don’t need to calculate dozens of paths at once so perhaps it can be parsed in a way that is seamless. Alternatively, I would love for a good method of pushing functions into other threads from blueprint. Use half the cores on the CPU to generate paths all day long while the rest handle generic stuff like UI and other simple logic.
[=;182940]
As it stands, I think my system is perfect for anything between the scales of King’s Bounty and XCOM, but for games lime Civ I think it is too slow at the moment. Perhaps not for player movement, but calculating all AI movement between turns is where I think my blueprint would start freezing up the game for a long time. I know of some ways to cheat by making the algorithm much quicker, but less precise, for long distances, so that’s one possible solution.
I’ll try to be as much help as I can when you get to making your own pathfinding, but I suspect you might wantto delve into C++ for something on the scale of Civ.
[/]
I think there is a way to calculate portions of the path at a time, pause, calculate some more portions, etc. Something using tick(framerate dependency?) and forloops I think. People kept telling me I should do that for the map generation, when really that is something I want to complete as soon as possible without care of a general freeze because I can still update some loading bars and shift some images in front of the player while they wait for the map to generate. Pahfinding could benefit from those suggestions though so I will have to research it some more when I get to that point.
Also I think there are quite a few ways to reduce some of the pathfinding load such as checking to see if both units are on the same continent before pathfinding the whole thing only to find you need a boat anyway. Also, I think there are ways to save commonly used paths, though that would take some serious work to get working properly I think.
In the end though, I think pathfinding will go into C++ no matter how fast I can get it working in blueprint just because either way it will be near the top in resource usage.