News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 23rd Mar 2005, 01:44 AM   #1
Bob242
Registered User
 
Join Date: Aug. 27th, 2004
Posts: 34
Debug information on Pawns and Controllers

I'm trying to spawn extra computer controlled players for a game using the UT2003 engine.

Long story short, I'm trying to spawn them manually. I suspect that the way bots are normally spawned is located inside the native code when the map/level loads (probably basic knowledge, but it's my guess at this point. ).

I have managed to spawn the pawn I want, and it looks fine.

This is where things get hard....

When I spawn a controller for the pawn, Level.controllerlist shows that for every controller I spawn, it actually spawns two controllers pointing to the same pawn.... I know this because if I spawn no controllers there are no controllers pointing to the pawns I spawned.

The controllers and pawns I'm using (stock) are quite some generations away from "AIController" and "Pawn". The exact class of the controller I'm using contains two references to the pawn, and the exact class of the pawn I'm using contains two references to the controller (for class specific purposes I'm guessing).

So... back to my two spawned controllers. For the one I spawned and have a variable pointing to, both references to its pawn are correct, as per my settings, however the other controller is only half correct since one of its references to its pawn points to none. I decided to try deleting the one that wasn't fully correct since it wasn't the one I had a variable pointing to.

That seems to have worked, but I'm still not sure why it spawns 2 controllers.

Now the computer players can run around nicely like I told them to, but the server crashes when it tries to run a native function determining a relationship of some sort with all of the other computer players.

I know I must either be forgetting to set something, or this is something that needs to be handled at the native level. Either way, I'm looking for a way to dump all of the variables of every controller and pawn in the map/level and all references to them. I really don't feel like having to go write a gigantic log() on every variable, although I've already started doing something like that.

Basically, at this point I'm trying to find the difference between a normally spawned computer player, and my type of computer spawned player.
Bob242 is offline   Reply With Quote
Old 23rd Mar 2005, 01:55 AM   #2
Dandeloreon1984
CXP Director
 
Dandeloreon1984's Avatar
 
Join Date: Jan. 31st, 2004
Posts: 1,303
i'd recommend taking a look at the monster code used for the invasion gametype... it'll help you a ton with this issue... you can prolly use this to avoid two controllers for the pawn.
Dandeloreon1984 is offline   Reply With Quote
Old 23rd Mar 2005, 02:23 AM   #3
Bob242
Registered User
 
Join Date: Aug. 27th, 2004
Posts: 34
I don't have UT2003 nor any of its mods... Where can I find that?
Bob242 is offline   Reply With Quote
Old 23rd Mar 2005, 02:28 AM   #4
Dandeloreon1984
CXP Director
 
Dandeloreon1984's Avatar
 
Join Date: Jan. 31st, 2004
Posts: 1,303
do you have unreal tournament 2004... your post says Unreal Tournament 2003... so i thought u had ut2k3... but if u have ut2k4, look at monster.uc and skaarj.uc
Dandeloreon1984 is offline   Reply With Quote
Old 23rd Mar 2005, 03:00 AM   #5
Bob242
Registered User
 
Join Date: Aug. 27th, 2004
Posts: 34
No, I'm using a totally different game that is using the UT2003 engine. The developers of this game licensed the engine, but other than that, it has nothing to do with UT in any way.
Bob242 is offline   Reply With Quote
Old 23rd Mar 2005, 01:08 PM   #6
Dandeloreon1984
CXP Director
 
Dandeloreon1984's Avatar
 
Join Date: Jan. 31st, 2004
Posts: 1,303
well, i can't help you if i don't know the game... lol.
Dandeloreon1984 is offline   Reply With Quote
Old 23rd Mar 2005, 01:58 PM   #7
Bob242
Registered User
 
Join Date: Aug. 27th, 2004
Posts: 34
I've done enough research into the engine using this forum and mainly the Wiki, and I have been able to make some nice things. All I'm asking for is information on how to debug pawns and controllers, and information regarding the way bots are normally spawned (ie. When in the native code are they spawned?).
Bob242 is offline   Reply With Quote
Old 23rd Mar 2005, 02:56 PM   #8
Bonehed316
Registered User
 
Join Date: Oct. 15th, 2001
Location: Florida
Posts: 208
You see, the "engine" and the "game" are quite (and that is putting it lightly) different. The difference between unreal 2 and UT2003 are immense, even. Just because it says unreal engine, does NOT mean that it is compatible at all with another game that uses the unreal engine. For instance, many of the U2 native functions (especially the AI) are dramatically different than those found in UT200x. Therefor, we NEED to know what game in order to have a reference of wtf you're talking about.

Also, UT2004 has the DrawDebug function which can be used to show debug info on the screen in game. U2 has no such function. The differences in engines can very easily be quite large. Asking us to help you is useless, since we really dont know anything about what youre talking about if you wont provide more information.
Bonehed316 is offline   Reply With Quote
Old 23rd Mar 2005, 04:08 PM   #9
Bob242
Registered User
 
Join Date: Aug. 27th, 2004
Posts: 34
I'm just asking for two things:

1) How are bots spawned in UT2003? If at the native level when loading the map/level like I suspect, can I simulate the process in UScript?

2) How can I dump all of the variables of pawns and controllers in UT2003?

Since there are very few real modders for my games, I doubt it would assist you to know what game. Modding is not supported by the company that produced it.

It's crashing when trying to run a native function figuring out whether or not to request assistance from other bots. This leads me to believe there is something fundamentally different between my bots and the bot spawned normally. Hence I'm just asking for the two things mentioned above.
Bob242 is offline   Reply With Quote
Old 23rd Mar 2005, 04:20 PM   #10
Bonehed316
Registered User
 
Join Date: Oct. 15th, 2001
Location: Florida
Posts: 208
Well, it cant be native because mod users have to be able to spawn their own pawns and controllers in single player. I'm also pretty sure that spawning pawns in UT200x doesnt add them to the controller list, although I could be mistaken there.

And as I said earlier, UT200x has the DrawDebug function to display info on the screen. The only other way would be to manually write a dump method.
Bonehed316 is offline   Reply With Quote
Old 23rd Mar 2005, 05:27 PM   #11
Dandeloreon1984
CXP Director
 
Dandeloreon1984's Avatar
 
Join Date: Jan. 31st, 2004
Posts: 1,303
well, i can't say much, but i'll say look into uncodex:
http://wiki.beyondunreal.com/wiki/UnCodeX

it'll have the unrealscript examples for various unreal games.
Dandeloreon1984 is offline   Reply With Quote
Old 23rd Mar 2005, 05:48 PM   #12
Bob242
Registered User
 
Join Date: Aug. 27th, 2004
Posts: 34
Well, if modders are able to spawn their own bots, in what order do they do what?

I first spawned a pawn using the Spawn() method, and then a controller the same way. I tried to initialize some values and have the controller possess the pawn.

One thing that is noteworthy is that I could destroy() the controllers that didn't have all their references correct, but I couldn't destroy() the controllers that were correct as per my settings.

I would appreciate it if someone could post some code samples. BTW, thanks for the link. I'll take a look in there.

EDIT:

OK, this is where I'm at now....

I'm using an initialization method for the pawn found inside the pawn class I'm using, which I found out spawns its own controller (Yes, I see why I was getting 2. ). So I'm calling this method which spawns the controller and gets a reference to it with the variable "controller", and of course has the controller possess itself.

The controller has an auto state where it gets everything configured, including the class specific references to it's pawn. Well, I know it's coming to this state because it's accessing none, but it's definitely not setting the variable properly for whatever reason. If I manually attempt to set the variables, it works that way, but I still can't figure out why it can't initialize itself....

I'm still getting the crash when the bots that I spawn try to run the same native function.

Last edited by Bob242; 23rd Mar 2005 at 08:48 PM.
Bob242 is offline   Reply With Quote
Old 23rd Mar 2005, 08:49 PM   #13
Dandeloreon1984
CXP Director
 
Dandeloreon1984's Avatar
 
Join Date: Jan. 31st, 2004
Posts: 1,303
Quote:
Originally Posted by Bob242
Well, if modders are able to spawn their own bots, in what order do they do what?

I first spawned a pawn using the Spawn() method, and then a controller the same way. I tried to initialize some values and have the controller possess the pawn.

One thing that is noteworthy is that I could destroy() the controllers that didn't have all their references correct, but I couldn't destroy() the controllers that were correct as per my settings.

I would appreciate it if someone could post some code samples. BTW, thanks for the link. I'll take a look in there.

EDIT:

OK, this is where I'm at now....

I'm using an initialization method for the pawn found inside the pawn class I'm using, which I found out spawns its own controller (Yes, I see why I was getting 2. ). So I'm calling this method which spawns the controller and gets a reference to it with the variable "controller", and of course has the controller possess itself.

The controller has an auto state where it gets everything configured, including the class specific references to it's pawn. Well, I know it's coming to this state because it's accessing none, but it's definitely not setting the variable properly for whatever reason. If I man ually attempt to set the variables, it works that way, but I still can't figure out why it can't initialize itself....

I'm still getting the crash when the bots that I spawn try to run the same native function.
try just spawning a pawn... that seems to work most of the time.

edit: and also, i'll point you to the segment of code responsible for the controller management... and anyways, look at the monster code:
http://unreal.student.utwente.nl/unc...k/monster.html

Last edited by Dandeloreon1984; 23rd Mar 2005 at 08:55 PM.
Dandeloreon1984 is offline   Reply With Quote
Old 23rd Mar 2005, 10:33 PM   #14
Bob242
Registered User
 
Join Date: Aug. 27th, 2004
Posts: 34
Well, I tried spawning a pawn, and sure it enough it's there, but it doesn't really do anything. You get some regular animations, but he has no weapons, and he doesn't seem to really react to anything.

The part of the code where it spawns the controller for a monster in its postbeginplay() looks similar to the initialization code of the pawn class I'm working with...

One thing I've noticed is that the gameinfo class I'm using inherits a function that is named to reflect that it spawns bots.... What it really does it just initialize all spawn points, and then add all the bot pawns it can find to a dynamic array of bot pawns. Perhaps I should be adding my pawns to this list?

EDIT:

Well, OK, for fun I spawned my pawns, and then called the bot spawning function everytime.... and sure enough the normal bots respawned....

Last edited by Bob242; 24th Mar 2005 at 01:02 AM.
Bob242 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 08:12 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