Skip to content
View in the app

A better way to browse. Learn more.

Learn more

Dispatch Sim

(continuation of conversation with Mikey)

Yup roads would be limited to 2 lanes as it would only be simulating a tracking system which would just use general location. I wouldn't actually need AI Traffic so that makes things easier. Though I may look into something like traffic lights so that vehicles don't just go straight through every junction they come across. Can probably use something similar to EM4 where if a vehicle is in a certain box collider it will be stopped until the light is green (like the VOs in EM4). Things like people or direct player control of vehicles won't be a problem either as they're unnecessary, just tell the vehicle what incident to go to and it'll go. I think the biggest challenge for me would be trying to get the roads to work, since I would think they'd need to be paths to not only define the lanes but also direction. With my boat test it was easier because on the sea he can go wherever he likes and whatever way he likes. If we did that on roads then a multiplayer session of GTA would probably be classed as realistic.

I used the 'fake 2D' method for the boat thing too, as you can't use a NavMesh 'standing up'. Looks the same with more options and less tweaking to things to get them to work 'standing up'. As you said, I'm lucky in that what I need are core assets are need little work to get them going. 

Featured Replies

Well, here's the deal; most of what you need I can help you out with b/c i've got far more advanced systems than what you need, so some adjustments (fine-tuning) gives you the more basic result you need. It's up to you if you want stop lights or stop signs, it depends on the environment, both work entirely different (already know how to code stop signs just havent implemented yet)....  That being said if you intend on having traffic roaming about your game, you WILL require an AI package to send them around and make them do what they do, as I said I already built simple ones as well as complex ones, the complex one is most certainly wrong for this project.... The basic one might work reasonably well for it, either way i'd just use something similar to mine with some alterations to how it behaves/handles since it doesnt have as much to worry about.  Depends on the complexity you want and how far you want to push the traffic AI (if they collide with shit and all that bla bla bla)..

The user-direct control believe it or not is in fact EASIER to deal with than the AI-driven goto location method.  For your project I'd strongly suggest using the floor baking method splitting items up as I've described earlier, this will basically ensure unless the road is 100% obstructed they will prefer the road over the sidewalk, the sidewalk over grass/terrain, and flat out won't try inaccessable shit like water.  Their behavior will be fairly similar to em4's although the obstruction detection in unity is by far much much better than em4's was/is.   Moving traffic around is a bit problematic but you can come up with a basic "redirection" method that should suffice quite well, so long as you name the roads correctly anyway....

I suggest the "faked" 2d method b/c you're mostly working with "box" shaped objects with textures on them to make them appear more realistic, it keeps the weight down which helps performance and makes life easier to develop with...  The basic "package" of what you want I can tell you how to setup most of it since i've already crossed those bridges, the floor baking aspect is a fucking pain in the ass, I have to look into it for much the same reason in my game, the point-and-click aspect where you can just click on the map and send em to the dest, they find their own way.. Problem is i still have to find out how to "paint" the floor for the break-down of what is classed what.  But for point-and-click it's the optimum method used by all the unity-based "fake" 2d games, they all use that same in-engine ai pathing method (which is actually extremely good with ppl and shit like that, spotty on cars b/c it wasnt meant for items which are long such as a car).

Your basic "core" of what you're speaking on (devil is in the details) is entirely possible, not only possible, but capable of being pretty stable if you don't over-do it.. I don't know how deep you wanna take the game in other aspects, like if it's just a traffic accident game or what... Most items can run on basically scripts which are "public" scripts so others can manipulate them, so for example a character's health has a coroutine started at spawn which just simply counts down the health removing say 2 off of 100 per 5secs, just keeps doing that over and over again, now the "health" variable is stored as an int within the doc (again public) so that any other script may access this data.. So as its  counting down to 0 a medic for example can do some "healing" and add to the health variable, if it hits 100, stop the health drain (blood drain) whatever the hell you want to make it, or however complex you want to make it.. All these kinds of things if you "isolate" each one so it's not running 100% real time (per frame) and you ensure they only "active" on certain conditions, don't actually take much to run, avoid "void update" operations, keep them slimmed down and you won't get the notable stutter many unity games get in your project.

  • Author

I shouldn't need AI traffic, unless I were to make them invisible so that when the player's units are at junctions they're not always at the front, also means that they can end up in queues. So if you are willing to help me out with that too then that would be a nice addition. Even then it would only need to be a really simple system (no need for lane changes etc) and since the user wouldn't be able to see them it's not a problem if they mess up here and there.

Thinking about it that does make sense. User-driven would simply be a case of getting the game to create a 'target' like in my Boat test wherever the user clicks (then remove when target reaches it and replace if user clicks elsewhere) I believe?

How would a road system work with a NavMesh? As far as I know (though I've not done much testing with it) you can't define directions with it and it's a case of the object will use any of that area going any direction it wants to reach it's target. With vehicles only being bound to roads and not user-controlled I shouldn't need to bake any NavMesh at all would I (as nothing/nobody is going to try and get them into a river or building)?

Regarding the depth I was hoping that eventually I can have it so that a prisoner may need to be transported or a medic emergency requires more advanced personnel etc. I'm basically going for a combination of Missionchief and 911 Operator except with a different look, fictional location/s and the removal of having to purchase your stuff (not trying to make a tycoon but instead just a small simulator where you're having to manage/juggle calls and decide what's more important and where you need to cover), if you've ever played those games.

Okay.... I'm trying to figure out your concept here and I think we're kind of mixing up what you have in mind.  So let me ensure we're on the same Idea before I go too far into this with ya, for ex i don't wanna "add" features/functions if they are not visible to the end-user, just chews more resources where it doesnt really have to...   So confirm which method your game best meets so that I can gather my thoughts and target the gameplay you're going for.

Both cases are top-down but one is more or less "visual support" but more code/text driven response....

Option A is still a 2D method of a game, but in the instance of how it functions it would be more or less pop-up driven, mainly describable as most FB games where the graphics are purely visual and have no interactive value, so you'll see the vehicle roll to the location of the incident when you call it out, but  you are not in control of where it goes or anything like that... IE: Event pops up,  you click the vehicle you want to send and tell it to go there, from there once it arrives pop-ups come up where you handle the incident and all of that.. Mostly this method is text-based with pop-ups, often most FB games function this way, but its option a to work on.. The vehicles and their pathing is basically "fixed" to follow to the random incident, traffic, buildings etc are purely visuals on the "map" (which is to say it actually is just a map style thing where you click on say the FD and then in the GUI get the vehicle options, select the vehicle you want, then pick the incident you want it to respond to (with what equp/ppl whatever in that GUI pop-up) then send it to the incident... Then a pop-up occurs when it's on scene or if you click on the incident (many diff ways to handle that) and you interact there.

Option B is more similar to EM4 in 2D where basically you click on the vehicle/unit, click ANYWHERE on the map and the thing can goto that location and then interact via the GUI for the particular unit so that is to say you can park a fire engine in the middle of the road if you so desired, even though it wasnt going to an event that happened.... This method is more complex because you WILL require some AI behaviors on both the Players and NPCs.... Depends on what you want really and how far you wish to take it....

20 minutes ago, Pottyscotty said:

Thinking about it that does make sense. User-driven would simply be a case of getting the game to create a 'target' like in my Boat test wherever the user clicks (then remove when target reaches it and replace if user clicks elsewhere) I believe?

 

User-driven is more similar to my silverado in my game, although it's a "testbed" setup, I can use the arrow keys WSAD to move that thing wherever and however I want.. This method is by far the simplest since it only requires colliders to slam into if it's going somewhere it shouldnt.... The Point-and-click method works quite similar to your little boat would, with some alterations to keep it reasonably close to on-target... I can probably sort that out one way or another, truth of the matter is I need to figure that one out for myself, though with my system it should be easy enough, the way yours will work we'll have to get a bit more creative.. I'll loan you a script I made that helps setup paths and shit; it will make your life easier on setting up how you want traffic to roll around town, and in the end its probably how the PlayerVehicle will end up getting around as well, through a "pathfinding" nav script.

20 minutes ago, Pottyscotty said:

How would a road system work with a NavMesh? As far as I know (though I've not done much testing with it) you can't define directions with it and it's a case of the object will use any of that area going any direction it wants to reach it's target. With vehicles only being bound to roads and not user-controlled I shouldn't need to bake any NavMesh at all would I (as nothing/nobody is going to try and get them into a river or building)?

That is what i was bringing up, the method i've used for a floor I've not found a way to designate areas to go through IE roads vs sidewalks vs terrain vs blocked vs water etc.. You can put "penalties" onto an object to make it less desirable to the moving person/vehicle... Which means IF possible they will stay to the roads, to further that you would essentially have to tell it to always favor the "closest" waypt bearing to the side the traffic goes to IE stay within 2m of the right hand drive waypts in a usa style road struct.  It can be inverted for a left-hand drive for ex, but that's probably how I will end up handling it, only massively different b/c of how my nav system works, yours would do waypt style start here end here just like em4 does.  You unfortunately DO have to think of things like this because if the end-user can do it, they unfortunately generally will.  The easiest solution (imo) is to make model "blocks" to represent whatever the hell your map needs, IE a road segment, with a sidewalk segment next to it, a terrain segment, water segment and finally a non-passable segment, piece these together to create your "map" and the good news is you can bake them to have different "penalties" going from minor to severe, the vehicles/persons will avoid the things that punish them more sticking to ideal transit paths (aka the roads) this alone will not ensure they stay on the correct side of the road, that is where the extension to the basic point a to point b nav method would come into it.

26 minutes ago, Pottyscotty said:

Regarding the depth I was hoping that eventually I can have it so that a prisoner may need to be transported or a medic emergency requires more advanced personnel etc. I'm basically going for a combination of Missionchief and 911 Operator except with a different look, fictional location/s and the removal of having to purchase your stuff (not trying to make a tycoon but instead just a small simulator where you're having to manage/juggle calls and decide what's more important and where you need to cover), if you've ever played those games.

I've never played those games but I will look them up to get an idea so I understand more what you're going for, the complexity required all depends on what your going for.. From what I've supposed about your game none of it in either format is impossible, one is more work than the other method for basically the same end result.. I'm going to look up your examples to see if I can't get an idea and await your response to what I've written here.

  • Author

Option A is basically what I'm looking for. I'm not the best at describing things so hopefully my two examples give you some sort of idea of what I mean. You basically play as the dispatcher, events generate, you select what you want to send to them and they'll trot along to the calls using the shortest path they can. This is the kind of design I'm hoping to go for if it explains it better -

SHGqKeW.jpg

PK42QXU.jpg

So essentially you want a purely GUI-based system which it essentially is acting in a "dispatcher" role, which really means no requirements for most of the shit i've brought up unless you want a somewhat "interactive" map to be involved in the game system.. What this means is really you'll have a far easier go of it since it's 100% script-based and very little graphically included... Now if you want a more "game" experience/feel vs the full blown system-based gui thing you can do that as well, since essentially you're scripting the thing to do what it does, That also means you can design the gui to show graphically the little vehicles going where they are supposed to go and all that.. Essentially a "satellite map" view where it's just showing either representative dots and/or actual models moving through to the location... Either way is purely visual and has no real factor on the "game" system because of this...

Creating "random" events in unity is extremely simple to do because of the way it works, imo I would have each "event" be it's own script, which is called upon by the "primary" callout script, which at set blocks of time will call upon a "random' event from the list it keeps inside of it, which is purely just the events you want thrown down... Again if you want them graphically shown you can do this, it just takes more effort, text-based games are all over FB for this reason, it's little work to set them up visually and it's mostly script based.

  • Author

Yeah it should be a simple thing to do. Only issue as I've said would be pathing for vehicles. I would think it'll be a case of making multiple waypoints at things like junctions or turns, just as you do in EM4 and when you send a unit it will determine which route through the waypoints is the quickest. I'd also need to add it so it will use the correct side of the road (though this isn't too much of a problem on smaller roads, larger ones it's quite noticeable if they're in the middle).

That's how I imagined they'd be, will probably add it so that they'll only spawn in defined areas too so you can only get certain ones at certain places (so you don't get things like a water rescue on a main road).

Like I said it depends on how you handle the interface/graphics of the thing.. IF you just want a basic map representation of the vehicle, you'd simply need the "map" with dots representing the vehicle moving to a destination.  If however on the other hand you desire an actual city even in 2D (faked) that would require setting up traffic behavior AI systems (which isnt a big deal, I can help you do basic AI for that).  And then unfortunately handling the user-controlled pathfinding which is actually far more complicated.. It's actually figuring out the path that is the difficult part, not ensuring that they stay on the proper side of the road, you can figure out the vector of where they are vs where they are going and "limit" their options so they stay on the paths they're intended to go.. IE if the truck is released NW corner heading SB it would be told that it may only use SB lanes and EB lanes, it would not be permitted to use NB or WB lanes in this scenario, that is the easiest solution to that problem, limit their options in how it may find a path to the tgt so that it must stay on certain lines on the setup.. Alternatively you can use a "centerline" method for emergency vehicles and have it check it's global rotation to know it's orientation to that center line, IE if it's heading 180 true it would then wish to stay 2m to the left of the line b/c it's heading south bound, if it is heading 90 that would be 2m left of the line as well bc its eastbound etc.. the only time for "issues" to that would be in turning which probably wouldnt hurt the visual much anyway b/c it would be transitioning anyway...

well you can "define" spawn zones and only permit the events to spawn within these "VOs".. IE CarWreck, any gameobject named "carwreck" will accept the carwreck event (basically set it active) with whatever variables you want to spawn there..... Have it go either by tag or by name when it's spawning to "look" for the locations accessable by name OR keep them all in a script list so it's already stored and just accessed from that script.  Essentially how my nav system runs is much the same... scripts hold the data which is accessed externally.

  • Author

That's basically all it is, an image that will just head to the target (event) using the quickest route of a series of waypoints. Heading to a target I've already done, however that's been with a NavMesh (so much easier unfortunately) instead of pathing/waypoints. Never thought of the displacement idea with a centerline, I think I'll use that method. As you said, should work apart from when making turns but isn't anything too 'in-your-face'.

I'm currently working on the event generation, seems to be the best starting point as without them I haven't got anything for my units to actually head toward.

Don't worry about events, from the sounds of it you're going to want to use GUI-generated pop-ups that represent the event.. Ie how to handle them (if you're going in-depth on them)... If not it would just be an "update" of on-scene and "working" with countdown timers for em... That part is fairly easy to code since it's purely scripted variables and timers....

The part you want to deal with is the map for navigation....  If you're just going for a mini-map style setup (just larger) where it shows the blip which represents the vehicle leaving it's "station" and heading to the scene I would do that with navmesh+baked terrain setup rather than going through the whole waypoint process... It would save on not having to actually draw/generate traffic and deal with that pandora's box and instead "code" the traffic delays and shit into the transit time of the object to the scene by using area variables (basically VOS which tell it heavy congestion, reduce speed to half) etc...   It all depends on the complexity you want to have visually on how much complexity you have to code for...  If you're not too focused on prettiness and want more function i'd use the large-scale mini-map style format since all you'd have to define is roads apart from the "map" portion to get them from A-B which the internal unity system does extremely well on it's own.  It will save you a ton of time on coding a nav system. I can help you make a waypt system fairly quickly and easily but if it's not important to the "visuals" of the game I would not suggest going down that road just for the sake of it.. Plus you can always "upgrade" systems later if you're content with your progress elsewhere.

  • Author

Okay that sounds good, will leave it until later down the line.

Alright then I'll go for that. To be honest I'm not sure if the GPS tracking is even accurate enough to show what side of the road vehicles are on (and even if they are nobody would notice, especially if zoomed out) so not a huge issue. I was already thinking of having VOs that define that area's speed limit so if I were to add things like traffic conditions then they can just be added/removed from that Int as time goes by. The boundary of the NavMesh can also be reduced so that the blip will stick to the middle of the road and not try and cut corners or stick to one side too.

I think this is an issue that I've always had when attempting to make something with Unity. I've never properly thought it through and just come up with a system I think'll work, even if it's far more advanced then anything I actually need. Thanks for your help with this, maybe this time I'll actually get somewhere.

That's the key problem with unity in particular, because the engine is so "open ended" it can literally do pretty much any insane thing you come up with, but at a performance cost for each one... Thus you do better to decide what is "critical" to your project, and work on the core of those critical tasks FIRST to fill them in, then sort the details once the "core" block is in place on your system... In your case something you want to get sorted in a test-stage at least (not dis-similar to my traffic sim of a base core asset i've got atm) is to get it to where you can pick a place on the floor which the vehicle will spawn from, have it follow the baked path to the destination on the floor map without attempting to go where it should not.. This is done by baking the terrain, it will make it possible to ensure the sob stays on-target (aka the roads), make them visible imo as RED for fire apparatus, Blue for PD, and White for Ambo, maybe Orange for tows (if included).  Later you can make it to where if you "mouseover" a dot it provides in a pop-up more involved data such as the vehicle number/type/destination etc.... For now thou the goal is to get a bastard to come out of it's "station" and head to a pre-defined point on the map... shift that point elsewhere and re-send it, etc.. if it works good to go on that front and we can hit the next stage of it... 

Always start with the "core" of what you want it to do, get that functional and stable THEN add in things, such as adding in speed restrictions and traffic conditions that alter the "state" of that "dot" of an emergency vehicle to slow it down or speed it up accordingly...  They can either be "random" events set to occur whenever, or they can be set to happen at set times of day (such as rush hr, lunch hrs, etc)... Either is possible and all it would do is access and alter the unit's movement data to slow it down.

It's pretty easy to do what you want to (as I understand it) with unity since it relies mostly on the core unity functions.. You'd lose most of your time setting up the "GUI" elements for this and making them functional but also ez to use, an intuitive GUI is not the easiest thing in the world to create so that takes a bit of time to lay out (and more importantly plan out)... From there it's pretty easy to setup the shit to do what you want.. I can loan you "snippets" of codes which can help you out on some of this shit, if you need them anyway.. For now we'll go under the pretense of if you get hung up on something ask and I shall try to assist (so long as it's c#).  Take the time to plan and lay out what you absolutely want out of your game experience, focus on what is "essential" and leave the "details" to fill in as you get closer to completing that "section" of the game.. It does no good to make a complex "mission" task if you have no way to interact with that mission task, no way to trigger it effectively, and no way to get to the mission task in the first place.. Start with things which are "critical" to the next chain in the sequence clearing them one at a time, it's slow going but how you'll actually complete the project to functional.  

Spend too much time on visuals for example you might have a "pretty" landscape, but no idea if your "game" it's self is even possible, and if so how will it perform.  Thus your project might very well die for lack of ability to make the game function in the first place, but you've got a pretty scene that now goes to waste... Notice that I've not bothered filling in my map or adding very much in the way of vehicles on mine?  There is a reason for that, I put in a few "variables" for vehicles to ensure the system worked on several types, even added tractor trailers to verify they work properly.  But I've not added in anything that isnt essential to what I'm working with:  Why?  No point in doing so if I hit a "wall" that makes a critical portion of what i've got in mind impossible to do (or inefficient).  There is no sense wasting time creating something BEFORE you know you can make it work out well, keep that in mind and you'll do well in your project.  Start out with the "core" of it and add/adapt as you go along.  My traffic net started out em-4 style with linear paths, didnt work till several alterations later, then once that worked well was changed to be "different" and more complex, but ironically also more efficient.. I didnt start out with the idea of the huge grand concept first because I wasnt sure it could do the original one to begin with, thus I stepped through the stages to "grow" it into the complex thing it is now... Approach all your tasks that way and you'll be able to get the hang of it and complete the project.

  • Author

This is what I currently have. The unit will follow the road system to the event no problem, no matter where it is (I'll eventually add it so that if the event is in a building or away from the road, the vehicle will be classed as 'arrived' when within a certain distance so they're not stuck trying to get all the way to the event blob). Only issues I have so far is that the 'ambulance' likes to hug the side of the road that is nearest to the event and not stay in the middle. I've made the NavMesh walls as close to the middle as I can before parts of the road are not included in the NavMesh. He also likes going the wrong way around the round-about though this is something that can be fixed later.

Edit:- Since managed to make the boundary even thinner but the Ambulance will still swerve all over the road, even if the agent's radius is smaller than the boundary. 

6b8a47a8f05b499c942433f6fdf809b8.png

Make the current system a pkg (manipulatable) so that I can run it on my unity(I run I think 5.3.4f1)  and I'll take a look at your nav system, the path may be too small for him to get there cleanly so he tries to find an alternative path... It's most likely the physics of your "vehicle" playing into why hes doing the behavior I see in your video, it looks like he's using a turning radius b/c hes "sliding" which you don't want.. I had to do similar to my AI network b/c the fuckers would behave irrational when they  came into turning events... Now a question for you because this is something I gotta deal with too.. How the fuck did  you manipulate the navmesh?  on mine it seems to want to do it on the floor whether I want it all the same or not >(

The issues of them staying @ the road and not going off we can do that pretty easy....  Via the "event" we'll set a waypt ON the road as to where you want them to "stage" for the event, so even though on the "game" event it shows the tgt as a structure, the "real" hidden one will be on the actual road closest to the event.. thus negating that whole mess.  Your roundabout is a bit of a problem b/c the internal net wants to find the "nearest" pathing so if it's nearer to just go northbound, that's how it will want to try to go, we'll have to change the behavior from the internal to an external system for the roundabout to "force" movement through there, but I can help you with that part as well.

 

  • Author

Same ver as me - https://www.mediafire.com/?lv8q6ji1m6oxqjf

The road is actually a separate object so all I do is add the NavMesh to that. I used a similar method with the boat one but because I couldn't make a world map model by hand I found the specular map and converted it from the image to a mesh using Inkscape and Blender. Using a terrain like yours I'm not at all sure how you'd do it, unless you can 'paint' areas to define what can be entered, what is less-preferable etc.

That's what i'm trying to figure out how to do to mine as well, is paint it... The texture it's self on mine is "painted" in unity (neat lil tool but crap if you intend to use the internal nav system) Basically I have to use a hybrid of the tech to do the nav for playable point-and-click I think, so it's kinda similar to yours (only more complex).  I'm at work atm so I have to "timeshare" my effort but I'll take the breaks when I can to tinker with yours to see if I can't resolve your issues you've got going on right now.. The navmesh issues I think I can knock out, the "circle" traffic issue is going to take a script to flip it from using the navmesh data to a waypoint system for that segment... I can write that  fairly fast and it *should* work relatively well so long as you don't have 500 vehicles going through it and/or 500 circles to handle this process since it will prolly have to use "trigger enters) to deal with the change of settings.

Just running it for a first "test" of it I can see what's happening to make it play "bumper cars" when I fix the shit I'll just give you the required assets and tell you how to put them back into your package... She's got no "friction" but mass is my guess so she keeps trying to go instead of staying locked on the path... No biggie, I'll sort that one and see what I can do about dealing with your circle as well (both are fixable in my eyes just going to take a bit of tinkering).

 

  • Author

Thanks, Unity physics are a grey are for me since I only really do 2D stuff and leave everything on default settings. As for the roundabouts there would probably only be ten, if not less on the map so hopefully wouldn't be too resource intensive.

I got your toy behaving correctly (not playing ping-pong with a few tweaks, I still have to find the time to write the roundabout, you want them to go counter-clockwise in directionality correct? IE follow right-hand drive rules?

  • Author

That's good, what settings did you play around with? Planned it as a UK based sim so clockwise for left-hand drive. Would I be able to use the same roundabout system for something like a motorway (freeway/highway, not sure what the comparison is) too where you have two larger roads instead of one with a couple of lanes, or would it not work with that?

The same "system" can be manipulated/altered to fit just about any type of road struct you have to, essentially i'm making it go from your navmesh system to a waypt system for the explicit intent of forcing a path upon the vehicle for that segment, then "releasing" it once it gets closest to where it intends to go...  You'd have to modify the waypts and the nr of them accordingly to get smooth transitions between them, but it should work about the same regardless of where it's applied. the intent is to force the  vehicle to go the proper way instead of going from it's current pos to the most direct pathing which is what the engine tells the obj to do.. I just have to figure out (account for) vehicles entering each way without overcomplicating the system so they can go the proper way and "release" at the right junction.

For your actual asset the main thing I did was slow it down a bit so it didnt "overshoot" given the narrow paths you've got it has a tight turn and simply isnt slowing enough to make them without vectoring off.. My other tweaks made it less wobbly but the key thing was your toy was SLERPING the turns too much.

Idk if you have trillian, if you do let me know it will make communication easier for shit I don't have to do for ya ;)

*borrowing the space to store my thoughts***

proper circle navs setup; have to define pos of the vehagt vs intended tgt, store intended/flip to navs.... flip nav system override.

from defined pos of vehicle + intend tgt get ideal "exit" point, set int var for "exit".  Reset intended tgt, ensure nav to tgt proper.

if failure extend navsys further than round.

  • Author

Trillian is pottyscotty00

Here's your project back, it isnt "bulletproof" yet, but it's got most of the shit in there to do what you want now.  It's missing dependencies for how you want to handle things for ex... Prolly can use some changes too but for now you can tinker with it and at least get an idea of how it works and what to do with it.

 

Guest
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.