[Freeciv-Dev] Re: Finishing up AI dialogue
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, Sep 18, 2001 at 05:25:04AM -0700, Raahul Kumar wrote:
>
> > > > > I noticed this. I sent some patches a long
> > while
> > > > back to Thue trying
> > > > > to fix the movement code, because so much of
> > the
> > > > code has majic
> > > > > numbers in it.
> > > >
> > > > Do you still want this? Do you have updated
> > patched?
> > >
> > > The code was accepted some time ago. I haven't
> > sent
> > > any new patches because I was beaten by the magic
> > > number problem. I'll probably return to it some
> > day.
> >
> > This would be nice. Note that we are currently two
> > small steps from
> > the goal of a remove-all-magic-direction-numbers
> > crusade.
>
> What two steps would be needed to make this a general
> get rid of all the magic numbers crusade?
- think about the usage of dir_ok. IMHO the last block of goto_zoc_ok
always returns 0 and has no side effects. Is this true or not?
- introduce
> #define MAPSTEP(x,y,x1,y1,dir) \
> ( (x) = (x1) + DIR_DX[(dir)], \
> (y) = (y1) + DIR_DY[(dir)], \
> normalize_map_pos(&(x),&(y)) )
and change the code base to use it.
> By the way, I was not at all involved in magic direction numbers, I
> was responsible for the introduction of SINGLE_MOVE_COST and other
> movement constants to replace magic numbers used in various places
> in the AI code.
Replacing magic numbers is always good.
> If you're interested I could probably dig up my original patch to
> show you, but I see no point as it's already part of the freeciv
> code. My original plan was to allow for units that had different
> costs for moving over terrain, different rulesets where railroad
> move cost would not be 0 etc.
I don't know if this is really needed. (this is the political version
of saying "I don't care about this" ;) )
> When is your diff going into the CVS? Anything I can do to make it
> quicker, name it. Far easier to work with your AI code than the
> existing one.
You will have to wait some days.
> > > I'm planning to have the AI by default share world
> > maps.
> >
> > Does this benefit the AI?
> >
> It certainly benefits the AI. The AI currently
> indulges in massive cheating, using data not available
> to the human player. But by not cheating, the AI is at
> a massive handicap. By having the AI always agree to
> swap world maps with players
>
> 1) reduce the AI need for exploration until when the
> whole map is uncovered no explorers are produced.
> 2) Pathfinding problems crop up far less often for
> all the AI players(esp regards to trireme and air
> units)
> When you consider by the time of the development of
> flight all the world could be uncovered anyway there's
> no real disadvantage.
> 3) AI can see quicker where to expand without
> cheating.
> For the future when I have time I plan to have the AI
> expand in the direction where there is most tiles
> free.
> 4)helps me out in attack planning no end, if the civ
> is not even on the same continent as you then peace
> should
> be possible right up until the AI launches a sneak
> attack on you.
> Also helps in the search for other civs to help the AI
> if it is losing cities and cannot buy a ceasefire or a
> peace treaty.
Ok. But removing the cheating will make the AI weaker. At least some
player prefer a stronger AI. But this can be handled by enum
handicap_type.
> > > I'm also going to solve the tribute problem, if
> > you're much bigger
> > > than the AI it will offer up tribute.
> > >
> > > Incidentally, should I care about the
> > civilisations perfectionist
> > > etc tags at all. It's not used anywhere in freeciv
> > as far as I can
> > > tell.
> >
> > What kind of tags are you talking about?
> >
>
> I'm talking about the tags in the same file as the
> name of the civs cities, the name of the civ itself,
> which wonders the civ should pursue etc. There is
> usually a tag describing the civ as perfectionist or
> expansionist.
> But I believe it is almost always ignored.
The comments from common/nation.h:
/* AI hints */
int attack; /* c 0 = optimize for food, 2 = optimize for prod
*/
/* c0 = large amount of buildings, 2 = units */
/* attack has been un-implemented for the time being. -- Syela */
int expand; /* c0 = transform first , 2 = build cities first */
/* expand has been un-implemented, probably permanently. -- Syela */
int civilized; /* c 0 = don't use nukes, 2 = use nukes, lots of
pollution */
/* civilized was never implemented, but will be eventually. -- Syela */
say so.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
What's nice about GUI is that you see what you manipulate.
What's bad about GUI is that you can only manipulate what you see.
|
|