NewsUnrealEdFilesModsFragBULiandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > BeyondUnreal > Games > Unreal Series > Unreal 2

Reply
 
Thread Tools Display Modes
Old 8th Aug 2008, 03:29 AM   #1
takwu
cXp coder Tak®
 
takwu's Avatar
 
Join Date: Feb. 5th, 2004
Posts: 614
Post What I'm coding for XMP...

For the last month and a half, I've been trying to make a new mod for XMP. But to make this mod work, I needed a bot.

Originally I started looking at the Unreal2 code, because I think the NPC (Non-player character) AI is pretty good. But to my disappointment the code structure of the characters is completely different from XMP. They share almost nothing beyond the engine code (written by Epic). Plus it's complex beyond believe... about a dozen different classes to look at. It took a very long time to figure out everything and then decide to abandon that direction.

Then I looked at the existing code in XMP for the auto turrets. Not expecting much really. The code is too simple to transform into a search and destroy, moving enemy.

Finally I started looking at the UT2003 code. First the Bot code - computer behaving as actual players, is way too complex. It's 4500 lines of code in one class, plus other classes it depends on (Squad AI etc). It's a lot better than the U2 situation, but there is still no way I can port all of that over. Afterall the Epic Bot was probably designed to be as versatile as possible for all kinds of different games that the Unreal engine can be used for.

Looking a bit deeper, UT2003 also has the Monster code - controls monsters that simply kill players in the Invasion gametype. It's a much simplified version of Bot (about half the size) and it's exactly what I'm looking for... except of course it doesn't just work in XMP. It took me another week to understand everything so I can make the XMP character code (Pawn) compatible with any AI - it was designed to be human controlled only. Now I am going thru the AI code to (hopefully) properly control the Pawn.

2600 lines of code is still not easy to go thru all at once. After hoping everything to automagically work together has proved to be futile, I decided to go thru it step by step. I cut down the code to be as simple as possible, and then I'll put each feature back in and fix it up that way.

At this point I have cut all the "awareness" of the Monster, and put in the first feature: wandering (now at just over 500 lines). It works - thank the Artis. The screenshot I made doesn't "prove" anything: it's just some Gunner named "Bot1" walking. But trust me, that is not a player, it's computer controlled. And it walks around in different directions randomly.

I picked RGB as my test bed for obvious reasons... But something hilarious happened. I watched the bot wander for a while, and eventually he walked over the jumppad! He landed in the middle "bridge" and kept wandering as if nothing happened

Now I am way overdue for the other project - real life. The bot issue was very optimistically thought to be solved by last month, so I still have this month to work on the mod. But now we're one week into the month and I have a "zombie" that only wanders around. So the status of this whole project now becomes "I'll work on it if I feel like it."

The reality is I am back to school in September, and if possible I would like to get a part-time job to pay for this school too. In that case I'll have zero time to even touch any games. We'll see what happens with the rest of these days I'm still free. In all likelihood the project will be on hold after that.

If there is anyone interested in continuing the AI part of the project, feel free to contact me and we'll talk. Oh, and what's the rest of this mod thing? I was going to announce it once the bot issue is solved... So let's hope it will be solved soon, or you'll have to wait until who knows when.

Meanwhile let's just keep the party going and play XMP as it is every week hehehe...
Attached Thumbnails
Click image for larger version

Name:	Shot00010.JPG
Views:	49
Size:	270.9 KB
ID:	96280  
takwu is offline   Reply With Quote
Old 8th Aug 2008, 08:28 AM   #2
GreatEmerald
Khnumhotep
 
GreatEmerald's Avatar
 
Join Date: Jan. 20th, 2008
Location: Lithuania
Posts: 4,042
Nice Yea, I code by the same way - copy some code, hope that it works, see that it doesn't, disable what doesn't, see if everything else works, repeat, fix what I can, ask people at the UT2004 forums for advice.
GreatEmerald is offline   Reply With Quote
Old 8th Aug 2008, 11:27 AM   #3
(GR)Killer
...
 
Join Date: Mar. 6th, 2004
Posts: 3,557
Look at that health bar...H4X!!!!!!
(GR)Killer is offline   Reply With Quote
Old 8th Aug 2008, 01:15 PM   #4
Dusty
Registered User
 
Dusty's Avatar
 
Join Date: Jun. 3rd, 2008
Posts: 18
Stop seeing H4X everywhere.
Bot and player are same team.
UIscripts:
Component=PIDHealthBars in PID.ui
Dusty is offline   Reply With Quote
Old 8th Aug 2008, 01:36 PM   #5
Leo(T.C.K.)
Registered User
 
Leo(T.C.K.)'s Avatar
 
Join Date: May. 14th, 2006
Posts: 4,066
What happened with the "alpha" code? Did it work, did you look into it?
Leo(T.C.K.) is offline   Reply With Quote
Old 8th Aug 2008, 09:58 PM   #6
takwu
cXp coder Tak®
 
takwu's Avatar
 
Join Date: Feb. 5th, 2004
Posts: 614
Leo I looked at the U2 Alpha version and it wasn't really that different from the release version. Unless I missed something?
takwu is offline   Reply With Quote
Old 8th Aug 2008, 10:03 PM   #7
takwu
cXp coder Tak®
 
takwu's Avatar
 
Join Date: Feb. 5th, 2004
Posts: 614
Laughing OMF OMF a leak! Leak!

I found a leaked Alpha version (a5) of this mod, called Ruby!

http://members.shaw.ca/takwu/XMP/Ruby_a5.zip

Ok so I leaked it You can all thx Killer... Tak: but it doesn't die, it just lies there waiting to be revived, you sure you still want it? Killer: So it doesn't respawn? Tak: maybe I'll make one that dies and respawns...

So I did. lol. Have fun!
Attached Thumbnails
Click image for larger version

Name:	Shot00000.JPG
Views:	24
Size:	287.4 KB
ID:	96285  

Last edited by takwu; 8th Aug 2008 at 10:05 PM.
takwu is offline   Reply With Quote
Old 8th Aug 2008, 10:09 PM   #8
(GR)Killer
...
 
Join Date: Mar. 6th, 2004
Posts: 3,557
Thank you Killer.

edit- where do we save it to? no bot spawns and i extracted it to my system folder.

edit 2- Hmm, i read the readme but it still does not show a bot in my server, i did both things the readme says also.

Quote:
Can't find file for package 'Ruby_a5'
Does that when i load the ruby map, or it does that when i load a map that has the stuff the readme says.

Last edited by (GR)Killer; 8th Aug 2008 at 10:52 PM.
(GR)Killer is offline   Reply With Quote
Old 8th Aug 2008, 11:09 PM   #9
(GR)Killer
...
 
Join Date: Mar. 6th, 2004
Posts: 3,557
Quote:
Originally Posted by (GR)Killer View Post
Thank you Killer.

edit- where do we save it to? no bot spawns and i extracted it to my system folder.

edit 2- Hmm, i read the readme but it still does not show a bot in my server, i did both things the readme says also.



Does that when i load the ruby map, or it does that when i load a map that has the stuff the readme says.
Nevermind, i did it wrong. I put it in u2 folder, instead of system folder. Put the bot rgb map in the maps folder and you will see a bot named Bot1. He just stands there.

Ok, bot cannot get ko'd or revived, lays dead forever. Already let Tak know.

Last edited by (GR)Killer; 8th Aug 2008 at 11:12 PM.
(GR)Killer is offline   Reply With Quote
Old 9th Aug 2008, 01:13 AM   #10
(GR)Killer
...
 
Join Date: Mar. 6th, 2004
Posts: 3,557
Ok it's fixed, the download link is good to go.A slight bug in it, since it's beta. Bot 1 leaves the game as the game starts, you kill it and bot 2 enters the server and kill it bot 3 enters. They all leave after u kill them and a new one enters.
(GR)Killer is offline   Reply With Quote
Old 9th Aug 2008, 02:02 AM   #11
(GR)Killer
...
 
Join Date: Mar. 6th, 2004
Posts: 3,557
What a nub!

http://img385.imageshack.us/my.php?i...ot00019fv1.jpg

I prolly made him rage quit.
(GR)Killer is offline   Reply With Quote
Old 9th Aug 2008, 09:03 AM   #12
Leo(T.C.K.)
Registered User
 
Leo(T.C.K.)'s Avatar
 
Join Date: May. 14th, 2006
Posts: 4,066
Quote:
Originally Posted by takwu View Post
Leo I looked at the U2 Alpha version and it wasn't really that different from the release version. Unless I missed something?
It's a lot different than final, at least at weapons and such stuff. I thought it might work.
Leo(T.C.K.) is offline   Reply With Quote
Old 28th Sep 2008, 03:38 PM   #13
GreatEmerald
Khnumhotep
 
GreatEmerald's Avatar
 
Join Date: Jan. 20th, 2008
Location: Lithuania
Posts: 4,042
Hey Tak, tried to look at the UTXMP code?
http://pastebin.com/m5122b5ca - Gunner pawn code Oh wait, you ALREADY have the pawn code! The same is at Pawns.Gunner! Then all you need is a good Controller! By the way, it seems that there are tests of a Bot already at GTestB (Gunner Test Bot)... http://unreal.student.utwente.nl/unc...ns/gtestb.html
http://pastebin.com/m1e3c520a - XMP Bot code (needs XBot class)
http://unreal.student.utwente.nl/unc...e/xbot.html.gz - XBot class, a controller, needs Bot... ScriptedController... AIController... And Controller... Luckily you already have Controller, AIController and even ScriptedController! Maybe it could work then! You still need Bot then:
http://unreal.student.utwente.nl/unc...me/bot.html.gz

Also the Bot must be replicated.. You need a RepicationInfo:
http://unreal.student.utwente.nl/unc...oninfo.html.gz
And then the XMP Player Replication Info:
http://pastebin.com/ma77d40b

For pathing, AssaultPaths would be useful:
http://unreal.student.utwente.nl/unc...ltpath.html.gz
Strangely, everything else seems to be already set up for bots! :S

With all this you should get a fully working DeathMatch bot, but with nothing to attract it as there are no pickups... So basically they would only wander around. To make them steal artifacts, you need an Objective...
First you need a JumpSpot (if the bot can't get on that platform at Sirocco, you have to tell him to jump!): http://unreal.student.utwente.nl/unc...mpspot.html.gz
Then a GameObjective to attract it: http://unreal.student.utwente.nl/unc...ective.html.gz
And finally a fresh Icon Node: http://pastebin.com/m54ff2743

I know, a hellish lot of links, but I can send you the full UTXMP code if you wish

Last edited by GreatEmerald; 28th Sep 2008 at 04:05 PM.
GreatEmerald is offline   Reply With Quote
Old 28th Sep 2008, 05:12 PM   #14
(GR)Killer
...
 
Join Date: Mar. 6th, 2004
Posts: 3,557
He is nolonger doing this, and hasn't for a while. Maybe next summer he told me a while back. School and work take up alot of time.
(GR)Killer is offline   Reply With Quote
Old 29th Sep 2008, 02:05 AM   #15
takwu
cXp coder Tak®
 
takwu's Avatar
 
Join Date: Feb. 5th, 2004
Posts: 614
Yep. In the summer I had foreseen that I would be way too busy when school starts. That is the reason for the very rush release (or "leak") of Ruby Alpha.

All I can do now is try to be there on Wednesdays

As I have originally explained, Bot is 4500 lines, so good luck trying to debug that for XMP. Everything, including the UTXMP bot, that subclasses Bot will need Bot to work perfectly.

Monster, on the other hand, is very similar to Bot, with a lot less features. RubyBot is Monster stripped down to basic wandering only. It's a subclass of AIController.

GTestB is an AIController that tells the pawn to repeat an animation. That's it.

xBot uses xPawn. U2XMP pawns are not xPawns.

...

Well I hope that doesn't discourage anyone who wants to continue developing a bot for U2XMP. The fact that RubyBot works means it is possible, only that considerable work is required to continue porting over the rest of Monster or Bot.

If you are interested, please extract RubyBot code from Ruby Alpha, compare it to Monster and Bot, and carefully read my comments in code. I traced the code all over the place to figure out some of the things that's needed to make it compatible with XMP.

For examples, look at the weapon preference code and the physics mode stuff. They seem trivial, but without them even RubyBot wouldn't wander around, and you would have no idea why.

I will not have time to work on it again in the immediate future... But yeah next summer I will see what happens in my life
takwu is offline   Reply With Quote
Old 29th Sep 2008, 07:33 AM   #16
GreatEmerald
Khnumhotep
 
GreatEmerald's Avatar
 
Join Date: Jan. 20th, 2008
Location: Lithuania
Posts: 4,042
Quote:
Monster, on the other hand, is very similar to Bot, with a lot less features. RubyBot is Monster stripped down to basic wandering only. It's a subclass of AIController.
Yet you need a Bot, not a Monster! It needs teamwork and the use of weapons.
Quote:
GTestB is an AIController that tells the pawn to repeat an animation. That's it.
No it's not, it's a Pawn. It doesn't have a (usable) AIController and that's why it won't work.
Quote:
xBot uses xPawn. U2XMP pawns are not xPawns.
Yes, but that doesn't seem to be essential.

Quote:
As I have originally explained, Bot is 4500 lines, so good luck trying to debug that for XMP.
Bot of UT2004 is 5744 lines, Bot of UT2003 is 4357 lines. Monsters are 2542-8.

And can you give us the extracted code? GPL FTW

Oh, and also we could look at U2's bots. They even have 2 options:
http://unreal.student.utwente.nl/unc...erbaseold.html - Old NPC Controller Base (6887 lines, but heck loads of comments), used for U2 Bots!
http://unreal.student.utwente.nl/unc...ollerbase.html - New NPC Controller Base (W00t, only 3132 lines! And still a lot of comments!)

Last edited by GreatEmerald; 29th Sep 2008 at 07:45 AM.
GreatEmerald is offline   Reply With Quote
Old 29th Sep 2008, 09:48 AM   #17
Leo(T.C.K.)
Registered User
 
Leo(T.C.K.)'s Avatar
 
Join Date: May. 14th, 2006
Posts: 4,066
The alpha bots too, but he said they are no use for him.
Leo(T.C.K.) is offline   Reply With Quote
Old 29th Sep 2008, 11:23 AM   #18
GreatEmerald
Khnumhotep
 
GreatEmerald's Avatar
 
Join Date: Jan. 20th, 2008
Location: Lithuania
Posts: 4,042
The Controller class, you mean? Well, if it's different, I could see if it could possibly help...
GreatEmerald is offline   Reply With Quote
Old 29th Sep 2008, 07:21 PM   #19
(GR)Killer
...
 
Join Date: Mar. 6th, 2004
Posts: 3,557
Typhoon told me he will make bots for u2xmp sometime, of course it will probably be a few years from now when he's done making xmp for ut3 (starting from scratch), he's almost a pro coder now.
(GR)Killer is offline   Reply With Quote
Old 29th Sep 2008, 07:42 PM   #20
takwu
cXp coder Tak®
 
takwu's Avatar
 
Join Date: Feb. 5th, 2004
Posts: 614
In a few years...

"XMP 10th Aniversary Edition featuring the long awaited bot support!"

takwu is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:13 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer