UE4+启动脚本及项目配置

16 篇文章 0 订阅
1 篇文章 0 订阅

开发情景:PC版多人联机VR游戏(其中有一台独立服务器,4个客户端,还有一个OB上帝视角)

启动逻辑:iPad配置游戏时长,游戏地图,游戏人数等参数。然后iPad通知代理程序,启动Server,OB,Client程序。

文件解释:.bat为启动脚本,.config为iPad配置的参数文件由代理程序写入游戏目录下,.default为游戏默认配置

 

一、游戏启动脚本配置

1、Server端

  • GameServer.bat
@echo off

:: custom variable
set GamePath=.\SFGameServer.exe
set ConfigFiles=.\SFGameServer.config
set DefaultFiles=.\SFGameServer.default
set LogFile=MapServer.log

:: read config file
setlocal enabledelayedexpansion

for /f "tokens=1,2 delims==" %%i in (%DefaultFiles%) do (
	set Command=!Command!%%i=%%j?
)

for /f "tokens=1,2 delims==" %%i in (%ConfigFiles%) do (
	set Command=!Command!%%i=%%j?
)

echo !Command!
start %GamePath% ?GameType=MapServer?!Command! -server -game -log -log=%LogFile%
endlocal
  • GameServer.config
BattleMaxNum=1
FightTime=60
MapName=1,4
HostServerIp=192.168.2.30
  • GameServer.default
MULTIHOME=192.168.2.200
AutoReload=1
ConfineTime=60

2、OB端

  • GameOB.bat
@echo off

:: custom variable
set GamePath=.\SFGameOB.exe
set ConfigFiles=.\SFGameOB.config
set DefaultFiles=.\SFGameOB.default
set LogFile=Spectator.log

:: read config file
setlocal enabledelayedexpansion
for /f "tokens=1,2 delims==" %%i in (%DefaultFiles%) do (
	set Command=!Command!%%i=%%j?
)
for /f "tokens=1,2 delims==" %%i in (%ConfigFiles%) do (
	set Command=!Command!%%i=%%j?
)

echo !Command!
start %GamePath% ?GameType=Client?!Command! -game -log -log=%LogFile%
endlocal
  • GameOB.config
BattleMaxNum=1
FightTime=60
MapName=1,4
HostServerIp=192.168.2.30
  • GameOB.default
HostServerPort=7777
RoomId=0
TeamId=100
HeadId=0
WeaponId=0
UserName=Observer
PlayerTempId=3
ClientType=3

CaptureType=1
CaptureIp=MCServer@192.168.1.250
CapturePort=1111
Point1=4
Point2=5
Point3=9

IsVrMode=0
MusicValue=130

3、Client端

  • GameClient.bat
@echo off

:: custom variable
set GamePath=.\SFGame.exe
set ConfigFiles=.\SFGame.config
set DefaultFiles=.\SFGame.default
set LogFile=Client.log

:: read config file
setlocal enabledelayedexpansion
for /f "tokens=1,2 delims==" %%i in (%DefaultFiles%) do (
	set Command=!Command!%%i=%%j?
)
for /f "tokens=1,2 delims==" %%i in (%ConfigFiles%) do (
	set Command=!Command!%%i=%%j?
)

echo !Command!
start %GamePath% ?GameType=Client?!Command! -game -log -log=%LogFile%
endlocal
  • GameClient.config
BattleMaxNum=1
FightTime=300
MapName=1,4
HostServerIp=192.168.2.30
  • GameClient.default
TeamId=1
StoreId=1101011
PlayerTempId=3

HostServerPort=7777
RoomId=1
HeadId=0
WeaponId=0
BackpackId=1
UserName=测试玩家1
ClientType=1

CaptureType=4
CaptureIp=MCServer@192.168.2.105
CapturePort=1111
Point1=5
Point2=6
Point3=9

IsVrMode=1

二、项目工程配置

1、GameUserSettings

设置应用打包后运行时窗体的分辨率及位置

[/Script/Engine.GameUserSettings]
bUseVSync=False
ResolutionSizeX=1280
ResolutionSizeY=960
LastUserConfirmedResolutionSizeX=1280
LastUserConfirmedResolutionSizeY=960
WindowPosX=-1
WindowPosY=-1
bUseDesktopResolutionForFullscreen=False
FullscreenMode=2
LastConfirmedFullscreenMode=2
PreferredFullscreenMode=2
Version=5
AudioQualityLevel=0
FrameRateLimit=0.000000
DesiredScreenWidth=1280
DesiredScreenHeight=960
LastRecommendedScreenWidth=0.000000
LastRecommendedScreenHeight=0.000000

 

UE4项目工程文件是指在使用虚幻引擎制作游戏或其他应用程序时所使用的工程文件。这些文件包含了项目的所有资源和设置,可以对项目进行管理和编辑。 在UE4中,项目工程文件主要包括以下几个部分: 1. .uproject文件:这是项目的主文件,以.uproject为后缀名。它记录了项目的名称、版本号、引擎版本等信息,并充当了项目的入口点。通过双击打开.uproject文件,可以启动UE4编辑器并打开项目。 2. .umap文件:这是关卡文件,以.umap为后缀名。每个关卡通常对应一个.umap文件,它包含了关卡的地形、模型、材质、光照等信息。在这些文件中进行编辑和设计,可以创建游戏的具体关卡。 3. .uasset文件:这是资源文件,以.uasset为后缀名。它包含了项目中使用的各种资源,如纹理、音效、脚本等。这些文件经过编译和打包后,可以在项目中使用。 4. .uplugin文件:这是插件文件,以.uplugin为后缀名。它用于扩展UE4的功能,可以添加自定义的工具、功能模块等。通过导入和加载插件文件,可以增强项目的开发和编辑能力。 除了上述常见的文件类型外,UE4项目工程文件还包括一些辅助文件和配置文件,如.sln、.suo、.ini等,这些文件用于项目的管理、编译和配置。 总结起来,UE4项目工程文件是一系列用于管理和编辑项目的文件,包括主文件、关卡文件、资源文件和插件文件等。通过对这些文件的编辑和配置,可以实现游戏或应用程序的开发和制作。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值