Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

***Tutorial*** Creating dynamic asteroid fields

Here you find the different tutorials on editing and MODing Freelancer

Post Sun Feb 06, 2005 11:23 am

***Tutorial*** Creating dynamic asteroid fields

Dynamic asteroid fields require editing 4 seperate files.

Solar\Asteroidarch.ini
Solar\Asteroids\Asteroid_field_name.ini
The system file you will place the field.
...and the hidden secret, FX\Explosions.ini

1. Asteroidarch.ini.

You will use the dynamic asteroid function to create the field. So you first make new archetypes for dynamic asteroids, but using larger 3dbs for the visual.

Code example:
[DynamicAsteroid
nickname = DAsteroid_rock_10;<--- new name for the asteroid field file
DA_archetype = solar\asteroids\models\ast_rock_10.3db;<--3db found in the asteroids\models directory
material_library = solar\ast_rock.mat;<---corrensponding MAT file
explosion_arch = Explosion_DAsteroid_rock_10;<---custom explosion for the asteroid. You will need a custom explosion for every single dynamic asteroid archetype you make!

2. Asteroid_field.ini

Make a new field, and get rid of the cube, billboards and band sections. Also remove any loot sections, as the asteroids are supposed to be indestructible, not popping apart like balloons!

Example:
[TexturePanels
file = solar\asteroids\rock_shapes.ini

[Field
cube_size = 1000<--
fill_dist = 1<--only used for the cube section, so this these two are unimportant actually
diffuse_color = 255, 255, 255
ambient_color = 1, 1, 1
ambient_increase = 0, 0, 0
empty_cube_frequency = 0.400000<-- this does not matter, either

[properties
flag = rock_objects
flag = object_density_high

[DynamicAsteroids
asteroid = DAsteroid_rock_10<--our new DynamicAsteriod archetype
count = 100<--number of asteroids of that type to be generated at once
placement_radius = 5000.000000;<-- area around you in which they exist.
placement_offset = 0;<-- Just leave it zero, worked best for me
max_velocity = 100.000000<--self-explaining
max_angular_velocity = 1.000000<-- too
color_shift = 1.000000, 1.000000, 1.000000

3. Now build that field into a system

[Asteroids
file = solar\asteroids\custom_asteroid_field01.ini;<---name of the file for the field created above
zone = Zone_Custom_Asteroid_Field01;<--name of the zone in the system, featuring the field

(...)

[zone
nickname = Zone_Custom_Asteroid_Field01
pos = 0, 0, 0
shape = SPHERE
size = 20000
property_flags = 68
visit = 0
density = 10
sort = 1
interference = 0.500000
pop_type = nonlootable_ast_field

Defines asteroid field properties like position, shape and size, sensor efficiency reduced and appeareance on the map, as usual.

4. Now the part that is the key to making them asteroids indestructible!
EXPLOSIONS.INI!

[Debris
nickname = debris_explosion_DAsteroid_rock_10;<--debris type defition
death_method = vanishing
lifetime = 0, 0;<--lifetime 0, 0 makes the debris not disappear at all!
linear_drag = 0
angular_drag = 10, 10, 10;<--reduces spinning. For larger asteroid 3dbs you should set this higher

[explosion
nickname = Explosion_DAsteroid_rock_10;<---the explosion archetype name from the first paragraph
lifetime = 0.000000, 0.000000
process = NONE;<-- all dynamic asteroids must use an explosion with process=none.
debris_impulse = 0;<--leave at zero
debris_type = debris_explosion_DAsteroid_rock_10, 1
innards_debris_start_time = 0.000000
innards_debris_num = 1
innards_debris_radius = 1
innards_debris_object = simple_explosion_DAsteroid_rock_10

[Simple
nickname = simple_explosion_DAsteroid_rock_10<;--the appearance of the asteroid after you shot it is set here!*
DA_archetype = solar\asteroids\models\ast_rock_10.3db
material_library = solar\ast_rock.mat

Look carefully at the code. What does it do? When you shoot the asteroid, it is destroyed and triggers the explosion defined in asteroid_arch.ini. That explosion however, has no visual or sound effect, and just creates one single debris object with an unlimited lifetime. And that single debris object...

"DA_archetype = solar\asteroids\models\ast_rock_10.3db
material_library = solar\ast_rock.mat"

...has the very same appeareance as the original asteroid!

That's the whole trick.

If you want to have different asteroid meshes, just overlay several fields over each other, all using a different dynamic asteroid (cut down the individual count then to save performance), each with its own archetpye and explosion and simple_archetype. They can share the same debris_type, however.

Be warned, above 8 of those fields overlaying, Freelancer can't properly load the system, or it just takes ages to do so. I tried putting more and more fields with lots of different asteroids on top of each other, until that problem occured. Removing one field again solved it, no matter which on it is.

Now go ahead and put this into your mods if you wish. Just make sure to give credit where it is due.

--------------------------------------
*With little effort, you could use this to create a lot of funny things. Imagine a planet manhattan, when you shoot it, it is blown apart into hundreds of Starfliers for example, or transformed into something else, that is all possible with this function!

Edited by - Mephistopheles on 2/6/2005 2:17:03 PM

Post Tue Feb 08, 2005 9:30 am

Good stuff.
I would use it in Freelancer Fifth Gearm but I don't know where to put it. Excellent work anyway.

Post Wed Apr 13, 2005 8:14 am

Well... I'm sure that could prove usefull in my experiment.

Post Fri May 06, 2005 6:32 am

Yes, I think I might try to include this in a personal mod ... I'm a stickler for realism, and, as we know, vanilla FL is a little short in this respect in a few areas
I just wonder about system resources ... ? I already have many LODs edited to make all ships visible from about 100K away (of course, they only spawn about 10 away, so only see them that far away), making the ships look much better, no suddenly-popping-onto-ship parts - or ships themselves. But I have to wonder about combining this improved visibilty with dynamic asteroids ...

Hmm, perhaps tonight after school I'll have time to give it a shot. Does anyone have an idea about this, about sys resources? Thanks in advance.

And, my kudoes on this awesome work, Mephistopheles Modders who rise to the challnge of using owe you a big one! I'm eagerly awaiting trying Sol Mod - it looks absolutely great!

Ro9ue
_________________________________
"Do or do not. There is no try."
- Jedi Master Yoda

Post Sun Jul 30, 2006 2:29 pm

Sorry for gravedigging, but I think this topic is of enough importance to deal with some further important questions regarding the matter.

I've now implemented Mephistoteles' methods into my mod, but modified them slightly, so I now have a field of large asteroids, falling apart into smaller ones on impact.

Yet I see two most important problems here:
a) While you can set a mass for the asteroids created on destruction (the simples), the original dynamic asteroid seems to be using hardcoded values on mass, making it about as heavy as the original small dynamic asteroids. If you have larger asteroids, this is far from realistic.
b) Also, the dynamic asteroids seem to use hardcoded values that make them go "poof" on taking only one single shot, which is also rather not so good when you are dealing with larger asteroids.

It seems there can be no direct solutions to the problem, yet some workarounds may exist. The simpe question is whether or not someone has found them or knows of them. It would be a pitty to have such a realisitc approach to asteroid fields fail because of such basic things.

Post Mon Sep 04, 2006 9:48 am

To make massive dynamic asteroids I usually make ship encounters of asteroid like ships with no engines, but I never manage to increase the amount of asteroids as I want 'em. I am also trying to make commodity pods spawn so I can increase the amount of asteroids, but to make a commodities spawn the player ship needs to hit the exploding object. Simples made from explosions despawn if they get out of camera. However there is a type of debris that dont that comes from at least Liberty Dreadnoughts.

By the way, I heard something about someone managing to edit mass of dynamic asteroids by HEX .dll editing in one of the stickified posts in the Tutorial forums.

Edit: Actually you could make simples from explosions that don't despawn after getting out of camera, by changing the debris_type in the explosion arch to something like cap_ship_piece the simples will last longer. This gives the possibility to easily make a dynamic asteroid field consisting of massive asteroids by having ships or solars getting there with an explosion that make long lasting asteroid like simples and then you make the ships/solars explode by mines or radiation.

Edited by - erkolos on 9/8/2006 11:27:11 AM

Return to Freelancer Editing Tutorial Forum