UE4中GameInstance和GameState区别
2016-05-11 16:50
531 查看
1.
Game State:
GameState is replicated extension of GameMode, since GameMode it self is not replicated and exists only on servers memory for security reasons. So GameState let clients access some game data which you would normally place in GameMode, primerly scores and
match time, stuff that you usually see on scoreboard. This is only info that client will have and GameMode should have info which only server should know. You can ignore GameState if you creating single player only game.
Games Instance:
GameInstance is a class that which state persists switching of levels, game mode switches etc. where classes like GameMode or PlayerController are being reset and any data stored in them is deleted and put to defaults again. Any data that you want to keep
beyond levels and matches, for example "what player did in specific moment so you can have consequence on other level" should be placed here. This class is mainly helpful for single player games... but it can find uses in multi player too ;] I not sure if
that class is replicated
For UI of multiplayer game you should use GameState and PlayerState ofcorse
点击打开链接https://answers.unrealengine.com/questions/189120/whats-the-deferent-between-gamestate-and-game-inst.html
2.
Games Instance:
One of the new UE4 engine features as of 4.4 is the Game Instance class!
This is a globally accessible instanced UObject that can store any data you want to be carried between levels!
Where formally you would have had to write out data to a config file or to binary file, to transfer between levels, now you can use the Game Instance class!
API documentation:
UGameInstance
Game State:
The GameState is responsible for monitoring the state of the game on the client.
Conceptually, think of the GameState as the state of the game. It can keep track of properties like score, list of connected players, number of caps in a CTF game, where the pieces are in a chess game, what missions you have completed in an open world game,
etc. In general, the GameState should track properties that change during gameplay. The GameState exists on the server and all clients and can replicate freely to keep all machines up to date.
点击打开链接https://answers.unrealengine.com/questions/259371/game-instance-and-game-state-difference.html
Games Instance:
Game State:
GameState is replicated extension of GameMode, since GameMode it self is not replicated and exists only on servers memory for security reasons. So GameState let clients access some game data which you would normally place in GameMode, primerly scores and
match time, stuff that you usually see on scoreboard. This is only info that client will have and GameMode should have info which only server should know. You can ignore GameState if you creating single player only game.
Games Instance:
GameInstance is a class that which state persists switching of levels, game mode switches etc. where classes like GameMode or PlayerController are being reset and any data stored in them is deleted and put to defaults again. Any data that you want to keep
beyond levels and matches, for example "what player did in specific moment so you can have consequence on other level" should be placed here. This class is mainly helpful for single player games... but it can find uses in multi player too ;] I not sure if
that class is replicated
For UI of multiplayer game you should use GameState and PlayerState ofcorse
点击打开链接https://answers.unrealengine.com/questions/189120/whats-the-deferent-between-gamestate-and-game-inst.html
2.
Games Instance:
One of the new UE4 engine features as of 4.4 is the Game Instance class!
This is a globally accessible instanced UObject that can store any data you want to be carried between levels!
Where formally you would have had to write out data to a config file or to binary file, to transfer between levels, now you can use the Game Instance class!
API documentation:
UGameInstance
Game State:
The GameState is responsible for monitoring the state of the game on the client.
Conceptually, think of the GameState as the state of the game. It can keep track of properties like score, list of connected players, number of caps in a CTF game, where the pieces are in a chess game, what missions you have completed in an open world game,
etc. In general, the GameState should track properties that change during gameplay. The GameState exists on the server and all clients and can replicate freely to keep all machines up to date.
点击打开链接https://answers.unrealengine.com/questions/259371/game-instance-and-game-state-difference.html
Games Instance:
相关文章推荐
- [置顶]iOSDay34之UICollectionView
- [置顶]iOSDay25之UIScrollView
- UIImage两种初始化的区别
- iOSDay30之UITableView编辑
- APUE,TLPI读书笔记——信号
- iOSDay14之OC NSNumber + NSValue
- 【Arduino官方教程第一辑】示例程序 4-1 ASCIl表
- Ajax请求中的async:false/true的作用
- iOS UITextField限制输入内容
- 【IOS开发】UIImageView的用法 图片
- ios开发UI篇—使用纯代码自定义UItableviewcell实现一个简单的微博界面布局
- java集合类深入分析之PriorityQueue
- Failed to set (keyPath) user defined inspected property on (UIView): [<UIView 0x7994f790> setValue:f
- iOSUINavigationBar变透明完全解决办法
- easyUi 图片上传
- 有关请求路径的总结 request.getContextPath()、request.getServletContext().getRealPath("")、request.getRequestURI
- iOS UILable 加载 html
- java集合类深入分析之Queue篇
- 63. Unique Paths II
- runtime-运行时动态添加占位文字颜色-UITextField