agentx Posted July 18, 2014 Report Share Posted July 18, 2014 I've found a way to render internal maps on a HTML canvas providing some visual confirmation. Only the passabiltiy map gives some headache. pathfinder.xml defines these PassabilityClasses:unrestricteddefault <MaxWaterDepth>2 <MaxTerrainSlope>1.0ship <MinWaterDepth>1building-land <MaxWaterDepth>0 <MinShoreDistance>1.0 <MaxTerrainSlope>1.0building-shore <MaxShoreDistance>2.0 <MaxTerrainSlope>1.25The API knows these classes + values://uneval(sharedScript.passabilityClasses);pathfinderObstruction:1, foundationObstruction:2, building-land:4, building-shore:8, default:16, ship:32, unrestricted:64 Here are the classes rendered using the Arcadia 02 map:(the mouseover title shows the mask value)pathfinderObstruction is surely no-go area for everything. What I want is where land/water units can go, so default looks good for land, however slope is not indicated in the map and ship also has area on land indicated. I know I can bitmask what I need, but somehow API and pathfinder.xml do different things. Which one is reliable? 1 Quote Link to comment Share on other sites More sharing options...
agentx Posted July 20, 2014 Author Report Share Posted July 20, 2014 There are two other issues, on the left is a height map I've imported into atlas, in the middle the resulting passability map and on the right both blended, they do not align on the east side.Also, deep sea and shallow water do not connect. There is a gap indicated by black pixel below.What is the trick to get a continuous passability? Quote Link to comment Share on other sites More sharing options...
FeXoR Posted July 21, 2014 Report Share Posted July 21, 2014 (edited) One reason for this might be that we use different code (for e.g. slope) in the different parts of the game (e.g. Engine, Simulations, Random maps).[i'd prefer one shared lib for such functions]In this case however it's more likely that it's simply the "Import Heightmap" functionality that cuts a part of the image (AFAIK to please the engines need for square maps with even side lengths). So the original and the resulting map do not fit.Also take into account that if the image is (eventually cut to) X*X in size the slope map is [X-1]*[X-1] in size because you need 2*2 heights to get a plane witch than has a slope.The "neither deep nor shallow water" thing is entirely unknown to me. Edited July 21, 2014 by FeXoR Quote Link to comment Share on other sites More sharing options...
Stan` Posted July 21, 2014 Report Share Posted July 21, 2014 Afaik there is a tool that let´s you set passability. Maybe you need some tweaking ? Quote Link to comment Share on other sites More sharing options...
Stan` Posted July 21, 2014 Report Share Posted July 21, 2014 Did you try using a circle version of yours ? Quote Link to comment Share on other sites More sharing options...
agentx Posted July 21, 2014 Author Report Share Posted July 21, 2014 > the slope map is [X-1]*[X-1] in size because you need 2*2 heights to get a plane witch than has a slope.Yes, that's documented for *.pmp and leads to a very tiny offset in NE direction, barely a pixel.> Afaik there is a tool that let´s you set passability. Maybe you need some tweaking ?Sorry, should have mentioned the passability info is needed to steer a bot's units around. No chance to edit maps while playing. Quote Link to comment Share on other sites More sharing options...
agentx Posted July 21, 2014 Author Report Share Posted July 21, 2014 > neither deep nor shallow waterWould you set them to deep or shallow? Quote Link to comment Share on other sites More sharing options...
FeXoR Posted July 21, 2014 Report Share Posted July 21, 2014 (edited) > neither deep nor shallow waterWould you set them to deep or shallow?Perfectly I'd look into the code or ask at http://webchat.quakenet.org/?channels=0ad-dev what's up about this (In fact it looks like a bug to me).If I felt to lazy for that (or as a temporary solution) I'd set it to deep water to not confuse the player that this area would be passable (If meant for the player at all though bots would likely be confused too). Edited July 21, 2014 by FeXoR Quote Link to comment Share on other sites More sharing options...
agentx Posted July 21, 2014 Author Report Share Posted July 21, 2014 Makes sense, there is no difference for ships and land unit are on he safe side. Might reduce area for docks and landing, but that needs more than one tile anyway. 1 Quote Link to comment Share on other sites More sharing options...
Radagast. Posted August 16, 2014 Report Share Posted August 16, 2014 Hannibal is coming along nicely.Your recent Map Analysis wiki entry is related to this topic.Any news on if it will be integrated into 0AD as experimental bot prior to the planned Git transition? Or do we have to provide it as a mod?Funny I now reused our AI tournament state machine for a storylineMachine too. I like those 0AD bots. Always makes me want to continue on the Hybrid AI, of course it will build upon Hannibal, perhaps turning my command machine (yet another usecase of the state machine) into Hannibal compatible plugins. Quote Link to comment Share on other sites More sharing options...
Radagast. Posted August 17, 2014 Report Share Posted August 17, 2014 (edited) http://noiv.pythonanywhere.com/agentx/0ad/explorer/hannibal.html#!0;athen;MAPS;mapThe maps tab there is nice. I feel like 0AD is beginning to shape really promising. We can finish this.The only thing I didn't get to work on your webpage is the Plan functionality. Edited August 17, 2014 by Radagast. 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.