Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: FreeTerran on September 12, 2003, 01:13:36 pm
-
I have some change in the starfield.cpp e.g. bump up the star limit from 2000 to 100000 and this is the result
i'm not done now i will change some things in the next time
(http://swooh.com/peon/FreeTerran/starfield/1.jpg)
(http://swooh.com/peon/FreeTerran/starfield/2.jpg)
(http://swooh.com/peon/FreeTerran/starfield/3.jpg)
-
Impressive stuff, but 2 things:
1 - Can you provide the .exe? I'd like to look at it in motion.
2 - That many starts swirling around as the player turns is very distracting. Any way around it?
-
Yeah the problem is the warp of the stars if you moving faster i will fix it...
and i will put a exe on the net as soon as i have fix it
-
More stars = good. And the more you optimise it the better. It doesn't kill the framerate, does it?
-
Originally posted by diamondgeezer
It doesn't kill the framerate, does it?
Only about 1 or 2 frames if you move fast
-
Ok the star warp is fixed here is an build for you guys
http://swooh.com/peon/FreeTerran/starfield/fs2_open_s.rar
-
Looks really nice FT, but I think we may have some duplication of work going on here, since Sticks is working on exactly the same sort of thing?
Flipside :D
-
Hmm sh*t maybe if he works on an other thing we could put the starfield.cpp source together
IMPORTANT NOTE: if you want test the much star thing open your mission with notepad search "$Num stars: " put behind it an 25000 "$Num stars: 25000"
-
I added more color variety to the star creation code... some random reds and blues now show up. I think its in the new EXE that FT just put up, we worked on it together just now.
-
Yeah the exe is updated :)
-
way too many stars. plus i already had some colored star code in fs open
-
That are not to much.... that is real :doubt:
-
I always wanted to see a really [glow=orange]DENSE[/glow]starfield.
Now, it is the thing I have always wanted.
-
I suppose to make it 'real' looking you would have to have 'clusters' of stars, whereas FS2 isn't quite random, I think, when placing them, I don't know the code, but does it take measures to make sure the starfield is 'even' or is that just how things turn out?
Flipside :D
-
Originally posted by Flipside
I suppose to make it 'real' looking you would have to have 'clusters' of stars, whereas FS2 isn't quite random, I think, when placing them, I don't know the code, but does it take measures to make sure the starfield is 'even' or is that just how things turn out?
Flipside :D
Yeah i and max work on it
-
// following code randomly distributes star points within a sphere volume, which
// avoids there being denser areas along the edges and in corners that we had in the
// old rectangular distribution scheme.
dist_max = (float) (HALF_RND_MAX * HALF_RND_MAX);
for (i=0; i dist = dist_max;
while (dist >= dist_max) {
v.xyz.x = (float) ((myrand() & RND_MAX_MASK) - HALF_RND_MAX);
v.xyz.y = (float) ((myrand() & RND_MAX_MASK) - HALF_RND_MAX);
v.xyz.z = (float) ((myrand() & RND_MAX_MASK) - HALF_RND_MAX);
dist = v.xyz.x * v.xyz.x + v.xyz.y * v.xyz.y + v.xyz.z * v.xyz.z;
}
vm_vec_copy_normalize(&Stars[i].pos, &v);
This is the code that avoid the clusters but i and max donno how we could put it off :( the testing goes on...
-
Once again, a purely non-coders point of view, but it looks like it checks each point to make sure it is not too close to any others? So it's roughly 'While Distance is More than or Equal to' and it generates a random average distance for each starfield so they look different? I'm not very up on array generation in anything above Cobol ( a tiny bit) and Pascal.
I suppose my first suggestion would be to remove the checks altogether?
// following code randomly distributes star points within a sphere volume, which
// avoids there being denser areas along the edges and in corners that we had in the
// old rectangular distribution scheme.
for (i=0; i {
v.xyz.x = (float) ((myrand() & RND_MAX_MASK) - HALF_RND_MAX);
v.xyz.y = (float) ((myrand() & RND_MAX_MASK) - HALF_RND_MAX);
v.xyz.z = (float) ((myrand() & RND_MAX_MASK) - HALF_RND_MAX);
dist = v.xyz.x * v.xyz.x + v.xyz.y * v.xyz.y + v.xyz.z * v.xyz.z;
vm_vec_copy_normalize(&Stars.pos, &v);
Once again, I have applied brute force to this, so chances are it is completely wrong :D Computer Randomness is not 'real' as such, so there is a tendency to create clusters etc if you let it create enough stars :)
Flipside :D
-
Is there any way to try and give some kind of pattern to the background? IE. the galactic rim should be less starry than if you face the core...
-
I realize this is a pointless post, but shouldn't the stars be recognizably the same in the same star system? Granted there would be some derivation based on the location within the observing system but that would be minimal.
We could maybe add some code, and this is complete pie-in-the-sky, but, we could add some code that generates the basic starfield for, say, Delta Serpentis and make an option in FRED that allows the mission designer to choose the system that the mission takes place in. This would be limited to the canon systems of course.
-
But then we have to decide what canon delta serpintis starfields look like... along with all the other systems..
-
Originally posted by Knight Templar
But then we have to decide what canon delta serpintis starfields look like... along with all the other systems..
And realistically... who cares?
Denser Starfield = Good.
Clunping Starfield = Good
Identical each time for whatever system you're in = Pointless.
Most people don;t evenb care if the nebulae change colours, let alone whether this tiny point of light is in the same place as it was three missions ago.
However, it might be interesting, if this clumping code cant be worked out, to try doing it with PCXes...
-
This definitely looks better and more realistic than before. I had this in mind at one point long ago but forgot to bring up the subject here. Since this is really only a question of upping the limit, it will give mission designers the option to use the higher limit while having older missions work as they did before, so there's no reason not to go for it.
The swirling thing is a neat effect but it does indeed get quite annoying when there are that many stars. Is it possible to do it only for a few of them (randomly selected) without dropping the framerate significantly?
I keep the nebulas the same for all missions in a system, but nobody is really going to notice the star thing unless there is some glaring change.
-
Originally posted by CP5670
The swirling thing is a neat effect but it does indeed get quite annoying when there are that many stars. Is it possible to do it only for a few of them (randomly selected) without dropping the framerate significantly?
It dosen't drop the framrate at my pc
if you want test it at your machine with framrate i could put an debug build on the net ?
-
What about this guys ? ;)
(http://swooh.com/peon/FreeTerran/starfield/4.jpg)
(http://swooh.com/peon/FreeTerran/starfield/5.jpg)
(http://swooh.com/peon/FreeTerran/starfield/6.jpg)
-
Getting there - could you make the stars bleed a little bit? Really fuse together the groups of stars.
-
Hmm it looks in game other then here try it
http://swooh.com/peon/FreeTerran/starfield/fs2_open_s.rar
-
Can't - no FSO build ever works on this comp - memory issues I think.
-
that is really cool btw... some day people will load up thier old 1998 game and 'patch' it.... then WTF!?!??!?!!!?!?
-
Now if you could only overlay a small blue glow over those stars, it'd own!
-
Originally posted by LAW ENFORCER
that is really cool btw... some day people will load up thier old 1998 game and 'patch' it.... then WTF!?!??!?!!!?!?
there's an idea, get :V: to put a FS_OPEN link up when you update using the launcher.
-
Originally posted by Raa Tor'h
Now if you could only overlay a small blue glow over those stars, it'd own!
Funny you should mention that - didn't FS have exactly that kind of glow?
Or indeed it could be done Greg Martins way - I strongly recommend Stealth and other starfield making people look up his work and take a note at what "fantastic" is defined as ;)
-
dist_max = (float) (HALF_RND_MAX * HALF_RND_MAX);
for (i=0; i dist = dist_max;
while (dist >= dist_max) {
v.xyz.x = (float) ((myrand() & RND_MAX_MASK) - HALF_RND_MAX);
v.xyz.y = (float) ((myrand() & RND_MAX_MASK) - HALF_RND_MAX);
v.xyz.z = (float) ((myrand() & RND_MAX_MASK) - HALF_RND_MAX);
dist = v.xyz.x [color=red]*[/color] v.xyz.x [color=red]+[/color] v.xyz.y [color=red]/[/color] v.xyz.y [color=red]+[/color] v.xyz.z [color=red]*[/color] v.xyz.z - v.xyz.y [color=red]/[/color] v.xyz.y;
}
vm_vec_copy_normalize(&Stars[i].pos, &v);
the red market code how could i code it that they randomize the operations ? they shall randomize use +, -, * or /[/B]
-
Identical each time for whatever system you're in = Pointless.
If there are recognizable star formations it'd be a nice touch. There have been people who've noticed different colored nebulas. :p
-
Seems a bit anal, no? ;)
But if we can do it - we may as well go the whole nine yards and make this open source really special.
When I say we, I mean you.
At least I'm honest.
I'm going now.
-
the problem is the stars will be in ever mission the same i must write an random script that we have various missions :sigh:
-
The only other way is to use some sort of Fractal method, where the seed is defined in Fred for each mission, but that really is a hell of a lot of Math for something that most people won't notice :)
Flipside :D
-
I wonder if we could actually map the entier starglobe...
Certain constellations could be mapped for each system, using rho and gamma (horizontal and vertical angle).
Then we should use the same values for the Milky Ways position.
That should define the zone where the cluster generator should work.
The rest of the globe could be filled with various small stars.
-
what use would that be? barely anybody could recognize anything from Sol, if you change the angle seeing those stars from another system, there will be nothing to recognize :p
-
Hey, I've always wanted this... actually, the stars in IW2 (if you remember them) are really good, if you want some direction to go in. But this bunched up stars is definitely a move in the right direction :nod:
-
Certainly something in the form of a galactic core would be good - it'd be even better if this was implemented into FRED so that the orientation / direction of the core could be changed so that you could simulate moving around the galaxy...
-
Originally posted by Flaser
I wonder if we could actually map the entier starglobe...
Certain constellations could be mapped for each system, using rho and gamma (horizontal and vertical angle).
Then we should use the same values for the Milky Ways position.
That should define the zone where the cluster generator should work.
The rest of the globe could be filled with various small stars.
actually, that would be possible, i think.
just, really, really not so usefull.
alternatively, you could try to render the stars as a background using some program which can do this.
-
Hmmmmmm... ok, I can understand how this would appeal to certain people, but to be honest, I truly cannot see the point of having specific 'star' setups. They are decoration, quite frankly, I'd much rather see my diskspace and CPU power being used on more tangible aspects of the game. I can gaurantee that if you make the stars random, about 3 people will point it out. If you make them fixed, absolutely no-one will notice.
Flipside :D
-
Having fixed constellations is one thing.
Seeing the galaxy as the Milky Way in a variety of ways - being among the core stars where space is almost white is definitly something you will have to notice, while on the Periphery you'd only see the greatest arc of the galaxy ever seen and the sky would be very dark on the other side.
-
Originally posted by Flaser
Having fixed constellations is one thing.
Seeing the galaxy as the Milky Way in a variety of ways - being among the core stars where space is almost white is definitly something you will have to notice, while on the Periphery you'd only see the greatest arc of the galaxy ever seen and the sky would be very dark on the other side.
i think this should be something for the MODder, not the coder, to do.
think of creative use of backgrounds.
note, i am not a FREDder or a MODder, but from what i hear and see, i think this should be possible rather easily.
-
You know, you've been
just another newbie without any modding, FREDding or real programming experience
For over 2 years now. You planning to work on that or anything? :p
-
Originally posted by Black Wolf
You know, you've been
For over 2 years now. You planning to work on that or anything? :p
dude, i'm here for two years?
****.
and no, i don't plan on working on that, actaully.
i am just working on passing this year without failing any subjects. last year they had to "rethink" some of the grades just to pass me. they did that only because i was a fail on 0,003 of a point, but still, i'd rather make this year with a little breathing room.
-
you should vary the star magnitude - ie some stars are nearby some are farther away - and also globular clusters