BeNiiiBoiii Posted January 15, 2020 Share Posted January 15, 2020 (edited) The past couple days I've been trying to make a start on an attacking system.. but keep hitting a dead end! I was wondering if any of the more experienced developers on here would be up for making a basic attack system, where users can either mug for money, attack for exp or hospitalise other users. basically an mccode/grpg type of system. Edited January 15, 2020 by BeNiiiBoiii AKA Avellion 1 Quote Link to comment Share on other sites More sharing options...
Mark Topper Posted January 15, 2020 Share Posted January 15, 2020 I am already working on an attacking system for Gangster Legends and would like to hear more details about your needs and use case please. 2 Quote Link to comment Share on other sites More sharing options...
BeNiiiBoiii Posted January 15, 2020 Author Share Posted January 15, 2020 (edited) Awesome! Well I think it should include the use of bullets and obviously take stats into consideration as well as location. I think the option for attack should be on user profile.. but with that said an attack option in the kill menu would be fine. if it was on the kill menu, then maybe a user search page initially to find the player you want to attack. I don't think it should include the detective.. by this I mean any user can be attacked any time. I think some energy and will should be used in order to carry out the attack. If you fail the attack then your sent to hospital. finally, perhaps an option for new users to have bots they can attack. Edited January 15, 2020 by BeNiiiBoiii AKA Avellion 1 Quote Link to comment Share on other sites More sharing options...
Mark Topper Posted January 15, 2020 Share Posted January 15, 2020 Do you have any ideas how to do the algoritme to define who wins the battle? I was thinking of simulating multiple shots, like first the defender was to attack, with the "weapon-stats" the player holds against the defenders "health-stats". After each round the player losses one bullet (plus maybe a 25% chance of missing - or this could be related to another kind of stat). Once one player has finished the attack for a round, the system will simulate the other players attack. This will go on until one player is dead, or if both players are out of bullets. What are your thoughts on this? Quote Link to comment Share on other sites More sharing options...
Dave Posted January 15, 2020 Share Posted January 15, 2020 28 minutes ago, Mark Topper said: Do you have any ideas how to do the algoritme to define who wins the battle? I was thinking of simulating multiple shots, like first the defender was to attack, with the "weapon-stats" the player holds against the defenders "health-stats". After each round the player losses one bullet (plus maybe a 25% chance of missing - or this could be related to another kind of stat). Once one player has finished the attack for a round, the system will simulate the other players attack. This will go on until one player is dead, or if both players are out of bullets. What are your thoughts on this? Most games use the "Gym stats" to handle this. Things like strength, defense, speed etc. Each one of these stats is combined into an algorithm to determine who can hit first, damage etc. These attack systems typically do multiple attacks until a single player is out of HP. TORN has the idea of a stale mate as you can be fairly balanced and end up just both missing or doing 0 damage. For instance MCCodes calculates damage with the following algorithm: $mydamage = (int) (($r1['weapon'] * $youdata['strength'] / ($odata['guard'] / 1.5)) * (rand(8000, 12000) / 10000)); $hitratio = max(10, min(60 * $ir['agility'] / $odata['agility'], 95)); This takes the weapon damage times by the strength, the divides by the enemies guard (or defense). Then some more calculations, the hit ratio is calculated based in agility vs opponents agility. 2 Quote Link to comment Share on other sites More sharing options...
BeNiiiBoiii Posted January 15, 2020 Author Share Posted January 15, 2020 Thanks Dave.. been trying to word a reply for past half hour lol you explained it much better 🙂 1 Quote Link to comment Share on other sites More sharing options...
Mark Topper Posted January 16, 2020 Share Posted January 16, 2020 This is brilliant Dave, thank you 🙏 Will workout the algoritme, and make it modular for future proof. 2 Quote Link to comment Share on other sites More sharing options...
Dave Posted January 16, 2020 Share Posted January 16, 2020 6 hours ago, Mark Topper said: This is brilliant Dave, thank you 🙏 Will workout the algoritme, and make it modular for future proof. No problem! Good luck these types of things can be hard to perfect. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.