ZenCoder's fix for PlayerBots

Posts about what EvilGrins has been or is up to!
Post Reply
User avatar
EvilGrins
Posts: 2486
Joined: Thu Jun 30, 2011 8:50 pm
What is the middle number? (one, TWO, three): 2
ExtraAntiSpam: Blue
extraextraantispam: Yes
NoMoreSpam: Silver
Location: Palo Alto, CA
Contact:

ZenCoder's fix for PlayerBots

Post by EvilGrins » Mon Apr 26, 2021 9:15 pm

I'm not a coder, doing scripts is not my strong suit... but I copy & paste with the best of them!
Image
I was toying with this for awhile, before I actually tried it... and admittedly screwed up a map I'd been editing for a very long time.

The annoying thing about summoning playerbots, or editing them directly onto a map, is they can't be team assigned and they all show up on the scoreboard as "Player". This is especially annoying if you are working with more than one of them. But due to a recent map edit I've been working on, 1 of 4, I discovered there's been a work-around for this that I somehow never noticed before...

...which was especially annoying as I've been asking if this were possible for years and everybody told me it couldn't be done!

Part of the mapping edits I've been working on is this map:
https://unrealarchive.org/maps/unreal-t ... a6ea8.html
That map is especially interesting as it has a playerbot embedded into the map, but it's on the Red Team and it actually has a name. So I studied how that was setup to see if I could do it, while I did a review of more of ZenCoder's work to see if he'd done similar anywhere else.

As I've since learned, this method only works with one player model type at a time, you can setup multiple bots on the map this way but they each have to be a different model... which may explain why ZenCoder only had one on one team. But the basic code is pretty simple:
//=============================================================================
// Ronald.
//=============================================================================
class Ronald expands MaleOneBot;

function PostBeginPlay(){
PlayerReplicationInfo.PlayerName = "Ronald the Clone";
PlayerReplicationInfo.Team = 0;
}

With slight alterations, I've used that on 5 different player models for a few maps already... but as stated, I can only do that with one player model per team (if I've got a Boss model on 1 team I can't have one on the other team). Try to do 2 with that on any map, the map won't work and you'll have to start over from scratch.

I did find another map ZenCoder had done this on:
https://unrealarchive.org/maps/unreal-t ... ea07d.html
This time around it was the Abbey model and it was for more than one of the same model type.

That looks like this...
//=============================================================================
// Amazon.
//=============================================================================
class Amazon expands AbbeyBot;
var() int myTeam;

function PostBeginPlay(){

PlayerReplicationInfo.Team = myTeam;
if ( myTeam == 0 ) {
PlayerReplicationInfo.PlayerName = "Sheena";
multiskins[0] = texture'MyLevel.Amaz1T_0';
} else {
PlayerReplicationInfo.PlayerName = "Xena";
multiskins[0] = texture'MyLevel.Amaz1T_1';
}
}

The screenshot at the top of this post was my attempt to do it, and it worked. I'm doing a re-edit of the CTF-ColaWars map.

Now, I only know how to use it to the extent of making slight variables in what's there, but I'm no coder. I can't make them do auto-taunts, I can't alter their skill level (which is probably a good thing) but I can use them fairly basically for fillers.

Just wanted to share, and to those who told me this was impossible... I will have blood vengeance!

But, moving right along, there are still complications.

For the 1st version you have to skin the model after you place it on the map, but with the 2nd version you can skin it in the code so long as the skin is 1 texture for the entire model. However, if the model is a multi-texture deal then you're better off skinning it as with the 1st version...

...though those better at coding might be able to find work-around for that too.

User avatar
Kelly
Posts: 127
Joined: Sat Dec 01, 2012 2:29 am
What is the middle number? (one, TWO, three): 2
ExtraAntiSpam: Blue
extraextraantispam: Yes
NoMoreSpam: Silver
Location: Coos Bay, Oregon

Re: ZenCoder's fix for PlayerBots

Post by Kelly » Mon Apr 26, 2021 10:37 pm

You run the risk of messing up quite a few things by embedding items with a playerreplicationinfo into the map. Lots of mutators that count through the list of PRI's are going to end up counting these too, not to mention kills and deaths are going to be included.

It's not that what people said to you was that it wasn't possible but more that it's not a good idea and it's going to break a LOT of stuff.
When everyone you ever known is headed for a headstone
I don’t wanna give the end away but we’re gonna die one day

User avatar
EvilGrins
Posts: 2486
Joined: Thu Jun 30, 2011 8:50 pm
What is the middle number? (one, TWO, three): 2
ExtraAntiSpam: Blue
extraextraantispam: Yes
NoMoreSpam: Silver
Location: Palo Alto, CA
Contact:

Re: ZenCoder's fix for PlayerBots

Post by EvilGrins » Fri Apr 30, 2021 4:03 am

I was wondering more in terms of some being concerned this was like an aimbot, which is why I've tried to stay clear that I don't alter their skills so they're at default settings.

But damage? I haven't seen any signs of them breaking anything. They seem not at all different than the NPC characters or the UTDM-monsters.

User avatar
Kelly
Posts: 127
Joined: Sat Dec 01, 2012 2:29 am
What is the middle number? (one, TWO, three): 2
ExtraAntiSpam: Blue
extraextraantispam: Yes
NoMoreSpam: Silver
Location: Coos Bay, Oregon

Re: ZenCoder's fix for PlayerBots

Post by Kelly » Fri Apr 30, 2021 9:50 am

It has to do with them having a player replication info assigned to them. Lots of mods will iterate through the actors in a map and count the items with a PRI for various reasons. This is how MH maps know how many monsters are still on a map. They count the number of monster replication infos. That's also why certain animals don't show in this list like birds and blobs. They don't have one in stock form.

Anyway it's not an insurmountable problem but you should be aware of it.
When everyone you ever known is headed for a headstone
I don’t wanna give the end away but we’re gonna die one day

User avatar
Hook
Posts: 3435
Joined: Fri Feb 16, 2007 9:41 am
What is the middle number? (one, TWO, three): 3
extraextraantispam: No
NoMoreSpam: Silver
Location: Minnesota USA (Just West of MPLS - by a pond beneath a tree - Dead & Buried)
Contact:

Re: ZenCoder's fix for PlayerBots

Post by Hook » Fri Apr 30, 2021 2:32 pm

ZenCoder (aka Bryan Westly I believe from Texas) was a Great Coder and a good person too!
He was a professional coder/software developer in real life.
I chatted with him a lot back in the day, and we shared a lot of personal chat as well as UT99 chatter.

Tooting my horn here: I was the one who taught him (ZenCoder) how to add things into maps when he was first starting in ut99. (he asked me how I did it)
Of course he flew with that and built on that info, and the rest is history.
Adding these bots though was something he did himself, as I never did it. (I don't think anyway) :P
=Hook= of Hook's UT Place - Hopelessly Addicted to UT99!
Forum: https://hooksutplace.freeforums.net
CROSSBONES Missile Madness {CMM} (GT Top 50)
PRO-Redeemer | PRO-SNIPER-Redeemer | SEEKER-Redeemer
Birth Place of ALL Seeker/Scoped Deemers!
IP: 68.232.181.236:7777
CROSSBONES Monster Hunt {CMH} (Special Edition MH by mars007)
IP: 108.61.238.93:7777

User avatar
EvilGrins
Posts: 2486
Joined: Thu Jun 30, 2011 8:50 pm
What is the middle number? (one, TWO, three): 2
ExtraAntiSpam: Blue
extraextraantispam: Yes
NoMoreSpam: Silver
Location: Palo Alto, CA
Contact:

Re: ZenCoder's fix for PlayerBots

Post by EvilGrins » Fri Apr 30, 2021 9:31 pm

I don't intend to be putting maps out a lot with these bots added necessarily... but I'll be careful.

User avatar
Hermskii
Site Admin
Posts: 8395
Joined: Sun Jul 10, 2005 9:56 pm
What is the middle number? (one, TWO, three): 2
ExtraAntiSpam: Blue
extraextraantispam: Yes
NoMoreSpam: Silver
Location: Houston, Texas
Contact:

Re: ZenCoder's fix for PlayerBots

Post by Hermskii » Wed May 05, 2021 10:51 am

The important thing I detected here is that Kelly chimed in. I love it when he pops in and helps.
~Peace~

Hermskii

User avatar
Kelly
Posts: 127
Joined: Sat Dec 01, 2012 2:29 am
What is the middle number? (one, TWO, three): 2
ExtraAntiSpam: Blue
extraextraantispam: Yes
NoMoreSpam: Silver
Location: Coos Bay, Oregon

Re: ZenCoder's fix for PlayerBots

Post by Kelly » Sun May 09, 2021 12:45 pm

I still read most stuff but my opinion isn't really relevant to any of the discussions as I'm so out of the loop. Maybe I'll do something this fall when the rainy season starts up. Been talking to Ferali and paper a bit and I enjoy that back and forth. I had a couple of garbage can ideas I might dig back out and take another look at. Maybe.
When everyone you ever known is headed for a headstone
I don’t wanna give the end away but we’re gonna die one day

User avatar
Nelsona
Posts: 997
Joined: Sun Mar 06, 2011 11:45 am
What is the middle number? (one, TWO, three): 2
ExtraAntiSpam: Blue
extraextraantispam: Yes
Location: Still at Keyboard
Contact:

Re: ZenCoder's fix for PlayerBots

Post by Nelsona » Tue May 11, 2021 4:25 pm

These were in discussions before.
Bots from UnrealShare added in map might need some fix as long as they call a None DeathMatchGame which is not DeathMatchPlus. Here they can have also a Playershadow decal and added over a weapon for preventing another fascinating code calling a NONE weapon because this pawn has nothing when it's embedded in map.

Bot class from BotPack is more easy to manage, in exchange, any of these would be advisable to have entrance in state "Dying - WaitingforStart" or something like that in order to have a normal reaction - starting match normally - spawning, and letting game to load them with a default gun and no error will be spread.

You can imagine a map on-line when no player is connected. Mr. "Ali-G" is running here and there processing data for no reason. I passed the stage when I was making engine to process actors for nobody joined. Original Bot deal inspired me to do changes in MonsterHunt too, my recent work put monsters in "GameEnded" if nothing makes noise. When game starts, monsters "are joining", they are awaken in groups using a start cycle having a second purpose too - that's not for this discussion. When all things are calibrated well, you'll be amazed how nice is still UE1 as it is.

So far this fix for player-bots for me it was not ready. There are differences between Bot from BotPack and Bots from Unrealshare. These are not the same thing and so the fix it's not something common.
Either way sending them in a team when game it's not a TeamGame makes no sense. Code should be something generic for being imported and mapper adding team and name without to compile code all time and excepting executions when are not needed. Pawn enters game normally even if it was there all this time and all it's running fine.

The solution two a la Nelsona is a tracker actor nearby embedded Bot, making possible using any stock Bot without having a new class, player data going there and actor does the job even for XAN class TBossBot, no Bot subclass is ever needed, no pawn running in an empty game-server and no errors spamming log-file.

Post Reply