Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Specialist said:
MadocComadrin said:
Specialist said:
Not that I know of. A crossbow bolt at 5 feet does the same damage as a bolt from 500 feet, sadly. You would probably need to make your own MT trigger and your own very long script to calculate distances, then reduce the damage delivered accordingly (or add HP back to the player)
Actually, they may reduce damage at longer distances. It depends if projectile speed is reduced from simulated air-resistance (I'm assuming yes because there's an item flag called itp_ignore_friction).

I tested it myself just now... it does make more friction between the targets, but they always  do the same damage. I set my player HP at 20, and then equipped an enemy troop with a crossbow fit to to 19 damage ranged, plus a bolt damage of +1 (for a total of 20 HP loss), and he was firing on me from over 140 feet away, then right around all the way across the map (I used the itp_ignore_gravity command in order to allow him to do it) and I died every time

That's not a rigorous test. The first thing I'd do is set up a map with various training dummies at different distances to report damage. Then I'd crank up the friction value in module.ini to make the effect more pronounced and fire at the various dummies. Your base damage was only 20, but remember in native damage is also determined based on the near-square of the speed. (that is, speed^1.9).

Edit: just multiplied that value in module.ini by 100, and already I'm noticing a drastic effect. Bolts literally slow to a crawl when fired in an arc.
Edit 2: At any other distance other than point-blank, I'm doing 0 damage, while at point-blank, I'm doing 3. I need to scale that back a bit.
 
Specialist said:
MadocComadrin said:
Specialist said:
Not that I know of. A crossbow bolt at 5 feet does the same damage as a bolt from 500 feet, sadly. You would probably need to make your own MT trigger and your own very long script to calculate distances, then reduce the damage delivered accordingly (or add HP back to the player)
Actually, they may reduce damage at longer distances. It depends if projectile speed is reduced from simulated air-resistance (I'm assuming yes because there's an item flag called itp_ignore_friction).

I tested it myself just now... it does make more friction between the targets, but they always  do the same damage. I set my player HP at 20, and then equipped an enemy troop with a crossbow fit to to 19 damage ranged, plus a bolt damage of +1 (for a total of 20 HP loss), and he was firing on me from over 140 feet away, then right around all the way across the map (I used the itp_ignore_gravity command in order to allow him to do it) and I died every time

Nice test, but I think it's better to give the target very high HP, and displaying the damage resulted and distance from the damager on ti_on_agent_hit trigger so we have more data and avoiding data error come from rounding/clamping.
 
I set up 4 targets at varying distances, and they're literally reporting 5 (point blank shot at the 1st dummy), 4 (first dummy), 3, 2, 1 at 10x air friction with a siege crossbow, normal bolts and just enough strength to wield it.

Edit: 2x air friction gives me 5,5,5,5,4.
 
MadocComadrin said:
I set up 4 targets at varying distances, and they're literally reporting 5 (point blank shot at the 1st dummy), 4 (first dummy), 3, 2, 1 at 10x air friction with a siege crossbow, normal bolts and just enough strength to wield it.

Edit: 2x air friction gives me 5,5,5,5,4.
Sweet!

You guys are awesome. Thank you for testing all this out. It will help me, and I'm sure others, find a good balance.

CR
 
dunde said:
Specialist said:
MadocComadrin said:
Specialist said:
Not that I know of. A crossbow bolt at 5 feet does the same damage as a bolt from 500 feet, sadly. You would probably need to make your own MT trigger and your own very long script to calculate distances, then reduce the damage delivered accordingly (or add HP back to the player)
Actually, they may reduce damage at longer distances. It depends if projectile speed is reduced from simulated air-resistance (I'm assuming yes because there's an item flag called itp_ignore_friction).

I tested it myself just now... it does make more friction between the targets, but they always  do the same damage. I set my player HP at 20, and then equipped an enemy troop with a crossbow fit to to 19 damage ranged, plus a bolt damage of +1 (for a total of 20 HP loss), and he was firing on me from over 140 feet away, then right around all the way across the map (I used the itp_ignore_gravity command in order to allow him to do it) and I died every time

Nice test, but I think it's better to give the target very high HP, and displaying the damage resulted and distance from the damager on ti_on_agent_hit trigger so we have more data and avoiding data error come from rounding/clamping.

Didn't have time to set it all up that way. I mean, I did the fast test because it was something that took less than 5 minutes. I may try something like that soon...
 
I got somewhat interested in multiplayer aspects of the MS recently, so I have a theoretical question.

Suppose a player in a single-player campaign starts a battle, however this battle is started with start_multiplayer_mission operation. Other players running this module go into Multiplayer menu, find this game and join as first player's companions (with their skills and equipment) for that battle. All this is managed by the main game server using send_message_to_url operation to track who helped whom and how many times (you can call for help only a limited number of times and then you must earn your "credits" back by helping others).

Now the question: is this all possible? Will multiplayer operations function properly in single-player mode? Has anyone done any testing on this? It's all purely theoretical at the moment (and will probably remain so), but it would be interesting to know the answers.
 
MadocComadrin said:
I set up 4 targets at varying distances, and they're literally reporting 5 (point blank shot at the 1st dummy), 4 (first dummy), 3, 2, 1 at 10x air friction with a siege crossbow, normal bolts and just enough strength to wield it.

Edit: 2x air friction gives me 5,5,5,5,4.

What was your air friction set to with that first one?

And by 2x air friction, do you mean air_friction_bolt = 0.004?

CR
 
dunde said:
Is there any operation, flag, ai behavior or anything to make ai agents (on foot or mounted) do jumping?
Never tried, but my guess would be (agent_set_animation, ":agent_no", "anim_jump" / "anim_horse_jump").
 
Lav said:
Never tried, but my guess would be (agent_set_animation, ":agent_no", "anim_jump" / "anim_horse_jump").
MadVader said:
Correct, did this in TLD and it works as expected.

Thanks. I never expect it's so simple  :oops:
But I want it not just play the animation, but also let the mounted agent jumping accross obstacle, or any agent jump onto table/wall, just like player can do. I want to make a horse racing scene. It's not fair that player can jump to cross the obstacle, but other participants just go around it with longer route.
 
Well, your major problem will be detecting when there's a need to jump. With horse race on a predefined track it's probably even possible (horse cleared stage 2 and distance to spawn point 3 less than 0.5m ==> jump), though still highly likely to stray off-course.
 
Specialist said:
FrisianDude said:
1. If a native helmet is roughly 300 faces, does that mean a new made helmet of significantly more is also significantly worse if you want to run smooth?
It can be. If you make good LOD's that are right around Native's LOD polycount, it should be fine, since you only see LOD0 (the main mesh) when you are under 20 feet from the agent
FrisianDude said:
2. Some items I have are multimesh. Are multi-part meshes slower to load than if its in one part?
Yes, but if you notice, even Native uses it. It doesn't significantly slow down loading or drop framerate, but in giant scale, it may.
FrisianDude said:
3. I want to reorganize some textures, is it a good idea to combine four 1024x1024 in one 2048x2048 texture or are four faster to load? Same with 512x512 and 1024x1024? I guess one 1024x1024 sheet with four items is more efficient then four sheets with each one 512x512 item, but I'd like to make sure.

In short, yes. In long:
A 2048X2048 DXT1 DDS file is right around 1.5-2 megs (if I remember correctly). Four 1024x1024 DXT1 DDS files are 683 KB each, multiplied by four equals 2.5-2.6 megs.
Four 512 DXT1 textures are 342 kb each, coming up to 1,366 KB for the four of them (not to mention normals or speculars), while one 1024 is onl 683 kb.
The smaller the size, faster the load
Thanks, that does help. One more question; is there a limit to the amount of .lods to be effective?
 
Xenoargh is the most knowledgeable in that, though you can only use 4 lod's in the Warband engine (not sure about any other engines though), and most things in Native use 3-4 lod's
 
xPearse said:
Hey I need some help, I created this shelf and in the brf it is see through at some points but ingameit is not. Can someone tell me why it is like this. I really need to fix this and would appreciate the help.

BRF

Ingame

Here is the alpha channel for the metal shelf, anything wrong with this. I grayscaled the image to make the alpha, did I do that right or wrong. If wrong tell me how to do properly.

 
@Fris: For reorganizing textures, try to make sure that each texture will be loaded a similar amount of times. IE. if you have a texture that needs to be loaded quite often, and 3 others that are almost never loaded, in essence you're just loading a the same texture except 4 times the file-size.
 
My question and I hope to God that someone might be able to answer me is thus:

Code:
  # script_multiplayer_find_bot_troop_and_group_for_spawn
  # Input: arg1 = team_no
  # Output: reg0 = troop_id, reg1 = group_id
  ("multiplayer_find_bot_troop_and_group_for_spawn",
    [
      (store_script_param, ":team_no", 1),
      (store_script_param, ":look_only_actives", 2),

      (call_script, "script_multiplayer_find_player_leader_for_bot", ":team_no", ":look_only_actives"),
      (assign, ":leader_player", reg0),

      (assign, ":available_troops_in_faction", 0),
      (assign, ":available_troops_to_spawn", 0),
      (team_get_faction, ":team_faction_no", ":team_no"),

      (try_for_range, ":troop_no", multiplayer_ai_troops_begin, multiplayer_ai_troops_end),
        (store_troop_faction, ":troop_faction", ":troop_no"),
        (eq, ":troop_faction", ":team_faction_no"),
        (store_add, ":wanted_slot", slot_player_bot_type_1_wanted, ":available_troops_in_faction"),
        (val_add, ":available_troops_in_faction", 1),
        (try_begin),
          (this_or_next|lt, ":leader_player", 0),
          (player_slot_ge, ":leader_player", ":wanted_slot", 1),
          (val_add, ":available_troops_to_spawn", 1),
        (try_end),
      (try_end),

      (assign, ":available_troops_in_faction", 0),

      (store_random_in_range, ":random_troop_index", 0, ":available_troops_to_spawn"),
      (assign, ":end_cond", multiplayer_ai_troops_end),
      (try_for_range, ":troop_no", multiplayer_ai_troops_begin, ":end_cond"),
        (store_troop_faction, ":troop_faction", ":troop_no"),
        (eq, ":troop_faction", ":team_faction_no"),
        (store_add, ":wanted_slot", slot_player_bot_type_1_wanted, ":available_troops_in_faction"),
        (val_add, ":available_troops_in_faction", 1),
        (this_or_next|lt, ":leader_player", 0),
        (player_slot_ge, ":leader_player", ":wanted_slot", 1),
        (val_sub, ":random_troop_index", 1),
        (lt, ":random_troop_index", 0),
        (assign, ":end_cond", 0),
        (assign, ":selected_troop", ":troop_no"),
      (try_end),
      (assign, reg0, ":selected_troop"),
      (assign, reg1, ":leader_player"),
      ]),

Basically, confirmation that this code determines the bots being spawned in MP matches (just in case I'm way off :razz: ) and how I can change this to allow the players to command more than three types of bot.

Thanks in advance.
 
Specialist said:
Xenoargh is the most knowledgeable in that, though you can only use 4 lod's in the Warband engine (not sure about any other engines though), and most things in Native use 3-4 lod's
I'll keep four as a limit then, thanks.

MadocComadrin said:
@Fris: For reorganizing textures, try to make sure that each texture will be loaded a similar amount of times. IE. if you have a texture that needs to be loaded quite often, and 3 others that are almost never loaded, in essence you're just loading a the same texture except 4 times the file-size.
Yeah, I'd heard of that. I'll probably just keep it so that any sheet with four textures has four variations of the same item, which means they're only there for variety, which means they'll be roughly equally often loaded. Thanks.
 
Lav said:
I got somewhat interested in multiplayer aspects of the MS recently, so I have a theoretical question.

Suppose a player in a single-player campaign starts a battle, however this battle is started with start_multiplayer_mission operation. Other players running this module go into Multiplayer menu, find this game and join as first player's companions (with their skills and equipment) for that battle. All this is managed by the main game server using send_message_to_url operation to track who helped whom and how many times (you can call for help only a limited number of times and then you must earn your "credits" back by helping others).

Now the question: is this all possible? Will multiplayer operations function properly in single-player mode? Has anyone done any testing on this? It's all purely theoretical at the moment (and will probably remain so), but it would be interesting to know the answers.

All this except for the stat tracking is implemented in the Battle Time! mod. Also in Brytenwalda, but that's Battle Time! as well, just merged with Brytenwalda.
 
Is there a required number of set tiers per faction? I'm making my own barebones MS for a friend of mine, and wanted to check before I just erased a ton of lines of code

Edit: Found out. Man it is easy to remove stuff
 
Status
Not open for further replies.
Back
Top Bottom