Page 3 of 3

Re: DyDoBP: New AI on MultiAIpack

Posted: 03 Sep 2009, 20:58
by Zarel
Per wrote:I think I found the issue. Some functions take world coordinates, others map (tile) coordinates. If you use the wrong coordinate system, the call will fail. This one wants map coordinates, so if you divide the input coordinates you are using by 128, it should work.

(As an aside, I think this dual coordinate system stuff is really too confusing to expose to the scripting world. We should probably make sure only world coordinates are used in scripts some day.)
What's the difference between world and map coordinates? If world coordinates are in units of 1/128 tiles, then maybe it would be better to make sure only map coordinates are used.

Re: DyDoBP: New AI on MultiAIpack

Posted: 03 Sep 2009, 23:19
by Per
Map coordinates are by tiles, each increment is one tile. World coordinates are 128 points per tile. So you can convert from one to the other by multiplying or dividing by 128. However, when calculating new positions in world coordinates, you should also add half a tile so that the new position is at the center of the tile, not at its edge.

I do not really have much of an opinion as to which coordinate system scripts should use, but I do think they should only use one of them.

Re: DyDoBP: New AI on MultiAIpack

Posted: 04 Sep 2009, 04:01
by Zarel
I dunno; I can think of situations where one would be better, and situations where the other would be better.

It's your call, I guess.

Re: DyDoBP: New AI on MultiAIpack

Posted: 04 Sep 2009, 10:08
by DylanDog
Per wrote:I think I found the issue. Some functions take world coordinates, others map (tile) coordinates. If you use the wrong coordinate system, the call will fail. This one wants map coordinates, so if you divide the input coordinates you are using by 128, it should work.
You are right it works! I tested it with DyDo-BP 1.04 and WZ2.2.2.

Code: Select all

    local float basecoordX ,basecoordY ;
    local int _x,_y;
    basecoordX = (float)baseX/(float)TILE;
    basecoordY = (float)baseY/(float)TILE;
    _x = 0;
    _y = 0;
   if ( getNearestGateway( (int)basecoordX, (int)basecoordY, ref _x, ref _y ) )
...do something
An update on DyDo-BP.
I have set up a very very simple webpage to keep track of the various versions, for bug reportings and so on...I think such things can be better managed outside this forum.The link to the webpage will follow in another new post at some point next week I think.

I have spent at least 4-5 hours a day until now to develop and test it. I think I am starting to reach a good point where I can say "I have improved a bit BP" (and fixed some bugs!).

I have soooo many ideas on new features but developing an AI requires a lot of testing and takes much much time...be patience.

I hope Nikers will continue to develop BP too...at the end both AIs should have very different personalities to better enjoy skirmish games.

Re: DyDoBP: New AI on MultiAIpack

Posted: 04 Sep 2009, 16:52
by whippersnapper
.

When you write Campaign A.I. scripts you NEED to use "map coordinates" from 32EW because you are writing A.I. triggers to a SPECIFIC, already created, map's locations to serve ends defined to that particular maps matrix of GOALs aka Mission Imperatives or victory conditions.

When you are writing Skirmish A.I. scripts you are writing to ANY maps relative position within the proactive-reactive telos construct (sans player defined imperatives or a specific map) of the Skirmish A.I. as it may unfold on any WZ map in existence at present or yet to be made in the future - ergo "world coordinates"

This also accounts for the functions relative to the diffs between Campaign A.I. and Skirmish A.I.

There are very good reasons for the 2 coordinate systems. Can't stand to see peeps "spinning their wheels".

- whip :ninja:
.

Re: DyDoBP: New AI on MultiAIpack

Posted: 22 Oct 2009, 17:43
by guciomir
what is the current status for the AI?

Re: DyDoBP: New AI on MultiAIpack

Posted: 28 Oct 2009, 09:50
by DylanDog
guciomir wrote:what is the current status for the AI?
You can download it since yesterday here:
viewtopic.php?f=10&t=4037