From: alexti <al...@sh...> - 2010-03-25 02:40:08
|
I guess I have side-stepped a lot of issues by doing all that logic on the graph rather than on the board description. Though the question of what tile can be used for upgrade is not solvable automatically - in some games specific upgrades are not permitted, even all the normal requirements are satisfied. And in other games strange "upgrades" are permitted (like replacing yellow town with yellow straight or curve in 1856). This has to be a part of the game's tile manifest. On Wed, 24 Mar 2010 12:06:11 -0600, Dave Mitton <da...@mi...> wrote: > I've built this code in my VB 1830 game years ago. > > You have to solve a lot of the problems to get this far, and the > information can > be use to validate tile lays. > > Is that hex reachable? What tiles can I use? In what rotations? Does the > track > connect? (permissive or strict upgrade rules?) > > There are many track connectivity, token location (look out for XX > tiles), and > tile drawing issues to conquer just getting this much done. > > But I did it with a simple iteration and evaluation stack to flatten the > recursion problem. > > (push the tokens; pop a location, mark connected edges; push edges it > connects > to that is new, repeat) > > Without an route suggestor; you can then build a simple "connect the > dots" route > interface that lets you point at a route on the map, it color's the > connecting > track, and total's the revenue for you. Do it in a list for multiple > trains. > That's as far as I got. The interface was buggy as heck, most due to > using lousy > route list structures. > > Even with a route suggestor, the UI will get "interesting". > > Dave. > > > > Mar 24, 2010 01:25:51 PM, rai...@li... wrote: > > On Wed, Mar 24, 2010 at 10:20 AM, Aliza Panitz <ali...@gm...> > wrote: >> This is something we could implement incrementally: >> >> (1) Have a button that users can click to highlight every bit of track >> that their trains can reach from their tokens. This will be useful >> even without route calculation, though it will require Rails to learn >> about track, routes, tokens, etc. >> >> The algorithm I'm thinking of would be a simple flood-fill that gets >> blocked by foreign tokens if the circles are filled. > > > I agree. This is a great starting point. > > It provides useful information to players almost immediately, even > before route calculation is feature complete. > > ---Brett. > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ |