ickylevel Posted September 28, 2014 Report Share Posted September 28, 2014 (edited) Hello all,From last year when I last checked the game we still have this huge performance issue. What is the status on this? It seems to occurs when lots of units are moving. I have had a look and it doesn't seem to be due to the pathfinding at first sight but I am pretty new to the code. is pathfinding being called constantly for moving units? The lag occurs at every turn and doesn't seem to be altered if the turn length is changed.Does anyone know the game architecture? I know it has a turn system like age of empire but that's all my knowledge of it. It seems to me that the first frame of the turn has to do all the calculations which is causing all the lag. Is this something inherent to the game engine or is it fixable?Also I have noticed a important framerate drop (10 fps out of 40) due to the drawing of the unit list panel (in javascript) which is the cause for the game running slower if units are selected. Edited September 28, 2014 by ickylevel Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 28, 2014 Report Share Posted September 28, 2014 The Pathfinder still needs to be rewritten. It's called only when moving units. So if you do nothing it won't lag About the Unit List, what version are you on ? Quote Link to comment Share on other sites More sharing options...
ickylevel Posted September 29, 2014 Author Report Share Posted September 29, 2014 (edited) Hello,I am using the latest trunk from svn. Actually i managed to improve performance significantly by having the pathfinder recompute only the short path when a unit gets stuck by colliding with another unit. it makes a 1v1 playable at 300 population WITHOUT formation (which is the laggiest in theory). it still a bit laggy when the population reach that level tough. I think i can achieve good results by making workers ignoring collisions when harvesting, a la starcraft 2. Edited September 29, 2014 by ickylevel Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 29, 2014 Report Share Posted September 29, 2014 Well you could submit patches to wraiti's pathfinder branch on github. https://github.com/wraitii/0ad/commits/pathfindingI'm interested of the slowdown you have when using the interface, could you be more specific ? And maybe create a ticket patch for it ? Quote Link to comment Share on other sites More sharing options...
niektb Posted September 29, 2014 Report Share Posted September 29, 2014 Stan, sounds like the issue I had, but that has been fixed recently. Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 29, 2014 Report Share Posted September 29, 2014 Stan, sounds like the issue I had, but that has been fixed recently.I had it too, but he says he is using latest svn... Quote Link to comment Share on other sites More sharing options...
ickylevel Posted October 1, 2014 Author Report Share Posted October 1, 2014 When has it been fixed? I am now having an error with the latest trunk: Cannot open include file: 'SDL_keysym.h': No such file or directory Quote Link to comment Share on other sites More sharing options...
niektb Posted October 1, 2014 Report Share Posted October 1, 2014 (edited) A couple of weeks ago.What are you doing when the error occurs? Edited October 1, 2014 by niektb Quote Link to comment Share on other sites More sharing options...
ickylevel Posted October 1, 2014 Author Report Share Posted October 1, 2014 Well some of the commits removed the sdl includes. I don't know which one I just reverted a couple of revision and it works.This is stuff that has been removed :C:\Users\ickylevel\work\0ad\libraries\win32\sdlC:\Users\ickylevel\work\0ad\libraries\win32\sdl\includeC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDLC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_config_macos.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_config.h.defaultC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_config_dreamcast.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_error.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_audio.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_cpuinfo.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_events.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_video.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_thread.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_config.h.inC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_rwops.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_active.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\begin_code.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_timer.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_stdinc.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_opengl.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_main.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_version.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_config_symbian.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_config_win32.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_config_os2.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_getenv.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_mouse.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\close_code.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_endian.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_byteorder.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_joystick.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_keyboard.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_mutex.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_config_amiga.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_types.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_cdrom.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_config.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_copying.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_config_nds.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_config_minimal.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_config_macosx.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_name.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_loadso.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_keysym.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_quit.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_syswm.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\include\SDL\SDL_platform.hC:\Users\ickylevel\work\0ad\libraries\win32\sdl\libC:\Users\ickylevel\work\0ad\libraries\win32\sdl\lib\SDL.libC:\Users\ickylevel\work\0ad\libraries\win32\sdl\lib\SDLmain.lib 1 Quote Link to comment Share on other sites More sharing options...
niektb Posted October 1, 2014 Report Share Posted October 1, 2014 That is true. SDL has been replaced by its successor SDL2. Quote Link to comment Share on other sites More sharing options...
ickylevel Posted October 1, 2014 Author Report Share Posted October 1, 2014 I can't find what commit deleted them in the logs... But I have looked at every revision in it.I am on windows 7 and I can't compile anymore: 7>c:\users\ickylevel\work\0ad\source\lib/sysdep/os/win/wsdl.h(33): fatal error C1083: Cannot open include file: 'SDL_keysym.h': ... 1 Quote Link to comment Share on other sites More sharing options...
niektb Posted October 1, 2014 Report Share Posted October 1, 2014 (edited) Could you check if you have appended --sdl2 to your update-workspaces.bat? (WSDL is also removed) Edited October 1, 2014 by niektb Quote Link to comment Share on other sites More sharing options...
ickylevel Posted October 1, 2014 Author Report Share Posted October 1, 2014 Thanks i didn't re-run the batch file. Everything is fine. Quote Link to comment Share on other sites More sharing options...
niektb Posted October 1, 2014 Report Share Posted October 1, 2014 Happy to hear that. Quote Link to comment Share on other sites More sharing options...
ickylevel Posted October 1, 2014 Author Report Share Posted October 1, 2014 I still get a 30% frame-rate drop when units are selected. I go from 30 fps to 40 If I deselect a group of 100 units or if I comment out the javascript code of the selection panel. Quote Link to comment Share on other sites More sharing options...
Stan` Posted October 1, 2014 Report Share Posted October 1, 2014 Mmmmh Can you open a ticket on trac ?http://trac.wildfiregames.com/wiki/ReportingErrorsThis shouldn't happen. Quote Link to comment Share on other sites More sharing options...
Radagast. Posted October 1, 2014 Report Share Posted October 1, 2014 (edited) Isn't sdl2 the default for windows by now (and thus shouldn't be required with the --sdl2)? Please try again with the newest SVN version as Itms recently fixed a similar selection lag issue. (which doesn't mean that another issue could still remain) Sorry for the noise if that is what you already used. Edited October 1, 2014 by Radagast. Quote Link to comment Share on other sites More sharing options...
Stan` Posted October 4, 2014 Report Share Posted October 4, 2014 @ickylevelCan you check if this commit makes it better ?http://trac.wildfiregames.com/changeset/15836 Quote Link to comment Share on other sites More sharing options...
ickylevel Posted October 6, 2014 Author Report Share Posted October 6, 2014 (edited) It doesn't help. But can you reproduce the issue by the way? Have like an army of 100, select them, make them move and then try selecting and deselecting to see the fps difference. Making them move is easier to spot the fps diff if you dont have a counter, Edited October 6, 2014 by ickylevel Quote Link to comment Share on other sites More sharing options...
Stan` Posted October 6, 2014 Report Share Posted October 6, 2014 It's always laggy when moving units now... We definitely need to create a ticket. It should be a release blocker. Since A17 will be out in a few days, I guess it will be for A18 though... Quote Link to comment Share on other sites More sharing options...
meap Posted October 12, 2014 Report Share Posted October 12, 2014 To come back to the original question of this topic, my feeling is that the origin of the huge lag performance problems is still not quite clear and has different sources.Sure, path finding is a source of problem. But I suspect another sources like the AI or stucked units...An status of these issues would indeed help ;-) Quote Link to comment Share on other sites More sharing options...
ickylevel Posted October 23, 2014 Author Report Share Posted October 23, 2014 As I said obstructed units do too much calculations, so I propose this fix :Index: simulation2/components/CCmpObstructionManager.cpp===================================================================--- simulation2/components/CCmpObstructionManager.cpp (revision 15848)+++ simulation2/components/CCmpObstructionManager.cpp (working copy)@@ -431,7 +431,7 @@ } } - virtual bool TestLine(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r);+ virtual bool TestLine(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t &x1, entity_pos_t &z1, entity_pos_t r); virtual bool TestStaticShape(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, std::vector<entity_id_t>* out); virtual bool TestUnitShape(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, std::vector<entity_id_t>* out); @@ -536,7 +536,7 @@ REGISTER_COMPONENT_TYPE(ObstructionManager) -bool CCmpObstructionManager::TestLine(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r)+bool CCmpObstructionManager::TestLine(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t &x1, entity_pos_t &z1, entity_pos_t r) { PROFILE("TestLine"); @@ -559,8 +559,12 @@ CFixedVector2D center(it->second.x, it->second.z); CFixedVector2D halfSize(it->second.r + r, it->second.r + r);- if (Geometry::TestRayAASquare(CFixedVector2D(x0, z0) - center, CFixedVector2D(x1, z1) - center, halfSize))+ if (Geometry::TestRayAASquare(CFixedVector2D(x0, z0) - center, CFixedVector2D(x1, z1) - center, halfSize)) {+ x1 = center.X;+ z1 = center.Y; return true;+ }+ } std::vector<entity_id_t> staticShapes;Index: simulation2/components/CCmpPathfinder.cpp===================================================================--- simulation2/components/CCmpPathfinder.cpp (revision 15848)+++ simulation2/components/CCmpPathfinder.cpp (working copy)@@ -583,6 +583,8 @@ } } ++ void CCmpPathfinder::ProcessShortRequests(const std::vector<AsyncShortPathRequest>& shortRequests) { for (size_t i = 0; i < shortRequests.size(); ++i)Index: simulation2/components/CCmpPathfinder_Common.h===================================================================--- simulation2/components/CCmpPathfinder_Common.h (revision 15848)+++ simulation2/components/CCmpPathfinder_Common.h (working copy)@@ -260,7 +260,7 @@ virtual CFixedVector2D GetNearestPointOnGoal(CFixedVector2D pos, const Goal& goal); - virtual bool CheckMovement(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, pass_class_t passClass);+ virtual bool CheckMovement(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t &x1, entity_pos_t &z1, entity_pos_t r, pass_class_t passClass); virtual ICmpObstruction::EFoundationCheck CheckUnitPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, pass_class_t passClass); Index: simulation2/components/CCmpPathfinder_Tile.cpp===================================================================--- simulation2/components/CCmpPathfinder_Tile.cpp (revision 15848)+++ simulation2/components/CCmpPathfinder_Tile.cpp (working copy)@@ -420,7 +420,7 @@ // Hack to avoid spending ages computing giant paths, particularly when // the destination is unreachable- if (state.steps > 40000)+ if (state.steps > 10000) break; // If we ran out of tiles to examine, give upIndex: simulation2/components/CCmpPathfinder_Vertex.cpp===================================================================--- simulation2/components/CCmpPathfinder_Vertex.cpp (revision 15848)+++ simulation2/components/CCmpPathfinder_Vertex.cpp (working copy)@@ -851,7 +851,7 @@ } bool CCmpPathfinder::CheckMovement(const IObstructionTestFilter& filter,- entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r,+ entity_pos_t x0, entity_pos_t z0, entity_pos_t &x1, entity_pos_t &z1, entity_pos_t r, pass_class_t passClass) { CmpPtr<ICmpObstructionManager> cmpObstructionManager(GetSystemEntity());Index: simulation2/components/CCmpUnitMotion.cpp===================================================================--- simulation2/components/CCmpUnitMotion.cpp (revision 15848)+++ simulation2/components/CCmpUnitMotion.cpp (working copy)@@ -629,6 +629,11 @@ ControlGroupMovementObstructionFilter GetObstructionFilter(bool forceAvoidMovingUnits = false); /**+ * Returns an appropriate obstruction filter for use with path requests.+ */+ ControlGroupMovementObstructionFilter GetObstructionFilterNoAvoid();++ /** * Start moving to the given goal, from our current position 'from'. * Might go in a straight line immediately, or might start an asynchronous * path request.@@ -892,11 +897,17 @@ fixed maxSpeed = basicSpeed.Multiply(terrainSpeed); bool wasObstructed = false;+ bool wasObstructedTerrain = false; // We want to move (at most) maxSpeed*dt units from pos towards the next waypoint fixed timeLeft = dt; fixed zero = fixed::Zero();++ fixed targetX;+ fixed targetY;++ fixed maxdist; while (timeLeft > zero) {@@ -907,14 +918,18 @@ CFixedVector2D target(m_ShortPath.m_Waypoints.back().x, m_ShortPath.m_Waypoints.back().z); CFixedVector2D offset = target - pos; + + // Work out how far we can travel in timeLeft- fixed maxdist = maxSpeed.Multiply(timeLeft);+ maxdist = maxSpeed.Multiply(timeLeft); // If the target is close, we can move there directly fixed offsetLength = offset.Length(); if (offsetLength <= maxdist) {- if (cmpPathfinder->CheckMovement(GetObstructionFilter(), pos.X, pos.Y, target.X, target.Y, m_Radius, m_PassClass))+ targetX = target.X;+ targetY = target.Y;+ if (cmpPathfinder->CheckMovement(GetObstructionFilter(), pos.X, pos.Y, targetX, targetY, m_Radius, m_PassClass)) { pos = target; @@ -927,7 +942,10 @@ else { // Error - path was obstructed- wasObstructed = true;+ if (target.X != targetX || target.Y != targetY)+ wasObstructed = true;+ else+ wasObstructedTerrain = true; break; } }@@ -936,8 +954,9 @@ // Not close enough, so just move in the right direction offset.Normalize(maxdist); target = pos + offset;-- if (cmpPathfinder->CheckMovement(GetObstructionFilter(), pos.X, pos.Y, target.X, target.Y, m_Radius, m_PassClass))+ targetX = target.X;+ targetY = target.Y;+ if (cmpPathfinder->CheckMovement(GetObstructionFilter(), pos.X, pos.Y, targetX, targetY, m_Radius, m_PassClass)) { pos = target; break;@@ -945,12 +964,68 @@ else { // Error - path was obstructed- wasObstructed = true;+ if (target.X != targetX || target.Y != targetY)+ wasObstructed = true;+ else+ wasObstructedTerrain = true; break; } } } + if (wasObstructed)+ {+ // Oops, we hit something (not terrain).+ // const AsyncLongPathRequest& req = longRequests[i];++ /*+ ICmpPathfinder::Path pathf;+ m_PathState = PATHSTATE_WAITING_REQUESTING_LONG;+ cmpPathfinder->ComputePath(pos.X, pos.Y, m_FinalGoal, m_PassClass, m_CostClass, pathf);+ PathResult(m_ExpectedPathTicket,pathf);+ */++ m_PathState = PATHSTATE_FOLLOWING_REQUESTING_SHORT;+ ICmpPathfinder::Path path;+ ICmpPathfinder::Goal goal(m_FinalGoal);+ ICmpPathfinder::Waypoint way;+ //if (m_LongPath.m_Waypoints.size() > 0)+ // way = m_LongPath.m_Waypoints.back();+ //else+ way = m_ShortPath.m_Waypoints.front();+ goal.x = way.x;+ goal.z = way.z;+ cmpPathfinder->ComputeShortPath(GetObstructionFilter(), pos.X, pos.Y, + m_Radius, SHORT_PATH_SEARCH_RANGE, goal , m_PassClass, path);+ PathResult(m_ExpectedPathTicket,path);+ ++ /*+ CFixedVector2D diffHit(targetX - pos.X,targetY - pos.Y);+ diffHit.Normalize();++ fixed pdistance = diffHit.X.Multiply(diffHit.X) + diffHit.Y.Multiply(diffHit.Y) ;+ pdistance = pdistance.Sqrt();+ diffHit.X = -diffHit.X; + diffHit.Y = -diffHit.Y;+ maxdist = maxdist - pdistance;+ diffHit = diffHit.Multiply( maxdist ) + pos;+ targetX = diffHit.X;+ targetY = diffHit.Y;+ if (cmpPathfinder->CheckMovement(GetObstructionFilter(), pos.X, pos.Y, targetX, targetY, m_Radius, m_PassClass))+ {+ pos = diffHit;+ }+ */+ }++ if (wasObstructedTerrain)+ {+ m_CurSpeed = zero;+ RequestLongPath(pos, m_FinalGoal);+ m_PathState = PATHSTATE_WAITING_REQUESTING_LONG;+ }+ // Update the Position component after our movement (if we actually moved anywhere) if (pos != initialPos) {@@ -964,20 +1039,7 @@ m_CurSpeed = cmpPosition->GetDistanceTravelled() / dt; } - if (wasObstructed)- {- // Oops, we hit something (very likely another unit).- // Stop, and recompute the whole path.- // TODO: if the target has UnitMotion and is higher priority,- // we should wait a little bit.- - m_CurSpeed = zero;- RequestLongPath(pos, m_FinalGoal);- m_PathState = PATHSTATE_WAITING_REQUESTING_LONG;-- return;- }-+ // We successfully moved along our path, until running out of // waypoints or time. @@ -1229,8 +1291,19 @@ return ControlGroupMovementObstructionFilter(forceAvoidMovingUnits || ShouldAvoidMovingUnits(), group); } +ControlGroupMovementObstructionFilter CCmpUnitMotion::GetObstructionFilterNoAvoid()+{+ entity_id_t group;+ if (IsFormationMember())+ group = m_TargetEntity;+ else+ group = GetEntityId(); + return ControlGroupMovementObstructionFilter(false, group);+} ++ void CCmpUnitMotion::BeginPathing(CFixedVector2D from, const ICmpPathfinder::Goal& goal) { // Cancel any pending path requestsIndex: simulation2/components/ICmpObstructionManager.h===================================================================--- simulation2/components/ICmpObstructionManager.h (revision 15848)+++ simulation2/components/ICmpObstructionManager.h (working copy)@@ -171,7 +171,7 @@ * @param r radius (half width) of line * @return true if there is a collision */- virtual bool TestLine(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r) = 0;+ virtual bool TestLine(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t &x1, entity_pos_t &z1, entity_pos_t r) = 0; /** * Collision test a static square shape against the current set of shapes.Index: simulation2/components/ICmpPathfinder.h===================================================================--- simulation2/components/ICmpPathfinder.h (revision 15848)+++ simulation2/components/ICmpPathfinder.h (working copy)@@ -148,7 +148,7 @@ * or impassable terrain. * Returns true if the movement is okay. */- virtual bool CheckMovement(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, pass_class_t passClass) = 0;+ virtual bool CheckMovement(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t &x1, entity_pos_t &z1, entity_pos_t r, pass_class_t passClass) = 0; /** * Check whether a unit placed here is valid and doesn't hit any obstructions Quote Link to comment Share on other sites More sharing options...
ickylevel Posted October 23, 2014 Author Report Share Posted October 23, 2014 I need to update the workers javascript (I think its the script) code so they dont collide when they harvest, and the game would become playable 1v1 with a 300 population cap. Quote Link to comment Share on other sites More sharing options...
thamlett Posted October 24, 2014 Report Share Posted October 24, 2014 Have you uploaded this patch to a ticket? Quote Link to comment Share on other sites More sharing options...
iNcog Posted October 28, 2014 Report Share Posted October 28, 2014 (edited) This is some very interesting stuff right here. I would like to try this out for myself if possible. I've been messing around in single player a bit and indeed, large movements of units continue to be a thorn in the side of the game. I get ~110 fps in game throughout the game but as soon as units need to move you get freezes, the time it takes for the engine to calculate everything. I'm still unable to code anything. I still have a question though. Would it be possible to find a way to rewrite pathfinding code so that it's well-threaded? e.g. it will scale off more than one CPU core. This is what I get after playing a single player skirmish: http://i.imgur.com/0I5eoBs.png I'm not sure how it would be possible though. I'm guessing that every unit would have to recalculate its path using the exact same equation or something? The only thing that changes for each unit's equation are the variables of the problem. Would that be well-threaded or something? Or perhaps task the thread for long-range path-finding to one core and then the other thread for short-range path-finding to another core. Everyone has at least two cores on their CPU. I understand it's difficult to make a task scale off more than one core obviously. However, shouldn't it be possible? I actually have no idea what I'm talking about but maybe we can start a discussion or something, idk. Pathfinding and multiplayer lag are the two biggest issues with 0 AD which are, imo, the issues that need to be looked at the first. I understand that obviously, these are probably the most difficult problems to tackle. This is why I'd like to try out / discuss ickylevel's pathfinding solution. I understand there are certain rules that need to be followed, given that this is an open-source project (i.e. a continuity that everyone needs to follow). However maybe those rules should be tweaked to be more lenient. Personally, with formations gone, units have interesting movement. I actually feel they're more realistic now, especially the way cavalry moves around the map. The way they clump up when they arrive at their destination is less than realistic though, I don't think that's a big issue though. Edited October 28, 2014 by iNcog 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.