Tutorial for ver.3

Record and play character movements (saved in MySQL)

In this scene, you can record and play back the movement of characters and some objects to MySQL.

MySQL environment construction

If you are using MySQL, you need to go through a few steps first.

First, build MySQL Server. The details are omitted, but the outline is as follows.

  1. Install MySQL Server. The version has been confirmed in [8.0.15].
    You can download MySQL related information from [[here] https://dev.mysql.com/downloads/]]. (Archived Versions here)
    It is also convenient to install MySQL Workbench.
  2. Create a Schema (database) named "sigverse".
  3. Create a MySQL user with update privileges for "sigverse".
  4. Create a table called “playbacker_motion_data” under “sigverse”.
    The table creation script is as follows.  CREATE TABLE `playbacker_motion_data` (    `recording_id` int (11) NOT NULL,    `elapsed_time` int (11) NOT NULL,    `data_type` int (11) NOT NULL,    `motion_data` text NOT NULL,    PRIMARY KEY (`elapsed_time`,` data_type`, `recording_id`)  ) ENGINE = InnoDB DEFAULT CHARSET = utf8;

Also, set MySQL to use SIGVerse setting screen.

  1. Click [SIGVerse]-[SIGVerse Settings] in the Unity editor to open the SIGVerse settings screen.
  2. Check [Use MySQL] in [Define symbols Settings].
UseMySQL.png

Since an error occurs in the Console tab of the Unity editor, add the library to the Unity editor.

  1. Access Download Site of Connector / NET. (Archived Versions)
  2. Select [8.0.15] for [Product Version], [.NET & Mono] for [Operating System], and click [Download].
  3. Drag and drop MySql.Data.dll and Google.Protobuf.dll in the "v4.5.2" folder after unzipping the zip file under [Assets/Plugins] on the [Project] tab of the Unity editor.
  4. Check that the Unity Editor error is gone.
MySQLLibrary.png

Startup procedure

Start the [Assets/SIGVerse/SampleScenes/Playbacker/Playbacker(.unity)] scene with reference to here.

Recording to MySQL

  1. Select [Database Recorder] for Mode.
  2. Make some settings such as [Unique ID] and database connection information.
  3. Click the [Start] button to start recording to MySQL.
  4. Operate the character with the four-way controller.
    (Click [Baby icon] to show/hide the panel.)
  5. Click the [Stop] button to stop recording to MySQL.
PlaybackDatabaseRecording.png

Playback from MySQL

  1. Select [Database Player] for Mode.
  2. Set the same database connection settings and [Unique ID] set in the above recording procedure.
  3. Press the [Start] button to start playback.
    (Click [Baby icon] to show/hide the panel.)
  4. When the [Stop] button is pressed or the recording time elapses, playback ends.
PlaybackDatabasePlaying.png

Front page   New List of pages Search Recent changes   Help   RSS of recent changes