From: Dave M. <da...@mi...> - 2010-04-13 17:05:02
|
<html><HEAD><LINK rel=stylesheet type=text/css href="/webmail/static/deg/css/wysiwyg-3451203449.css" media=all> <META name=GENERATOR content="MSHTML 8.00.6001.18904"></HEAD> <BODY> <DIV>I'm not sure what each person has done here, but I'll insert my approach.</DIV> <DIV> </DIV> <DIV>For a given tile edge entrance, you have to be able to figure out what it connects to.</DIV> <DIV>It could be another edge, or a city (of some type). More complex tiles have several cities on them.</DIV> <DIV>This is the connectivity of the tile/hex expressed by the track graphic and must be encoded for the game.</DIV> <DIV>Note that this didn't take into account the various "splat" like tiles in some later games.</DIV> <DIV>These could be handled with a $0 no-token, no-stop city in the middle, if that helps the graphic representation.</DIV> <DIV> </DIV> <DIV>For 1830 style tiles I ended up with a system of "locations" that were basically the 6 edges and two internal cities.</DIV> <DIV>That probably was not enough for some games, but it worked for me.</DIV> <DIV>I flattened the tile connectivity input down into a bit vector for each edge, that could be rotated as the tile was placed, </DIV> <DIV>and then wrote a simple function for connection exploration that given an edge in, produced a list of "edges" out.</DIV> <DIV> <DIV>After a comparison to see if we've been there already by another route, then the edge "out"s where pushed to the adjacent tile edges to be evaluated.</DIV> <DIV> </DIV></DIV> <DIV>Also note that using a bit vector allowed me to produce a tile lay rule where the AND of the existing tile connectivity and the canidate tile </DIV> <DIV>had to be the same as the existing tile bit vector.</DIV> <DIV> </DIV> <DIV>So, I like your graph data structure, but there must be a sense of direction in connections or keep a representation of the edge vertex.</DIV> <DIV>I think that would preserve the correct connectivity. </DIV> <DIV> </DIV> <DIV>Another key issues is how to represent these "coordinates". If you can do this, then you can print out lists of a route for logging and recording.</DIV> <DIV> </DIV> <DIV>I went with something like <hexcoord>{<edge a-f>|<city x,y>} e.g. A23d</DIV> <DIV> </DIV> <DIV> and if the city had a name a function could bring that up too.</DIV> <DIV> </DIV> <DIV>Well, enough rambling...</DIV> <DIV>Keep up the good work.</DIV> <DIV>Dave.</DIV> <DIV> </DIV> <DIV><BR>Apr 13, 2010 11:17:48 AM, <A class=parsedEmail href="mailto:rai...@li..." target=_blank>rai...@li...</A> wrote:<BR></DIV> <BLOCKQUOTE style="BORDER-LEFT: rgb(102,153,204) 3px solid"> <DIV class=gmail_quote>On Tue, Apr 13, 2010 at 1:28 AM, alexti <SPAN dir=ltr><<A class=" parsedEmail parsedEmail" href="mailto:al...@sh..." target=_blank>al...@sh...</A>></SPAN> wrote:<BR> <BLOCKQUOTE style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>I avoid "switch" problem in a different way. My vertex definition is<BR>geographical - vertex id is its coordinates. Because of that I can check<BR>backtracking differently - my criterion is that two consecutive edges from<BR>the same hex are only allowed if they are joined at the center. This can<BR>not be derived from the graph definition formally. Essentially I have<BR>additional information in the graph that is encoded in the vertex<BR>identifiers.<BR></BLOCKQUOTE> <DIV><BR></DIV> <DIV>If I understand you correctly, this will fail for some games with complicated tiles -- also, how does it handle multiple cities per tile?</DIV> <DIV><BR></DIV></DIV>-- <BR>John A. Tamplin<BR><BR> <HR SIZE=1> <BR>------------------------------------------------------------------------------<BR>Download Intel® Parallel Studio Eval<BR>Try the new software tools for yourself. Speed compiling, find bugs<BR>proactively, and fine-tune applications for parallel performance.<BR>See why Intel Parallel Studio got high marks during beta.<BR><A class=parsedLink href="http://p.sf.net/sfu/intel-sw-dev" target=_blank>http://p.sf.net/sfu/intel-sw-dev</A><BR> <HR SIZE=1> <BR>_______________________________________________<BR>Rails-devel mailing list<BR><A class="parsedEmail parsedEmail" href="mailto:Rai...@li..." target=_blank>Rai...@li...</A><BR><A class=parsedLink href="https://lists.sourceforge.net/lists/listinfo/rails-devel" target=_blank>https://lists.sourceforge.net/lists/listinfo/rails-devel</A><BR></BLOCKQUOTE></BODY></html> |