Jump to content

Modding the Random Number Generation


Koshea69

Recommended Posts

This is because you don't often get 100% hit probabilities, even when standing close to the enemy.

 

don't forget, enemies can have defensive buffs, just like your soldiers do with armor. Shooting an ethereal point blank shows me they have at least 10 defense, as I see my chances drop to below the base level chance to hit of whoever is trying to shoot them point blank. I've seen it drop to as low as 75% when my guy has a base value of over 85%.

 

point being, it isn't all about your trooper's position or base chance, the enemy has modifiers, depending on the type of enemy it is.

Link to comment
Share on other sites

Alternatively the FLUSH ability might become more useful than RAPID SHOT, or at least make it a tough choice.

 

lol. that's exactly how I have been using flush. Not to flush enemies out, but simply to guarantee a close range hit without flanking :P

 

of course, now that my troopers have psi, that does the job better. Well, except against sectoid commanders and ethereals.

Edited by Sir_Toejam
Link to comment
Share on other sites

Okay so, I looked it up and I'm an idiot, yes rolling more dice does hit middle numbers more often ofcourse, sorry to the OP :)

 

So, while I think what the OP wants is doable in theory, it's not a simple matter of rolling more dice.

 

What would be your suggestion for a better RNG?

Link to comment
Share on other sites

Rarther than fooling around with the RNG, I suggested a mod that changes the cover bonus.

 

I'm a believer that if you are in full cover you should be nearly impossible to hit. I understand the game tries to simulate simultaneous action (when you take a shot your enemy is taking a shot back at you) but because its still turn based its a race to who shoots first and can connect on the shot.

 

This was advertised as a turn based tactical game and thats what i want damn it. The game preaches that you need to flank but once you get a sniper anywhere near captain cover becomes pretty useless (for the aliens). I was suggesting going as high as 40 for half and 80 for full.

 

I think this might address what the OP was attempting to create in fiddling with the RNG. This will create more low % shots and rather than waste ammo you will have to methodically move your troops into flanking positions. And if you used high cover your guys are unlikely to get nuked by a fluke shot from an alien on the other side of the map.

 

40/80 might be on the high side but I think if you are hunkering down in high cover you should be invicible (you are no longer taking a shot while being shot at).

Link to comment
Share on other sites

That was the first thing I looked at, and it's a great stopgap measure I would use until I could get this kind of a mod created, but it doesn't fix all situations and it doesn't necessarily help make all profession options viable.

 

for example, does anyone take holo targeting over bullet swarm? +10 to aim instead of an extra attack?

 

And Telekinetic Field, while it's good, it's not nearly as good as Mind Control, but if you can get up over 50% to 60 or 70% without cover, basically providing a turn you can run across open ground without needing cover, that's a great tactical ability, for that matter dense smoke adding 40 to defense is another way to CYA if the aliens just decide to pop in on you and your now flanked.

 

So yes, full cover being 80% would be great, but it's a quick fix to me, I'd like to see something that deals with the underlying problem of 1-100 not being a fairly good indicator of the odds on some of the shots listed at <30% or >70%.

Link to comment
Share on other sites

The biggest problem is more the global seed issue. It needs multiple seeds to be generated and attached to characters so you can't "transfer" bad rolls via save scumming. You may know what the next roll percentage is for a character, but you can do very little about it for the purposes of cheating.

 

If the RNG is providing a problem using number gen on a scale of 1-100 you could increase the scale and do a divide to bring back a more uniform number spread, but true randomness will always piss off players :D

Link to comment
Share on other sites

RNG (1-10,000)/100 will still provide the same odds of getting a 1 as a 50. I'm looking for far more likely odds of hitting the stuff you should be hitting as opposed to the things you should be missing. I still want some randomness to it, but more along the lines of "Wow, I missed that 95% shot, that's a once in a lifetime miss and my buddies are going to give me hell about it for a long time" versus "Commander report!" "We all shot and missed, we had the high ground and flanking positions, but some crazy thunderstorm came rolling in and we lost our sights for a couple seconds. Unfortunately it left before the return volley by the X-rays and Bravo One Three's position has now been compromised"

 

It's the one change I think would make this game more playable for me at the impossible level with no other changes. It's the way I see of making the game live up to the statement "Tactics are essential but s*** happens"

Link to comment
Share on other sites

"And Telekinetic Field, while it's good, it's not nearly as good as Mind Control"

 

actually, mind control has the hardest will check by far of any of the psi powers. If your psi trooper has a moderate will score (in the70s), you're better off taking field instead of control.

Edited by Sir_Toejam
Link to comment
Share on other sites

  • 2 weeks later...

The only way to add more randomness into the calculations would be to include a non-pseudo-random element. Multiplying by the time of day is one way to make the number more random (i.e. taking a shot two seconds later could turn a miss into a hit).

 

The hit percentage calculation does seem a little ridiculous at times but I don't necessarily think that needs to be changed. What I'd like to see is multiple rolls per attack. You might've noticed almost every attack is actually several shots in succession (e.g. 8 shots for a SHIV Laser) so I think each shot should have its own roll. With a Sniper Rifle this doesn't change a whole lot, but by this methodology it would deal maximum damage (not including criticals) if it hits. This way I think we'd see fewer complete misses but there would also be fewer attacks at full damage. The main problem with this method is low damage weapons which take x shots and deal <x damage. Still, the number of shots could just be ignored completely and each potential point of damage could have its own roll.

Edited by Malik_Killian
Link to comment
Share on other sites

Great thread topic here.

 

Definitely something I was looking into (searched high and low, should have figured it'd be waiting here all the time, at the nexus).

 

To Sum up my opinion: For some, the randomness in the game feels "unfair". Investigations have been done to show that it's not the case, the randomness is technically pretty accurately random, however that isn't the important point. Humans have a hard time with the concept of probability, it's in our nature. Since this is a game played by humans, it makes sense that while technically correct (an 84% chance to hit will, over long averages, actually produce 84% of your attempts hitting), it's more important for the game and game play to address the perception of the players, regardless of what the reality is.

 

So the perfect way to test this: would be a mod to alter the way the Random Numbers work in the game.

 

OP and further posts I think hit the nail down on the head. I think human perception intuitively "likes" (is more comfortable with) a uniform probability curve/distribution, rather than the uniform/linear one that we have by default int his game. The easiest (and most intuitive way) to accomplish this would be to simply add an additional "roll" in. You see that in board games (mentioned by a few), but basically, if you roll 1-100 once, each # has the same chance of coming up. Roll twice, and find the average, and now the middle numbers will come up more than the extremes. (Rolling a "1" now requires two rolls of "1" in a row, which is much less likely). You can further change this weight by adding increasing rolls, but I think a 2 rolls should be a good compromise. (After more than 2, the extremes of both high and low start to get really low odds, such that things like over-watch might no longer be viable.)

 

So how to accomplish this: Thankfully there is a good analysis of the RNG that was posted recently Here. In that the investigator found where in the UE scripts the chance to hit is calculated.

 XGAbility_Targeted:RollForHit(): 

 

Unfortunately at the moment, there is not ability to edit the Scripts outside of changing number values (HEX Editing) and not adding the additional code (to make the change to two rolls, instead of one.

 

So the only real option is the inject this code into the executable itself (using something less savory, like say cheat engine?). From that same article we have an idea of the function in the EXE that does the work:

function bool RollForHit(float fChance, out TCharacter kShooter, out TCharacter kTarget, out float fRoll)
{
fRoll = class'XComEngine'.static.SyncFRand(string(Name) @ string(GetStateName()) @ string(GetFuncName()));
return fRoll <= fChance;
}

 

So if we could simply modify that, it could accomplish the goals.

 

The effect: Not sure how easy the above is to accomplish, but if such a mod exists I would be very curious to see what the effect would be (on the players). Would it make the game more "in line" with their expectations on how an "80%" shot should feel? And would this actually change their enjoyment of the game (some of the charm of Xcom may be due to it's sheer abusive difficulty ;)).

 

Either way, I'd love to see this happen to try it out.

 

Any insight into the feasibility of the above would be welcome.

Edited by aggies11
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...