Author Topic: just a better starfield  (Read 7266 times)

0 Members and 1 Guest are viewing this topic.

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
just a better starfield
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



Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline Fineus

  • ...But you *have* heard of me.
  • Administrator
  • 212
    • Hard Light Productions
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?

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
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
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline diamondgeezer

More stars = good. And the more you optimise it the better. It doesn't kill the framerate, does it?

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
Quote
Originally posted by diamondgeezer
It doesn't kill the framerate, does it?

Only about 1 or 2 frames if you move fast
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
Ok the star warp is fixed here is an build for you guys

http://swooh.com/peon/FreeTerran/starfield/fs2_open_s.rar
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline Flipside

  • əp!sd!l£
  • 212
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

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
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"
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline Max Sterling

  • Veritech Ace
  • 26
    • Skype
    • http://www.steveracer.com
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.
-Max

Creator of Altered Spirits
http://www.alteredspiritsfilm.com

Creator of the FS2 Robotech MOD
http://robotechlan.com/freespace2/
and Bosch Beer.

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
Yeah the exe is updated :)
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
way too many stars. plus i already had some colored star code in fs open
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

  

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
That are not to much.... that is real :doubt:
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline TopAce

  • Stalwart contributor
  • 212
  • FREDder, FSWiki editor, and tester
I always wanted to see a really [glow=orange]DENSE[/glow]starfield.
Now, it is the thing I have always wanted.
My community contributions - Get my campaigns from here.

I already announced my retirement twice, yet here I am. If I bring up that topic again, don't believe a word.

 

Offline Flipside

  • əp!sd!l£
  • 212
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

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
Quote
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
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
Code: [Select]
// 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...
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline Flipside

  • əp!sd!l£
  • 212
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
« Last Edit: September 12, 2003, 04:08:46 pm by 394 »

 

Offline IceFire

  • GTVI Section 3
  • 212
    • http://www.3dap.com/hlp/hosted/ce
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...
- IceFire
BlackWater Ops, Cold Element
"Burn the land, boil the sea, you can't take the sky from me..."

 

Offline Liberator

  • Poe's Law In Action
  • 210
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.
So as through a glass, and darkly
The age long strife I see
Where I fought in many guises,
Many names, but always me.

There are only 10 types of people in the world , those that understand binary and those that don't.

 

Offline Knight Templar

  • Stealth
  • 212
  • I'm a magic man, I've got magic hands.
But then we have to decide what canon delta serpintis starfields look like... along with all the other systems..
Copyright ©1976, 2003, KT Enterprises. All rights reserved

"I don't want to get laid right now. I want to get drunk."- Mars

Too Long, Didn't Read