This SocialVille example is not currently officially supported. Therefore, there are some parts that do not match with the latest ProudNet. The only examples that match the latest ProudNet are those in the Sample folder in the ProudNet installation folder.
Sample download link: RealtimeSocialVille.zip
The file includes library file, graphic resource and code programmed in video for practicing.
This video is based on Unity 5.3.4p6 와 VisualStudio 2013 . Display composition can be vary by version.
4.1Demo
This is a tutorial about real-time multiplayer social game.
4.2RealtimeSocialVille Practice Video
Connection of client and server and Using RMI Message #1
그림 4-11번 영상
00:37 Unity doesn't recognize file names with blank. Be careful when writing file name.
그림 4-200:38 : Distinguish Unity Area
00:38 Process of pasting on Game Client after creating C# script has been omitted.
Unity won't recognize it unless you paste the script on Game Object.
1 Select GameClient in Hirarchy tab.
2 Drag GameClient in Project tab
3 Paste it on Inspector box.
그림 4-300:46 Folder structure after pasting on Client Project folder
00:46 ProudNet\lib\plugins folder in the video changed to ProudNet\lib\DotNet folder.
Connection of client and server and Using RMI Message #2
그림 4-4Video #2
00:53 ProudDotNetClient.dll and ProudDotNetServer.dll is in ProudNet\lib\x64\DotNet of sample file.
그림 4-505:45 Content of modified pidl.bat file and folder location in which it is saved.
05:45 For making batch file, refer to below.
1 Copy sample file SngServerDotNet\pidl.bat and paste it on the path where PIDL.exe is included.
2 Open pasted pidl.bat by notepad and edit the path.
3 If you followed the video, edit ..\ProudNet\util\PIDL.exe which is in every line of the file into PIDL.exe.
10:48 Making server.Dispose()
function part has been omitted in the video. The function is a member function of SngServer
. For implementation, refer to 09:03 of the video. But in case of 09:03 we called member function of client(m_netClient
). But as this is server, call member function of m_netServer
.
11:47 After building Proxy and Stub, to check the build result, you have to attach *.cs file on the project which is related to automatically created Proxy & Stub. Refer to 00:18 of video #3.
12:05 As you pasted DotNet folder, run-time error doesn't occur even if you didn't paste rest of the files. Rather Muiltiple plugins with the same name 경고 comes up on Unity if you paste it.
Planting trees on client and Synchronizing network #1
그림 4-6Video #3
01:36 ville
object is a class of Ville_S
type which is created on 02:37. For actual usage the object, refer to 04:10 of the same video.
02:11 Coding
. m_failMessage
on GUI.label(new Rect(10, 30, 200, 80), m_failMessage)
has been omittedm_failMessage
is a string
type member function of GameClient
class. Or you can change the part in to literal.
ex) GUI.label(new Rect(10, 30, 200, 80), "log on failure")
03:52 For making WorldObject_S
class, refer to 04:47
04:04 Please note that we are making HostID on the line below after making m_worldObjects
. It might be invisible due to subtitle below.
04:23 You can use ConcurrentDictionary including using System.Collections.Concurrent;
.
Planting trees on client and Synchronizing network #2
그림 4-7Video #4
그림 4-800:50 Editting Transform value on Main camera and Changing Scene viewing mode.
00:50 If Plane doesn't come up,
1 Click Main Camera in Hierarchy tab.
2 Set the value as picture upper in Inspector tab on the right.
Or,
3 clicking 2D on Scene tab in the middle to change 2D into 3D.
그림 4-901:04 Unity Project tab after pasting
01:04 Material is in the SngClient\Assets\Materials\ of sample folder. Put the folder in Client\Assets folder.
Position | 0 | 0 | 30 |
Rotation | 50 | -30 | 0 |
Scale | 1 | 1 | 1 |
01:24 For Transform value of Directional light, refer to upper chart
01:30 GameClient
of InVillage.cs is also partial class
.
3분 17초 You must finish with semicolon after making lambda function.
03:26 Content of the first line of Start function is (Nettention.Proud.HostID remote,Nettention.Proud.RmiContext rmiContext, int groupID, int result, String comment
). It has taken over unmodified factor value of ReplyLogon
in SocialGameS2C_stub.cs.
03:28 m_myP2PGroupID
is a member variable of GameClient
. Please refer to 04:21 of the same video.
04:16 Refer to 04:29 for detailed implementing process of Start_InVilleRmiStub()
function.
04:35 Freefab is in SngClient\Assets\Prefabs\ of sample folder. Paste the folder in Client\Assets folder. It is same as pasting Material.
Position | 0 | 220 | -130 |
Rotation | 60 | -360 | -360 |
Scale | 1 | 1 | 1 |
04:54 For angle value of camera, referring to values in the upper chart is better than referring to video.
05:43 You can use Monitor including using System.Threading;
.
07:06 Declaration of list
variable is on 07:29.
Planting trees on client and Synchronizing network #3
그림 4-10Video #5
if (pickedObject.name == "Terrain") { // request to plant a tree m_C2SProxy.RequestAddTree(HostID.HostID_Server, RmiContext.ReliableSend, hit.point); } else if (pickedObject.GetComponentInParent(typeof(WorldObject))) { // Unity names "Tree (Clone)" e.g. WorldObject wo = (WorldObject)pickedObject.GetComponentInParent(typeof(WorldObject)); if (wo != null) { int treeID = wo.m_id; m_C2SProxy.RequestRemoveTree(HostID.HostID_Server, RmiContext.ReliableSend, treeID); } }
00:03 There was some changes on source code. Please type in as above.
Real-time P2P network between clients #1
그림 4-11Video #6
그림 4-1202:13 Inspector tab after registering Scribble
02:13 Registering Scribble Prefab of GameClient has been omitted as picture above.
1 Select GameClient in Hierarchy tab
2 Select Assets > Prefabs > Scribble in Project tab below.
3 Drag and drop on None of Scribble Prefab.