664b31695a6e0

664b31695ae73
1 Guest is here.
 

Topic: System Shock's assets importer for Unity Read 6628 times  

664b31695b818
Dear Shareholders

After the destruction of Citadel station 20 years ago by Employee 2-4601, as ordered by Our counter-terrorism unit, TriOptimum's Research & Development division has been trying to reconstruct the station and its events virtually. Most of our efforts have failed, but we haven't stopped at trying.

I'm proud to present our latest attempt at resurrecting Citadel station.

https://www.youtube.com/watch?v=5YejxnPEoo8

Source code can be found at https://github.com/jramstedt/SSImporter
Unity 5.3.1 is required.

Level geometry should be perfect and correspond to original game. Please report all errors.

This is not an attempt to remake System Shock. But eventually that could happen of course.
My intention is to create Unity extension to import all resources to Unity and create extendable game objects to which logic can be added (possibly in an separate project that is targeting for gameplay remake).

Lots of things will probably be remade and changed. Please don't start to create anything with this yet ;)
« Last Edit: 04. January 2016, 20:37:39 by Gawain »

664b31695b9cahank morgan

664b31695ba18
That's pretty cool looking.  Is this a runtime asset importer?

I'm doing something similar on Unity4.5 for SS1 and the Underworld games as discussed over here and here. Looking forward to seeing what you come up with and seeing whatever info you might have documented. My own code/model export isn't the best or neatest but it works so feel free to look at it for your own research.
664b31695bed6
This is Editor extension and all importing is made in editor mode. So no runtime importing. After the import no original system shock resources are needed. All data is converted to Unity friendly formats.


I'm doing something similar on Unity4.5 for SS1 and the Underworld games as discussed over here and here. Looking forward to seeing what you come up with and seeing whatever info you might have documented. My own code/model export isn't the best or neatest but it works so feel free to look at it for your own research.


I have been following your work silently, but haven't had time to burrow into your code yet.
I'm sure there are at least some useful stuff about triggers and other "action" objects. Very nice work!
664b31695bff2
Unity 5 has been released. You should be able to test and develop the code with free version.

I'm currently working on refactoring the game object creation.
[5.png expired]
[6.png expired]
664b31695c163
 :thumb:
[iamafraiddave.jpg expired]
« Last Edit: 03. March 2015, 18:10:10 by Kolya »
664b31695c2d3
Levels are now fully walkable (moving floors and ceilings, repulsors and working doors).

All new features and changes can be seen in my github repository.

I'm currently working on trigger graphs and have partially reverse engineered couple of new previously undocumented action types.
Trigger graphs are basically triggers or player interfaces (buttons, switches) that are connected together. Each trigger have some kind of action, such as activate other triggers, email player, move floor, spawn enemy or move item.

I have also made test build for web browsers where you can walk around the level, but there are some problems that I need to fix before releasing it.

664b31695c439JosiahJack

664b31695c484
Kewl.  That's pretty interesting.  I wonder if a simple tile-based editor like Tiled could export to the SS1 format so Unity could re-import using your script.  Interesting concept for making custom levels using your importer script maybe? 

Have you considered using or having as an option "Point" in the Unity texture import settings?  Gets rid of the filter blur on the textures giving the crisp pixels of the original.

664b31695c57cicemann

664b31695c5c8
Wouldn't a tile based editor have the issue of not being able to handle slopes and platforms at different heights?
664b31695ca40
Tileset doesn't necessarily mean that everything is orthogonal. It just implies that every piece is the same size. Or in more modern tileset editors, bigger parts have the multiple size of one tile.
Now a tile could also be a box of 1x1x1 dimensions. So there can be different heights or even slopes in a 3D tileset editor.
664b31695d1a6
Kewl.  That's pretty interesting.  I wonder if a simple tile-based editor like Tiled could export to the SS1 format so Unity could re-import using your script.  Interesting concept for making custom levels using your importer script maybe? 

https://www.assetstore.unity3d.com/en/#!/content/17260

But yes. New levels could be made using level editor that exports SS1 format.
In my opinion better option is modelling them in any 3D software or using level editing tools inside Unity.
New user friendly editor scripts will be needed for adding game object instances correctly.

If gameplay code will be completed someday this is the next step  :)

Have you considered using or having as an option "Point" in the Unity texture import settings?  Gets rid of the filter blur on the textures giving the crisp pixels of the original.

Yes. I have tried that. Looks very authentic ;)
Texts are currently using point sampling because they are so low resolution.
I'm thinking about implementing something like this to improve the text quality.

I'm happy to take contributions.
664b31695d2df
Hi! So where would I find the documentation on how to set this up? I've got some of the first steps set up, but when I get to the parts where I'd import textures or models, the menu options don't seem to do anything, and silently fail. Help? Thanks!
664b31695d42e
I added instructions to github and changed importing order to work better with Unity's asynchronous script compiling.

I'm slowly making progress with trigger graphs. Only one of the used trigger actions is still unknown (0x15) and most of the others need implementing. Some of those will be hard to implement (Type change and class data change).

Trigger graphs are big part of the gameplay, but I'm still not going for remake  ;)
664b31695d5b8
###Procedure   
1. Create new Unity project (3D, No asset packages needed)
2. Clone repository to Unity projects Assets folder. (or copy SSImporter directory)
   Unity should now import and compile everything.
3. Run every importer in order from Assets/SystemShock menu. 
   Starting from 0. Set RES Path. It should ask for folder. Select your RES folder. 
   Run 1. Create Object Factory 
   Run 2. ...

These still don't work. Anything after step 2 doesn't do anything, and silently fails. No error messages at all, just a lack of effect. I get the new directories after object factory, but everything else fails.
664b31695d747
You probably have selected the wrong folder in first step. You need to select the folder that has DATA folder inside. I will have to add checks and error messages for that in the future...

I have been using SYSTEMSHOCK-Portable as data source.

664b31695dae2hank morgan

664b31695db41
I'm slowly making progress with trigger graphs. Only one of the used trigger actions is still unknown (0x15) and most of the others need implementing. Some of those will be hard to implement (Type change and class data change).

I'm pretty certain trigger action 0x15 is action awaken (per ssspecs.txt). If I remember correctly it's used on Level 1 to awaken the sleeping drones within a certain ranged of tiles after you destroy the computer hub.

664b31695e08aZylonBane

664b31695e0e4
Texts are currently using point sampling because they are so low resolution.
I'm thinking about implementing something like this to improve the text quality.
Stop calling textures "text". That word already means something in computing. In fact you're looking at examples of that word right now. So here's a low-resolution text. And here's a way to improve text quality.
664b31695e4f7
Stop calling textures "text". That word already means something in computing. In fact you're looking at examples of that word right now. So here's a low-resolution text. And here's a way to improve text quality.

Stop making stupid comments. I was talking about texts not textures. Or more precisely bitmap fonts. I'm willing to use vector fonts, if you can tell me matching fonts.
664b31695e680
If you want to find a specific font http://www.myfonts.com/WhatTheFont/ and http://www.identifont.com/identify.html are pretty good adresses.
But somene might have them identified already.
664b31695ea83
I'm pretty certain trigger action 0x15 is action awaken (per ssspecs.txt). If I remember correctly it's used on Level 1 to awaken the sleeping drones within a certain ranged of tiles after you destroy the computer hub.

Yes I found out that myself yesterday and have partially figured out the data. The area of objects to awaken is rectangle calculated from two game object's positions.

Where can I find that ss-specs.txt? The one I'm using doesn't have 0x15..

664b31695eb43ZylonBane

664b31695eb99
There are already higher-res fonts in the RES files than the game itself actually uses.

664b31695eee3hank morgan

664b31695ef3a
Yes I found out that myself yesterday and have partially figured out the data. The area of objects to awaken is rectangle calculated from two game object's positions.

Where can I find that ss-specs.txt? The one I'm using doesn't have 0x15..

The Abysmal project had a more up to date version. Funnily enough I can't seem to find where I got my action list from on the computer I'm using at the moment so I suspect I either have a 3rd version of the specs on another pc or I found it from diving into other projects code (TSSHP or Abysmal).

For comparison my list of actions in decimal.

Code: [Select]
ACTION_DO_NOTHING 0
ACTION_TRANSPORT_LEVEL 1
ACTION_RESURRECTION 2
ACTION_CLONE 3
ACTION_SET_VARIABLE 4
ACTION_ACTIVATE 6
ACTION_LIGHTING 7
ACTION_EFFECT 8
ACTION_MOVING_PLATFORM 9
ACTION_TIMER   11
ACTION_CHOICE 12
ACTION_EMAIL 15
ACTION_RADAWAY 16
ACTION_CHANGE_STATE 19
ACTION_AWAKEN   21
ACTION_MESSAGE 22
ACTION_SPAWN 23
ACTION_CHANGE_TYPE 24

664b31695f10f
Thanks Hank.
I now have every action that is used in original game. Now I only have to figure out action specific data and implement them. :stroke:

I suggested creating repository for documentation that can be maintained in my first post. It seems someone has started doing that.
Documentation (and other ss1 resources related tools on his github) can be found here:
https://github.com/inkyblackness/ss-specs/

I'm planning to commit some new and corrected stuff there in the future.

There is some new information already about custom palettes and texture and sprite loops. I'm currently implementing those.
664b31695f2b8
I wanted to make browser playable version, but Unity's experimental WebGL build doesn't work very well.
So I made normal 64-bit Windows build.

It shows the current state of the project. Level is completely imported from demo version assets. Nothing has been edited by hand.
Light switches don't work. All doors are openable. All trigger&actions should work. Those that send emails don't show up because there is no HUD.
There is Z-fighting problem with texts on walls. I need to find good solution for those...
Textures and sprites can look messy because of texture compression.
You sometimes get stuck.

Well I guess you can figure out rest of the problems ;)

Alt+F4 quits.

https://www.dropbox.com/s/frmo0kcyrf5m1uf/SSx64.7z?dl=0

664b31695f802JosiahJack

664b31695f857
There is Z-fighting problem with texts on walls. I need to find good solution for those...
Generate a quad, move it out along the normal of the face by a small amount, and apply the text to the quad instead of the wall.  Or, if the text is a separate gameobject, move it out along its own normal since it should already be the same as the wall's normal.

Textures and sprites can look messy because of texture compression.
Set to true color to disable compression.
1 Guest is here.
We get dirty, and the world stays clean.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
664b31695f992