-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
769 changed files
with
47,850 additions
and
8,207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# DeepMind Lab Release Notes | ||
|
||
## Current Release | ||
|
||
### New Features: | ||
|
||
1. Lua customizable themes. | ||
2. String observations. | ||
3. Add ability for script to generate events visible to the EnvCApi. | ||
4. Updated EnvCApi to propagate error messages. | ||
5. Added customization point to enable reading files from external sources. | ||
|
||
### Minor Improvements: | ||
|
||
1. Fixed ramp jump velocity in level lt_space_bounce_hard. | ||
2. Fixed Lua function 'addScore' from module 'dmlab.system.game' to allow | ||
negative scores added to a player. | ||
3. Minor removal of undefined behaviour in the engine. | ||
4. Change LuaSnippetEmitter methods to use table call conventions. | ||
5. Added config variable for monochromatic lightmaps ('r_monolightmaps'). | ||
Enabled by default. | ||
6. Python module 'observation_spec' now returns current observation spec. | ||
7. Added config variable to limit texture size ('r_textureMaxSize'). | ||
8. Increased score range to include all 32 bit integers. | ||
9. api:modifyTexture must now return whether the texture was modified. | ||
10. Internal engine events are propagated to the script via gameEvent. | ||
11. Added ability to adjust rewards. | ||
12. Added ability to raycast between different points on the map. | ||
13. Reduced inaccuracies related to angle conversion and normalization. | ||
14. Added flag "sv_rateLimit" to disable rate limiting for networked games. | ||
|
||
## release-2016-12-06 Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
local colors = require 'common.colors' | ||
local game = require 'dmlab.system.game' | ||
local image = require 'dmlab.system.image' | ||
|
||
local SINGLE_BOT_SKIN_TEXTURE = 'models/players/crash_color/skin_base.tga' | ||
local SATURATION = 1.0 | ||
local VALUE = 1.0 | ||
|
||
local color_bots = {} | ||
|
||
color_bots.BOT_NAMES = { | ||
'Cygni', | ||
'Leonis', | ||
'Epsilon', | ||
'Cephei', | ||
'Centauri', | ||
'Draconis', | ||
} | ||
|
||
color_bots.BOT_NAMES_COLOR = { | ||
'CygniColor', | ||
'LeonisColor', | ||
'EpsilonColor', | ||
'CepheiColor', | ||
'CentauriColor', | ||
'DraconisColor', | ||
} | ||
|
||
local characterSkinData = nil | ||
|
||
local function characterSkins() | ||
if not characterSkinData then | ||
local playerDir = game:runFiles() .. '/baselab/game_scripts/player/' | ||
characterSkinData = { | ||
image.load(playerDir .. 'dm_character_skin_mask_a.png'), | ||
image.load(playerDir .. 'dm_character_skin_mask_b.png'), | ||
image.load(playerDir .. 'dm_character_skin_mask_c.png'), | ||
} | ||
end | ||
return characterSkinData | ||
end | ||
|
||
--[[ Returns a list of bots compatible with the addBot API. | ||
Keyword arguments: | ||
* count - Number [0, #color_bots.BOT_NAMES] - Number of bots to create. | ||
* color - Boolean (false) - Whether to create the bots with custom colors. | ||
* skill - Number - Skill level of bot. In range [1, 5] | ||
]] | ||
function color_bots:makeBots(kwargs) | ||
assert(kwargs.count, 'Missing count') | ||
local bots = {} | ||
local botNames = kwargs.color and self.BOT_NAMES_COLOR or self.BOT_NAMES | ||
for i, name in ipairs(botNames) do | ||
if i == kwargs.count + 1 then | ||
break | ||
end | ||
bots[#bots + 1] = {name = name, skill = kwargs.skill or 4.0} | ||
end | ||
return bots | ||
end | ||
|
||
local playerSkin = nil | ||
|
||
-- Required to inform bot api of the skin texture used by the bots. Call | ||
-- from modifyTexture API if color bots are desirded. | ||
function color_bots:findSkin(name, texture) | ||
if name == SINGLE_BOT_SKIN_TEXTURE then | ||
playerSkin = texture:clone() | ||
end | ||
end | ||
|
||
-- Required to set the color of the bots. Call from call mapLoaded API. | ||
function color_bots:colorizeBots(hue) | ||
assert(playerSkin, 'findSkin must be called during modifyTexture.') | ||
local skin = playerSkin:clone() | ||
local skins = characterSkins() | ||
local hueAngle = 360 / #skins | ||
local shape = skin:shape() | ||
for i, charachterSkin in ipairs(skins) do | ||
local r, g, b = colors.hsvToRgb(hue, SATURATION, VALUE) | ||
local skinC = charachterSkin:clone() | ||
skinC:select(3, 1):mul(r / 255.0) | ||
skinC:select(3, 2):mul(g / 255.0) | ||
skinC:select(3, 3):mul(b / 255.0) | ||
skin:cadd(skinC) | ||
hue = (hue + hueAngle) % 360 | ||
end | ||
game:updateTexture(SINGLE_BOT_SKIN_TEXTURE, skin) | ||
collectgarbage() | ||
collectgarbage() | ||
end | ||
|
||
return color_bots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
-- Utilities for color conversion. | ||
|
||
local colors = {} | ||
|
||
--[[ Converts an HSV color value to RGB. | ||
Conversion formula adapted from | ||
http://en.wikipedia.org/wiki/HSV_color_space. Assumes h in [0, 360), s and v are | ||
contained in the set [0, 1]. | ||
Returns r, g, b each in the set [0, 255]. | ||
]] | ||
function colors.hsvToRgb(h, s, v) | ||
local i = math.floor(h / 60) | ||
local f = h / 60 - i | ||
local p = v * (1 - s) | ||
local q = v * (1 - f * s) | ||
local t = v * (1 - (1 - f) * s) | ||
|
||
i = i % 6 | ||
local r, g, b | ||
if i == 0 then r, g, b = v, t, p | ||
elseif i == 1 then r, g, b = q, v, p | ||
elseif i == 2 then r, g, b = p, v, t | ||
elseif i == 3 then r, g, b = p, q, v | ||
elseif i == 4 then r, g, b = t, p, v | ||
elseif i == 5 then r, g, b = v, p, q | ||
end | ||
|
||
return r * 255, g * 255, b * 255 | ||
end | ||
|
||
|
||
--[[ Converts an HSL color value to RGB. | ||
Based on formula at https://en.wikipedia.org/wiki/HSL_and_HSV#From_HSL. | ||
Assumes h ∈ [0°, 360°), s ∈ [0, 1] and v ∈ [0, 1]. | ||
Returns r, g, b each in the set [0, 255]. | ||
]] | ||
function colors.hslToRgb(h, s, l) | ||
local c = (1 - math.abs(2 * l - 1)) * s | ||
local hprime = h / 60 | ||
local x = c * (1 - math.abs(hprime % 2 - 1)) | ||
|
||
local m = l - 0.5 * c | ||
c = c + m | ||
x = x + m | ||
local r, g, b | ||
if hprime <= 1 then r, g, b = c, x, m | ||
elseif hprime <= 2 then r, g, b = x, c, m | ||
elseif hprime <= 3 then r, g, b = m, c, x | ||
elseif hprime <= 4 then r, g, b = m, x, c | ||
elseif hprime <= 5 then r, g, b = x, m, c | ||
elseif hprime < 6 then r, g, b = c, m, x | ||
end | ||
|
||
return r * 255, g * 255, b * 255 | ||
end | ||
|
||
return colors |
Oops, something went wrong.