How is Epic creating asteroid fields?
- Second Chance
- Topic Author
- Offline
- King of Space
20 years 6 months ago #18061
by Second Chance
How is Epic creating asteroid fields? was created by Second Chance
Are you using map entities or Pog functions?
The reason I ask is, I've managed to generate asteroid belts using the map file but; when I fly to a distance and look at them using the external camera, after the second time (meaning the third look with the external camera) another asteroid belt just suddenly appears around my ships current position. And it's no ghost, you can crash into the asteroids. So I thought: This is highly unusual?!
I call it my "Automatic asteroid camouflage defense field".
mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos (on hold during SW MP mod)
cartoons.sev.com.au/index.php?catid=4
.
The reason I ask is, I've managed to generate asteroid belts using the map file but; when I fly to a distance and look at them using the external camera, after the second time (meaning the third look with the external camera) another asteroid belt just suddenly appears around my ships current position. And it's no ghost, you can crash into the asteroids. So I thought: This is highly unusual?!
I call it my "Automatic asteroid camouflage defense field".
mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos (on hold during SW MP mod)
cartoons.sev.com.au/index.php?catid=4
.
Please Log in or Create an account to join the conversation.
20 years 6 months ago #9852
by MajorTom
Replied by MajorTom on topic How is Epic creating asteroid fields?
I think the original game creates asteroid fields and debris fields dynamically (by pog). For Example: Look at the debris.ini and asteroids.ini in resource/sims/regions.
The asteroid belts on the MP maps are "hand placed" using the <map_name>.ini positioning template. (which means they are therefore effectivly placed by pog)
I dunno?
This may possibly indicate that the creation of map entities is also linked with the players "field of view"?
Or, maybe something like is done with animation effects, where the engine only does the animation effects if the player is "looking".
Iwar2 Multiplayer Fan Site
The asteroid belts on the MP maps are "hand placed" using the <map_name>.ini positioning template. (which means they are therefore effectivly placed by pog)
This is highly unusual?!
I call it my "Automatic asteroid camouflage defense field"
I dunno?
This may possibly indicate that the creation of map entities is also linked with the players "field of view"?
Or, maybe something like is done with animation effects, where the engine only does the animation effects if the player is "looking".
Iwar2 Multiplayer Fan Site
Please Log in or Create an account to join the conversation.
- GrandpaTrout
- Offline
- King of Space
20 years 6 months ago #9853
by GrandpaTrout
Replied by GrandpaTrout on topic How is Epic creating asteroid fields?
How far was your ship from the center of the asteroid field when it appeared around you? (just curious).
My theory: I know a field center is placed. You can see it. And then a code loop runs some where (pog or C), and notices when the player gets close and creates the field.
But then the external view should be creating asteroids around the center point, not your ship. Very odd.
The standard nebula have some odd behavior as well. If you create one using pog and place it, then it will not be visible (from outside) until you capsule jump into the system. But if you fly inside, it will still dim your view. Very strange.
Epic creates the asteroids by placing inert sims using custom pog code. There is a player-watch task that tracks player position and when inside culling distance to any station it sends a wakeup message. All the environmental stuff, guard ships, cargo, etc are created at that moment.
-Gtrout
My theory: I know a field center is placed. You can see it. And then a code loop runs some where (pog or C), and notices when the player gets close and creates the field.
But then the external view should be creating asteroids around the center point, not your ship. Very odd.
The standard nebula have some odd behavior as well. If you create one using pog and place it, then it will not be visible (from outside) until you capsule jump into the system. But if you fly inside, it will still dim your view. Very strange.
Epic creates the asteroids by placing inert sims using custom pog code. There is a player-watch task that tracks player position and when inside culling distance to any station it sends a wakeup message. All the environmental stuff, guard ships, cargo, etc are created at that moment.
-Gtrout
Please Log in or Create an account to join the conversation.
- Second Chance
- Topic Author
- Offline
- King of Space
20 years 6 months ago #9856
by Second Chance
Replied by Second Chance on topic How is Epic creating asteroid fields?
I'm not exactly sure how far away I was, but I think what I did was to target the asteroid field in the navmap, and then used F2 to check it out from my start position.
A "field center," if that's what you want to call it, is definitely placed (at least in the map file). It's placed in the same way that all objects are placed in the map, as distance and rotation entries from its parent (usually the star). I know you know this already (you wrote the geog SDK), I'm just stating it so everyone else can follow along.
I agree with both of you; I always assumed the fields must be created dynamically, hence the single placement point in the map and the need for ini files. Also, how could (and indeed why would) flux possibly track and maintain all the fields if they weren't "culled" somehow when the player wasn't there. A dynamic field theory (ooohh, sounds scientific, doesn't it ) would also lend support to why my problem is happening. Somehow, someway, something is getting confused about where the field should be placed. One thing I think is safe to assume is that the player ship represents one of the only constants on the maps. I wonder how, or if, this is connected. Then the player ship somehow acts as the locus of field creation.
And remember, this is an additional field, not a replacement. The original is still there. And of course, the new field won't show on the navmap (obviously).
GrandpaTrout, you mentioned placing nebula using Pog. Have you ever placed one using a map file? I thought I remember you saying no one ever has. Also, is the Epic asteroid code a seperate function? If it is, my I borrow it? I noticed you said you could make dense fields with it. One of most biggest peeves is not enough asteroids in a field. Thanks either way.
mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos (on hold during SW MP mod)
cartoons.sev.com.au/index.php?catid=4
.
A "field center," if that's what you want to call it, is definitely placed (at least in the map file). It's placed in the same way that all objects are placed in the map, as distance and rotation entries from its parent (usually the star). I know you know this already (you wrote the geog SDK), I'm just stating it so everyone else can follow along.
I agree with both of you; I always assumed the fields must be created dynamically, hence the single placement point in the map and the need for ini files. Also, how could (and indeed why would) flux possibly track and maintain all the fields if they weren't "culled" somehow when the player wasn't there. A dynamic field theory (ooohh, sounds scientific, doesn't it ) would also lend support to why my problem is happening. Somehow, someway, something is getting confused about where the field should be placed. One thing I think is safe to assume is that the player ship represents one of the only constants on the maps. I wonder how, or if, this is connected. Then the player ship somehow acts as the locus of field creation.
And remember, this is an additional field, not a replacement. The original is still there. And of course, the new field won't show on the navmap (obviously).
GrandpaTrout, you mentioned placing nebula using Pog. Have you ever placed one using a map file? I thought I remember you saying no one ever has. Also, is the Epic asteroid code a seperate function? If it is, my I borrow it? I noticed you said you could make dense fields with it. One of most biggest peeves is not enough asteroids in a field. Thanks either way.
mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos (on hold during SW MP mod)
cartoons.sev.com.au/index.php?catid=4
.
Please Log in or Create an account to join the conversation.
- GrandpaTrout
- Offline
- King of Space
20 years 6 months ago #9857
by GrandpaTrout
Replied by GrandpaTrout on topic How is Epic creating asteroid fields?
Hmmm. Beware, wild guesses ahead. I expect some tricky coding had to be done around the issue of external camera. You would want the level of detail switches or other graphical items to behave as though the player had arrived, even if only the external camera had arrived.
So what I am guessing happens is that the field notices the "player" as external camera has shown up and creates itself. But for some reason it was created to build itself around the player. Actually, that would be smart. If I was trying to code an infinite sized asteroid belt, one of several in Hoffer's wake, I would have no center point. I would just have player position, relative to center. And so I would write the code to create the field around the player ship, whenever the player dropped out of lds and was close to proper location.
Then that code get reused to create field sims. Except those have a center, but I still create around the player ship cause that is how it used to work. Plausable. I have not tried asteroid belts to see if they appear around the player ship no matter where he is. Ah - wait, it would also need to work this way if the field was larger than the 400km culling distance. Just like the Effreet. And it does have bits of asteroid all over. I bet that is it.
btw: code sent.
-Gtrout
So what I am guessing happens is that the field notices the "player" as external camera has shown up and creates itself. But for some reason it was created to build itself around the player. Actually, that would be smart. If I was trying to code an infinite sized asteroid belt, one of several in Hoffer's wake, I would have no center point. I would just have player position, relative to center. And so I would write the code to create the field around the player ship, whenever the player dropped out of lds and was close to proper location.
Then that code get reused to create field sims. Except those have a center, but I still create around the player ship cause that is how it used to work. Plausable. I have not tried asteroid belts to see if they appear around the player ship no matter where he is. Ah - wait, it would also need to work this way if the field was larger than the 400km culling distance. Just like the Effreet. And it does have bits of asteroid all over. I bet that is it.
btw: code sent.
-Gtrout
Please Log in or Create an account to join the conversation.
- Second Chance
- Topic Author
- Offline
- King of Space
20 years 6 months ago #9858
by Second Chance
Replied by Second Chance on topic How is Epic creating asteroid fields?
Brilliant! If the code creates a field relative to the camera and player locations (remember, there's two fields), then when the camera arrives in the proper field it gets created, but somehow the player location is involved too, and it gets created there as well! The external camera was probably never intended to be used to look at entities like fields or planets specifically (or it just wasn't thought of), so maybe the code might have missed it. Hey, this is interesting ! Maybe we might discover something new about the camera or player.
mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos (on hold during SW MP mod)
cartoons.sev.com.au/index.php?catid=4
.
mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos (on hold during SW MP mod)
cartoons.sev.com.au/index.php?catid=4
.
Please Log in or Create an account to join the conversation.