The Gang Garrison 2 Forum
May 18, 2013, 09:30:54 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Chat with us on IRC: http://ganggarrison.com/irc.html
Server: irc.esper.net, Channel: #gg2
 
   Home   Help Search Login Register  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 »
  Print  
Author Topic: Tempest Bot [v5_3]  (Read 35384 times)
Derpduck [LORD]
2011 Haxxy Finalist
*
Offline Offline

Posts: 3529



« Reply #195 on: July 08, 2011, 01:45:49 am »

I think that they should have a chance of missing the rocket with air blast or sometimes not do it at all or else the will be OP
Logged

Dusty
Hero Member
*****
Offline Offline

Posts: 10647


Dust in a box under a table


« Reply #196 on: July 08, 2011, 01:58:23 am »

hence the "random(3)" in that code snippet
Logged

Lemonade
Apprenticecrastinator
Hero Member
*****
Offline Offline

Posts: 2492



« Reply #197 on: July 08, 2011, 03:19:50 am »

It should also airblast too soon or too late instead of at right time or not at all. Like real players.
Logged

i already have a pet that follows me around 24/7

it's called  z4

you may have seen it
Orpheon
2011 Haxxy Award Winner
*
Offline Offline

Posts: 5818


Developer


« Reply #198 on: July 08, 2011, 04:23:44 am »

I intentionally didn't touch airblasting because it's damn hard to do, and the bot won't notice it's not shooting. No, this is not OP.
The ideal length is the length of the flamethrower+1 (for safety), aimDirection=point_direction(object.x, object.y, rocket_x, rocket_y)

I just need code that will detect an enemy rocket that's going to hit me, else the bot is going to do self damage.

Quote from: Acidlead
big suggestion, not sure if you even want to or can consider it but

since usually human players are at least decently intelligent in finding enemies and objectives, why not have bots tag along with human friends upon occasion? like they need a "coop-feel" flag on respawn and have to get a human player to "squad" onto, and avoid following scouts if not a scout due to doublejump, and stop following a player that goes too far away, etc etc etc very complex but would make the bots verrrrry sexy because sometimes a teammate is all that a guy needs

honestly i would also make bots following based on the type of attack pattern they are performing, the type of teammate they are following (the class) and the enemy they are attacking (i.e. if its pyro buddy rips onto a heavy let's not go rushing in after as a sniper)
This is a brilliant idea.
I'll get to it.


Other than those two things, my future plans is getting that damn HumanVsBot mode working. For some reason clients can't join, which is not ideal. The hoster doesn't notice anything.
If someone knows why, go say it in the Help Thread.

PS: If you have any other suggestions, tell them.
Logged

Your mind is software. Program it.
Your body is a shell. Change it.
Death is a disease. Cure it.
Extinction is approaching. Fight it.
Orpheon
2011 Haxxy Award Winner
*
Offline Offline

Posts: 5818


Developer


« Reply #199 on: July 08, 2011, 07:58:34 am »

Ok, thanks to Lorgan, I fixed the HumanVsBot mode.

Also included that follow-the-player and made it an option.

All friendly bots in range of 150 pixels around you (ca. twice a characters height) will follow you and jump when you jump. Unfortunately, they also often jump when they shouldn't.

Slower bots automatically don't follow you if you're a scout because they fall out of the range, so I didn't program class-checking.

Bots prioritize following over everything except fighting an enemy they can shoot at (in a line of sight). In those case they fight.

Links:
Exe
GMK


And for the airblast:
I just need code that will detect an enemy rocket that's going to hit me, else the bot is going to do self damage.
« Last Edit: July 08, 2011, 08:00:56 am by Orpheon » Logged

Your mind is software. Program it.
Your body is a shell. Change it.
Death is a disease. Cure it.
Extinction is approaching. Fight it.
Lorgan
Retired Randomizer Mod Developer
2011 Haxxy Award Winner
*
Offline Offline

Posts: 2967


check my new game in new projects k thx bye


WWW
« Reply #200 on: July 08, 2011, 08:45:09 am »

if distance_to_object(Rocket) <= 100 &&  owner.class == CLASS_PYRO{
    var target=-1;
    with(Rocket) {
        if team != other.player.team && collision_line(x,y,x+lengthdir_x(142,direction),y+lengthdir_y(142,direction),other.id,0,0) target=id;
    }
    if target != -1 {
        aimDirection=point_direction(x,y,target.x,target.y);
        code_that_calls_global.special;
    }
}

Something like that, but i'm not sure if it can check a collision with an id.
Logged

Unfortunately, turning a section into a communist oppressive regime is not against the forum rules, so there is really nothing we can do.
Quote from: steam
21:08 - Hullusorsa: lorgan, when will you buy us the keys?
21:09 - Lorgan: i'm waiting for greece to collapse so the value of the euro drops
21:09 - Lorgan: not even joking
Orpheon
2011 Haxxy Award Winner
*
Offline Offline

Posts: 5818


Developer


« Reply #201 on: July 08, 2011, 09:01:57 am »

if distance_to_object(Rocket) <= 100 &&  owner.class == CLASS_PYRO{
    var target=-1;
    with(Rocket) {
        if team != other.player.team && collision_line(x,y,x+lengthdir_x(142,direction),y+lengthdir_y(142,direction),other.id,0,0) target=id;
    }
    if target != -1 {
        aimDirection=point_direction(x,y,target.x,target.y);
        code_that_calls_global.special;
    }
}

Something like that, but i'm not sure if it can check a collision with an id.

I did it like this, but I think the "< 5" is going to generate a hell lot of bugs.

Code:
with Rocket
{
    if team == other.team //I only want to calculate enemy rockets.
    {
        continue;
    }
   
    if point_distance(x, y, other.object.x, other.object.y) < 75
    {
        hs = other.object.x-x
        vs = other.object.y-y
        distance = sqrt(power(hs, 2)+power(vs, 2));

        factor = 13/distance //13=rocket_speed;
       
        hs *= factor //normalize the rocket-me vector, multiply it with 13 to make it the same length as the rocket speed, and compare the hspeed and vspeed.
        vs *= factor
       
        if distance > 42 and abs(hs-hspeed) < 5 and abs(vs-vspeed) < 5 //42=flamethrower_length; And I couldn't come up with something better to test whether the rocket is going to hit you.
        {
            //airblast
            other.RMB = 1
            aimDirection = point_direction(other.object.x, other.object.y, x, y)
            other.LMB = 0
        }
    }
}
Logged

Your mind is software. Program it.
Your body is a shell. Change it.
Death is a disease. Cure it.
Extinction is approaching. Fight it.
Orpheon
2011 Haxxy Award Winner
*
Offline Offline

Posts: 5818


Developer


« Reply #202 on: July 08, 2011, 10:14:06 am »

I'm adding this to the download I just posted, and calling it v4_4.

-Added a working airblast

(Changes since first 2.3):
-Fixed HumanVsBot
-Created follow-human option.

Exe
GMK
Logged

Your mind is software. Program it.
Your body is a shell. Change it.
Death is a disease. Cure it.
Extinction is approaching. Fight it.
Unsung Hero
Hero Member
*****
Offline Offline

Posts: 3086


Classy Cynic


« Reply #203 on: July 08, 2011, 10:35:10 am »

 Woot

Since this is synced I've been studying the intelligence of the AI to regular pubs.

The pubs aren't impressing me very much; I'm starting to prefer fighting bots.
Logged


Swimming is all about speshul powah. I have mastered swimming in 721 different strokes.
Proud member of [PHS]
Orpheon
2011 Haxxy Award Winner
*
Offline Offline

Posts: 5818


Developer


« Reply #204 on: July 08, 2011, 11:10:16 am »

Woot

Since this is synced I've been studying the intelligence of the AI to regular pubs.

The pubs aren't impressing me very much; I'm starting to prefer fighting bots.
Thanks.
Did you look at the last/previous match thread?

I hosted today a server called "Man Vs Machine: A/D". Yes, we did win. But it was close. We only won at the end by backcapping, but at standard "medic-centric combat" (strange since they had no medic) we simply got owned hard in the middle of the map.

Also, about the airblast: Clicking the right-mouse button right after firing won't work, and that's not different for the bots. They can airblast stupidly well if they're not firing (ie. not in close quarters), which is something most humans can as well. So I'm not adding random numbers until people really start to complain.


Next thing: FIX THAT GODDAMN MAP-CHANGIN BUG!!!
« Last Edit: July 08, 2011, 11:15:26 am by Orpheon » Logged

Your mind is software. Program it.
Your body is a shell. Change it.
Death is a disease. Cure it.
Extinction is approaching. Fight it.
Unsung Hero
Hero Member
*****
Offline Offline

Posts: 3086


Classy Cynic


« Reply #205 on: July 08, 2011, 11:14:16 am »

I don't believe there ARE medic bots.
Logged


Swimming is all about speshul powah. I have mastered swimming in 721 different strokes.
Proud member of [PHS]
Orpheon
2011 Haxxy Award Winner
*
Offline Offline

Posts: 5818


Developer


« Reply #206 on: July 08, 2011, 11:16:43 am »

I don't believe there ARE medic bots.
No, there aren't. Yet.

Yet.
The following code was a hell lot easier than I expected it to be.

What would be a medic priority healing list again (in exact terms)?
Logged

Your mind is software. Program it.
Your body is a shell. Change it.
Death is a disease. Cure it.
Extinction is approaching. Fight it.
Orpheon
2011 Haxxy Award Winner
*
Offline Offline

Posts: 5818


Developer


« Reply #207 on: July 08, 2011, 11:23:50 am »

heal weakest first.

if you want realistic player replacements, make them stick with big guns and only heal others if no enemies are around
I don't want realistic player replacements, I want idealistic replacements.

-->The best players possible.

The only exception is the Sniper because that was simply not fun.
It's always easier to tone things down then make them better.
Logged

Your mind is software. Program it.
Your body is a shell. Change it.
Death is a disease. Cure it.
Extinction is approaching. Fight it.
trog
member of intel's squad of garbagemen against the yakuza
1000$ Monopoly Rich Beta Male
*
Offline Offline

Posts: 9865


i am uberdeath


« Reply #208 on: July 08, 2011, 11:46:26 am »

Lowest hp > taking damage > heavy/soldier

I think if you go by lowest health percent it'll basically prioritize the medibuddy classes. Coding uber might be harder...
Logged

Orpheon
2011 Haxxy Award Winner
*
Offline Offline

Posts: 5818


Developer


« Reply #209 on: July 08, 2011, 12:01:15 pm »

Lowest hp > taking damage > heavy/soldier

I think if you go by lowest health percent it'll basically prioritize the medibuddy classes. Coding uber might be harder...
Uber as soon as you get it or something.....

But no, I think I'll leave the medic alone for the moment. If someone wants to have a go at him, then I'll include it into the bot, but I want to make other things first.
One is fixing the thing that's hindering hosters most from hosting this (the map-changing bug), and the other is a surprise  hehe.
« Last Edit: July 08, 2011, 12:58:20 pm by Orpheon » Logged

Your mind is software. Program it.
Your body is a shell. Change it.
Death is a disease. Cure it.
Extinction is approaching. Fight it.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.342 seconds with 18 queries.