0:51 "You can see the vehicles obeying the traffic laws" **Screaming in right-side lane**
@javidx95 жыл бұрын
Yes, yes, I cant spell XD... Please permit a bit of background as to why this video is so long. It's effectively two videos in one, because the design changed considerably from Part #1 when the community showed an interest in creating models, assets and missions for it. As such, I wanted to show the changes and bias the engine design towards modification, but also introduce the next phase of the project: autonomous vehicle and pedestrian behaviour. The following videos in this series will not be this long, going back to my regular format of one topic per video. For your convenience I've added timestamps to the video for the two distinct sections. At 5:23 I discuss the project restructure, alongside using olcPixelGameEngine in OOP environments, using Lua to externalise game settings and asset management. At 42:18 I show how I've implemented NPC behaviour to bring the city to life, by defining a bidirectional track system with patterns to regulate traffic flow. Finally, this section concludes with a brief description of how the automata propel themselves around the track system and decide where to go next. No doubt, there is a lot going on in this video, but please check out the source code in the link above. It's a snapshot of the code in this video so will remain relevant.
@javidx95 жыл бұрын
@@shnmpoyscnhvupibvhpoyseuxv8560 I love lamp
@cpu_UP5 жыл бұрын
I love mods. Creating them, administer them, improve them, port them. So I fully give credits and support for this decision of Javidx9.
@cpu_UP5 жыл бұрын
P.S. I love burgers made by myself.
@michaelmahn43735 жыл бұрын
As far as I am concerned it could be even longer. XD
@goshisanniichi5 жыл бұрын
std::unordered_map has constant time extraction, so it's probably better for use in games where quick retrieval is more important. std::map is a red-black tree whereas std::unordered_map is a hash table.
@veda-powered5 жыл бұрын
You know the video will be good when a title like that is not clickbait. This new series is awesome!
@mariovelez5784 жыл бұрын
Hey, I know this was essentially a 2-in-1 episode, but when is part 3 going to come out?
@astronime5 жыл бұрын
Can’t wait for part 3!! Not only is the presentation and code wonderful and intuitive but you’re ideas and flow from project to project is extremely well thought out. Can’t be grateful enough for the content you release, you’re turning me into a much more confident coder!
@quicktastic5 жыл бұрын
Wow. So much information here. I really like the block diagramming at the beginning. It is so helpful for getting your head around what is happening. Also, the descriptions of the structure of a project like this as it moves along in development I find extremely informative. Thank you for uploading this.
@JayTheNegotiator5 жыл бұрын
If you ever up and decide to make your own Udemy course, you easily have my purchase. Hard to find someone who explains things so clearly, thanks for doing what you do!
@moofymoo5 жыл бұрын
now invent time machine, go back to october 20, 1997, and release this one day before gta1
@ogr24 жыл бұрын
I am sure that on that time, the computers can't handle this kind of engines very well XD. The first GTA was all sprites.
@PetrPss4 жыл бұрын
@@ogr2 No, it wasn't. Houses, fences, ground, bridges - all was in 3D. Cars and pedestrians - yes, sprites. But top-down view doesn't mean it's sprites only. Doom used sprites for monsters, power-ups and projectiles. Is Doom 2D?
@ogr24 жыл бұрын
@@PetrPss Doom really is 2D making the illusion of 3D. You can make the illusion of a 3D with some "techniques" like in Contra 1 when you passes the tunels.
@PetrPss4 жыл бұрын
@@ogr2 Ok. What is 3D then?
@ogr24 жыл бұрын
@@PetrPss Why the question?, in games, the 3D world is a projection in 2D. Most of the games in the past that make an illusion of 3D doesn't work with meshes like the engines of this time, some of them deformates the sprites to make the "illusion" of perspective.
@Siminfrance5 жыл бұрын
You have a great 'teacher' voice and a great way of explaining things :)
@dopplegangerdavid11 ай бұрын
It's an interesting traffic system, but after looking through GTA 2's map editor, I can see that they used a different system. For one thing, each of the tiles in that game is actually a separate lane and that allowed them to create roads of a variable number of lanes. The tiles could also be manually rotated and given a slope instead of the direction being automatically calculated by the editor.
@youngknight55892 ай бұрын
Im wondering how they handled traffic control with the traffic light zones
@guillotine4 жыл бұрын
Really would love the next part to this series! Been watching through all your videos and I've learnt a lot, really enjoying this one particularly (:
@InfiniteCoder012 жыл бұрын
+
@gamedeveloper90984 жыл бұрын
if this is isn't awesome and difficult then I don't what is. Hats off to javidx9!!!
@XEvil95 жыл бұрын
Amazing, everytime it makes me wants to make own game engine x)
@javidx95 жыл бұрын
Lol, do it Nick! Do it!
@bubuche19875 жыл бұрын
I will go against the answer of javid (sorry). Unless you are sure that you want to make a game =>engine
@XEvil95 жыл бұрын
@@bubuche1987 Good advice man, but I'm working with unreal engine for years
@javidx95 жыл бұрын
No need to apologise, its completely sound advice. I take the approach of if you want to learn about wheels, there is no harm in reinventing it.
@a.aspden3 жыл бұрын
@@javidx9 Any plans to continue this or is it a dead one?
@killianlomax82379 ай бұрын
One simply wonders will there ever be a part 3? 😅
@Diamonddrake5 жыл бұрын
Fantastic video, the system for working out how automata can inhabit a cell was very educational. Very interesting problem to solve.
@WernerSwindon5 жыл бұрын
Discovered your channel recently. Fascinating content !
@vahidansari48205 жыл бұрын
Amazing video as always, Javid! I love your videos, especially the game engine ones. As a c++ beginner, it really helps to understand how the core fundamentals are applied to more substantial (and fun) projects. Can you please create a c++ coding tutorial for us newbies out there? Pretty please?
@petersuvara5 жыл бұрын
Nice! I made a game like this for GBA back in 1999 in RISC Assembly.
@danielmyers84085 жыл бұрын
javidx your videos had help me a lot and i thank you and make more Big projects..
@asero82.5 жыл бұрын
Excellent, thanks for sharing your knowledge and passion 👏👏👏👌
@garychap83843 жыл бұрын
Roundabouts! Dammit man, they're what sets us apart from the barbarians! ; ) .... Oh, Hi America... didn't see you there XD
@tommytomtomtomestini38945 жыл бұрын
Ah man, its almost midnight and you post this.... I gotta get up in 6 hours for work x.x Have to watch it when I get of work 👍
@syne14565 жыл бұрын
This is getting more interesting, imagine if he makes a 3d rpg!
@skaruts2 жыл бұрын
I think it might be worth considering for the future, that GTA levels are built in a voxel-ish kind of way. I noticed this when I tried GTA2 level editor. That makes level editing easier and more versatile in terms of the shapes of buildings, but especially because it allows elevations and slopes, overhanging bridges and pathways or building entrances (and in GTA2 there are also metal structures connecting buildings across roads), and also the water, which, in GTA, appears when you lower the ground to the lowest height. And, iirc, in GTA2 editor, you could hide specific faces, such that you could, for example, make railings by leaving just one face visible with a railing texture. A proper editor that supports this might allow the community to build entire cities. :) I found GTA2 editor quite unintuitive. I've tried building a better one in Godot Engine a few years ago, and I think it's quite doable -- I was a noob and I was kinda managing to get it done, so... I'm thinking of picking up that project again, and follow up with the knowledge from this video, which I appreciate greatly. :)
@jw2002 жыл бұрын
I already made new GTA2 editor in OpenGL. I even had videos on my channel. Bu they are hidden atm
@parabalani5 жыл бұрын
You're a good man. Thank you.
@javidx95 жыл бұрын
Cheers Parabalani!
@justinrichardsmusic5 жыл бұрын
I was hoping a new video in this series would come out soon and man was I not disappointed! You have put a great deal of work and forward thinking into this project and it is going to be really informative for me and a great deal of others who are interested in proper game design to learn from. It doesn't matter if it takes months for another release because it will take that long for most of us to sift through the code! Great job as always! Ps. The car looks cool with lighting! But I question the grey colour? Looks a bit too similar to road surface in my opinion, i ditched it in testing and went with black and white for neutral options...
@javidx95 жыл бұрын
Thanks Justin! Im hoping to get people a bit more involved on the discord to shape the look and feel of the game. As for the car, That's simply the model you sent. I guess the greyness comes form the light not being directly above, or not quite pointing the right direction. I'll look into it!
@justinrichardsmusic5 жыл бұрын
@@javidx9 i see... perhaps the light intensity is set to a low value like 0.1 or something? The material intensity is set to 1.0.
@inayatkhan20615 жыл бұрын
I've discovered your channel today, you're amazing.
@javidx95 жыл бұрын
Hello! and thanks Khan!
@TheFinagle3 жыл бұрын
21:30 "We will have to be careful not to have the same name in our Lua file" - This is a good time to practice "always validate your inputs - even your own inputs". A simple 'If name already exists, skip' somewhere would be a good enough gate.
@samuelhulme83473 жыл бұрын
Nothing can stop me from being a programer . I’m all ready quite a good one
@cheaterman495 жыл бұрын
32:49 Yesss the lights are back! Vegas, baby!!! ^__^
@laureven5 жыл бұрын
WOW ...You bring so much value to those who like programming. wow again :)
@Maxjoker985 жыл бұрын
In the code you showed about the texture loading in Lua, I think you're corrupting the Lua stack, because you don't pop 2 values for each lua_next(Which always puts 2 extra elements on the stack, the key and the value, even if it's an array-type table). Haven't tested it though, just noticed it while watching.
@davep7176 Жыл бұрын
Sorry if this question was already answered in the video, but I didn't notice if it was...But what is the point of using Lua in your C++ project? Couldn't the same thing be done with either JSON/XML or just done inside a C++ script?
@alexanderhuliakov60125 жыл бұрын
Would be cool to see sort of smoothing on water edges.
@emmadrew504 жыл бұрын
are you gonna make another one of these?
@WolfLou4 жыл бұрын
Ey amigo con que libreria aplicaste el lerp en el minuto 1:04:24 ???
@mattwhelan135 жыл бұрын
great video but have you considered drawing with a light coloured text on a black / dark grey background when using oneNote instead of black on white. I find it really jarring when you switch between dark mode VS and a full white oneNote
@JoshRosario3103 жыл бұрын
Any chance of more videos in this series?
@mr_noodler3 жыл бұрын
This is legendary content!
@TheFakeVIP4 жыл бұрын
Javidx9, planning traffic since May 2019.
@nagualdesign5 жыл бұрын
Automata, shall I compare thee to a fruit?
@mikea6835 жыл бұрын
Finally! My dreams of playing GTA:Tunbridge Wells is becoming a reality!
@timaaos39035 жыл бұрын
YAY anew part of crime city
@ianciti5 жыл бұрын
okay what you did there. with putting the city cells in that data tree structure like that. that's almost exactly how BSP rendering works.
@ogr24 жыл бұрын
Hi, javidx9, I am having problems with the PixelGameEngine console, I am running the application at 9FPS, when with the ConsoleGameEngineGL I was running at 60FPS. What do I need to configure in my computer to make the engine work at a good framerate?
@javidx94 жыл бұрын
Hi Oscar, make sure you compile in release mode
@ogr24 жыл бұрын
@@javidx9 But I see in your videos that even you compiling in debug mode, you have a good framerate. I have compiled in release mode and I have a little better framerate, but lower than with the ConsoleGameEngineGL version.
@ericwoll4 жыл бұрын
"Javid was here"
@bubuche19875 жыл бұрын
I can't see video when I am online (during the evening) I can only see them when I am offline (I download videos on a usb key to watch them during the day). So, I started to write an answer, but it becomes veeeery long. I planned to post it on a forum of yours, but it seems that your forum is down for the moment ("509 Bandwidth Limit Exceeded"). I don't have any problem with this, at all, I just say it in case you don't know. So, to try to make a very short answer: 1/ you'll have a hard time saving/loading your game. The information of the game state already starts to spread in every single tiny object everywhere. 2/ I am not sure that it's a good idea to store in nodes both entering and leaving tracks. I think that it's the perfect case for an oriented graph, where you store in each node only leaving tracks. I think that it perfectly matches the traffic laws (if the google translate is correct for this term "code de la route" ). 3/ If the police can't leave the road, it will not be hard to escape from them. I say that even though => I never played a single gta in my life
@javidx95 жыл бұрын
Phew and thanks David XD. I'll try and answer some of your points. Saving and Loading the game in this instance is quite trivial. I do not need to save anything other than the players inventory and which quest they are up to. The city is static, and all the NPCs and pedestrians can just spawn as required. This is typical of the early GTA games. I started with directional graphs as it happens, but after some analysis I realised that nodes only have one entry point and at most two exit points. I felt it was simpler to just deduce the appropriate direction at run-time, and it reduces the required number of edges I need to add to the graph. It also allows me to be a little more creative with graphs without concerning myself with dead-ends by connecting things together that "shouldnt" be connected. On the whole, the police wont leave the road, they may skid a little, but they can travel quickly and there are many of them. I intend to use a combination of A* and Wave Propagation to guide the police to the player. I dont feel that any automata need anything as sophisticated as A*, they exist in the world so briefly that most of the time the player will only see them walk pretty much linearly for a few cells, before they are despawned. I can save myself a great deal of processing overhead by making this simplification. That said, I will have A* functionality in the game for some of the mission objectives. I plan to use the "Police" track as the A* network as they are just connected adjacent cells. As for NPCs with affinity, again this is way beyond the simulation I am trying to achieve, I dont think I'll even have the ability to enter buildings! As for allowing building cells to contain their own nodes defined by the building designer, I had not considered that and is well worth thinking about.
@joshinils5 жыл бұрын
I can't not see the output window. I have set it to autohide, that works qute well for me. As for the task bar, for video i would probably use VS in full-screen mode, without the task-bar.
@cpu_UP5 жыл бұрын
Just a random comment. Your game is for UK, and Japan (maybe some other countries), your cars drive on the "wrong"[?] direction :P
@javidx95 жыл бұрын
Pffftt... wrong side...
@cpu_UP5 жыл бұрын
@@javidx9 "...Because I am UK..." 48:58
@mistervoldemort75405 жыл бұрын
I noticed that too lol. As long as they're not gonna crash...
@lauram59055 жыл бұрын
I was thinking it would be useful to add a directional flag/boolean to the citymap's class, so it could be imported and have the tracks recalculated based on that
@guderian5575 жыл бұрын
javidx9 >75% of all countries drive on the right side. Should probably make that the default and and a configuration option or setting to make it left sided, to make it less confusing.
@renato360a5 жыл бұрын
You lost me when you started explaining British road orientation...
@clonkex5 жыл бұрын
You mean normal road orientation :)
@PetrPss4 жыл бұрын
@@clonkex Same kind of "normal" as imperial system of units.
@clonkex4 жыл бұрын
@@PetrPss Metric is normal. Same as right-hand-drive.
@skaruts2 жыл бұрын
Watch the video on a mirror. :)
@DeepestDungeon5 жыл бұрын
When the next part coming out?
@javidx95 жыл бұрын
Once my Nes series is finished.
@smartito_975 жыл бұрын
Guau!!!! Esto es increible
@javidx95 жыл бұрын
lol thanks Sergio!
@smartito_975 жыл бұрын
@@javidx9 I don't speak usually English (this is ctrl+C ctrl+V from Google translator, sorry 😓), but I wanted to tell you that your programming super powers leave me completely perplexed, it's amazing. I like your videos a lot and they inspire me to continue with my own projects. Thank you very much for the work you do.
@RobotronSage2 жыл бұрын
''i wanted a more visual programming'' .PO.OP. PP.P.PP O.O.O.O .P...P. O.O.O.O PP.P.PP .PO.OP. ''The P is for pedestrian'' hahahhahahahahahahaha
@pauldavis56655 жыл бұрын
Now make a 3D version of it for the next challenge. Give Rockstar Games some competition in the 'Car Based Crime Game' genre. :-D
@aiteron5 жыл бұрын
Very cool!
@jw2002 жыл бұрын
Part3 please!! I can donate
@EmmittBrownBTTF15 жыл бұрын
to calculate nodes per row of cells use nodes_in_world_width = 6* cells_in_row+is_wrap_around?0:1 sSince cell[0].node[6] is cell[1].node[0]. in world space find a node by world_nodes[cell.y*6+in_cell_node_y % nodes_in_world_height][cell.x*6+in_cell_node_x % nodes_in_world_width]
@mrcyberpunk5 жыл бұрын
this is really cool.
@mahmoudabdelsattar88605 жыл бұрын
Magnificent .
@BondThePaul5 жыл бұрын
Hey! I have been following your channel. Your videos are awesome. Before i know about the olcConsoleGameEngine.h, i have been making a pixel drawing program like mario paint by my own engine.But there is a problem that the frame rate is too terrible.By using your engine, the frame rate is much more better. So, can you tell me how can you do it so i can improve my game engine ? Thank you very much if you can help me with this problem.
@randominternetuser51235 жыл бұрын
hello javidx9, a new windows 10 update is coming that is going to change the terminal. will this affect the olcconsolegameengine?
@anandsuralkar29475 жыл бұрын
Someone plz link first video
@AntneeUK4 жыл бұрын
Awe Tomato: the most awesome tomatoes 😁 Never heard automata pronounced that way before. "or tom a ta", rather than "or toh mata". I want to mod this with tomatoes now... Oh, wait... I can 😁
@nycoshouse5 жыл бұрын
hello, did you tried godot engine ? it's in pythonish language GdScript or C# mono
@Ateur_Dev Жыл бұрын
Hey, I know this was essentially a 2-in-1 episode,
@ASeventhSign5 жыл бұрын
YES!!!
@TheRojo387 Жыл бұрын
This is just the original Grand Theft Auto.
@glebfedorov26015 жыл бұрын
Top down city based car crime game. How do you do fellow kids?
@yaroslavpanych20675 жыл бұрын
It took me a time to remember that you are from UK, so that is why those cars driving on wrong side of roads. Do you have somewhere a switch/define which rearranges it to right side traffic roads?
@javidx95 жыл бұрын
Its certainly possible, but currently its not a simple switch, It could easily be made though, so something to keep in mind for later builds
@clonkex5 жыл бұрын
You mean the cars are driving on the _right_ side of the road ;)
@spectrecular97215 жыл бұрын
9:46 - My OOP OCD really wants to make "cops" subclasses of "cars" and "people"
@PetrPss4 жыл бұрын
In this kind of game "cops" are "cars". Until their AI decide to stop and proceed to catching a criminal on foot. Then they create new "people" objects.
@jp33545 жыл бұрын
You would do great at teaching programming courses. I bet you could make up some udemy courses and they would be very popular
@only4posting4 жыл бұрын
I wish I could go back in time, and change a few things... one of them would be learning how to code...I am sure I would have created a few nice apps that many people would utilize. Unfortunately, in order to become, not even 'as good', but at least , 5% as good as you, it would require a bunch of maths... Because no matter how good a developer is, his skills will directly depend on how good his algorithms are. And more efficient algorithms mean more complex maths.. And when we start dealing with audio...video...physics, etc, that's another world. So many ideas, sent to the wc, because I can't code... Sure, it's never too late to learn something... I wish I could code a midi file editor... among many other things. I kind of envy the channel owner... the guy is a genius, no doubt about it.
@neph43725 жыл бұрын
Finally!
@onlynamelefthere3 жыл бұрын
still waiting on episode 3 :/
@kisliylemon80665 жыл бұрын
Awesome
@Jkauppa3 жыл бұрын
doom^2, "boom", with the geometry based rendering, path-casting with barrel-camera and sphere z-uv-geometry-buffers only for lighting
@Jkauppa3 жыл бұрын
it just need some glue code to implement it, or octree if you want to have all-in-one physics and draw first ordering
@madman35144 жыл бұрын
Can you make this game in android seystem
@Codethe_Road5 жыл бұрын
*thumbs up*
@jsflood5 жыл бұрын
Amazing :-D
@kepeb15 жыл бұрын
Beans automatas?
@deniskirin60075 жыл бұрын
и так шаг за шагом, играючись, Бог создал мир...
@philipfry94365 жыл бұрын
You better complete that project. I am so sick of following programming videos that get forgotten after the 'platform layer' and a stupid 'entity component bs'.
@eragg05 жыл бұрын
GetPostion :D
@emberprime96965 жыл бұрын
cloud water
@AI-ec2qb4 жыл бұрын
What do you think about God? I appreciate your honesty.
@sevenedus5 жыл бұрын
If anyone know, who made 2 dislikes?
@javidx95 жыл бұрын
People are entirely entitled to like or dislike my videos. However, Im aware of a small group of individuals that have been banned from the OneLoneCoder discord server for inappropriate behaviour that systematically dislike my stuff now. Its fruitless however as im not too bothered about internet points. 😂 but "likes" do help the videos get found!
@jp33545 жыл бұрын
Rockstar
@Ateur_Dev Жыл бұрын
Can’t wait for part 3!! Not only is the presentation and code wonderful and intuitive but you’re ideas and flow from project to project is extremely well thought out. Can’t be grateful enough for the content you release, you’re turning me into a much more confident coder!
@Ateur_Dev Жыл бұрын
Wow. So much information here. I really like the block diagramming at the beginning. It is so helpful for getting your head around what is happening. Also, the descriptions of the structure of a project like this as it moves along in development I find extremely informative. Thank you for uploading this.
@Ateur_Dev Жыл бұрын
If you ever up and decide to make your own Udemy course, you easily have my purchase. Hard to find someone who explains things so clearly, thanks for doing what you do!
@Ateur_Dev Жыл бұрын
Amazing video as always, Javid! I love your videos, especially the game engine ones. As a c++ beginner, it really helps to understand how the core fundamentals are applied to more substantial (and fun) projects. Can you please create a c++ coding tutorial for us newbies out there? Pretty please?
@inayatkhan20615 жыл бұрын
I've discovered your channel today, you're amazing.