Skip to main content

新建项目

项目类型

引擎内建支持Lua脚本,可以做到不用写一行C++代码,实现逻辑的编写,以及扩展引擎C++内建对象的功能。也可以基于C++写逻辑,扩展引擎逻辑层框架提供的功能。

新建脚本项目

参见新建项目

新建C++项目

目前的C++模板,是按照引擎与项目分离,项目内部源码和二进制及资源不分离的结构做的,大致结构如下:

项目目录:

​ bin

  res

  script

   source

   xxx.projectinfo

考虑到各个工种的权限管理,项目在拿到引擎的SDK后,可以调整成如下结构:

项目目录:

00_engine

​ include

​ lib

    source

    extern

01_program

02_config

​ 00_engine

​ standalone

​ unique_editor

​ unique_engine

​ windows

​ debug_md_vs2015x64

​ release_md_vs2015x64

​ tools

​ 01_client

​ 03_res

xxx.projectinfo

然后调整xxx.projectinfo里的配置,projectinfo的配置格式如下:

[Engine]

; 引擎类型

EngineType=DX11

; 创建时的引擎版本号

Version=18692

; 项目预览图路径

ShootPath=

[Project]

; 二进制目录(相对于.projectinfo)

BinaryPath=bin\windows

; 脚本目录(相对于.projectinfo)

ScriptPath=script

; 配置目录(相对于.projectinfo)

ConfigPath=config

; 资源目录(相对于.projectinfo)

ResourcePath=res

; 项目需要加载的DLL配置(相对于ConfigPath)

ProjectConfig=project.ini

; 全局效果配置路径(相对于.projectinfo)

Quality=content/quality/quality.setting

; 插件路径(相对于.projectinfo)

PluginPath=plugins

EnabledPlugins=

; 项目源码路径(相对于.projectinfo)

Source=source

[NeedRegisterPaths]

; 需要注册的路径,注册以后,可以通过ICore::GetRegisteredPath(path_name)来获取

cache=cache

game_bin=bin\windows

game_script=script

game_config=config

game_plugin=plugins

项目DLL加载配置

可以修改项目目录下的config\project.ini,配置需要加载的项目DLL。

示例:

[Module]

fx_game.dll

项目的debug版本的DLL应该生成到项目目录下的bin\windows\debug_md_vs2015x64\下,release版本的DLL应该生成到项目目录下的bin\windows\release_md_vs2015x64\下。引擎会根据当前的fx_main.exe是debug版本还是release版本(根据fx_main.exe所在路径),自动加载对应目录下的项目DLL。