3D models and Image textures tutorial

Supremacy; support/discussion/questions

Moderators: thunderchero, Iceman

User avatar
Danijel
Lieutenant-Commander
Lieutenant-Commander
Posts: 168
Joined: Tue Mar 06, 2018 9:49 am

3D models and Image textures tutorial

Post by Danijel »

3D models and exporting

Use Supremacy XNA Exporter to port your .x models to .xnb format used by Supremacy. You can also use VS2008 to export it on your own.

I'm mentioning both ways, because using VS2008 produces better output for images (they are sharper);
not tested with models size or texture size output. Using VS2008 also requires a lot more things to be installed.

In both cases I'm using 3D Studio Max (2017) to export models with Axe DirectX plugin and photoshop (cs5) for image manipulation.

I also assume that reader/user of this has basic knowledge of how to copy/paste, install and also be able to work in software(s) mentioned.
Other useful software
Image Image Image
-3D Viewer has support for viewing lots of 3D formats, .x and .3ds among them
-DxViewer for fast .x, .fbx, etc. models preview
-GameTools for fast preview of xnb 2D Texture contents (I never found a previewer for 3D xnb models)
Notice!
Xna or Supremacy, haven't figured it out yet, has a limit in object size;
since I'm in Europe, we'll use metric system here too.
-
In 3DS Max I keep object from about 100m rescaled to 10cm, so if Galaxy is represented
at 641m long, I would reduce it to ~64cm in 3DS Max, so 1:10000 if I'm not wrong. Try to keep this scale.
Smallest object ingame is Orbital Battery at around 7,5cm. All ships from size 75m are held to that approximation
for scale size, anything smaller is between those 7,5cm and 15cm as max (for objects smaller than 75m).
We didn't test this yet, but we think that even 7,5 might be too small, don't go below this size, even for shuttles.
-
Keep in mind that all textures that model uses MUST be in same directory as model.
Xna will convert any standard formats of images; png*, jpg, bmp, tiff, tga, etc.
-
Also textures MUST, when divided by 4, give a round number,...
  ie. 112x92 pix txd size / 4 gives 28x23,...if that dividend is decimal
  ie. 112x94=28x23,5, xna won't export texture.
If model has textures, or you made new ones, be sure to copy them to same location where you export the .x file.
* I advise usage of png; bmp tends to act weird, jpg slips colors, etc...png doesn't lose that much on quality, and alpha channel is always present and usable by all 3, 3dsMax, xna and supremacy.
Placing model(s) in subfolder(s) where Exporter exe is will cause some nuisance. So have your models anywhere on your pc, just not in that folder to avoid extra work of moving files by hand.
If model .X file is corrupted it will crash Exporter!
If model in Supremacy looks different, ie. standing with front side up and its tails down, looks like it's rolling going upwards, then your y (or z) axis is flipped.
If somebody is confused with this, provide me the model in question and I'll extend this tutorial.
-Current vertices count for ships is ~2000-2500.
-We don't want to go over 6000-7000 for we have no clue how that will influence a fight if and when we make one, especially in kinds of 500+
ships "fighting", and all miniaturization factors involved, doesn't really need to go over 5000.
-So if your ship looks good with 1500 vertices in shipyard viewer (this is only "most" detailed place to see models atm), it will look awesome
on battlefield when it gets there.
1st and easiest way, install requirements
Image Image Image
-3D Studio Max software, to work with models. Any other than this and i might not be able to help you :oops:
-Axe X Exporter plugin for 3DS Max for exporting models into .x format
-Supremacy XNA Exporter v1.0.9.0 (Link to: 2.0.1.6)for export of .x file (and textures) to .xnb used by Supremacy
2nd way, install requirements
Image Image Image
-Visual Studio 2008 is an integrated development environment
-XNA 3.1 is a freeware set of tools with a managed runtime environment and also needed for game and exporter to run
-XNAGS 3.1 is an integrated development environment for building video games on the Microsoft XNA platform
-VS2008 xna 3D game example I have no clue where i got mine from, and I can't locate it atm on pc
► Show Spoiler
Most models are easy downloadable in 3ds format .(some links here). Each one can be turned differently on open/export.
Having lots of meshes that form a model is useless for Supremacy and makes things complicated in terms, if you want to resize the model,
each mesh might resize differently. There is good script that keeps aspect ratio pretty well on resize.
Having meshes with separable (for model destruction) faces is ultimately useless waste of vertices for Supremacy.
For now we only want to achieve certain behavior inside Supremacy shipyard viewer.
Side note: LMB=left mouse button - RMB=right mouse button - Button combinations Ctrl+LMB ,Shift+LMB, Shift+Ctrl+LMB are available.
If you have installed 3DS Max, download and extract Axe plugin in your "..\3ds Max *ver*\Plugins", then start 3ds Max.
3D Studio Max part
► Show Spoiler
!!!Don't forget textures!!!
Supremacy XNA Exporter part
► Show Spoiler
Last edited by Danijel on Sun May 29, 2022 10:03 am, edited 25 times in total.
User avatar
Danijel
Lieutenant-Commander
Lieutenant-Commander
Posts: 168
Joined: Tue Mar 06, 2018 9:49 am

Re: 3D models and textures tutorial

Post by Danijel »

Texture editing and replacing

You will need to go through 2nd step of 3D models part and install all 3 softwares.


I use photoshop for image manipulation. And I save them as .png since game utilizes alpha by default.
The #FF000000, let's call it invisible color.

Note also that Supremacy images, if aren't compiled in xnb they must be in png, this part along
with images names is hard coded and case sensitive.

Those images (if any) that aren't in png (or xnb), will be eventually.
png example with alpha channel on left side and blue background on right side.
Image
<---Alpha Effects--->
Image
Open your VS2008 and goto File -> New -> Project (or Shift+Ctrl+N)
Image

For next part you need any microsoft workflow example with content loading for xna 3.1.
Pick under Visual C# -> XNA Game Studio 3.1 -> Windows Game (3.1)
Image

Drop your images in Content folder (this part works for .x files also, it will convert them to xnb too)
Image ---> Image

Right click your WindowsGame2 solution and left click on Build
Image

When build is done (check bottom-left in VS)
Image

Right click your solution again and click on "Open Folder in..."
Image

from there open \bin\x86\Debug\Content and is also location of exported xnb's
Image
In \Resources\Images\TechObjects\Buildings\ you have a small program optipng.exe.
It's a tool for optimizing PNG images while reducing their size also. Just drag'n'drop png(s) on it.
Images don't lose on quality, at least not on my screen.

Atm only 2D texture xnb usage are stars and textures of ship models, rest of images should be in png format.

All images are moddable/replaceable,...all except ..\Resources\Images\Backgrounds\Splash.png which is hard coded and can be
changed only by Iceman while compiling.
Last edited by Danijel on Sun May 29, 2022 10:04 am, edited 13 times in total.
User avatar
Danijel
Lieutenant-Commander
Lieutenant-Commander
Posts: 168
Joined: Tue Mar 06, 2018 9:49 am

Re: 3D models and textures tutorial

Post by Danijel »

Adding/replacing models stats
Files of interest:

Adding/modding should not be attempted if this confuses you :)
Lines below are also (for most part) interconnected for all objects ingame
  • \Resources\Data\TechObjectDatabase.xml - set the tech object's stats
  • \Resources\Data\TechTrees.xml - add object as a researchable item to the civ's techtree
  • \Resources\Data\TextDatabase.xml - add a description for the object (not mandatory), to be displayed in the Encyclopedia
  • \Resources\Tables - game start up settings
► Show Spoiler
And for now if it doesn't confuse you (or me), we'll keep it simple;
(Iceman? confirm-deny any of it :lol: )

this is how game will look under what "file name" should it search for model image in \Resources\Images\TechObjects\Ships
*this is valid for any other model/object modded/added, only it will be for example in \Resources\Images\TechObjects\Buildings, not with ships"

Code: Select all

<Ship Key="FED_COMMAND_SHIP_II">
If model is available to all civs

Code: Select all

<IsUniversallyAvailable>false</IsUniversallyAvailable>
If your model has tiers, then this is useful also, it will remove old model once new one is researched (click spoiler for more details)

Code: Select all

      <ObsoletedItems>
        <ObsoletedItem>FED_COMMAND_SHIP_I</ObsoletedItem>
      </ObsoletedItems>
      <UpgradeOptions>
        <UpgradeOption>FED_COMMAND_SHIP_III</UpgradeOption>
      </UpgradeOptions>
and from where shall game load model from, considering start location is hardcoded as ..\Resources\Models

Code: Select all

<ModelFile>FED_COMMAND_SHIP_III\FED_COMMAND_SHIP_III</ModelFile>
FED_COMMAND_SHIP_III\ -left side is folder name
\FED_COMMAND_SHIP_III -right side is model name without xnb extension, since it searches for xnb file at given location.
Since most microsoft stuff is wacky at best we use "_" instead of " "(empty space) for names, but game will utilize "FED COMMAND SHIP 3\FED COMMAND SHIP III" just as the same.
It wont load your model if you name file FED_COMMAND_SHIP_III and add it as FED COMMAND SHIP III under ModelFile.
It will load your model if you name file FED_COMMAND_SHIP_III and add it as FED_COMMAND_SHIP_III under ModelFile.
It will load your model if you name file FED_COMMAND_SHIP_III and add it as FeD_COmmANd_ShIP_III under ModelFile.
Keep in mind to place model in its own folder and name it accordingly.

Adding new model(s) should be pretty much self-explanatory.
Copy-paste complete Ship Key from <Ship Key=" till </Ship> and configure accordingly.
If there are any confusions, tutorials are known to be prone to changes ;)
Last edited by Danijel on Sun May 29, 2022 10:02 am, edited 11 times in total.
User avatar
Danijel
Lieutenant-Commander
Lieutenant-Commander
Posts: 168
Joined: Tue Mar 06, 2018 9:49 am

Re: 3D models and textures tutorial

Post by Danijel »

For now i'll place links here;
thunderchero wrote:Sun Feb 17, 2019 3:28 pm ... if anyone else needs files link may be shared...
3DS models
thx :)

Some web pages with models:
The Birth of the Federation 2 Consortium
sharecg
David Metlesits @DeviantArt
STMC
Daz3D
Armada Files -if help is needed for importing certain format into 3DS Max, i will add it to tutorial
Sketchfab
3D CAD Browser
Free3D
SciFi 3D
Blake's Sanctum - Star Trek Games

Some X files that are already ingame for testing.


Other, info and data related:
Daystrom Institute Technical Library
Ex Astris Scientia
Star Trek Starship Registry
Last edited by Danijel on Sun May 29, 2022 9:53 am, edited 3 times in total.
User avatar
crazyewok
Ensign
Ensign
Posts: 30
Joined: Tue Aug 07, 2012 3:27 pm

Re: 3D models and textures tutorial

Post by crazyewok »

Ok good guide but I have a issue. I am clicking on the explore .exe and nothing is happening.....
User avatar
crazyewok
Ensign
Ensign
Posts: 30
Joined: Tue Aug 07, 2012 3:27 pm

Re: 3D models and textures tutorial

Post by crazyewok »

error.png
error.png (146.58 KiB) Viewed 10357 times
Ok I got it working but now I am getting this error.......
User avatar
Danijel
Lieutenant-Commander
Lieutenant-Commander
Posts: 168
Joined: Tue Mar 06, 2018 9:49 am

Re: 3D models and textures tutorial

Post by Danijel »

you need library(dll) thats part of xna game studio 3.1 (this is not the same as xna 3.1, it is just part of whole xnags library)

if you wanna play a lil game of,...what else is missing,...ill send dll's one by one,..
outcome of this game would be, that, in future anyone using it, wouldnt have that issue, hopefully :)


EDIT;

Try placing this xna gs part1
if you have 32bit os=C:\Program Files\MSBuild\Microsoft -so it looks like C:\Program Files\MSBuild\Microsoft\XNA Game Studio
if you have 64bit os=C:\Program Files (x86)\MSBuild\Microsoft - so it looks like C:\Program Files (x86)\MSBuild\Microsoft\XNA Game Studio

Any folder missing along the path, must be created

EDIT2;
snipping.jpg
snipping.jpg (65.17 KiB) Viewed 10348 times
User avatar
crazyewok
Ensign
Ensign
Posts: 30
Joined: Tue Aug 07, 2012 3:27 pm

Re: 3D models and textures tutorial

Post by crazyewok »

Ok I see a problem....

The XNAGS 3.1 is not installing.

VS 2008 and XNA.3.1 has installed but that one gets halfway through installation then fails.

This is driving me nuts.
User avatar
Danijel
Lieutenant-Commander
Lieutenant-Commander
Posts: 168
Joined: Tue Mar 06, 2018 9:49 am

Re: 3D models and textures tutorial

Post by Danijel »

xnags fails mid way? redownload package from microsoft, maybe download got corrupted, but if you have vs2008 installed,..it should fly tru install of it

edit:

what is your os?
i work on win7 64bit
User avatar
crazyewok
Ensign
Ensign
Posts: 30
Joined: Tue Aug 07, 2012 3:27 pm

Re: 3D models and textures tutorial

Post by crazyewok »

Danijel wrote: Wed Feb 20, 2019 5:57 pm xnags fails mid way? redownload package from microsoft, maybe download got corrupted, but if you have vs2008 installed,..it should fly tru install of it

edit:

what is your os?
i work on win7 64bit
Windows 10 64bit.

Any chance you can send me the files of VS2008 and the rest in case I have downloaded something wrong?
User avatar
Danijel
Lieutenant-Commander
Lieutenant-Commander
Posts: 168
Joined: Tue Mar 06, 2018 9:49 am

Re: 3D models and textures tutorial

Post by Danijel »

Danijel wrote: Wed Feb 20, 2019 12:15 pm
Try placing this xna gs part1
if you have 32bit os=C:\Program Files\MSBuild\Microsoft -so it looks like C:\Program Files\MSBuild\Microsoft\XNA Game Studio
if you have 64bit os=C:\Program Files (x86)\MSBuild\Microsoft - so it looks like C:\Program Files (x86)\MSBuild\Microsoft\XNA Game Studio

Any folder missing along the path, must be created
this didnt work? got any new error?
User avatar
crazyewok
Ensign
Ensign
Posts: 30
Joined: Tue Aug 07, 2012 3:27 pm

Re: 3D models and textures tutorial

Post by crazyewok »

Give me 2 minutes and I will generate one
User avatar
crazyewok
Ensign
Ensign
Posts: 30
Joined: Tue Aug 07, 2012 3:27 pm

Re: 3D models and textures tutorial

Post by crazyewok »

Here we go
error.png
error.png (10.52 KiB) Viewed 10323 times
User avatar
Danijel
Lieutenant-Commander
Lieutenant-Commander
Posts: 168
Joined: Tue Mar 06, 2018 9:49 am

Re: 3D models and textures tutorial

Post by Danijel »

Extract these into your program files(address as above);

xna gs part2

So you get;
C:\Program Files (x86)\Microsoft XNA\XNA Game Studio

Ill prolly crash now, if it doesnt work, ill try to fix it tomorrow properly, but do post if you get any new error
User avatar
crazyewok
Ensign
Ensign
Posts: 30
Joined: Tue Aug 07, 2012 3:27 pm

Re: 3D models and textures tutorial

Post by crazyewok »

error2.png
error2.png (12.52 KiB) Viewed 10318 times
Same sort of message I am afraid....
Post Reply

Return to “Supremacy”