3D Starchart - Teaser 1: Rendering Planets
-
Ezekiel wrote:
i have a probleme with a custom FL :
“mat count 11!=12” or something similar.I think I found where this comes from. Happens if a “material library” node contains more materials than its “material count” value would suggest. But it will still work, this is one of my many exceptions that are thrown on principle if there’s an error in the file though the program would still work. Will remove it in the next release (which will come tonight or tomorrow ;-), its already gone in the code on svn, if you want to build it yourself )
Ezekiel wrote:
…anyway to ignore it and continue ?If that works (see above) why not
TheDvDMan wrote:
Wait… Does it read costum models? Or I’ll have to wait for the Beta for that?It might/should. Please, try it and give me some feedback if and how well it worked
@J.Walker
OK, that sounds much more complicated / time consuming than I hab hoped, so I can’t promise I’ll really try it…
But considering that so much has to be changed, of course there open up hundreds of possible sources for the planet rendering problem as well as the lighting problem (they aren’t really connected).
Rendering of models and planets isn’t much different except that the vertices for planets don’t come from a file but are generated by a sphere formula (I didn’t come up with that, copied it ). So the problem must lie there somewhere (PlanetRendere.generateSphere).
Lighting is another thing, it’s all done in the shader (StarchartContent/effects/Models.fx and Planets.fx) so maybe there is a problem with the content pipeline (thats an XNA feature usually used to load all models, textures and effects. But as everything except these effects is loaded from the Freelancer game files it could be).
Well, as of now I can only speculateAbout game development:
I know that it is usually done in C++ but I hate that language
Well seems I’m simply spoiled by garbage collection and large, well documentet libraries combined with welll working auto-complete, in other words by Java and .NET
And as .NET is much more performant than Java (and with VisualStudio has the best IDE ever) my choice was natural. As for C#, I really like the syntax and language features.
When I found out there was the XNA framework as wrapper for the DirectX API it was clear to me that my first serious game / 3D graphics project would be done in C# using XNAWell, so much about my motives…
Your windows forms intergation looks really nice. I’m really glad my work seems already fit for use in other projects.
I finally worked out how to select objects in 3D space (your approach was exactly the right thing, except that for some strange reason it doesn’t work when you set the z values of nearSource and farSource to 0 and 1, it must be larger than 1 so setting it to 2 and 3 works great. To find out what objects lie beneath the cursor I added BoundingBoxes to all objects so we can simply use Ray.Intersects)
I will update the SVN shortly and, as stated above, upload release 0.0.0.6 some time tonight or tomorrow.
-
This looked pretty cool, so I downloaded the binaries.
WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v1.1.4322** (Starchart.exe:10299): WARNING **: The following assembly referenced from /home/alex/Downloads/FLStarchart/Starchart.exe could not be loaded:
Assembly: Microsoft.Xna.Framework.Game (assemblyref_index=0)
Version: 4.0.0.0
Public Key: 842cf8be1de50553
The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (/home/alex/Downloads/FLStarchart/).** (Starchart.exe:10299): WARNING **: Could not load file or assembly ‘Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553’ or one of its dependencies.
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553’ or one of its dependencies.
File name: “Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553”And under Windows:
Any ideas?
-
Have you installed the XNA framework? Seems like XNA 4 is what you need:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a88c6dec-aeae-42cd-a108-d35c013c3b97
-
FriendlyFire wrote:
Seems like XNA 4 is what you needYou definitely do.
And it looks like you are using mono, I have no idea if that works, I only tested it on windows 7 professional 64bit with both .NET and XNA frameworks installed (both in the development, not the client / redistributable versions)
-
Thats good news about the object selection, i will eagerly wait for the 06 release.
for costumes it is really not that difficult to get than to display
In: FLApi.Characters.Costume.cs, change it to look like this:
using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using FLApi; using FLApi.Solar; using FLApi.Universe; using FLParser; using FLParser.Ini; using FLParser.Utf; namespace FLApi.Characters { public class Costume { /// <summary>/// Gets or Sets the selected SpaceObject's Docking Character Costume ///</summary> public string costume { set { m_costume = value; setcostume(); } get { return m_costume; } } private string m_costume; public Costume(string s1, string s2) { if (s1 == null) s1 = ""; if (s2 == null) s2 = ""; if (s1 != String.Empty && s2 == String.Empty) this.costume = s1; if (s1 == String.Empty && s2 != String.Empty) this.costume = s2; if (s1 != String.Empty && s2 != String.Empty) this.costume = s1 + ", " + s2; } /// <summary>/// changes the spacecostume for the selected spaceobject ///</summary> private void setcostume(string newcostume = "") { // TODO: code it to allow changing the space_costume (Class: FLAPi.Characters.Costume, Function: setcostume(string newcostume = "")) if (!string.IsNullOrEmpty(newcostume)) { this.m_costume = newcostume; } } } }
then in FLApi.Universe.SpaceObject.cs
in function: public SpaceObject(…)
locate: case “space_costume”:
and the line before: break;
change it to:
SpaceCostume = new Costume(e[0].ToString(), e[1].ToString());and when you want to display the costume string read it from the costume property:
spaceObject.SpaceCostume.costume;
-
I’m sorry it doesn’t work for you TheDvDMan, unfortunately I do not know Hebrew but if it is a generic vista error message it doen’t seem helpful anyway. Vista must be worse than I’d thought if it can’t even run normal .NET applications properly.
edit:
Hmm, I just thought of something: Of course this could be a language or font problem (and wouldn’t be the first one, why didn’t I think of that before :-? ).@=Alex=:
Why almost? Seems to be working fine on your screenshot.I would have said that it works on all Windows platforms for which .NET and XNA are available but it seems now that I was too optimistic.
-
great job on the object selection code mate. worked like a charm, and was easy to add to to be able to use the left mouse button to select the object.
As i mentioned after doing a quick convert of my app into C# i found that planets and lighting were rendering as they should based on revision 05. I have also intigrated the code changes for the object selection (ie: Revision 06).
I noticed you put in the code i wrote for the costume display, thanks mate, cheers for that. I plan on continuing work on it to allow for editing and saving it, as well as the faction class i am still working on.
anyway wanted to show this new screenshot of my app with the recent code changes, and the full conversion of the app into C#.
-
So, I finally uplaoded binaries for 0.0.0.6, hope they work as well as 0.0.0.5 or better.
As usual, dowload here
I did some internal reorganisation so now there’s no more flickering when hovering above systems on the sector map.
You can now turn trade lane rendering on and off by pressing t as well as jumphole and - gate routes with g and h respectively.
The names of objects are no longer displayed in the scene but the name and infocard of a hovered object is shown beneath the sector map@J.Walker:
Looks good, nice to see selection and lighting works. I did some changes but I’m not so sure it’s better now. What you referred to as Revision 06 was actually revision 129 on svn, I updated to 130 just after I built release 0.0.0.6. Just FYI. -
Works fine for me, Vista Ultimate 64 bit.