Caydr's yardmap request

Caydr's yardmap request

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
b1ind
Posts: 48
Joined: 21 Apr 2005, 04:01

Caydr's yardmap request

Post by b1ind »

Having read Caydr's request for new yardmap flags, I have been going through the code to determine what would need to be done in order to accommodate this.

Firstly, there is CUnitHandler::TestBuildSquare() which reads from CReadMap::groundBlockingObjectsMap through CReadMap::GroundBlocked().

CReadMap::groundBlockingObjectsMap is written to through CReadMap::AddGroundBockingObject(CSolidObject *object, unsigned char *yardMap).

The grid that hovers on the map for building structures is rendered by CUnitHandler::ShowUnitBuildSquare()

The actual checking of all this is done by CBuilder::StartBuild().

I seem to have forgotten where the yardmap is read, but if anyone would like to help me in this search, please do.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

One big one you need to add:

Pathfinding... if you had a diagonal building the units wouldnt be able to walk throuhg the unblocked bits...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Can you fix the existing yardmaps, remember ym screenshot of all those factories where the commander had blocked the factories building anythign by building llt's in the middle of them where the units get built?

I'll post a shot hen I remember where they where, it's a pain cus sometimes in nanoblobz closestbuildsite returns the centre of the autofac and NTAI builds a holder udner the autofac.

You might also wanna tie in an AI callback function to test if a square is blocked or not, which would be extremely useful (you have no idea how useful, submarine has asked for it too).
Post Reply

Return to “Engine”