The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
November 25, 2020, 09:26:46 am
Home Help Search Login Register
News: Paul & Fred have reached a settlement with Stardock!

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  General UQM Discussion (Moderator: Death 999)
| | |-+  Random Planets & Resourse
« previous next »
Pages: [1] Print
Author Topic: Random Planets & Resourse  (Read 3494 times)
Wingnut
Zebranky food
*
Offline Offline

Gender: Male
Posts: 7


Watch out! Alien-o-philia spreading...


View Profile
Random Planets & Resourse
« on: June 10, 2003, 04:38:11 pm »

Hello!  I'm a new on forum, 9 years in SC2, just love planet&galaxy exploration, and got a question:
As far as I can understand (I don't know C or C++ Embarrassed ), star chart is set in plandata.c, and acording to Fred Ford, number of planets/moons and minerals location on each generated on the seed of star destination. So they are, in fact, fixed.
The question is, how can I randomize them? Must I change star chart a liitle? Yes, I seached the forum, and still doesn't understand that. Dear ALL, answer to me please.
Logged

“You don’t need a reason to help people.” (c) Zidane, FF IX
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Random Planets & Resourse
« Reply #1 on: June 10, 2003, 06:30:45 pm »

To change the planets, moons, and minerals, you can probably just modify the initial seed (just adding 1 to them for instance would give completely different results). If you want to decouple them all from the same seed, and make them more random, you would need to store your choices for your seeds (or all choices themselves) in the savegame itself. Which would be a problem if you don't know C.
An added problem, even if you'd just change the seed, would be that for the special locations, existing planets are just modified. This will go wrong if by chance there aren't as many planets (so for instance changing planet 3 when there is only one planet).
Note that this is all theoretical, based on what I know of the source. I haven't actually tried it.

Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
youBastrd
Frungy champion
**
Offline Offline

Gender: Male
Posts: 67


It's real velour, just let yourself go.


View Profile WWW
Re: Random Planets & Resourse
« Reply #2 on: June 10, 2003, 06:32:54 pm »

Howdy, I'm new to this forum as well.  Welcome to us both Smiley

I've been working on a side project, Star System Editor, for a good while now.  It's written in Java.  The goal is to be able to edit star systems, manipulating things like stars, planets, and moons, and export in an easily read format.  It'll likely be open source soon, so if you don't like the output format or want to add another type of cestial object to edit, you should be able to without problem.  Hopefully, you'll be able to place things like ships, starbases, comets, and dust clouds; and be able to edit each of their attributes.  

Project Homepage
http://publish.uwo.ca/~pjforest/timewarp.html

Discussion thread
http://dynamic.gamespy.com/~timewarp/ikonboard/ikonboard.cgi?s=3ee5bbd5427cffff;act=ST;f=13;t=14
Logged

Wingnut
Zebranky food
*
Offline Offline

Gender: Male
Posts: 7


Watch out! Alien-o-philia spreading...


View Profile
Re: Random Planets & Resourse
« Reply #3 on: June 10, 2003, 07:16:08 pm »

Meep-eep, thanks for answer. i looked at the code and figured it out too (about modif. Random.c). I looked more at various GEN???.c files that generate all plot-critical events. Looks like GenerateIP() in charge for generating planet (more likely) or sustem. If Planet, then changing Random.c can only results in misplaced energy devices in different location on the same planet (no worries!). Am I right?
Logged

“You don’t need a reason to help people.” (c) Zidane, FF IX
Wingnut
Zebranky food
*
Offline Offline

Gender: Male
Posts: 7


Watch out! Alien-o-philia spreading...


View Profile
Re: Random Planets & Resourse
« Reply #4 on: June 10, 2003, 07:22:30 pm »

Oops, sorry, found out myself. It REALLY generate Systems, so I understand now. What I don't understand is HOW TFB_Random can give needed results for placing Energy Devices on right planet? I try to look at the code more, but explanations are heartily welcome!
Logged

“You don’t need a reason to help people.” (c) Zidane, FF IX
Death 999
Global Moderator
Enlightened
*****
Offline Offline

Gender: Male
Posts: 3848


We did. You did. Yes we can. No.


View Profile
Re: Random Planets & Resourse
« Reply #5 on: June 10, 2003, 08:13:51 pm »

One solution is to leave systems containing modifications alone, and change the others.
Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Random Planets & Resourse
« Reply #6 on: June 10, 2003, 08:49:00 pm »

Wingnut: The placement of energy devices isn't done by use of TFB_Random. It's a two-stage process: first, (pseudo-)randomly, but with a fixed seed, the planets are generated. This is done in sc2code/planets/solarsys.c. Then, (at the appropriate time) specific locations are changed to suit the storyline. This is done in the sc2code/planets/gen* files.
Death_999: I think that will work. It looks like the seed used in generating the planets is initialised from the star coordinates. Those seeds could be changed for the systems with no alien presense.
Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Wingnut
Zebranky food
*
Offline Offline

Gender: Male
Posts: 7


Watch out! Alien-o-philia spreading...


View Profile
Re: Random Planets & Resourse
« Reply #7 on: June 11, 2003, 10:29:15 am »

Death_999: That was the first thought after reading Fred explanation about generating, and I'm afraid will be the only solution. But to change star locations will result in starmap.c (copyright check) not working. If coordinates will be changed by X+1 (0,1 on chart), is that enough for completely new universe or not? What do you think?
My friend promised me to lend some books on C, so I gonna dig into code once more (still doesn't understand how seed & pseudo-random generation work).
Logged

“You don’t need a reason to help people.” (c) Zidane, FF IX
Wingnut
Zebranky food
*
Offline Offline

Gender: Male
Posts: 7


Watch out! Alien-o-philia spreading...


View Profile
Re: Random Planets & Resourse
« Reply #8 on: June 11, 2003, 08:18:23 pm »

Now making head & tale from generation chain. Think that if I undestand way of calculation number of planets & moons, it is possible to alter random.c  and ajust critical planets locations to change universe, yet not get in situation you refer to, Meep-eep (about device in system not apearring 'cause there aren't enough planets Shocked).
And looks like yes, changing X and Y just by 1 can drasticaly change system content.
Will be digging 4 next holidays, BIG THANKS to Meep-eep and Death_999 for support  Smiley))
Logged

“You don’t need a reason to help people.” (c) Zidane, FF IX
Wingnut
Zebranky food
*
Offline Offline

Gender: Male
Posts: 7


Watch out! Alien-o-philia spreading...


View Profile
Re: Random Planets & Resourse
« Reply #9 on: June 11, 2003, 08:24:29 pm »

Oh, almost forgot! Death_999, are you still writing technical FAQ on UQM? i 'll  definetly be glad to use it, 'cause now i have only faint ideas of "how to compile, add content and run all that stuff on W98".
Logged

“You don’t need a reason to help people.” (c) Zidane, FF IX
Death 999
Global Moderator
Enlightened
*****
Offline Offline

Gender: Male
Posts: 3848


We did. You did. Yes we can. No.


View Profile
Re: Random Planets & Resourse
« Reply #10 on: June 11, 2003, 08:54:45 pm »

Well, I had some quasi-avoidable delays. Tonight is probably my starting point. Very likely it will be done tomorrow evening (around 2 am GMT the day after tomorrow).
Logged
guesst
Enlightened
*****
Offline Offline

Gender: Male
Posts: 692


Ancient Shofixti Warrior


View Profile WWW
Re: Random Planets & Resourse
« Reply #11 on: June 12, 2003, 06:16:46 am »

You know. This makes me wonder. What would be the effect of mearly adding a randomize() line using something like the system's timer to the start of UQM? How much would change every time and would minerals move around everytime you reloaded the game?
Logged

A new game and it's code each week. Please visit Cymon's Games
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Random Planets & Resourse
« Reply #12 on: June 12, 2003, 07:12:57 pm »

That's actually done in some places (for instance for battle). However for different parts of the game different seeds are used. Changing them all to use a non-static seed would cause inconsistencies in the game, probably with crashes as a result.
Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Wingnut
Zebranky food
*
Offline Offline

Gender: Male
Posts: 7


Watch out! Alien-o-philia spreading...


View Profile
Re: Random Planets & Resourse
« Reply #13 on: June 18, 2003, 12:57:06 pm »

Yes! Finally got UQM builded under VC6++(haven't compiled anything ever).  Changed some star coordinates (Sirius and A Mira) and got completely new systems! Also change B mira to green and got a new system as well (interesting...). I have written a program to autochange coordinates, but its on 1C (internal lang), and I don't know any external lang well enough. My friend suggest to learn Perl a liitle, have to think about it. A programm must also ensure that accending order on Y on coord. will remain (else you get error in UQM).
Anyway, thanks again everyone for support, especially Meep-eep.
Logged

“You don’t need a reason to help people.” (c) Zidane, FF IX
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!