lab icon indicating copy to clipboard operation
lab copied to clipboard

Can you choose coordinates for the decal placement?

Open mathpun opened this issue 5 years ago • 4 comments

So I am trying to place the decals in custom locations -- would like to just have a (row,col) coordinate for placing the decals.

I can see right now how I change the decal frequency and control how many I will have (some decimal that is diving into 100) -- but then they are randomly placed. I see that once it randomly places them it keeps that configuration for the maze, no matter how many times I run the maze -- but still doesn't let me place them where I want. So how can I chose where they get placed? Thanks so much !!

Here is where I can see I can edit the decal frequency: /lab/game_scripts/themes in file themes.lua

this line: local decalFrequency = opts.decalFrequency or 0.01

0.01 makes 1 decal, 0.1 makes 10 decals... etc

mathpun avatar Jun 05 '19 21:06 mathpun

Take a look at function theme:placeWallDecals(allWallLocations). It returns a list of decals to be placed and their locations. The number of decals returned is proportional to the number of available locations.

charlesbeattie avatar Jun 07 '19 15:06 charlesbeattie

Wait wait! That doesn’t make sense — where can I just list and (x,y) coordinate though? I see the proportion - if you see my initial question - I listed that I get how I change how many I have - but where can i actually list a location?

On Friday, June 7, 2019, Charles Beattie [email protected] wrote:

Closed #156 https://github.com/deepmind/lab/issues/156.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/deepmind/lab/issues/156?email_source=notifications&email_token=AD3VQTWFJ5XLSE7LXFRBDP3PZJ773A5CNFSM4HUJNLAKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOR3VBTCQ#event-2397706634, or mute the thread https://github.com/notifications/unsubscribe-auth/AD3VQTSBTDDUQKVL5CGC4CLPZJ773ANCNFSM4HUJNLAA .

mathpun avatar Jun 07 '19 16:06 mathpun

Sorry for closing - The function does not to explicitly expose the decal location for editing from Lua.

The function does provide a list of all walls generated by the maze generator These can be examined. allWallLocations[i].direction is the compass direction of the wall allWallLocations[i].i and allWallLocations[i].j are the cell the wall belongs to.

You could create a list of cell locations to create paintings and store the relevant locations.

Or ...

Take a look at exposing the decals from C++:

deepmind/engine/lua_text_level_maker.cc

Can be extended to expose more of the struct WallArtLocation and allow editing of:

// Corner placement of wall art.
Eigen::Vector3d top_left;

// Corner placement of wall art.
Eigen::Vector3d bottom_right;

Look around this file how to expose and edit values form Lua.

charlesbeattie avatar Jun 10 '19 16:06 charlesbeattie

So just to be clear - I am just trying to chose the (X,Y) coordinate for the decal, where on the actual wall it is at that point doesn't matter.

So if I try the top option -- allWallLocations[i].direction, could you provide an example using some actual values for (X,Y) for a maze that comes with the install as an example so I can see how this works? Sorry still super confused. So I edit that clump of code that you first pointed to -- but which part and how I don't understand. Thanks so much in advance!

mathpun avatar Jun 19 '19 03:06 mathpun