Drawing on the map

Drawing on the map

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
User avatar
LoidThanead
Posts: 58
Joined: 27 Feb 2008, 16:16

Drawing on the map

Post by LoidThanead »

Hey all,

Currently I am trying to debug my AI's handling of resource spots. To that end, it would be incredibly useful to be able to see where it thinks the resource locations are on the map, as well as the distance from the unit's location.

I have jot down a bit of code that issues a AddPointDrawAICommand for each resource location, with the distance as label, but I am not seeing any points on the map. I am watching the game as an observer while two copies of my AI play against one another.

Am I missing anything? Could anyone enlighten me as to the use of the various draw commands?

Thanks in advance,
Loid
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Drawing on the map

Post by hoijui »

AF might be bale to help you, and i have a version of imbaczeks JKPAI which would be perfect for what you need (it draws the map with SWING, and the resource spots and.. whatever you want). i just tried it after half a year, and it seems not to work fine, so i try to get it running first.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Drawing on the map

Post by AF »

Yeah I saw ages ago that line drawing etc via AI was broken.

AI line drawing however was always slooooow, I know because I tried loading TGA images and using line drawing to render individual pixels as lines resulting in:


Image

Image

NTai also used to have code for custom markers. Rather than placing markers using the API, it would draw triangles that spinned. I also implemented coloured trails that followed units around, which were put in as debugging tools, so I could see what kind of command/task a unit had

In the end, I would suggest you write lua gadgets + widgets and use the AI interface to send data over. I dont have any examples to give mind
User avatar
LoidThanead
Posts: 58
Joined: 27 Feb 2008, 16:16

Re: Drawing on the map

Post by LoidThanead »

So, drawing through the AI is broken then? That is most unfortunate.
I think I'll try visualizing my data the way JKPAI does it, through Java Swing. If that doesn't work, I'll give the gadgets and widgets a try.

Thanks all.
Post Reply

Return to “AI”