Author Topic: DiasporaPort - Porting Diaspora R1 to a Hybrid Unity/Spaceward Engine  (Read 1392 times)

0 Members and 1 Guest are viewing this topic.

Offline ibanez

  • 23
DiasporaPort - Porting Diaspora R1 to a Hybrid Unity/Spaceward Engine
DiasporaPort, what?
It's Diaspora, ported to another engine.

What is Spaceward?
Spaceward is a sci-fi retro space game I'm developing. https://www.youtube.com/watch?v=4gfQfLpehQY - old video, old version, from a tech demo, not running on spaceward engine.

What is Unity?
Unity is a game engine. https://unity3d.com/

What is Diaspora?
What are you even doing in this thread? :eek2: Jesus Christ.

Why would you do this? :banghead:
It helps me develop Spaceward itself while at the same time working on something I love. Because I love Diaspora, and I love Spaceward.

What is "Spaceward Engine"? :rolleyes:
Spaceward Engine is a moddable, space simulator / fps shooter engine that works on top of Unity3d. Has extensive multiplayer features.

Why do you call this "Spaceward Engine" an engine if its working on top of Unity Engine? How does that work?
Simple, Spaceward Engine works in a way that lets me develop my game without even needing the Unity Editor(I still use it though, it's useful). This also gives it an amazing level of moddability. You can even think of it as borrowing Unity's rendering engine, while discarding everything else. Last sentence not entirely true, but close. Needless to say, Spaceward Engine in it's current form, is not a complete game engine, but an engine nonetheless.

Is this free?
Of course, it's a completely non-commercial project a friend and myself is undertaking, but mostly me. But Spaceward Engine itself won't ever be free, just the DiasporaPort.

At what state is the project relative to Diaspora R1?
Spaceward Engine itself has come along quite far. With it's dedicated tools, converters and even documenting. It can load optimized or unoptimized meshes, textures, materials, shaders, audio while playing video. Has full C# support, you can just open your favorite programming IDE and get on with it. The loading of textures and audio has onDemand or single time loading options, but even when onDemand, it can load these resources in the background without affecting fps. With DiasporaPort, I'm planning to just load everything at the start, then maybe load level specific dialog audio onDemand. Combined with the video playback of each Diaspora R1 level that was introduced in 1.1 there won't ever be a loading screen.

I have already converted some models and put them in DiasporaPort, like raptor, combat raptor, viper mk7, both drones, all cylons, I'm currently working on the Sobek Battlestar.
While it's possible to just put the .dae file format directly, I wanted to clean up some useless(useful in freepace but not in spaceward) helpers and then convert it to an optimized model format to reach fastest model loading times as possible. Used the .dds texture files as is, converted the .ogg vorbis audio files to an optimized uncompressed format. What else is there? Can't remember.

(optimized model/audio whatever means that it has been converted to be specifically read from the storage drive as is and write directly to memory or vram, also uncompressed, no parsing, no bit banging, no headers, just a to b copy. This enables very fast load times but at the same time not very good for very large games.)

Cut the technical stuff, Just tell us how many missions have you ported yet?
None of them, yet?  :) I haven't even ported the HUD yet and have been mostly working on the flight simulation, finding/taking/converting assets from one engine to another. But the flight gameplay feel is very akin to Freespace/Diaspora while at the same time having some characteristics from my own game, Spaceward. I'm planning on working on the AI this weekend.

What was the most challenging thing to do? Would you ask for help from Diaspora Developers?
I don't know freespace modding, so I'm mostly walking blind around the .vp files. I couldn't find the materials, so I had to randomly guess things based on the available textures.
I'd love to get some help with subtitles and dialog audio files, I'd be grateful, I can't figure out what subtitle string belongs to which audio file. I couldn't find any reference and there are hundreds of audio files if not thousands. And it's a though thing to go through all the subtitles and listen all audio files. What makes it worse is that there are also lots of generic audio and subtitles that makes this hundredfold more complicated/demanding.
But I'd still say that the most challenging task is still ahead of me.

When can I play it?
I don't know, when it's done I guess.

When can I mod it?
See the answer above.

In what areas this can improve Diaspora?
Multiplayer comes to mind instantly, I'm planning on making it possible to play the main campaign of Diaspora in Coop with friends.
Extra moddability is quite extensively extra too.

Can it be used to develop Diaspora R2 instead of fs2_open?
Absolutely possible, not only it's more modern but also has extensive modding support with C# .mono programming and multi-platform targeting. But...
It's not Freespace, it will never be open source, or it will never be as freespace as FreeSpace if you know what I mean. :doubt: I don't have the slightest expectation that it will be used for Diaspora R2 or R3. Or R4.

Can you show us something? Anything?
Of course!
Here's an actual snipped of a Viper mk7 implementation:
Code: [Select]
using UnityEngine;
using SpacewardEngine;
using SpacewardEngine.Networking;
using SpacewardEngine.Resource;

using System.Collections;
using System.Collections.Generic;

namespace DiasporaPort {

public class ColViperMk7 : SpaceFighter
{
//*****Normal Declarations begin here*****

public override void Awake()
        {
Assets.model = "Col_Viper_Mk7.ugmj";
Assets.modelCP = "Col_Viper_Mk7_CP.ugmj";
            CreateCollider = true;

            AcEngine = ResourceManager.GetAudioClip ("Engines_Col_Viper_MK7.ua16");
AcTurboBoost = ResourceManager.GetAudioClip ("Engines_AB_Col_Viper_MK7.ua16"); //AudioClip is Correct
AcTurboBoostLoop = ResourceManager.GetAudioClip ("Engines_ABL_Col_Viper_MK7.ua16"); //AudioClip is Correct
AcGlideOn = ResourceManager.GetAudioClip ("Glide_Col_Viper_MK7_On.ua16"); //AudioClip is Correct
AcGlideOff = ResourceManager.GetAudioClip ("Glide_Col_Viper_MK7_Off.ua16"); //AudioClip is Correct

Thrust = 55.0f; //Figure is Correct
Afterburner = 0.297f; //Figure is Correct
MaxSpeed = 110.0f; //Figure is Correct
ManeuverSpeed = 100.0f;
MaxCharge = 5.0f;

            HP = 50.0f;
}

        // Start is used for initialization
        public override void Start()
        {
            base.Start();
            AssignGunBanksWith<MecA6>(); //Figure is Correctish. MecA6 is for vipermk2, I thought vipermk7 used MecA12, but whatever.
            GunBank1.MagazineMax = 2000; //Figure is Correct
            GunBank2.MagazineMax = 1000; //Figure is Correct

            if (IsLocalPlayer || IsPlayer)
                SetCockpitMode(true);
        }

// Update is called once per frame
public override void Update ()
        {
base.Update ();

if (IsLocalPlayer || IsPlayer)
            {
if (Assets.Cockpit != null && Input.GetButtonDown ("ChangeView") == true)
                {
                    if (CockpitMode)
                        SetCockpitMode(false);
                    else
                        SetCockpitMode(true);
                }
            }
}

}
}


The text formatting got destroyed a little, but you get the idea. I cannot actually show you how SpaceFighter class is implemented yet unless you want to sign an nda, maybe later.

Here's some screenshots, with some generic procedural star field background.








This is DiasporaPort only, can't show anything that is Spaceward Engine related, obviously.

This is what I have so far. Let me know if you have any questions I haven't already answered :)

Update:
Very early work in progress AI. But you can see a lot of progress, with the general port and development.

https://www.youtube.com/watch?v=19AUOb1lgv4
« Last Edit: August 02, 2018, 10:46:53 am by ibanez »

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: DiasporaPort - Porting Diaspora R1 to a Hybrid Unity/Spaceward Engine
This is pretty cool. :yes:

 
What was the most challenging thing to do? Would you ask for help from Diaspora Developers?
I don't know freespace modding, so I'm mostly walking blind around the .vp files. I couldn't find the materials, so I had to randomly guess things based on the available textures.
I'd love to get some help with subtitles and dialog audio files, I'd be grateful, I can't figure out what subtitle string belongs to which audio file. I couldn't find any reference and there are hundreds of audio files if not thousands. And it's a though thing to go through all the subtitles and listen all audio files. What makes it worse is that there are also lots of generic audio and subtitles that makes this hundredfold more complicated/demanding.
But I'd still say that the most challenging task is still ahead of me.

In the missions folders of the vp file you'll find the actual missions as name.fs2 files. These can be opened in a text editor like notepad. Search for #Messages and you'll find the list of messages used in the mission with both the text and the name of the file.

Similarly the Messages.tbl is mostly a list of the built-in messages that ships send automatically when they spot enemies or respond to your orders.

If you're still having trouble beyond that, just ask. 
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline ibanez

  • 23
Re: DiasporaPort - Porting Diaspora R1 to a Hybrid Unity/Spaceward Engine
This is pretty cool. :yes:

In the missions folders of the vp file you'll find the actual missions as name.fs2 files. These can be opened in a text editor like notepad. Search for #Messages and you'll find the list of messages used in the mission with both the text and the name of the file.

Similarly the Messages.tbl is mostly a list of the built-in messages that ships send automatically when they spot enemies or respond to your orders.

If you're still having trouble beyond that, just ask. 

Oh wow! I had no idea the mission files were in text format, there is poopton of information in here! Thanks a lot! WOW!

 

Offline ibanez

  • 23
Re: DiasporaPort - Porting Diaspora R1 to a Hybrid Unity/Spaceward Engine
Update:
Very early Work In Progress AI. But you can see a lot of progress with the general port and development.


And here's a raw link if youtube plugin doesn't work for you:
https://www.youtube.com/watch?v=19AUOb1lgv4
« Last Edit: August 18, 2018, 12:51:26 am by Mongoose »