AI Navigation in the Procedural Cities

20 posts / 0 new
Last post
Dgreen02's picture
Offline
Last seen: 4 years 10 months
Joined: 05/12/2013 - 12:58am
Points: 9001
AI Navigation in the Procedural Cities

After some early morning hours, I have the artificial intelligence navigation mesh generated for the procedural cities in Just Death -- This mesh is how the AI knows where/how to move in the procedurally generated cities. The input mesh is well over 1 million triangle for this example it generates an optimized mesh of 30k triangles, VERY happy with the results. I'm also recording test videos with/without the Oculus VR virtual reality headset, everything is working great!! Expect to see this thing in motion very soon!

Screenshots of the optimized Nav Mesh ...


- Dan

Dgreen02's picture
Offline
Last seen: 4 years 10 months
Joined: 05/12/2013 - 12:58am
Points: 9001
AI Update #1 - Human and Vehicle Traffic

I've got the AI working on police - they chase you perfectly through the city :-) I'll post some screenshots below.

Also I have the first steps to getting traffic vehicles all over the city, humans AND vehicles :-] I can always remove them later for the zombie mod!! LOL.

//Traffic WIP from above ...

//Debug mesh output

//Police chase

- Dan

Dgreen02's picture
Offline
Last seen: 4 years 10 months
Joined: 05/12/2013 - 12:58am
Points: 9001
City Traffic Navigation Network Done!!

Made TONs of progress the last few hours, came up w a great way to generate the traffic patterns in the procedural cities! Here are a couple of debug images to show how it works!

//This image shows the North/South and East/West roads.

//This one shows the final road network, with North/South/East/West and Human lanes all rendered accordingly!!

Whooohoo! :-D

- Dan

Dgreen02's picture
Offline
Last seen: 4 years 10 months
Joined: 05/12/2013 - 12:58am
Points: 9001
Color coded breakdown ...

For a breakdown of the image above, consider the following ruleset, which is coded into the "intersection controllers" ( that's just what I call the state machine and associated data structures created to represent a group of traffic lights) in my game engine:

Color Key
---------------
North = WHITE
East = GREEN
South = RED
West = BLUE

Rules
---------------
To Go Straight:
RED-> RED
BLUE->BLUE
GREEN->GREEN
WHITE->WHITE

To Turn Right:
RED->BLUE
BLUE->WHITE
WHITE->GREEN
GREEN->RED

To Turn Left:
WHITE->BLUE
GREEN->WHITE
RED->GREEN
BLUE->RED

I'm sure this is confusing as fuck lol.

- Dan

nightovizard's picture
Offline
Last seen: 7 years 7 months
Joined: 10/05/2013 - 12:39pm
Points: 1401
So that's how you tell the AI

So that's how you tell the AI to go to the correct direction, and not going in the opposite direction of the road, plus how do you add working traffic lights in intersections...

Yeah, this is confusing as fuck. haha

Edit:
While i was playing payday i had this idea:
Why not creating a multiplayer gamemode where players can play as vigilantes and criminals, and the criminals have to complete misions such as stealing Banks, maybe using stealth and infiltrating. Meanwhile vigilantes have to find them and kill them without letting the Police notice IT. I think this could become an interesting gameplay.

For example 4 players play as criminals and 4 players as vigilantes. The criminals look like civillians and have to act like them so that the vigilantes, and the Police (ai) dont notice them If the vigilantes discover them they have to be careful because the Police also can detect and attack them. To win either the vigilantes or the criminals should escape and reach a safe position.

Would be like a mixture between payday 2 and assasins creed multiplayer, i think that i really Would enjoy IT. In addition this Would be a really uncommon multiplayer, kind of coop too.

"Instead of making a game you hope many people will like, it's sometimes better to create a game you know a few people will love"

''My intention is not to create something that won't be hated; it's to create something that will be passionately loved''

Dgreen02's picture
Offline
Last seen: 4 years 10 months
Joined: 05/12/2013 - 12:58am
Points: 9001
I have traffic lights working

I have traffic lights working now, will be included in the next update.

Ah! Cool idea about the vigilantes and robbers/cops! I have a regular bank robbery mode planned already, and a detailed bank made many years ago, will be including that for sure.

Great idea to have all 3 on the same map though, w some secret civilians :-), will be sure to include something like that when multiplayer starts up in the later releases of the game.

- Dan

nightovizard's picture
Offline
Last seen: 7 years 7 months
Joined: 10/05/2013 - 12:39pm
Points: 1401
Exactly, criminals and

Exactly, criminals and vigilantes are players, Police are bots (ai).

Each map has 2 or 3 places where a crime can happen, either robbery, hacking,transport drugs, transport weapons etc...

On one map for example you could start a robbery either in a bank or a store, and vigilantes have to discover where are you going. Of course both teams Would start in random positions.

IT Would be cool if you could sit on chairs and Banks, and make a reading the newspaper animation. IT Would be perfect if you could take the clothes from someone else and disguise yourself.

For gameplay purposes, the only way to complete the mission is by doing the Main objectives. Killing civillians Would be a crime, but IT would only penalize, if civillians spot you, you could use ropes to keep them silent. Killing security guards and Police is not penalized but you must be careful nobody discovers the dead body, you could hide them by draging them to somewhere else or placing them iside a bag.

If stealth fails, then go for diplomacy, use the civillians as hostages. For example if a player dies or is arrested you could exchange the civillian for him. Criminals want to complete the objective and escape and vigilantes wants the criminals dead or arrested and have to escape (by escape i mean reaching a safe zone that finishes the match).

Of course balancing in this gamemode Would be Hard to do. Something that could be done is that if criminals or vigilantes spots someone doing something strange, they could call the Police (Or security guards), and the Police Would start a search for them (They should hide or change clothes if they don't want to be discovered), this Would be a nice way to take advantage of the Police to eliminite or give problems to the enemy team.

After someone dies or gets arrested you can use hostages to release them fast. If you dont have hostages you Would need to wait for some minutes, and the player Would spawn next to one of the survivors, if everyone dies at the same time, that team loses.

consider vigilantes and criminals to have different kinds of bonus, after all they have different objectives, and I would dare to say that criminals are in disadvantage as they have to hide from police, hide from the vigilantes, and steal something, and get out and escape with it. Then vigilantes only have to kill the criminals and hide from police, if they have the same properties criminals have a disadvantage. That's why criminals should have more bonus, like for example, they are harder to detect by police, and they use common clothes, like most civillians, so it is hard for vgilantes to spot them to. Vigilantes clothes would be more uncommon, and easier to spot (unless they changed clothes, but first they would need to kill somebody or take a hostage). Criminals could also pay a bot (AI) that would infiltrate inside the designed place to spot police, security guards, cameras and strange actions hat could be done by vigilantes.

So this Would be a mixture of:
assasins creed multiplayer, as players can hide with other civillians and act like them, so nobody suspects from them, for example sitting in a chair or entering with a group of civillians.
Hitman, as players can take clothes from hostages or dead bodies and use them to infiltrate in places. You can drag dead bodies and hide them.
Payday 2, you are able to finish misions using stealth only, you can use security cameras and other devices/ tools, you can take hostages using ropes and exchange them to revive players quickly, you can hide dead bodies inside bags.

That plus what you already are doing, plus being able to drive vehicles, sounds really awesome. Take this into consideration before you decide to add gameplay features, you could do something really interesting.

https://www.youtube.com/watch?v=gk8OWX85PXA
https://www.youtube.com/watch?v=1LVDm0CyKUQ
https://www.youtube.com/watch?v=MI2_1D1RwOE

EDIT:

Placing barricades could be nice, imagine for example being able to place wood pallets on windows. Because you know, after all at the beginning is stealth, if stealth fails, its time for entrenchment, if entrenchment fails, its time for diplomacy, and if diplomacy fails, you better run haha

"Instead of making a game you hope many people will like, it's sometimes better to create a game you know a few people will love"

''My intention is not to create something that won't be hated; it's to create something that will be passionately loved''

Dgreen02's picture
Offline
Last seen: 4 years 10 months
Joined: 05/12/2013 - 12:58am
Points: 9001
Sounds really cool man!! All

Sounds really cool man!! All the building blocks are in place currently to do pretty much all of what you describe. Right now though focusing on core elements of the project. This is fantastic stuff though, I've got a document typed up describing the project in a bit of detail, but I've not made that public yet. Once I do, it should make it easier for you to determine what is possible/not possible within the game's framework. One of the first things to do in the releases after the first "early adopter" release will be to add the giant bank building I have into the game!!

- Dan

nightovizard's picture
Offline
Last seen: 7 years 7 months
Joined: 10/05/2013 - 12:39pm
Points: 1401
a giant bank building nice!

a giant bank building nice! do you think you'll be able to make 2 versions of it? more than 2 versions, I mean that the vault could be placed in 2 different places inside the building, and each time you play the location of the vault/drugs/gold/money... is random. Criminals could know the location of those, but vigilantes would not, and as there are 2 possible buildings to stole something from, and the money is randomly placed, it would not be easy for vigilantes to locate the criminals, which would help balancing both teams.

in singleplayer, youre epretty much a one man army, but in mp teamplay would be very important, as its coop (AI Police) and versus (enemy player team) at the same time. Of course you could add gamemodes that are only about coop too. but I think that that versus and coop combination would be a success.

edit:
Placing barricades could be nice, imagine for example being able to place wood pallets on windows. Because you know, after all at the beginning is stealth, if stealth fails, its time for entrenchment, if entrenchment fails, its time for diplomacy, and if diplomacy fails, you better run haha

"Instead of making a game you hope many people will like, it's sometimes better to create a game you know a few people will love"

''My intention is not to create something that won't be hated; it's to create something that will be passionately loved''

Dgreen02's picture
Offline
Last seen: 4 years 10 months
Joined: 05/12/2013 - 12:58am
Points: 9001
Right now the bank is

Right now the Bank Building's interior is constant/the same all the time, but I could break it up and procedurally generate the interior. I've read a lot about previous games who've done procedural work, and it seems that you can spend a lot of time working on something then have it not really be that important in-game, so we can try w a static bank model first then expand.

I think the challenge and interest would be getting out of the procedurally generated city to the random exit point on the map ? Obviously determining the best randomized distance the police team spawns from the scene would be important [ more for the standard bank robbery/heist gameplay mode ].

Tons of potential here, if the games proves fun, etc. I don't think procedurally generated interiors for the bank would be an issue at all.

Thanks for your input/feedback/ideas!!

- Dan

nightovizard's picture
Offline
Last seen: 7 years 7 months
Joined: 10/05/2013 - 12:39pm
Points: 1401
mmm I think that cops could

The escape could be done this way: criminals take a van or special vehicle, they drive until they find a place to, more or less, hide it. after stealing, criminals have to use that vehicle to escape (they drop everything in the vehicle) , then drive to a certain location or garage, then transport the bags to a certain place marked in the map and the floor, and if everyone that is alive is inside the marked zone, they win (could be a helicopter extraction or a safe zone who knows). This way you would take advantage of the driving feature too. car firefights sure sound cool.

about bots spawning... mmm I think that cops could be droped using helicopters, and cars could spawn in certain areas (not in the eye of sight of the player of course). The other option too would be to expand the city and create roads with invisible walls for the player, where cops and civilians and other stuff can come from if necessary.

You could try to spawn the police and other stuff inside the city, but you know, if you spawn too much in a small area that would be a problem, and cities are not that big. Maybe you should just try and see if it works, while taking into consideration multiplayer, where different players can be in different areas far from each other. If you divided 8 players all around the map in equal portions, would the players be able to see the cops and other stuff spawn? that's the question.

Invisible walls are not that bad, but make sure there is enough gameplay area for everything. The other option is the one about ''return to the battlefield in 10 seconds or die'', maybe this one is more realistic but personally I prefer the invisible walls, so you don't have to worry to die in the middle of the outside of the map, being unable to return to the battlefield.

So either you should make really big cities with so many streets where bots can spawn, or you can add invisible walls and make bots spawn from outside the gameplay area, and come to the playable area from there. This last one seems to be the best option.

Another thing I considered are garages, there are some garages all around the map, police cars and police vans spawn inside of them, then the doors open and they get out, there is an invisible wall so players cant try to get inside the garage. (The problem is that it would be very strange you know, police coming from random garages is not common lol).

I think you should consider a casino too: Stores, Banks and Casinos could be the main objectives in multiplayer, then as secondary missions you could transport weapons or drugs, make business with AI bands etc... These would give extra points and experience, and even maybe some AI could return you the favor by disabling alarms, cameras etc or placing health or ammo in hidden places etc... which would make the main objective easier. Of course these secondary missions in multiplayer could be main missions in single player, but only from the vigilante perspective (as you only play as vigilante in sp).

Edit: Another posibility is to take all the lights out when its dark, you could get night vision in a side secondary misión as reward, for example.

Oculus rift would be awesome too, amazing experience you know.

"Instead of making a game you hope many people will like, it's sometimes better to create a game you know a few people will love"

''My intention is not to create something that won't be hated; it's to create something that will be passionately loved''

Dgreen02's picture
Offline
Last seen: 4 years 10 months
Joined: 05/12/2013 - 12:58am
Points: 9001
Niiiice - Yup I've got vans

Niiiice - Yup I've got vans and panel trucks created already :-D You read my mind man. lol

Sounds great.

- Dan

nightovizard's picture
Offline
Last seen: 7 years 7 months
Joined: 10/05/2013 - 12:39pm
Points: 1401
Cool!! Haha hope you Cn add

Cool!! Haha hope you Cn add most of those features, and im pretty sure you already have some ideas of your own :) its funny though, some time ago you said you wanted to make a simple game, but this doesn look simple anymore haha this could be pretty much a game that could bé recognized by many People, after all i dont know of any other game where you can use stealth in a multiplayer versus, steal banks and that stuff. I think multiplayer is going to be the key factor, even more than sp i would darée to say. If you manage to make it right, oh man, Ill play this a lot.

"Instead of making a game you hope many people will like, it's sometimes better to create a game you know a few people will love"

''My intention is not to create something that won't be hated; it's to create something that will be passionately loved''

Dgreen02's picture
Offline
Last seen: 4 years 10 months
Joined: 05/12/2013 - 12:58am
Points: 9001
Yea, lol - well this is

Yea, lol...well this is simpler than Killing Horizon - but I'm really leveraging the 2+ years of work I put into my engine since 2012. It's starting to pay off - now I can make a game like this in ~3 months, if I have the art assets around.

Multiplayer is always great, I'm treating everything as "Offline Practice" currently, so it uses all the same systems multiplayer will eventually use.

- Dan

nightovizard's picture
Offline
Last seen: 7 years 7 months
Joined: 10/05/2013 - 12:39pm
Points: 1401
Nice! Just one more thing,

Nice! Just one more thing, you should make humans look mpre human, what i mean which that is that ypu should add as many body animations as posible, such as:
-When civilian/cop/player stops walking, he looks to the right and the left, looks at the clock, touches his head etc...
- Civillians and others could have conversations with others (not players though, but if they asked you something you could just ignore it).

"Instead of making a game you hope many people will like, it's sometimes better to create a game you know a few people will love"

''My intention is not to create something that won't be hated; it's to create something that will be passionately loved''

Dgreen02's picture
Offline
Last seen: 4 years 10 months
Joined: 05/12/2013 - 12:58am
Points: 9001
Yup, I have 5 human idle

Yup, I have 5 human idle animations already, a lot do what you describe ie: look at wrist-watch, fidget around, etc.

I was going to add conversations and interactions w civilians [ something I had fully integrated w Urban Empires ], but THAT is what will add a lot of complexity to the project. I have thought about it though - we can add things like that in the future once we get into future versions. Right now it's just a lot of work to get the basic essentials of the game functioning ;-)

- Dan

Dgreen02's picture
Offline
Last seen: 4 years 10 months
Joined: 05/12/2013 - 12:58am
Points: 9001
Traffic System + Traffic Lights In-Game

Hey guys,

Here are screenshots of lots of vehicles in the city. The white polygon debug output in front of the vehicles is the detection zone for traffic vehicles so they don't rear-end eachother. The images of the traffic cars were taken before I added the intersection/traffic lights btw.

Here are screenshots of the finalized "traffic light" system, which will control the intersections. The box is the detection zone or "area of effect" for that traffic light. The light controller data structure determines the states of the lights in each intersection.

Close up of an intersection

Generated for the entire city

More updates soon!

- Dan

Dgreen02's picture
Offline
Last seen: 4 years 10 months
Joined: 05/12/2013 - 12:58am
Points: 9001
AI Traffic Simulation Bubbles + Brake Lights + More ...

Below are some screenshots of the "dynamic vehicle-traffic simulation bubbles" that surround the camera and maintain a constant number of traffic vehicles in the scene/world. Of course this is totally adjustable traffic density and radius. Obviously the blue lines, etc. are temp debug output.


I also got lots of other touches like brake lights on all vehicles working, and interior steering wheels working properly in all situations.

I've also made a lot of progress on things that can't really be shown in screenshots, etc.

More updates soon!

- Dan

nightovizard's picture
Offline
Last seen: 7 years 7 months
Joined: 10/05/2013 - 12:39pm
Points: 1401
I can't wait for more updates

I can't wait for more updates :) keep the good work.

"Instead of making a game you hope many people will like, it's sometimes better to create a game you know a few people will love"

''My intention is not to create something that won't be hated; it's to create something that will be passionately loved''

Dgreen02's picture
Offline
Last seen: 4 years 10 months
Joined: 05/12/2013 - 12:58am
Points: 9001
Thanks man! I've already

Thanks man! I've already rewritten my entire client/server for my engine, for the multiplayer components, using much newer RakNet netcode. All works great already. I have also recently coded support for the Oculus DK2, and positional VR tracking, it's working great!! Made lots of other progress too... Remaining a bit silent, bc I should have cool announcement soon!

- Dan

Log in or register to post comments