Reviving Vega Strike

Development directions, tasks, and features being actively implemented or pursued by the development team.
Post Reply
stingray18
Explorer
Explorer
Posts: 9
Joined: Sun Dec 13, 2009 7:25 pm
Location: Northern Germany

Re: Reviving Vega Strike

Post by stingray18 »

Yes, I did. As I said we should decide and put all the documentation in one place, may it be the wiki or another app. To have an easy start and preventing the discussion about an UML tool, we should indeed start with the wiki as the central place for documentation.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Reviving Vega Strike

Post by chuck_starchaser »

I'd stay far, far, FAR away UML; beyond fuel range. Problem is, more people know C++ than know UML.
Understanding a UML graph is about 7 times harder than reading the code it represents, for me at least.
The original idea sounded good, of representing code graphically; but it failed miserably. To see an arrow
pointing up from a rectangle below to a rectangle above and recognize that as an "inheritance" relationship
still takes me an effort, to this day. Arrows, to me, represent changes **in time**, like control flow, or data
flow, rather than timeless, abstract things like inheritance. On top of that, you got dots and bubbles and
a dozen kinds of arrowheads to identify various kinds of relationships; and NONE of them are natural or
intuitive in ANY way; you have to study and MEMORIZE what all the symbols do. To me, UML is the
worst invention since war. Not saying you shouldn't use it, if it helps you, personally; but I don't think it's
likely to help anybody else. Besides, wherever you see inheritance in the VS engine, there probably should
not be; and viceversa. Documenting good code is good; but ... ... documenting BAD code... ???
EDIT:
The only part of the code where inheritance is probably somewhat sensically used now is the unit class
hierarchy, which Safemode worked on recently. You know how it was before? A single class was used
for anything from a ship to a station, a planet, a star or a jump-point. The distinctions between all these
object types were signaled via boolean flags in the class. You can expect such horrors everywhere you
look; like SPEC engine code buried inside flight control code, and spaghetti everywhere.
EDIT2:
One of the things that make the VS engine code most difficult to follow are the horrible naming standard,
or lack thereof. There are sections called "fog" and sections called "fawg", and neither have anything to
do with fog. Functions are often named to sound like nouns, and variables to sound like verbs. Etceteras.
There's also a prevalent policy of using special values in float variables and arguments to mean special
things, like 1.5 may be a speed, but 0.0f means it's a bird; not a plane; and -1.0 it's Superman. How do
you document that in UML? :)
Last edited by chuck_starchaser on Fri Dec 18, 2009 7:58 pm, edited 1 time in total.
stingray18
Explorer
Explorer
Posts: 9
Joined: Sun Dec 13, 2009 7:25 pm
Location: Northern Germany

Re: Reviving Vega Strike

Post by stingray18 »

Well, I grew up with UML and am quite used to it. Besides it's on of the few standards the developer front ever came up with.

Regarding documenting bad code: of course, if it could be identified as such, no use to document it (besides marking it as bad code). My intention is to do a top-bottom documentation, start from the very general, and then dive into the details. At the end of the details, there's algorithms and source code. And the stuff already present in the wiki is a good start.

But I'm fully open to suggestions
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Reviving Vega Strike

Post by chuck_starchaser »

I was still editing my post; check out the edits.
Well, I grew up with UML and am quite used to it. Besides it's on of the few standards the developer front ever came up with.
UML is fine to represent class hierarchies; but in the VS engine the only case of such a thing occurs with the unit class and derivatives; nowhere else. You'd be better off with good old flowcharts for anything else. There's hardly any inheritance, and it's usually BAD inheritance (mostly just code inheritance, without as much as an intent to use polymorphism).
stingray18
Explorer
Explorer
Posts: 9
Joined: Sun Dec 13, 2009 7:25 pm
Location: Northern Germany

Re: Reviving Vega Strike

Post by stingray18 »

chuck_starchaser wrote: One of the things that make the VS engine code most difficult to follow are the horrible naming standard,
or lack thereof. There are sections called "fog" and sections called "fawg", and neither have anything to
do with fog. Functions are often named to sound like nouns, and variables to sound like verbs. Etceteras.
There's also a prevalent policy of using special values in float variables and arguments to mean special
things, like 1.5 may be a speed, but 0.0f means it's a bird; not a plane; and -1.0 it's Superman. How do
you document that in UML? :)
Not at all, that's beyond the scope of UML or any other Modelling Language: But I wouldn't want to go to deeply into theoretical discussions of pros and cons of UML. It's widely used and recognized and in void of alternatives I will use it.

Regarding coding style and such: it's difficult to maintain in an open-source project without being busy changing contributions from other people instead of coding. Of course, if we can agree of a few rules the better. But it wouldn't be on the top of my priority list.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Reviving Vega Strike

Post by chuck_starchaser »

Fine; suit yourself; I just thought you should know what you're up against.
RedAdder
Bounty Hunter
Bounty Hunter
Posts: 149
Joined: Sat Jan 03, 2009 8:11 pm
Location: Germany, Munich
Contact:

Re: Reviving Vega Strike

Post by RedAdder »

Regarding Git on windows, there is a package from google which comes with a nice version of msys:
http://code.google.com/p/msysgit/

Reportedly it is slow, but IMO it is fast enough for medium size projects(whatever that may mean to you :wink: ).
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: Reviving Vega Strike

Post by JsnMtth »

RedAdder wrote:Regarding Git on windows, there is a package from google which comes with a nice version of msys:
http://code.google.com/p/msysgit/

Reportedly it is slow, but IMO it is fast enough for medium size projects(whatever that may mean to you :wink: ).

It's probably the POSIX emulation making it slow. I'm not against using it on windows regardless, but I think mercurial should be explored. I think mercurial can clone a git repo, it could be used for windows users as long as it supports submodules properly. I think submodules is VERY important for VS in a distributed version control system. My git repo of it is around 5GB.
charlieg
Elite Mercenary
Elite Mercenary
Posts: 1329
Joined: Thu Mar 27, 2003 11:51 pm
Location: Manchester, UK
Contact:

Re: Reviving Vega Strike

Post by charlieg »

chuck_starchaser wrote: One of the things that make the VS engine code most difficult to follow are the horrible naming standard, or lack thereof. There are sections called "fog" and sections called "fawg", and neither have anything to do with fog. Functions are often named to sound like nouns, and variables to sound like verbs. Etceteras.
So one of the first things stingray or anybody can start doing is changing the source bit by bit to use more appropriate names to greatly enhance readability. That theoretically shouldn't add bugs either.
chuck_starchaser wrote:There's also a prevalent policy of using special values in float variables and arguments to mean special things, like 1.5 may be a speed, but 0.0f means it's a bird; not a plane; and -1.0 it's Superman. How do you document that in UML? :)
You don't document that with a tool like UML. You change it. Variables like that are really bad practise. Any non-trivial-enough-to-understand-by-a-name variable needs documenting where it is defined.
stingray18 wrote:I wouldn't want to go to deeply into theoretical discussions of pros and cons of UML. It's widely used and recognized and in void of alternatives I will use it.
Meritocracy. If you want to use UML and it helps, do so. I can't see how it'll burden anybody else.

--------

Has anybody attempted to set up VS in Eclipse CDT?
Free Gamer - free software games compendium and commentary!
FreeGameDev forum - open source game development community
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Reviving Vega Strike

Post by chuck_starchaser »

This may be a stupid question; but at least it's not off-topic: Is there someone around, still, that can
grant commit access to the code repositories to stingray and jsnmtth? --and to the data repos to
nphillips, myself, and other incoming artists?
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: Reviving Vega Strike

Post by JsnMtth »

Sounds like fixing the compile problems and cleaning up the most glaring bugs would be the things to do first.
Second would be to define feature improvements.
Any comments on the Coding Standards? http://vegastrike.sourceforge.net/media ... Code_style
Any comments on the roadmap? http://vegastrike.sourceforge.net/media ... dmap:0.6.0
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Reviving Vega Strike

Post by chuck_starchaser »

Apparently I can no longer edit the Vegastrike wikis. I wrote a big page of coding standards
for the Sirikata project, a while ago; then Klauss edited it. Now I wanted to add its contents
to the code standards page that Safemode wrote, but my username/password are no longer
accepted by the wiki. I think it has something to do with the fact that my forum name has an
underscore, which the wiki login changes to a space. I had the same problem before the
change to phpBB3, and I had solved it by creating another user with a space instead of an
underscore; but apparently something messed that up.
Please refer to the page here:
http://www.sirikata.com/wiki/index.php? ... _Standards
In it I address many things that Safemode didn't, such as const-correctness, naming of
variables and functions, etcetersas.

With regards to the roadmap, Klauss no longer has time for development; so if someone
wants to take on the task of finding code to read DDS cubemaps, it's on the table. All of the
plumbing is already in; I've already produced DDS cubemaps for all VS backgrounds; and
shader changes are trivial. The only thing that needs to be done is the code to read the files.
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: Reviving Vega Strike

Post by JsnMtth »

chuck_starchaser wrote: With regards to the roadmap, Klauss no longer has time for development; so if someone
wants to take on the task of finding code to read DDS cubemaps, it's on the table. All of the
plumbing is already in; I've already produced DDS cubemaps for all VS backgrounds; and
shader changes are trivial. The only thing that needs to be done is the code to read the files.

Are we GPL3 compatable? http://www.visualizationlibrary.com/jetcms/
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Reviving Vega Strike

Post by chuck_starchaser »

You mean OGL 3.x? Not sure the relation to the link.
So, you mean whether the code would compile if we loaded GL3 libraries? You could try.
Not sure why you're asking; GL3 has DDS cubemap reading code built in?
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: Reviving Vega Strike

Post by JsnMtth »

chuck_starchaser wrote:You mean OGL 3.x? Not sure the relation to the link.
So, you mean whether the code would compile if we loaded GL3 libraries? You could try.
Not sure why you're asking; GL3 has DDS cubemap reading code built in?

Sorry... Alphabet soup. General Public License version 3
The library is licensed under those terms.

I found some examples here for creating our own built in support for DDS,
but I can't find the license, although they claim on the site we can use them.
http://www.codesampler.com/oglsrc/oglsrc_4.htm
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Reviving Vega Strike

Post by chuck_starchaser »

Ah, I see. I know nothing about licenses; but the example they got for dds texture loading is not what
we need; we need DDS cube map texture loading. DDS cube-maps are a DX10 (MS) extension
of the DDS format, to support arrays of textures. So, a 1024 cubemap is an array of 6 textures, each
consisting of a 1k by 1k top LOD (LOD 0), a 512x512 second LOD (LOD1), a 256x256 LOD2... and so
on to a 1x1 (1-texel) LOD 9. So, 60 sub-textures in total; each in DXT1-compressed format. Not that we
need to decompress it; --we'd send it to the videocard compressed, as GPU's decompress DXT1 on
the fly.
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: Reviving Vega Strike

Post by JsnMtth »

Does OpenGL support it?
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: Reviving Vega Strike

Post by JsnMtth »

Vegastrike is released under the GNU General Public License version 2 (GPL2)

Under the license we have the option to upgrade to version 3. What we need to know is:
1) Do we want to upgrade to version 3?
1) If not, does linking GPL3 code automatically update our license to GPL3 too?
2) Are we allowed to use DDS Cubemaps under the GPL?


We do not have the right to link against GPL incompatible software (see the 4 freedoms required by the license)

Below are the links to the actual licenses
GPL2: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
GPL3: http://www.gnu.org/licenses/gpl.html

I'm familiar with version two, but have never needed to understand three. I'll read it over the weekend.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Reviving Vega Strike

Post by chuck_starchaser »

Never heard of use of file formats being restricted by licenses. Anyways, the DDS cube map is a
free and open MS extension. What we need to do is write the code to read it, and integrate it.
Should be easy. There's a 4-byte code at the beginning, followed by a 124-byte header that's
standard in DDS, followed by another, extension header that MS put in there, not sure how big,
followed by the data. Just a few nested loops; that's all; I could probably write it; just wouldn't
know where in the engine to put the code.
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: Reviving Vega Strike

Post by JsnMtth »

A Free and Open format is good news. File formats can fall under patent law, but not copyright law. A library that implements a format can fall under copyright law. DirectX would be an example if DDS cubemaps ONLY work in DirectX and if DirectX has a non-free license were stuck. Judging from my glance at compiling openAL, DirectX is non-free (but I haven't read the license). If OpenGL supports DDS Cubemaps, and we can get fee (as in speech) documentation than yes, its quite implementable. I imagine it would need to be implemented in the rendering engine. I've looked through some of it and it looked quite clean to me.

Isn't a cubemap a big box that we're flying around in? The box just happens to look like space, or are cubemaps used in other areas of the rendering process as well (like rendering ships for example)?
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Reviving Vega Strike

Post by chuck_starchaser »

JsnMtth wrote:A Free and Open format is good news. File formats can fall under patent law, but not copyright law. A library that implements a format can fall under copyright law. DirectX would be an example if DDS cubemaps ONLY work in DirectX and if DirectX has a non-free license were stuck. Judging from my glance at compiling openAL, DirectX is non-free (but I haven't read the license). If OpenGL supports DDS Cubemaps, and we can get fee (as in speech) documentation than yes, its quite implementable.
Microsoft themselves have a description of the file format on their website.
I imagine it would need to be implemented in the rendering engine. I've looked through some of it and it looked quite clean to me.
Cool!
Isn't a cubemap a big box that we're flying around in? The box just happens to look like space, or are cubemaps used in other areas of the rendering process as well (like rendering ships for example)?
It's used also for "environment mapping", to show reflections of the sky on shiny surfaces. In the pixel shader (which is executed for each pixel), the view vector is reflected across the surface normal, and that reflection vector is then used to fetch the color of the reflected sky from the cubemap.
It's also used for the ambient component of the lighting: instead of using the reflection vector, as in environment mapping, one uses a baked "bent normal" that points in the direction where most of the light comes from, in the case of CineMut, which has such bent normal; --or in the direction of the plain normal, in the case of VS's current High Shader.
We're doing these things currently with the spheremaps we got; but the problem with spheremaps is that they are anisotropic (compressed in the center; stretched to hell in the periphery), so they don't filter well.
And of all cubemaps, the DDS kind,
a) are compressed, and remain compressed IN video memory, so they take up about 1/4 as much memory; and
b) have "mip maps" (extra layers of successively half sized textures), which we use for progressive blurring. Why blurring? Because rough materials reflect the environment in a blurry way. That's why you don't shave in front of a stainless steel pan, or an aluminum baking tray, even though they reflect as much light as a mirror... the reflections are blurry.
Anyways, we're already doing this, but it looks like crap because of the damned spheremaps.
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: Reviving Vega Strike

Post by JsnMtth »

The code referred to below appears to read DDS cubemaps already.

Code: Select all

Filename: src/gfx/vsimage.cpp
Lines 682-825 
Function Name: unsigned char *VSImage::ReadDDS()
The code referred to below handles SphereMaps:

Code: Select all

Filename src/gfx/env_map_gent.cpp
Lines 337-436
FunctionName: static void GenerateSphereMap()
It looks to me like the implementation is close to complete. As long as the two implementations are close to the same functionality, it shouldn't be hard to switch from one to the other. The implementation may be complete or almost complete.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Reviving Vega Strike

Post by chuck_starchaser »

WOW! Excellent! I'll have a look at it.
I kept asking Klauss what was the status with it, and getting no reply... Maybe he did it already!
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: Reviving Vega Strike

Post by JsnMtth »

I've found where the gfx system is loaded in relationship to the main() function as well. I don't under stand 95% of the jargan about the difference between what VS is doing and what we want it to do. In relation to (spheremaps vs cubemaps). You know that, with your help I think we can move forward quickly. It might just need a switch flipped somewhere, (like at compile time).
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: Reviving Vega Strike

Post by JsnMtth »

Ok, I've read through it again and I only don't understand 5% :). It sounds like all we need to do is read the DDS file, then shove it into the graphics cards memory. It looks like that function does just that. Am I on course?

Also, How would I be able to see if it's working or not?
Post Reply