Project Chinese surface bases: Development and questions

cr1

Promoting vegetables in space
Joined
Apr 20, 2008
Messages
152
Reaction score
1
Points
18
Location
Zurich
Since this is my first attempt to "make my way into the complicated add-on development world", I will have many questions to ask. Rather than post them in loads of separate threads I'll keep them within this thread, so that everyone is happy. :)
I am trying to make surface bases for some of the airports in China (because that's where I'm from :cheers:). I won't have the time to do all of them, so I'll just do the "main ones". After all, this is only my first step in my add-on development "pathway".


OK that was the introduction. Now on to the first question.
In ar81's excellent surface base tutorial, in the Appendix 1, it says that I need to add something to Base.cfg (between BEGIN_TEXTURES and END_TEXTURES ) so that Orbiter knows my texture file is there. The problem is that I want my add-ons to be easy to install, meaning the user will just need to extract the files and doesn't need to worry about anything else like changing .cfg files.
So, how can make Orbiter know that my texture file is there, without having the user manually edit existing files?
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,615
Reaction score
2,335
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Why don't you also make a nicer Chinese space port? ;)
 

cr1

Promoting vegetables in space
Joined
Apr 20, 2008
Messages
152
Reaction score
1
Points
18
Location
Zurich
Good idea, I'll try my best :)

I can now see my own texture in Orbiter (hurray!) by modifying Base.cfg.
How do I tell Orbiter where my texture file is, without having to manually modify files like Base.cfg?

IMHO the answer should be very obvious to skilled add-on developers


-----Post Added-----


Please, even though not many people would land in China, I've made this thread so that I can get answers to surface base development questions...

If my question was not clear enough, I'll rephrase it here.
I want my own textures to show up in Orbiter. Is there any other way of doing that apart from modifying the "Base.cfg" file?

Thanks for your attention... and sorry for the double-posting and bumping.
(I just need the answer badly :( )
 
Last edited:

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,816
Reaction score
640
Points
188
Cr1, are you making a new base, or modifying an existing one in Orbiter

N.
 

Starshipexplorer

New member
Joined
Mar 25, 2008
Messages
199
Reaction score
0
Points
0
Location
Fairview NC
Hi cr1. ar81 made this tutorial that may help you in your project.

[ame="http://www.orbithangar.com/searchid.php?ID=2733"]Tutorial: How to create surface bases[/ame]
 

cr1

Promoting vegetables in space
Joined
Apr 20, 2008
Messages
152
Reaction score
1
Points
18
Location
Zurich
I'm making a new base (or rather, many new bases, but I'll start with one).
In my first post I mentioned "ar81's excellent surface base tutorial" which was also the one Starshipexplorer talked about. It did help a lot, the only problem is that I cannot find the answer to my question in there.

I wanted to add my own texture file into the surface base I'm making. Appendix I in ar81's tutorial says that I have to manually add my texture's name in to Base.cfg.

My question is, is there any way to make my own texture file appear in Orbiter without having to manually modify Base.cfg?
 

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,816
Reaction score
640
Points
188
Cr1, if you are starting from the default Orbiter installation, there is no "base.cfg" file. There is a "Base" directory under the "Orbiter/Config/Earth/" path. This Base directory is where you will place your "Mybase.cfg" file.
Have you decided on the base location, and the name yet?

N.
 

cr1

Promoting vegetables in space
Joined
Apr 20, 2008
Messages
152
Reaction score
1
Points
18
Location
Zurich
I know about that, the file I meant was "Orbiter/Config/Base.cfg". My base is located at "Orbiter/Config/Earth/Base/Beijing.cfg". (It's actually here [ame="http://www.orbithangar.com/searchid.php?ID=3667"]Beijing surfacebase v0.1[/ame])

The Textures section of Appendix I in ar81's tutorial seemed to say that to make my own texture (lets say it's called "mytest.dds") be seen in Orbiter, I have to:
15.Copy your DDS file to the Orbiter TEXTURES directory.
16.Open Notepad.
17.Select File > Open and load a file called BASE.CFG that is located at the CONFIG directory.
As you see this file, you will find a list of texture names between a BEGIN_TEXTURES header and END_TEXTURES at the bottom.
18.Add a line between BEGIN_TEXTURES and END_TEXTURES that reads:

Mytest

This will tell Orbiter that our new texture called Mytest.dds will be used as part of the base repository of textures
19.Select File > Save.
20.Close Notepad.

I followed these steps, so after adding "Mytest" to the "Base.cfg" file I saw my texture "mytest.dds" in Orbiter. At that time, my "Base.cfg" file looked like this:
Code:
; === Generic surface base resources

; === List of generic object meshes ===
BEGIN_MESHES
END_MESHES

; === List of generic textures ===
BEGIN_TEXTURES
Mytest
Fcd01
Fcd02
Fcd03
Fcd04
Fcd05
Fcd06
Fcd07
Fcd08
Fcd09
Fcd10
Fcd11
Fcd12
Fcd13
Roof01
Roof02
Wall01
Door01
; etc... stopped copy-pasting, I think you get the idea
No errors until now, everything is working fine. My texture is showing up fine, as in the picture attached to this post.

What I want though, is to obtain, without having to add "Mytest" to the "Base.cfg" file, the same result, that is, making "mytest.dds" show up in Orbiter.
 

Attachments

  • mytest_texture_screenshot.PNG
    mytest_texture_screenshot.PNG
    165 KB · Views: 20

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,816
Reaction score
640
Points
188
Apologies, I didn't realise you had an existing base made, that beats me!
I've never used the base.cfg file, always used the "Mybase.cfg" in the \Earth\base path for all my meshes, textures and the rest.

What do you want to do with the textures, is this for surface tiles?

Dowloaded your Beijing base and that seems fine. Can you not add your base.cfg entry, and let Winzip do its magic at merging directories, same as its done for /Scenarios and /Config/Earth/Base ?


N.
 

Starshipexplorer

New member
Joined
Mar 25, 2008
Messages
199
Reaction score
0
Points
0
Location
Fairview NC
Hi cr1. My apologizes about the tutorial, mis-read your first post. If I understand you correctly, are you referencing surface tiles?
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
cr1, it's my understanding you are talking about custom block building tectures, right?
In which case, to answer your question, no you cannot bypass this manual base.cfg editing problem. To use custom textures you have to add them in the list like you say, no easy way around it - just include the list in the documentation with your addon, like I did with Ascension.

The one benefit of adding textures this way is that you can have day and night versions, so that lights come on at night. To do this have 2 texture files for each texture. eg. Mybuilding.dds and Mybuilding_n.dds. The first should have the texture as it looks in day, the second is how it will look by night. Orbiter will switch between them automatically providing they are both listed in the base.cfg.
 

cr1

Promoting vegetables in space
Joined
Apr 20, 2008
Messages
152
Reaction score
1
Points
18
Location
Zurich
Thanks everyone for their prompt answers!

Yes, I was trying to get the textures on to "BLOCK" objects. Too bad there is no work-around for modifying "Base.cfg"... I think I'm not going to add a custom "Config/Base.cfg" into my add-on packages, because if the user has another different Base.cfg (from another add-on for instance), then my version of "Base.cfg" will overwrite the user's version of it. I'd rather include instructions in my add-on docs, as proposed by wehaveaproblem.

Now I'm trying to make surface tiles... I'm using ar81's "Surface Tile Calculator". After getting the output tile coordinates around a "base marker" (outputted Latitude 1&2, Longitude 1&2), I paste them on Google Earth and then get a screenshot of it, and crop it down around the coordinate sets. Is it normal, though, that the final resulting "box" made by these coordinate sets is not really a square, but a rectangle? Would I have to resize that rectangle into a 256x256 square?

Also, what is the recommended surface tile texture resolution around an airport? (So that the airport is still "pretty" enough without slowing down the computer too much) And, is it possible to make local night-time surface tiles?

Above are my three questions for now :)
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
1. It's actually been ages since I made calculated my surface tiles, so my memory is a bit vague. But I don't remember my tiles being rectangular, but square. And yes each of my tiles is a 1:1 ratio. Bear in mind that long/lat coords in orbiter may not match exactly those in google earth. I had to tweak Ascension's position slightly from RL position, so that it matched the default earth texture.

2. Choice of surface tile size and res is up to you really. As an idea, Ascension uses 512x512 level 4 textures. I think one of the KSC hi-res addons uses level 8 textures, not sure on the res. The smaller the RL area you have to copy, the easier it is to use smaller tiles and higher textures. The trick is to make sure the distance you are covering with your google pic matches the dimensions of the tile, so that it scales correctly. So if your texture shows a 1km x 1km real world area, you need it to be spread over the same amount of ground in orbiter. This will, to some extent limit the available tile sizes to you.

3. To my knowledge you cannot make custom night textures for surface tiles. You can, in theory edit the world's night lights, to add your own, but this is a lot of work for little results. Better to use night textures on your buildings imo.

hope that all made sense and is some help.
 

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,816
Reaction score
640
Points
188
In this thread, at #10, is the way I use.

http://www.orbiter-forum.com/showthread.php?t=813&highlight=surface+tiles

What I didn't put in is that at the Latitude of the airport I'm doing, the tiles are roughly 2:1 aspect. so I rotated the Google Earth image 90 degrees before saving to get more screen, i.e. they were tall and skinny, so I put them on their side.
I rotated in PSPro -90 degrees, then saved as 1024x512 as .bmp.
The rest of the comments still apply, especially keeping track of lots of tiles.

Regarding resolution, the highest tiles I made were level 9, but thats a lot of work. I went down to level 8 at the airport boundary, then gradually down to level 3.
Making a level 5 only for "less-impact" machines at the moment, once I have finished more buildings!

You might want to have a look at these:-

[ame="http://www.orbithangar.com/searchid.php?ID=3069"]EasyTiler v.0.9 BETA[/ame]

[ame="http://www.orbithangar.com/searchid.php?ID=3068"]EasyMapper v.1.0[/ame]

I couldn't get into them, but my attention span isn't what it was...

Re your surface tile resolution question, here's two pairs, the first at Level 5, the second at Level 9.

http://i89.photobucket.com/albums/k207/Notebook_04/08120920-15-10Deltaglider.jpg
http://i89.photobucket.com/albums/k207/Notebook_04/08120920-14-56Deltaglider.jpg

http://i89.photobucket.com/albums/k207/Notebook_04/08120920-14-25Deltaglider.jpg
http://i89.photobucket.com/albums/k207/Notebook_04/08120920-14-10Deltaglider.jpg

Usual trade off I'm afraid, so hedging my bets by doing a level 5 only version.

N.
 
Last edited:

cr1

Promoting vegetables in space
Joined
Apr 20, 2008
Messages
152
Reaction score
1
Points
18
Location
Zurich
I'm trying to do level 5 textures around 40.079286N, 116.579275E.
I've tried the two tools but it seems like Google Maps blocked me after some time (only black screen shows up). I guess I'll have to stick with Google Maps/Earth.

I have a little problem here, my latitude is 40°N, and the width:height ratio is usually around 3:4. What do the tiles in Orbiter represent in real-life? What can I do to make the surface tiles around this area with good proportions? Google Earth and Maps make 3:4 pictures even with terrain off, but Orbiter tiles require 2^x:2^x ...

Making add-ons doesn't seem to be as easy as I first thought :(
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
hang in there, cr1, you'll get it.

Each size of tile represents a certain amount of Earth's surface. I can't remember what sizes are what off the top of my head, but I think ar81's excellent tool does tell you somewhere. IIRC level 4 is about 4km x 4km of orbiter world.
 

Mission_CDR

New member
Joined
Mar 28, 2008
Messages
164
Reaction score
0
Points
0
Hey if you need any help with surface bases, PM me, i will gladly help you;).
 

cr1

Promoting vegetables in space
Joined
Apr 20, 2008
Messages
152
Reaction score
1
Points
18
Location
Zurich
So, does a square texture fit in a perfect square in Orbiter? And vice versa, does a square-shaped texture in Orbiter have to be a square texture (.dds) file?
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
For surface tiles, yes they need to be square.
Although the closer to the poles you go the more the surface tiles become warped to fit on the orbiter globe. But in a region suitable for launch(closer to the equator), you shouldn't find that to be a visible factor.
 

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,816
Reaction score
640
Points
188
Not sure I'm understaning Cr1's last question, but a .dds file dosn't have to be square. Its sides need to be powers of two in the bitmap thats given to DxTex utilty, but it can be rectangular.
I've given DxTex bit maps of 1024x512, 512x256, 128x512 and its converted them to .dds files.

N.


-----Post Added-----


I did a test for scaling and aspect ratio between Google Earth and Orbiter, here's what I got.

The airport I'm working on has a crop circle test area just North of the runway, that, or the farmer's tractor has a satnav problem;)

Either way, its a circle and useful for this test.

Here's a screengrab from Google Earth:-
http://i89.photobucket.com/albums/k207/Notebook_04/TestCircle.jpg

This is after it has been cropped to as near a containing square as I can do, had the dimension text added, rotated 90 degrees, and re-sized to 1024x512.
http://i89.photobucket.com/albums/k207/Notebook_04/TestCircle1.jpg

It then went through DxTex, saved as "TextCircle.dds", DXT1 type, into \texture directory.
Entered "TestCircle" into Base.cfg file in /cfg directory.

Entered this in my base.cfg file
"BLOCK TestBlock
POS 0 0 0
ROT 180
SCALE 185 1 185
TEX1 Fcd05 1 1
TEX2 Fcd05 1 1
TEX3 TestCircle 1 1
END"
I also placed a couple of scaled tanks at 185/2 on the +- zaxis for reference.
This is what it looks like:-
http://i89.photobucket.com/albums/k207/Notebook_04/08121010-21-01PB-01.jpg
http://i89.photobucket.com/albums/k207/Notebook_04/08121010-21-48PB-01.jpg
http://i89.photobucket.com/albums/k207/Notebook_04/08121011-07-52PB-01.jpg

I think the aspect ratio is as good as I can eyeball it, and the scale is within 10%? Good enough for me anyway.

The rotation in PSPro isn't neccesary for this test, it was force of habit! I do that when I get a larger image on the screen by rotating in GE, then undoing that roation in PSPro

To Cr1: It was through experimenting that the 2:1 resize seems to work, maybe 52 North is a sweetspot for that ratio? You are stuck with the powers of two for the sides of the bitmap, so some compromise is unavoidable.

N.
 
Top