Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Andrashi

16
Mafia Mod Request / MAFIA II - melee weapons
December 01, 2011, 10:54:05 AM
Hi fellow modders and Mafia II fans,


 




INTRODUCTION, skip if you are not interested


 




<div class="ipsSpoiler_header">



 




Allow me to briefly introduce myself and then we'll get to the business. The name is Andrashi, I am from Czechoslovakia and I have always been quite keen about Mafia and its sucessor, Mafia II. I have followed Mafia II since its announcement and felt enraged when cuts began, mainly in close combat part (see THIS 2K FORUM THREAD). Being a fan of unarmed brawling, it was decided that this matter was worth investigating. Result of the search were interesting enough to be worth posting in form of a pair of videos. Outrage followed, then everything went calm, apart from occasional comment like "F##K 2K" posted under one of these.


 




About a month ago I started getting e-mails how to mod in these melee weapons. I am currently studying Master's degree of Microelectronics and Technology, so answers had to wait. Of course that led to nice secondary effects like another messages sent from the questioner, saying warm and pleasant things like "You greedy bastard, keep that melee s##t in your @$$ if you think you are so good you don't have to respond me anymore."


 




Well OK, still I tried to respond in my spare time. But then it happened. During last few days I got quite a number of e-mails on this topic, so I went to have a look "why". And that's when I came over this thread, only to learn that all you guys were asking me and posting here my answers as if it mattered whether one of you asks or another   .


 




</div>

 




Now let's get to business. First of all, let's have a look at animations sets of our beloved melee weapons.


 




<div class="ipsSpoiler_header">



 




KNIFE




moveset number: 35 (0x23)




missing moves: All three counterattacks and all their hit responses (both normal and stun types)


 




BATON / NIGHTSTICK




moveset number: 36 (0x24)




missing moves: none, this set is complete


 




BASEBALL BAT




moveset number: 37 (0x25)




missing moves: light punch combo, also block animation is pretty much unpolished


 




CHAIR




moveset number: 73 (0x49)




missing moves: all, this animset is a relic from development


 




BARREL




moveset number: 74 (0x4A)




missing moves: all, this animset is a relic from development


 




Grabs are behaving always the same as for unarmed melee. Finisher for low stun (enemy slumps on ground) is always standard melee kick. For some unknown reason, standing melee weapon stun finishers mess the camera for a few first times they are used (camera goes to the ground). After some time everything gets miraculously fixed and from that point during melee weapons finishers the camera behaves normally.


 




Clever animation set parenting can help with getting rid of some shortcomings. For example, when baton moveset is made to be a parent for Baseball bat moveset, then Baseball bat light puch combo copies Baton light punch combo. Looks better than Baseball bat empty hands light punch combo in my opinion.


 




Sidenote: as you all can see, Mr. VÃÆávra was not lying back in 2007. There was really planned rich brawl with usage of environment.


 




</div>

 




Now what about actual weapons?


 




<div class="ipsSpoiler_header">



 




In Mafia II there are two files named Table_0 which have something to do with melee weapons.


 




One is in "Tables.sds" and contains weapons.tbl datatable. Within this table various firearm parameters can be tweaked - ammunition, rate of fire, muzzle effect, type of projectile, kickback etc. Of course empty hands and melee weapons are listed as well so...so nothingÃâà  <img src="/wp-content/uploads/invision_emoticons/wink.png" alt="" data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/wink@2x.png 2x" width="20" height="20"> . As far as I know, empty hands and melee weapons have their entry in this table only because each weapon has to have a weapons.tbl table entry. Which leads me to a curious question - can anybody try to add some "ammunition" to a melee weapon and observe the results? Maybe we are closer to having melee weapons than we thinkÃâà  <img src="/wp-content/uploads/invision_emoticons/tongue.png" alt="" data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/tongue@2x.png 2x" width="20" height="20">


 




Anyway, still there is one curious flag in weapons.tbl. If a firearm is set a certain flag and then is fired at some wall, it leaves not bulletholes, but blunt weapon scratches. Interesting, eh? I think melee weapons and overall melee combat was originally meant to be "free to use anywhere". Decision to have duels was probably made later in the development.


 


 




The second Table_0 in question is in "Ingame.sds" and contains Human_Items.tbl and contains all itemsÃâà which can be attached to human characters. Of course that also means melee weapons. This table is quite important because it shows us something pretty interesting: engine of Mafia II probably works with some internal values (number most likely) which represent all of these items. So even if c1911 is completely tweaked and modded to look and behave like Thompson1928, the icon of c1911 stays because it is slot 4 in Ingame.sds.


 




Such a discovery is important, because it means certain item slots can be "special". Yes, for example empty hands, which are currently the only human "item" allowed to enter melee duel. What if at some point of development melee weapons were given such a privilege as well? Can it be that melee weapons are now simply excluded from such a condition? Or it can be similar, but in fact opposite: what if items have their internal hardcoded status (empty hands, firearm, melee weapon, decorative item) and then there is some condition that only empty hands are allowed to enter melee duel. And what if we expand this condition once again that not only empty hands, but also melee weapons can enter melee duel?


 




</div>

 




Which options we modders have if we want to reimplement melee weapons back again?


 




<div class="ipsSpoiler_header">



 




Now, what are our options if we want to bring melee weapons back and NOT break something else in the progress? Switching movesets by hand in files is maybe a fun, but fixes nothing. We don't need to switch movesets in files, we need the GAME ITSELF to switch movesets dynamically, based on a weapon in hand. Or at least fake such a process.


 




Generally, there are according to my knowledge two ways we can try:


 




1.)




The best would be if we could somehow get past the condition which makes melee weapons unable to operate in close combat. This condition WAS NOT always active as you can see for example in this video (delete away the letter X): <a rel="">Xhttp://www.youtube.com/watch?v=omY93dIH8pc#t=05m03s</a>. Question is whether we are powerful enough to find this condition and change it. If it is in some global LUA file (some general settings which are loaded when the game starts) then we may stand a chance. But if it is on code-level (somewhere in Mafia II.exe), then this way is screwed unless we have some Neo within our ranks.


 




2.)




Second way is to keep empty hands as the only weapon which can enter duel, but then use LUA scripting to change the animset and to fake in melee weapon into the hand. Changing animation moveset can be done via "SetAnimStyle". I personally tested it, it works well. Still there is an issue of the weapon itself missing in the hand. Can you remember the level "Room Service"? Vito drags some bucket through half the mission. This bucket is in fact some "actor item". Can you remember Francezka's sidemission and Erik being smashed by a bottle? The same "actor item" mechnics are used. This "actor item" is first registered ("RegisterActorItem"), then attached to Vito's hand ("ActorItemTo Hands"). If the same can be done for melee weapon model (spawn it as actor item, then attach it to Vito's hand), then we can go round the empty hands check and fake in melee weapon in hand. Next tweak the damage via SetDamageMultiplier and here you go with almost fully functional melee weapon. Almost, because I guess you cannot force it out of hand, since there is in fact no melee weapon present.


 




Remember, this method may work, but it utilizes "empty hands" human item with faked melee weapon model in hand, changed animation moveset and modified damage multiplier. It may work, it may work not.


 




</div>

 




Conclusion


 




<div class="ipsSpoiler_header">



 




In my opinion (based on my current knowledge) there are no other ways how to bring back fully operational melee weapons than the two mentioned above. If I knew any trick how to modify melee weapons back, do you guys really think I would sit on it and not implement it into RotH mod?Ãâà    But I hope now you all can see that I am not hiding anything away from you all. I just don't fell like shouting "LOOK I CAN MAYBE BRING BACK MELEE WEAPONS, I'M SO GOOD !!!" when in fact I have only theses and nothing to show. Oh, and the tiny little peeble thing named "real life" called right now, it wants me back immediately.Ãâà  <img src="/wp-content/uploads/invision_emoticons/wink.png" alt="" data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/wink@2x.png 2x" width="20" height="20">


 




</div>

 


 




Best regards, Andrashi
17
Andrashi's Mods / Realism mod concepts
April 15, 2012, 09:21:00 AM
Dear Mafia II fans,


 




altough I don't have THAT much free time, still there are a few ideas I would like to try. And I think Your opinions on these ideas would be most welcome feedback.




Two realism mods should discussed in this thread, both having connection with gunplay. See video in spoiler.


 


 




<div class="ipsSpoiler_header">

TwoRealismMods


</div>

 


 




LIMITED INVENTORY




The idea is so far very strict. Vito can pick and hide only ONE handgun-type weapon, it is referred as "sidearm". Another handgun can be picked and used, but it has to be in hands and is discarded if player tries to holster it. If Vito has a "sidearm" in hands and tries to pick up another handgun, the newly picked handgun replaces the previous as a "sidedarm".


 




Hiding a rifle-type weapon is not possible, Vito can only carry one rifle-type and only in hands.




Summary of Vito's inventory with this mod: one handgun which can be holstered + one other weapon in hands (be it small gun or rifle).




Future hypotetical iterations may include various limits based on 3 Vito's outfit types (outfits without jacket, outfits with jacket, long coats)


 


 




HIT REACTIONS




Vito performs one universal hit reaction when hit by a gunfire or explosion. Multiple reactions are maybe possible, but so far I am glad it works at least somehow " data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/happy@2x.png 2x" width="20" height="20">.




Hit reaction forces Vito to stop aiming, slows him down for a moment, disturbs weapon reloading process (gun is not reloaded and player has to again initiate reload) and forces Vito out of cover.


 




When Vito's health drops below certain threshold, each additional damage makes Vito drop currently held weapon and enter "low health critical mode".




In low health critical mode, Vito uses injury animset (which slows his movement), cannot operate guns, cannot climb obstacles and generally is very, very vulnerable. Low health critical mode fades away over time and Vito returns to normal mode (all possibilities permitted).


 




Purpose of a "low health critical mode" is to add realistic touch and to discourage players from rushing enemies head on. With "low health critical mode" and hit reactions mod active, at least slow health regeneration is REQUIRED, otherwise the game is annoying and unplayable (personally tested).


 


 


 




Well, let the discussion begin. What are your ideas, what would you like to see in regards to these two gamedesign changes?