View Full Version : AI in the works
Shrimp
9th May 2004, 03:39 AM
I have begun working on AI for UnWheel, and so far have managed to get a bunch of cars to follow me around the map... They accelerate, steer, reverse - everything they need to get around. They follow very well in fact :D
Now I'll just apply the same method used to follow me, to game objectives like checkpoints, flags, etc. :D
ProjectX
9th May 2004, 04:12 AM
I have begun working on AI for UnWheel, and so far have managed to get a bunch of cars to follow me around the map... They accelerate, steer, reverse - everything they need to get around. They follow very well in fact :D
Now I'll just apply the same method used to follow me, to game objectives like checkpoints, flags, etc. :D
WOW!!!! That was quick! Congrats Shrimp! :D
Shrimp
9th May 2004, 07:43 AM
:)
I got them playing CTF now, picking up flags, chasing eachother around trying to steal flags, and returning them - though they tend to get stuck from time to time as they battle to avoid some objects, but they can reverse and make their way around most sticky situations :D.
ProjectX
9th May 2004, 07:59 AM
:)
I got them playing CTF now, picking up flags, chasing eachother around trying to steal flags, and returning them - though they tend to get stuck from time to time as they battle to avoid some objects, but they can reverse and make their way around most sticky situations :D.
I reckon it's all a conspiracy.
When you went for a week I think it's all because you were abducted by the FBI, and they typed that you were going out to look for work.
Now they've replaced you with an SCTR Robot (super-coding and thread replying robot). Bring back Shrimp! :lol:
Excuse me while I answer the door to the men in black suits outside. I'll be back in a minute.
EDIT: I have returned to my place of work as my protocol dictates and have executed the successful completion of 647 maps. I am not a robot. Carry on as you were.
Shrimp
12th May 2004, 05:10 PM
:lol: :D
Ok, I have the AI racing like crazy around the map... I might make a quick vid of it beating me :D
ProjectX
13th May 2004, 02:40 AM
:lol: :D
Ok, I have the AI racing like crazy around the map... I might make a quick vid of it beating me :D
woah :drools:
carmatic
13th May 2004, 09:05 AM
uh i really am more convinced by projectx's posts than shrimp's posts...
anyway making AI that intergrates with vehicle physics... hmm so its just 'turn left until you are facing this direction and keep gonig' kind of thing? are those the same ai routines that onslaught uses... cuz they work well for small vehicles, but they absolutly die in something as big as the leviathan... how much of an interface can the bots have with the vehicles? do they know when the wheels are touching the ground... more importantly do they know if the wheels can touch the ground, like if the car gets stuck somewhere , they shoudl give out a message like 'uh im stuck' and teleport back to the last checkpoint...
normally in racing games they worry about setting the AI to use the best path , calculating the shortest distance around corners, etc etc... but maybe in unwheel this doesnt actually apply and the shortest distance between 2 points really is a straight line... oh wait thats not true, in citytrack you actually need to round corners... can the bots see and react to corners? or avoid obstacles like the DARPA-sponsored robot car race...
and oh speaking of recording... can unwheel have this local-server-loopback-package-whatever style recording facility? cars look so much better when your not always looking at them from a fixed perspective...
GRAF1K
13th May 2004, 12:14 PM
This might not be fair to the other mod teams, though I don't remember anything in the official MSUC rules that strictly forbids the use of robots...
Oh well. You're making them look bad is all I'm saying. :D
UltraNew-B
21st May 2004, 01:32 PM
The issue that concerns me most about AI, is performance . Right now some vehicles are over 10,000 polys, very high (ut2004 vehicles are no more than 3000), any more than 2 vehicles would most likely bring the fps down to 2. This problem could be fixed by switching over to s-vehicles as opposed to k-vehicles, along with some serious optimization on the existing vehicles.
Just a thought :)
Shrimp
21st May 2004, 02:52 PM
Actually the models are fine, it seems possible to have tens of thousands of StaticMesh polys on screen at once quite easily.
The real problem lies in the physics, so when a bunch of bots decide it's time to crash, they will generate a bit of slowdown...
As for their 'AI' CPU usage, I've kept this way down, the bot's don't really think at all like a UT bot would, I'm simply giving them throttle/steering instructions based on their current curcimstances which reduces the CPU load quite a bit, rather than constantly calcuating a 'best plan of action' like a UT bot.
But yes, the physics will slow you down if you don't have a decent CPU. I have also disabled bots in multiplayer to prevent performance problems in that area.
Lukian
22nd May 2004, 02:16 AM
Can you define decent CPU, Shrimp? ;)
ProjectX
22nd May 2004, 04:21 AM
Can you define decent CPU, Shrimp? ;)
he probably means 2.7MHz and above (I got 3.2MHz overclocked and it runs just about bearable with 8 bots)
Shrimp
22nd May 2004, 04:27 AM
Umm, not really :P
Probably anything better than a 1.6GHz should handel quite a few cars.
Lukian
22nd May 2004, 04:27 AM
3.2MHz would be quite unclocked for me, any results on AMD cpus? :D
And also: what is your physics setting on? Low, Medium or High? :o
Shrimp
22nd May 2004, 04:28 AM
he probably means 2.7MHz and above (I got 3.2MHz overclocked and it runs just about bearable with 8 bots)
Oh :eek: :eek:
ProjectX
22nd May 2004, 06:18 AM
Oh :eek: :eek:
what's wrong Shrimp? My PC's a very old rig so its a lot slower than a straight out of the factory 3.2MHz overclocked (its about 2 years old)
and I have every graphical and physical setting set to maximum (and resolution 1028x1024)
Lukian
22nd May 2004, 06:26 AM
ProjectX: reread what you've said :p
I think Shrimp would be excited if his AI worked well on a 3.2MHz CPU, not to mention UT2004 ;)
ProjectX
22nd May 2004, 07:53 AM
ProjectX: reread what you've said :p
I think Shrimp would be excited if his AI worked well on a 3.2MHz CPU, not to mention UT2004 ;)
Alright alright, you lot know what I meant, I meant GHz
Shrimp
22nd May 2004, 09:02 AM
Ye I know, I was just a bit surprised it's even choppy on that kind of setup... :(
ProjectX
22nd May 2004, 11:53 AM
Ye I know, I was just a bit surprised it's even choppy on that kind of setup... :(
it is, but it is quite an old one, and I've only got a GeForce 4 and I run everything on maximum at 12780 x 1024 like I said so you can't expect it to run like a dream. Not to mention its in need of a good defrag and I've accumulated all those annoying programs that install themselves automatically and run in the backgrond and don't serve any percievable purpose and are unremovable.
Diego1203
22nd May 2004, 12:21 PM
Yeah I think performance is a bit of a problem too, my system is an Athlon xp 3000+, 1gb ram, and a radeon 9700 pro all-in-wonder, and with max bots in temple run, or most maps, the framrate isn't too good, I run at 1024x768 most of the time.
UltraNew-B
22nd May 2004, 01:47 PM
I run a P4 2.4Ghz, Nvidiai GeForce 4ti 128Mb. Running one vehicle under 1024*768, normal settings, performance is not terrible and not great (avg. 25-40 fps) on most maps. Any more and my fps tumbles badly.
I think these problems could be fixed if the team is interested (not sure what future goals are), switching to s-vehicles, optimizing 10000 poly vehicles (1200 polys per wheel is crazy),and some map optimizing (adding distance cull, fog etc). I don't think it would take alote to get this game running much better, but i'm also not a coder :p
I found this (http://wiki.beyondunreal.com/wiki/Polycount) article at Unreal Wiki, it describes the poly limits for this engine, of course this will vary from person person based on your comp settings and hardware etc. But, they estimate a 50,000 - 70,000 polys on screen is decent, any more is really pushing it. So you figure, 10,000 poly per vehicle + 20000 - 40000 polys in maps avg. Running more than 1 vehicle is indeed pushing it. Just my 2 cents :p
ProjectX
22nd May 2004, 03:49 PM
(1200 polys per wheel is crazy)
Woah I didn't know we used so much on qwheels alone! Yikes thats 4800 polys for all four wheels! That's more than most UT2K4 vehicles in total!
I reckon we should at least half the wheel polycount at least. We need to make the textures do a lot more of the work, after all the wheels'll be spinning most of the time so fast that you won't tell the difference between a 1200 poly wheel and a 450 poly wheel.
carmatic
22nd May 2004, 05:40 PM
wheels'll be spinning most of the time so fast that you won't tell the difference between a 1200 poly wheel and a 450 poly wheel.
now reading stuff like this just reminds me why i like unwheel so much... after all the wheels just behave mathematically, not defined by the actual polygons on them... like they should be at most cylinders ... or like how the onslaught vehicles take advantage of the crudeness of their wheels by making them look all rugged and stuff...
besides i honestly didnt see that much of a difference between the details on an onslaught vehicle and an unwheel one... the lighting system for ut2k4 on stuff like vehicles are notably dissapointing, like however smooth the hood of a car is, its still subjected to some crappy unrealistic shadowing effects...
strangelet
23rd May 2004, 06:59 PM
i note that in gran turismo they switch from a sharp texture to a motion blurred texture when the wheels spin fast, this not possible?...
also i agree that the game is a lil bloated - my dual 1ghz g4 with 64mb radeon 9600 can handle one car at about 30fps but more than one is a crawl.
my g4 is mb not a state of the art rig but certainly representative of a large demographic who can't upgrade every month for gaming purposes.
i believe the excellent textures on the vehicles would carry the detail of the cars with half the polys used...
carmatic
23rd May 2004, 09:55 PM
yeah who was responsible for the models in the game anyway? stuff like the 'high detail' cars (the vipers and the rally cars) did the vehicles get imported directly from somewhere...
ok this is drifting abit off topic, but like, i keep thinking of the leviathan's wheels... obviously they cant just use any cheap rotating wheel animations for something that big, and the realism in the motions of the wheels show off quite nicely... but then again there can only be up to 2 leviathans in any single game...
anyway this got me to think, is it possible to use different detail levels at the same time? like the small cars in onslaught have their crappy animations but the leviathan is simulated to a higher degree... maybe , unwheel vehicles can switch between the two as needed?like when the car is mid air , some animations can take over, but when its on the ground rolling freely the physics has to be accurate... also , can there be different speeds of animation depending on the speed of the vehicle? i can see this effect on normal players ,like you can see them animate slowly when for some reason they arent moving at full speed , but for some reason the onslaught vehicles have the same wheel spindown time , whatever the speed the vehicle was moving at when i let go of the accelerator and the rate of deceleration of the car is always the same, resulting with the wheels spinning even after the car has stopped...
UltraNew-B
24th May 2004, 12:20 AM
With S-Vehicles, which are used in ut2004 ONS, the model is imported as 1 mesh, body and wheels together, the wheels are animated through code. In Unwheel now, vehicles are k-vehicles, which ut2003 used (obsolete now for performance reasons). Basically 5 seperate meshes, the body + 4 seperate wheels, all attached in the end through code.
Check out this link for more info on differences between k-vehicles and s-vehicles, full explanation here. :)
http://udn.epicgames.com/Two/SVehicleCreation#Creation_Overview
Shrimp
24th May 2004, 02:19 AM
Any performance issues in UnWheel at the moment have very little to do with the level of detail on the vehicles or their wheels.
The performance hit comes from simulating larger numbers of Karma objects (more vehicles).
UnWheel does not use any polygon-acurate collision detection, it's all handeled by basic shapes around the vehicle models. For example, the wheels are surrounded by a simple Karma sphere - the models themselves have absolutely no collision properties apart from those spheres.
Vehicle bodies are surrounded by an extremely simple 26-sided box, so once again, there is no actual collision on the high-polygon model itself.
We could probably easily triple the number of polygons on each vehicle and still generate nowhere near as much slowdown as adding one more vehicle to the game.
Yes, SVehicle will probably reduce the speed issue a lot, but right now that is simply not an option as we do not have the time to create an entirely new fleet of vehicles, and convert all of UnWheel's code to a completely new vehicle system.
ProjectX
24th May 2004, 03:17 AM
You have a good point, maybe after MSUC we'll have some time for it eh? And by then I MIGHT have learnt how to model.
carmatic
25th May 2004, 01:44 PM
so... svehicles are the way to go then?
UltraNew-B
25th May 2004, 11:20 PM
yes carmatic :)
carmatic
26th May 2004, 06:45 AM
cool... that means the suspensions will start working ...oh wait i was just reading that thing about svehicles, it seems that they can only rotate, not compress or expand, which would have been nice for stuff like the monster trucks...and since they only rotate about points its not gonna be easy to do anything beyond the simple buggy-style wishbone suspensions... unless i am hopelessly under informed on this herirachical thing that unreal uses...
and how do you want to overcome the problem with the animations being ... like the wheels keep spinning after the car stops... if it has begun stopping before it has reached full speed... maybe theres like a way to switch between the 2 vehicle systems? or some deep tweaking to the animations of the vehicles...
ProjectX
26th May 2004, 07:24 AM
cool... that means the suspensions will start working ...oh wait i was just reading that thing about svehicles, it seems that they can only rotate, not compress or expand, which would have been nice for stuff like the monster trucks...and since they only rotate about points its not gonna be easy to do anything beyond the simple buggy-style wishbone suspensions... unless i am hopelessly under informed on this herirachical thing that unreal uses...
and how do you want to overcome the problem with the animations being ... like the wheels keep spinning after the car stops... if it has begun stopping before it has reached full speed... maybe theres like a way to switch between the 2 vehicle systems? or some deep tweaking to the animations of the vehicles...
yeah and for some reason the wheels stop being powered when the wheel leave the ground, they gently slow down as if you'd decided to turn the engine off midair or something (this is the prime reason why turbo don't work on terrain levels) and that slows you down a lot because you've got to accelerate again to get the wheels back up to speed.
carmatic
26th May 2004, 05:22 PM
no i think they do not have a realistic moment of inertia in regards to their rotation, the moment the wheels touch the ground they behave as if they have been spinning all the time and continue to drive the car forwards... which is even worse than if they actually slow the car down by hitting the ground when they are almost still... anyway i hope that a change in the vehicle system will fix this... and switching to kvehicles should also fix the vehicles rotating-in-the-opposite-direction-as-wheels problem when they are in mid air , cuz the onslaught vehicles definitely dont do that
ProjectX
26th May 2004, 06:03 PM
and switching to kvehicles should also fix the vehicles rotating-in-the-opposite-direction-as-wheels problem when they are in mid air , cuz the onslaught vehicles definitely dont do that
you mean S-vehicles right?
carmatic
26th May 2004, 07:00 PM
oops yeah... need sleep
yeah the one with the rotating joints and bones and stuff
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.