Jump to content
MakeWebGames

Attack System (Request)


BeNiiiBoiii

Recommended Posts

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 by BeNiiiBoiii AKA Avellion
  • Like 1
Link to comment
Share on other sites

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 by BeNiiiBoiii AKA Avellion
  • Like 1
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...