Adding particle effects to map icons

Users who are viewing this thread

wheene

Sergeant Knight at Arms
So Id like to add some animated decorations to worldmap like waterfalls and stuff. All I know will be needed is icon with same flags as bridges have and void model, beside that Ive no idea. So what code would be needed and what graphics are needed to make it work?

Thanks for any responses

The first problem is with trees. Im replacing trees on the worldmap, the ones for plains are ok (map_tree_a,map_tree_b...). I have brf with these, the names of them are the same as Native obviously and I comment out the line in module.ini that loads brf with Native trees so the objects dont collide (there are errors if the line remains uncommented). So far so good, trees are displayed correctly, there is randomness. Now I try to also load custom trees for other biomes (snow, steppe) and here goes trouble. None of the biome trees get used and there are only map_tree_a all over the place. Also sometimes, and this seems to be random, it throws error at me that it cannot find map steppe tree "name"  (this error pops up when trying to start a new game or load, not on startup. Also it doesnt crash the game like other missing object errors do, rather the models are just missing on the map)

The second problem is with mountains snowy tops. Where does MnB take the snowy hilltop texture from? Cause its not the same snow it uses when you explicitly draw snow material on the map. I need to override it so it is the same texture as mountain = there is no snowy top even though the mountain is already in the height where the engine automaticaly makes it snowy. And please dont suggest moving the whole mesh down, thats what Im doing now and the problem is there appears some kind of fog if you zoom in all the way as the camera gets "under the sea level" (I dont know what it really is, but Im sure its because the camera is too low).

Thanks for any and all answers!
 
I haven't messed with the flora but the snowy mountain texture depends on the Z level of the map mesh. From what I understand it can't be changed but you can move your map up or down to set the height at which the snow starts; side effects is that your water might not have a reflection and as you stated fog. This might be changeable if messing around in shaders, but I'm not sure.

Also the snow appears on the mountain texture using it's Alpha Channel. editing that will change the way snow appears on mountains before they are fully white. Also you should post a picture of your map to show the higher areas in the map.
 
Id like to keep the map secret for now, so no pics. They probably wouldnt tell you much anyway in this case. But the thing with alpha chanel sounds interesting, could you elaborate a little more please?
 
wheene said:
Id like to keep the map secret for now, so no pics. They probably wouldnt tell you much anyway in this case. But the thing with alpha chanel sounds interesting, could you elaborate a little more please?
Sure, the Mountain.dds file like most textures have a blue, red, & green color channel. Textures with transparency use the alpha channel which is black & white. Also the texture used to show the mountain snow is the same snow texture used for the ground snow. At a certain Z-height the mountain texture would become pure white.

If I were you I'd scale (Squeeze) your map along it's Z axis (It may be X or Y depending on your external mesh editor.) The mountains on the map don't have to be that high above the Z-axis to look realistic in-game.
 
I know what alpha channel is, what I meant is how it relates to snow tops and how can I influence/modify it. Also the snow automatically generated on mountain tops is not the same texture as ground snow (snow.dds, snow_bump.dds) Im sure about that because I have that texture edited for something else yet the snowy tops remain unchanged.

I cant really change the mesh itself, I want it as it is now, if there is no other solution Ill just move it all down.

Thanks for your replies anyways.

Now Id need someone to help me with the trees. Pretty please :smile:
 
bump

Please I really need to know how to fix those trees. Anyone who knows please help me.

Thanks
 
For the map trees to display you need to adjust the number of variations by setting a bunch of
Code:
module.ini
directives, take a look.

For the white tops on the campaign map you only need to alter the mountain shader. Computica is right, it is a blend of pure white blended with the alpha mask as modulator using the current vertex's height (z position).

And by the way, this shader was suggested by mtarini like four years ago, who sent a PM to armagan about it and it got in the official game. He is in the credits for that.

The fog is because the engine detects that your camera is under water level, so it switches to the bluish-fogish submarine mode. There's nothing you can do to overcome that.

And yes, this is getting scary! I should have modded a bit less.
 
Is there anything besides
Code:
# use meshes map_tree_a through map_tree_r on for map trees
map_tree_types = 5
map_snow_tree_types  = 0
map_steppe_tree_types = 2
map_desert_tree_types  = 0
I need to change in module.ini? Cause I cant find anything else that would seem tree related and it doesnt work with just this.

As for the mountain shader, I have a problem with editing it, because the shaders are core_shaders they are not explicitly loaded in module.ini, so I suppose they are hardcoded and always load. And if I add replacement shader with the name map_mountain_shader it tells me it ignores it on startup because such shader already exists.

Excuse my noobiness and bear with me please.
 
wheene said:
Is there anything besides
Code:
# use meshes map_tree_a through map_tree_r on for map trees
map_tree_types = 5
map_snow_tree_types  = 0
map_steppe_tree_types = 2
map_desert_tree_types  = 0
I need to change in module.ini? Cause I cant find anything else that would seem tree related and it doesnt work with just this.

As for the mountain shader, I have a problem with editing it, because the shaders are core_shaders they are not explicitly loaded in module.ini, so I suppose they are hardcoded and always load. And if I add replacement shader with the name map_mountain_shader it tells me it ignores it on startup because such shader already exists.

Excuse my noobiness and bear with me please.

No, there isn't. Ensure you're using the correct nomenclature for your trees and the count stored in the INI is okay. It works for me on the original 1.011 game.

If you copy the
Code:
core_shaders.brf
within your own Resource folder the game will use it, overriding the common one. This only works for Warband, for any
Code:
core_*.brf
, and was added by Taleworlds after much begging from this guy and the guys from The Last Days.
 
Thanks again Swyter, you are my hero.

The trees work now, I cant understand why though as I swear I had those in the .ini before and it didnt work. So thats solved, apologies for the false alarm.

As for the shaders, not so great so far. I cant figure out how to force MnB to load the core_shaders.brf I added to my resources. I tried feeding it to .ini, both with
Code:
load_resource = core... , load_mod_resource = core...
and even not typing in anything yet nothing seems to work, the original always gets loaded. To make sure I see the change I actually test it on core_materials.brf where its easier for me to make a change that would be 100% visible if it really happens. I tried searching around the forum but I found only one tread where guys asked the very same question and never got an answer.

Please help me once more and then I wont bother for a few weeks again  :oops:
 
So Id like to add some animated decorations to worldmap like waterfalls and stuff. All I know will be needed is icon with same flags as bridges have and void model, beside that Ive no idea. So what code would be needed and what graphics are needed to make it work?

Thanks for any responses
 
I tried that, it doesnt look good enough + I need the water to become vapor towards bottom which cant be done with just river
 
wheene said:
I tried that, it doesnt look good enough + I need the water to become vapor towards bottom which cant be done with just river


This is what we were using some releases ago for the atmospheric effect of the planets in the galactic map of our mod. Triggers which call standard particle effects (which are governed by the appropriate file, definitions and format).

...
Code:
("sw_swy_NarShadda",mcn_no_shadow,"swy_Planet_Coruscant",planet_minor_scale,0,
[
	(ti_on_init_map_icon,
	[
	(store_trigger_param_1, ":planet_id"),
	
	#Remove existing particle effects everytime it loads! Otherwise we'll be having lensflare-looking icons.
	(party_clear_particle_systems, ":planet_id"),
	(party_clear_particle_systems, ":planet_id"),
	(party_clear_particle_systems, ":planet_id"),
	(party_clear_particle_systems, ":planet_id"),
	
	(party_add_particle_system, ":planet_id", "psys_moon_icon_atmospheric_effect"),
	
	(str_store_party_name,s1,":planet_id"),
	(display_log_message, "@DEBUG: {s1} has a particle system.", color_quest_and_faction_news),
	]),
]),
...

Ensure you're cleaning any other attached particle effect by removing them first and reapplying it later (as seen above).
Otherwise after you save and load a new game, they will add up, slowing the rendering down and looking horrid.

Sorry for not replying your PM, will get around it once I finish with other stuff on my backlog, takes a while to reply properly. No worries.


Edit: Fixed inconsistent indenting.
 
Thanks!

So I managed to add particle effect to my map icon, I created custom particle effect but now I have problem with rotating it. Since its waterfall, the emit box is very elongated, thin block
Code:
 (1, 0.02, 0.02)
. Also it is spraying water in one direction to simulate speed at which water comes to the waterfall from the river, so the whole effect has to be oriented in the right direction to work nicely. However when I change rotation of the map icon in module_parties, nothing seems to happen. Is it impossible to make different particle system rotation for every icon that uses it or is there some other settings that need to be changed?
 
Code:
psf_always_emit         = 0x0000000002
psf_global_emit_dir     = 0x0000000010
psf_emit_at_water_level = 0x0000000020
psf_billboard_2d        = 0x0000000100 # up_vec = dir, front rotated towards camera
psf_billboard_3d        = 0x0000000200 # front_vec point to camera.
psf_billboard_drop      = 0x0000000300
psf_turn_to_velocity    = 0x0000000400
psf_randomize_rotation  = 0x0000001000
psf_randomize_size      = 0x0000002000
psf_2d_turbulance       = 0x0000010000
psf_next_effect_is_lod  = 0x0000020000

I haven't really tried anything like this. Take a look at the flags you have. Maybe
Code:
psf_global_emit_dir
helps you.
 
Nope, doesnt cut it. The flags only relate to how particles face the camera it seems. Also going through properties of the particle effect it seems it cant be rotated at all. So Ill just have to give up the idea of simulating momentum of water and make the waterfall series of point emiters which spray in random directions. Wont look as good but at least itll work.

Oh and these particle effects are pretty awesome, I think therell be a lot of this stuff on the map :grin:
 
wheene said:
Nope, doesnt cut it. The flags only relate to how particles face the camera it seems. Also going through properties of the particle effect it seems it cant be rotated at all. So Ill just have to give up the idea of simulating momentum of water and make the waterfall series of point emiters which spray in random directions. Wont look as good but at least itll work.

Oh and these particle effects are pretty awesome, I think therell be a lot of this stuff on the map :grin:

I used that one to make thrusters in the spaceship dog fighter mode, so they always point behind, no matter the orientation/facing of the ship.

Yeah they are fun to make and add a lot of personality and variation to the map.
Performance-wise everything's good too. As they aren't rendered once the center of the icon is out of camera.
 
Back
Top Bottom