Skip to content

Commit

Permalink
- renamed repo and project into MaRLEnE
Browse files Browse the repository at this point in the history
- further test plugin build procedure
- usage tutorial
  • Loading branch information
sven1977 committed Dec 21, 2017
1 parent ed534f5 commit 577dffe
Show file tree
Hide file tree
Showing 29 changed files with 558 additions and 182 deletions.
23 changes: 0 additions & 23 deletions Plugins/Engine2Learn/Engine2Learn.uplugin

This file was deleted.

This file was deleted.

This file was deleted.

File renamed without changes.
23 changes: 23 additions & 0 deletions Plugins/MaRLEnE/MaRLEnE.uplugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.0",
"FriendlyName": "MaRLEnE",
"Description": "Remote Machine- and Reinforcement Learning with MaRLEnE",
"Category": "Machine Learning",
"CreatedBy": "ducandu GmbH",
"CreatedByURL": "ducandu.ai",
"DocsURL": "https://github.com/ducandu/marlene",
"MarketplaceURL": "",
"SupportURL": "https://github.com/ducandu/marlene",
"CanContainContent": true,
"IsBetaVersion": false,
"Installed": false,
"Modules": [
{
"Name": "MaRLEnE",
"Type": "Developer",
"LoadingPhase": "Default"
}
]
}
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unreal_engine as ue
from unreal_engine.classes import DucanduSettings
from unreal_engine.classes import MaRLEnESettings

settings = ue.get_mutable_default(DucanduSettings)
settings = ue.get_mutable_default(MaRLEnESettings)
for prop in settings.properties():
print('{0}={1}'.format(prop, settings.get_property(prop)))
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
-------------------------------------------------------------------------
engine2learn - Plugins/Engine2Learn/Scripts/ducandu_server.py
MaRLEnE - Machine- and Reinforcement Learning ExtensioN for (game) Engines
Plugins/MaRLEnE/Scripts/marlene_server.py
The server running inside UE4 (UnrealEnginePython) and listening on a
port for incoming ML connections.
Expand All @@ -16,7 +17,7 @@
import asyncio
import ue_asyncio
import server_utils as util
from unreal_engine.classes import Engine2LearnSettings, GameplayStatics, InputSettings
from unreal_engine.classes import MaRLEnESettings, GameplayStatics, InputSettings
from unreal_engine.structs import Key
from unreal_engine.enums import EInputEvent

Expand Down Expand Up @@ -291,7 +292,7 @@ async def spawn_server(host, port):
Main Program: Get UE4 settings and start listening on port for incoming connections.
"""

settings = ue.get_mutable_default(Engine2LearnSettings)
settings = ue.get_mutable_default(MaRLEnESettings)
if settings.Address and settings.Port:
asyncio.ensure_future(spawn_server(settings.Address, settings.Port))
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def get_scene_capture_image(scene_capture, texture):
# trigger the scene capture
scene_capture.CaptureScene()
# TODO: copy the bytes into the same memory location each time to avoid garbage collection
byte_string = bytes(texture.render_target_get_data()) # use render_target_get_data_to_buffer(data, [mipmap]?) instead
byte_string = bytes(texture.render_target_get_data()) # use render_target_get_data_to_buffer(data,[mipmap]?) instead
np_array = np.frombuffer(byte_string, dtype=np.uint8) # convert to pixel values (0-255 uint8)
img = np_array.reshape((texture.SizeX, texture.SizeY, 4))[:, :, :3] # slice away alpha value

Expand All @@ -146,9 +146,11 @@ def get_scene_capture_image(scene_capture, texture):

def compile_obs_dict(reward=None):
"""
Compiles the current observations (based on all active E2LObservers) into a dictionary that is returned to the UE4Env object's reset/step/... methods.
Compiles the current observations (based on all active E2LObservers) into a dictionary that is returned to the
UE4Env object's reset/step/... methods.
:param Union[float,None] reward: The absolute global accumulated reward value to set (mostly used to reset everything to 0 after a new episode is started).
:param Union[float,None] reward: The absolute global accumulated reward value to set (mostly used to reset
everything to 0 after a new episode is started).
:returns: The obs_dict as a python dict (ready to be sent back to the client).
:rtype: dict
"""
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

using UnrealBuildTool;

public class Engine2Learn : ModuleRules
public class MaRLEnE : ModuleRules
{
public Engine2Learn(ReadOnlyTargetRules Target) : base(Target)
public MaRLEnE(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

PublicIncludePaths.AddRange(
new string[] {
"Engine2Learn/Public"
"MaRLEnE/Public"
// ... add public include paths required here ...
}
);


PrivateIncludePaths.AddRange(
new string[] {
"Engine2Learn/Private",
"MaRLEnE/Private",
// ... add other private include paths required here ...
}
);
Expand Down

0 comments on commit 577dffe

Please sign in to comment.