3D Starchart - Teaser 1: Rendering Planets
-
So this is the first info about my “project”. Yes, I try to make a starchart for freelancer in 3D. The picture above is a screenshot of my program, wirtten in C#, using the Microsoft XNA Framework 4.0 for graphics.
It needs loads of improvemet, of course. I realise Pittsburgh and Maine in the background show serious flickering, the sun is not really displayed well and all other space objects are only displayed by their name. And the lighting is probably a bit extreme.Most of the work I did thus far is beneath the surface: the means of accessing all the data required for rendering this picture. I might go into detail in a second teaser.
So how do planetary textures work? Actually, it’s quite easy, Freelancer uses a technique known as cubic mapping, where a cube of six textures is mapped onto a sphere. To figure this out, I created a test planet and replaced manhattan with it:
As XNA (and DirectX) natively support cube textures, the rest was quite easy.
I will publish the code soon, after I stuctured it a bit better, added all the licence info (I put so much work in it, I just don’t want to release it without any kind of licnese. it will be open source, of course.) and updated the copyright info (of course I used a lot of work by other people, and I certaily don’t want to “sell” it as my own, after all I’m not minister of defense).
-
Now that’s a cool feature ! Keep it up.
-
=Alex= wrote:
Sounds good, what license are you intending to put on it?The MPL (Mozilla Public License) as code under the MPL may be combined with proprietary code. An important part of my project is a dll to access Freelancer data and I want to allow people to use it in their project even if they’re not prepared to make their software open source.
-
So, finally, I managed to include models in Starchart. I know it’s nothing new and I admit that without access to the sources of the UTF editor I couldn’t have done it but I hope that this combination of system, planets and models is at least something.
And, as promised, it’s all open source.
Get the code here -
I uploaded a built version to sourceforge: https://sourceforge.net/projects/flapi/files/
You will need the .NET Framework 4 and the XNA Redistributables 4
It can take quite some time to start and will use ca. 600mb ram at startup and much more if you switch between several systems until it will crash due to low memory. Well, it’s pre pre pre alpha
Controls:
press the right mouse button and move the mouse to look around
change position with arrow keys
left-klick on a system on the sector map to go there (does not work too well)
press h or j to show/hide jumphole/jumpgate connections on the sector map -
So, i have tried it
Works great for vanilla freelancer, i have switch 10 times in different systems without crash.I’ve tried it on a modded freelancer -> application won’t load.
I think it’s because some files are not BINI encrypted, in the mod, universe.ini and some systems INIs are in .ini and not in BINI encrypted format. Not sure about that.It can be a great tool for previewing new systems or to see if a modul s corectly positionned with a base, or to make some “tactics videos”
Keep it Up
-
Did you get an error message? if yes, what did it say?
Theoretically, text inis shouldn’t be a problem. On startup, Starchart looks for the freelancer registry entry, then parses freelancer.ini to get the data path and the name of universe.ini and solararch.ini, then parses these and all inis and utfs refrenced there. Of course I could have made some mistakes (better: I know I did, adoxa already pointed out) so any further info could halp me fix that.
Nice to know it works with vanilla on other machines, though. Could you post some data about your pc and how you experienced the performance of Starchart? Thanks for testing!
-
I was wondering why it wouldn’t work at all on my mechine, you just answered my my question though, I never installed FL on this desktop. I just dragged and dropped the install folder from another drive, so there is no registry entry.
-
So, when i rename my modded FL in “Freelancer” to make your soft parsing my files, no errors, the soft doen’t load, it say “Starchart a cesé de fontionner” (in english i think its’s equal to “starchart have stopped running”) this is the Details :
Description :
Stopped workingSignature du problème :
Nom d’événement de problème: CLR20r3
Signature du problème 01: starchart.exe
Signature du problème 02: 0.0.0.1
Signature du problème 03: 4d835042
Signature du problème 04: FlApi
Signature du problème 05: 0.0.0.1
Signature du problème 06: 4d835028
Signature du problème 07: 17
Signature du problème 08: 565
Signature du problème 09: System.InvalidCastException
Version du système: 6.0.6002.2.2.0.768.3
Identificateur de paramètres régionaux: 1036I’m on Vista 32bit.
proc: t7500
Ram: 3Go
GC: 8600M GT
Animation when orientating systems and moving around are smooth zoom in and out too. Switching system take about 3 secondes. i will make more test to see how many times i can switch systems.Hope details can help you to found problem, but i thing to a cast error like saying in the details, are you casting some values, or just manipulate them ? Good luck.
I cant take a look at your source code for now, cause i havn’t my compiler installed in this computer. -
yep, I just installed JFLP after adoxa pointed out that “I don’t like it”
Starchart, or rather my FLApi library are very strongly typed. The invalid cast is because in JFLP many values that are floats in vanilla are integers, and the parser handles this correctly but the api assumes other types.Will try to fix that soon
-
OK good news so
Oh, just a suggestion :
is there an easy way for you to let the user point at the FL folder instead of reading the registry ? So that, we can choose if we want load vanilla FL or a modded one :), By asking the user to point at the universe.ini or the freelancer.ini r the FL Folder.It can be a cool option for your future release.
-
No not an editor really, more a system viewer, well, a star chart
But Starchart really is just a frontend for FLApi, a library im working on to access Freelancer data. The api could be eqipped with editing functions (I plan to, some time in the distant future), so then it can be used to build editors. Starchart itself could evolve into a new engine for Freelancer, but that is far far off. I’m just scratching at the surface.
-
Found another problem caused by JFLP. I use the longer “En Dash” (U+2013) for the gate “arrows”. This character isn’t present in the sprite font, so another exception is thrown. Solution is simple, add s = s.Replace(‘\x2013’, ‘-’); before MeasureString in drawString in SystemMap.cs. Well, simple for that particular problem, but there could be other missing characters, so a more robust solution is needed.