Somehow it makes me feel like watching Bob Ross making a painting. Loved it, thanks!
@GregoryTheGr8ster5 жыл бұрын
Gr8 minds think alike! I noticed the same Bob Ross similarity recently, though on a different video.
@jwdonal5 жыл бұрын
You are so right. :)
@decapent3164 жыл бұрын
This is exactly what I was thinking.
@bane_376 жыл бұрын
You are amazing. I am such a visual learner and for years I read about pseudo 3d and the math's involved and never really understood it until this video. You were able to visually show me how the code/math translates to the screen in an easy to understand way. Thank you so much!
@javidx96 жыл бұрын
Hi bane, thanks and no problem! I'm very much a visual learner too, that's why I like to do lots of little programs to learn about specific things.
@abual.yaceininformation31472 жыл бұрын
pleasIf you please, your WhatsApp number is right
@researchandbuild17516 жыл бұрын
This is a great video because it teaches you how to think at the base level, that most games are basic math. It's easy to get caught up in complexity of modern game engines (sprites, rigidbodies, collisions, etc, etc) and overlook the simple solutions for things. Also, I always wondered how they made these old racing games. Thanks for this!
@javidx96 жыл бұрын
Hey R&B, my pleasure. You're right, too many programming videos emphasize the end result and not the journey - thats what I try to do on this channel.
@JM_Traslo4 жыл бұрын
I think the one big difference here might be that you let the player move away from the center. Taking something like Hang-on / Super Hang-On, you'll see the style was to keep the player dead-center and instead offset the track itself to simulate player movement.
@REDFOGSX5 ай бұрын
I recently started to play my old Road Rash game and as someone using Unreal Engine, I can't stop thinking how they could deliver that feeling of 3D collisions when hitting the car, or when vehicles hit the AI at an intersection without being 3D. It would be amazing to have an additional video to this video even if it is 6 years old. 😁
@pedestrian92874 жыл бұрын
Amazing video. Just wish I could think and come up with something like this. The math alone is not too advance but the way it's used is clever. Thanks for the video!
@RukkunSensu5 жыл бұрын
Thanks for uploading this tutorial, I'm trying to do a game in Unity(C#) with pixelArt and i was lack of concepts and ideas. This was very helpfull. The other viewers are right, you are the Bob Ross of Coding.
@RukkunSensu5 жыл бұрын
sorry for my bad english, still learning
@paul80286 жыл бұрын
Excellent video and for the length of it, it's not boring at all like many others. Very well presented and explained. Congratulations.
@javidx96 жыл бұрын
Thanks Pablo!
@paul80286 жыл бұрын
Sir Lone Coder, I have a question for you, if you can spare the time: your video was very helpful in understanding some basics and i even implemented it using LibGDX, but i want to achieve roads like Cisco Heat or Outrun, that are made of sprites. I'm trying to understand how its done, but is giving me some difficulties. How can I render tracks like this video but using sprites?
@metox33884 жыл бұрын
Really well done! It reminds me a lot in "Buggy boy" which I played on a Commodore C64. Thank you so much for sharing your knowledge to the world. I have learned so many things from you.
@achtsekundenfurz78764 жыл бұрын
There's a remake underway. It's called _Buggy the vampire slayer_ - and it's gonna suck more than the vampires ever did... #GamingIn2020 ;)
@rallokkcaz6 жыл бұрын
Javid, these videos are so inspiring and easy to follow. Thank you so much for this.
@javidx96 жыл бұрын
Hey thanks rallokkcaz, my pleasure!
@mrDalien2 жыл бұрын
No hablo tu idioma, pero tu código habla por sí mismo. Eres un excelente programador, y si explicas como programas, pues, eres asombroso. Gracias por el video! Necesitaba un ejemplo para hacer un juego así, desde la consola de comandos.
@dlg95813 жыл бұрын
I have always struggled trying to code a 2d racing game with java. With yours insights, I made a lot of progress.
@higgins0076 жыл бұрын
Such a brilliant illustration of putting basic (relatively) mathematics principles to practical use. Me likey! :)
@javidx96 жыл бұрын
Cheers Paul, more often than not, you only need simple maths to create cool things!
@darryljf72154 жыл бұрын
Great job explaining. I used to play Lotus Turbo Esprit on the Amiga in the early 90's. I was learning C pgmg at the time but I could never work out how they made these type of car racing games. Now I know and it's not as hard as I thought it was !
@cheaterman495 жыл бұрын
I think I agree with your conclusion, and it's the sort of thought I always have after watching your videos - there's nothing particularly difficult here, except maybe thinking of the interactions between all the simple things that are needed - the things themselves are simple, but how they work together is of course a bit more complicated.
@javidx95 жыл бұрын
Thats exactly it, the components on their own are always quite simple, and with experience and practice, you can form those simple components into complex machines.
@techbear825 жыл бұрын
You are god-sent. Thank you for sharing this knowledge. F1 Race was one of the games I played as a child on the NES. Thank you.
@tctrainconstruct25924 жыл бұрын
I converted it to the PGE and it still fits in 250 lines of code. I also shrunk the car a bit, lowered the lap times to 3, and changed the resolution to 256x220 (the same as a SNES or a NES) and added an FPS counter.
@davep7176 Жыл бұрын
Hey, I know it was 2 years ago, but still worth asking... Did you keep and share the code anywhere? I'd love to see the finished, concise version to compare to my own project. Thanks
@adamfryman67892 жыл бұрын
Enjoyed this tutorial, used it to do the same thing in javascript on a canvas. Instead of plotting pixels though I turned them into rects and just had 5 draw calls per row
@chenlin-z2d11 ай бұрын
It's cool, I like it,I'm a student, I' m interested in games, and now I have learned C++,this video is helpful for me. Thank you for sharing.
@elaguy35497 жыл бұрын
Thanks for the video! It's nice to see a video game programming video have explanations for the code instead of just typing it with some music in the background. Keep up the good work!
@javidx97 жыл бұрын
Thanks Elaguy!
@the-code-provider7 жыл бұрын
Man, you're the BEST KZbinr of your category. Thanks.. Thanks a lot !
@javidx97 жыл бұрын
Lol, cheers that means a lot, looks like Discord collapsed!
@the-code-provider7 жыл бұрын
Yes, their server often crash since this morning :-/
@sergiyradonezhsky6344 жыл бұрын
now, the question is, after many many videos watched, have I actually learned to code it myself? answer is no. but that's cuz i'm dumb these videos are absolutely brilliant mate.
@frundok3 жыл бұрын
The whole point of the videos is to teach you how to code so you're basically saying his videos were useless lol
@code-dredd5 жыл бұрын
-"But the player will never know that they're nonsense" -javid@14:23 -"They'll never know.... because you won't be alive to tell them." -Thanos@2019 :0!
@andresmata88596 жыл бұрын
I love your videos, but this one in particular is awesome! Thanks for the great series.
@javidx96 жыл бұрын
Hi Andres, thanks man, I like this one too, one of my faves :D
@spjewkes7 жыл бұрын
I stumbled across your video and it's very good. You've inspired me to try and do more of this sort of thing. I like the use of the console to do the graphics. A neat idea and side-steps a large amount of set-up and fiddling with APIs, allowing you to get to the real meat of the problem. I just need to find a similar solution on the Mac :)
@javidx97 жыл бұрын
Hi Steve. I completely agree! On some of my other videos the community has had discussions and posted source regarding mac and Linux implementations with varying degrees of success. I'd point you there but I'm out and about at the moment.
@spjewkes7 жыл бұрын
Not a problem. I'm happy to go through more of your videos and read the comments :)
@marcosadrian652 жыл бұрын
It's amazing how you did this I will try to replicate in Godot engine I only wonder how do you will handle hills here?
@josegabrielgruber Жыл бұрын
Such a simple and rich video, nice work!
@Teuopoty5 жыл бұрын
It reminds me of a game I played in my childhood. Top gear from Super Nitendo. I liked it a lot.
@thisismyapple68584 жыл бұрын
I am so glad that I understand the mafs he talking about
@FredM807 жыл бұрын
I really like these old algorithms to make pseudo 3D or other tricks to make some graphics, before 3D cards were included into all machines. Thx for this video !
@javidx97 жыл бұрын
No problem Fred, Cheers!
@karenlutas67784 жыл бұрын
recently I been looking for good content thanks
@javidx94 жыл бұрын
Hey thanks Karen, I get a lot of comments now, but ones like this make it all worth while!
@JaimeFins5 жыл бұрын
Indeed, ur really amazing. I'm learning a lot with you. I would love too see a 2nd part of this tutorial on how to implement billboards and other cars and colisions ;)
@surprisingstuff5 жыл бұрын
These are brilliant, so glad I found this channel.
@decapent3164 жыл бұрын
You really have a knack for explaining all of this! If i would subscribe twice if i could
@PhilBoswell6 жыл бұрын
I watched your video on using Splines and now I'm wondering whether that could be combined with this to allow for a funky Track Editor…
@javidx96 жыл бұрын
Lol, wait for another two videos! 😂
@PauloConstantino1676 жыл бұрын
Lovely, but in fact the road should not disappear when it hits the vertical middle of the screen! That means a slope downwards. If the road is in fact flat, it should go on getting smaller and smaller till it hits the horizon at a point. If there is a bend instead, then it should show on the screen far away. See what I mean ?
@davidchan87324 жыл бұрын
I just like this kind of tutorial that program retrospect games from scratch
@CraigPerry4 жыл бұрын
This channel is really well done
@logosknight545 жыл бұрын
I have never done any of this before. But you motivate me to get into it
@NeilRoy4 жыл бұрын
Just watching this again three years later and for your ASCII art for your car you could have used R"( )" instead of L" ". R"()" (including brackets) will not recognize escape codes so you can just put one backslash or forward slash and it will display exactly what you have, no escape codes. There was another similar programming page I seen one time where they also added in hills, which you may have seen in similar games from back then. They should be simple to implement but fun. Also things like trees etc... as well as a wall on one side (like in Test Drive). Could be interesting to update this using the pixel game engine with more features etc. I may try my hand at this myself.
@2kBofFun Жыл бұрын
It was really nice to watch, I do wonder how close this is to original Pole Position like games. Somehow I would have liked it even better if it was non-object code with integer calculations instead of floats and sines.
@debrucey5 жыл бұрын
I’d love to know how this was implemented on retro machines considering most of them didn’t have floating point math or an efficient way of calculating trigonometric functions.
@javidx95 жыл бұрын
Anything floating point can do, can also be done using fixed point maths, and some really elegant and crazy hacks exploiting the properties of binary numbers.
@jeffthecoder4 жыл бұрын
Hmm, well, an 8-bit byte can hold a fixed point value between 0 and 255. With a little imagination it can alternatively be represented as a value between 0.0 and 25.5, or a value between 0.00 and 2.55. As far as calculating goes, pretty much anything outside of simple addition and subtraction isn't really possible on the fly if you want the game to run faster than 1 frame per second. You'd want to store precalculated answers in memory in a look-up-table/array so that you can then get an "instant answer".
@javidx94 жыл бұрын
Thats not quite accurate. Assuming 8 bits, being split 4.4 and the split is arbitrary, the left hand side could represent 0 to 15, and the right hand side, represents between 0 and 1 with a resolution of 1/16th. Addition and subtraction do remain unaltered, multiplication and division need to be tracked and performed in a larger word width, which you can then shift back into place. More often than not in fixed point maths you engineer the solution in such a way that fixed point can be exploited readily, i.e. you cant just drop it in place. Tracking the scaling can become fiddly too, butt since youve engineered the solution, it is likely you know the domains you are operating within, potentially eliminating any "post processing" requirements of the scaling operations youve performed.
@achtsekundenfurz78764 жыл бұрын
Fixed point is pretty much the answer, and the early machines didn't have an OS either, so almost the entire RAM was available to the program. Calculating the width of the road once per line rather than once every pixel (see ~ 05:10 to 06:00) can't hurt either. :P
@krabattondovich83725 жыл бұрын
Thank you. You almost clear with your explanations, cool. Would you plan to make tutorial about Voronoi diagramma and some voxel engine?
@SeNniN067 жыл бұрын
I've been thinking of making one of these. Will sit down one day and give it a shot now. Thanks. :]
@javidx97 жыл бұрын
Hi SeNniN, that's great news - good luck!
@obsoletepowercorrupts7 жыл бұрын
This is a neat little simple demonstration. I suppose for an advanced version, one could have the "rows" of track (which vanish into the distance by means of that sine wave) instanciated as objects in a linked list (maybe also hold them as class nodes in a superclass), and so between each, on might "fake" a sort of interpolation so as to make the jagged edges "smoother looking" by means of recursion if an object called ts own process/method via a unary relationship. A settings menu could tweak how much that was done (if it affected performance). Maybe Fourier series might help. Not sure. Or maybe a Fourier transform would do it actually. Yeah actually, if each "jagged bit" is a square, one could "get" eaach corner of the jagged bits as a square and then for each square, separate that into its fourier series (a bunch of sine waves) and hten populate a linked list and interpolate between those. I'm not sure if that would work mind you, because I CBA to try. x'D
@javidx97 жыл бұрын
Hi, I like you already! If I understand you correctly, you think that using a connected structure of the visible track rows (maybe 2D patches), that "sort of" settle themselves out biased by a coarse global field of influence, because the patches are spatially aware of their neighborhood, according to some rule set that facilitates interpolation, (breathe in) then you should consider looking at Multilayer Convolutional/Recurrent Neural Networks - they take quite a similar approach to smartly interpolating between steady states. It would certainly be an advanced version of the game. The risk is that the "game" and the rendering in my example are highly coupled, and such an abstract approach would yield a system where you're not sure of the state at all times, therefore can't facilitate the player sensibly. In essence I would still have to have both curvatures calculated anyway, or radically rethink how the game is implemented at all levels. As an intellectual exercise I like these sort of things, but man, that would be a long video!
@obsoletepowercorrupts7 жыл бұрын
Yeah That's pretty much how I imagined it. One could use object or struct or whatever, bu the principle would be vaguely along those lines. I suggested OO since it would be easier to interogate. The suprclass could be grabbed as a save state so as to mess with it further. However, one could do it in assembly I suppose, if one were hardcore and familiar with bit-revorder (bit reversed addressing) and butterly-algorithms, then it really would work on some retro machine I suppose. Do you have links for the specific videos on Neural networks you had in mind, so I can have a butcher's gander at them? :) Cheers! I do need to get better at stuff tbqhwy. Yes it would be a long video and abstruse nerdery. I wonder though if one might "cheat" by simply having those variables (or methods) available (public) to be called by another software. So for example, one could build the image (or part of it) as a linked list and then you could half-inch some manner of video compression code (FourCC's? Discrete Cosine Transform) and get that to do it (interpolate and compress via Floating Point arithmetic) and "overlay" it (a bit like how Afterburner on the sega Cd was over layed with the 32x part of the game - but do it in software not over a cable). I see Brek Martin did your code example on a PSP. He speaks of video compression and Amiga CD32 FMV cartridge quite a bit and it is cool. That little (psp) device is over 300mhz and so, by my reckoning, can do MPEG2 and some Mpeg4-esque bit twiddling. A dynamically linked list (at least doubly linked) would allow a efficiency for the objects (call destructor of objects). Actually I shouldn't have suggested "method" as that is Java and would lend itself to garbage collection which could happen at anytime. The usage of C++ would not only avoid that but it could allow multiple inheritance so that objects that breifly "exist" in the linked list as a stepping stone for points of interpolation could inherit from multiple objects (choosing what to inherit from depending on performance so as to scale performance on the fly). This has got me wondering. Would it be worthwhile to overide the operation (or method in java) of those objects to inherit only what was needed or available at ony one given moment (to scale that performance of the fourier analysis)? With regard to that, I assume the linked list would grow and shrink when you go around corners because you'd end up with an tangent would you not and that would asymptote, like when using the tangent in calculus for instantaneous rate of change? Basically polymorphism so that you keep the curve from becoming blocking (while at the same frame rate) when you go around corners. I can't think how to do it though.
@javidx97 жыл бұрын
"choosing what to inherit from depending on performance so as to scale performance on the fly" is the bit that I think you would struggle with. If a system needs to choose the best option, it can only do it if it has evaluated the other options first, even at a coarse approximation level you would need to ensure that performing this evaluation across the set of options is worthwhile. My gut tells me it wouldn't be. That said, GPUs have been doing this for years with MipMaps and such, selectively choosing textures and interpolators depending on what was required, but it could determine the effectiveness of its options before choosing. I get the impression (perhaps incorrectly) that your approach wouldn't know if it was successful until after it's done it. All algorithms like this need to be hard bounded to stop asymptopic behavior. That's why the coding gods gave us atan2! I'm intrigued by leveraging a video decoder to fake the drawing with doctored data, but my understanding is the block size is not scaleable? Perhaps really low-res video stream inflated to a higher res where each block is crudely a section of visible track? I may be wrong there though. Video codecs are something I've not spent much time with.
@obsoletepowercorrupts7 жыл бұрын
Aye you're right. It'd be shite.
@ChupoCro5 жыл бұрын
Hi, let me first say I am really surprised your videos don't have at least 10x more views than they do. You really explain everything in very well organized and concise way. One of your 3D Graphics Engine videos appeared as a recomendation when I opened the KZbin application on my TV a few days ago and since then I watched about 15 of your videos and I plan to watch all of them. Your memories of your first Nintendo are similar to my memories of my ZX Spectrum I got in early 80s :-) Regarding this racing engine, it would be a nice follow up if you implemented a few different styles of displaying the track similar to the ones used back in the days. For example, in a lot of racing games a car (or a motorcycle) was always in the middle of the screen and the track was moving left and right to make an illusion of a turn. One of such games was Full Throttle: kzbin.info/www/bejne/mXKQZnyjmLKtpq8 And there were a few where you could drive up and down the hills as in WEC Le Mans: kzbin.info/www/bejne/e4WteGamZ9OKZqM There was an interesting algorithm for creating the illusion of driving up and down the hills despite of fixed horizon in Full Throttle 2: kzbin.info/www/bejne/oqCndYafiL1rgtU It would be really nice if you did one more video showing the implementation of these styles. Maybe you could even introduce a flag to choose if the car will be always in the middle or not. Here are a few more old style racing games to compare the track rendering engines: kzbin.info/www/bejne/j3-9fJqPhLJ0jM0 If I remember correctly you mentioned VHDL in one of your Sound Sinthesizer videos so I hope in some future videos you are maybe going to cover even that. Regards
@deejons5760Ай бұрын
I wanted to do the project, but I didn't understand the slightest how to do it after watching this video, and making the C++ makelists is the hardest thing for me currently.
@stcpimus3 жыл бұрын
Hi from colombia from 2021 you can create 2 variables outside of the cycle ScreenWMid = ScreenWidth() / 2 ScreenHMid = ScreenHeight() / 2 and you dont need to do the division into the 2cycles The same thing, defining variables outside to the cycle float fPerspective; and then into the cycle For example fPerspective = y / ScreenHMid
@endoflevelboss2 жыл бұрын
"It's simple tricks like this that can create a much more compelling gameplay experience". Compelling gameplay experience? Wow those are some powerful words. While you're going down that path how about, I'm going to add some hills to further enhance the exhilaration and serve as a visceral adrenalin driver on the corners submerging the player in an alternate F1 reality. That's the same sort of remark isn't it... Anyway good video and nice ponytail cupcake!
@tw75226 жыл бұрын
You're doing a great job. I learned a lot. Thanks
@javidx95 жыл бұрын
Hey thanks Tomasz, I appreciate that!
@nairrohit835 жыл бұрын
Little help some one? Forgive me but maybe i missed something?...I did not quite get the perspective equation with roadwidth. The roadwidth seems should have decreased at lower portion of the screen and increased at higer portions...unless the equation is different because that is not what is happening (and should not !)...Update: I think I got it now!. The coordinates start at top left and there is a Row variable which is actually used for drawing!
@GreatHacker16 жыл бұрын
Your accent looks very much like British, it is quite cool. Nice video bro. Thanks
@javidx96 жыл бұрын
Thanks! There could be a reason for that 😉
@zPamboli6 жыл бұрын
How can I do this with graphics instead of coloring the console? I'm kinda noob and I don't know what libraries should I use if I need any.
@javidx96 жыл бұрын
Hi Raptor, I released a simple library people can use to get started called "olcPixelGameEngine" which is the tool I use in a lot of my videos - its great for beginners to get playing with graphics very simply
@valleykid65774 жыл бұрын
I need to say man, you've done a wonderful job at this. I've programmed professionally for 20 years, and I admit to learning a few things from you in some of the videos. keep it up!
@cgiscript41511 ай бұрын
30:55 animation stutters when lap is completed and starts again. i believe its because of sin function. resetting distance variable, which is phase shift, interrupt our sin function's cycle. is there any way to achive "smooth transition" between laps ? fascinating pseudo3d tutorial btw!!
@swinki334 жыл бұрын
Exercise for the ambitious one: To code above using 8 bit processor, 3.5MHz with no floating point numbers. no sine/cosine/abs functions, not even multiplication function in your programming language (use multiple additions and/or binary shifts instead), no blitter/no copper, - all done by CPU, using only 8bit (0-255) and 16bit (0-65 535) bit numbers. Did I mention using assembly language? No? Sorry :} Restriction: keep the frame time budget below 1/30 s (or at least 1/10) and you have only 40 kbytes memory for code and data... After that ...you can feel like master /kzbin.info/www/bejne/j3-9fJqPhLJ0jM0
@supersolik6 жыл бұрын
Very useful video, i've really learned a lot from it, thank you man :)
@javidx96 жыл бұрын
Hi Sergey, no problem, cheers!
@eddieloius45923 жыл бұрын
If you wanted to work at a higher pixel depth (16-bit graphics) ,how much different does this code need to be?
@javidx93 жыл бұрын
Not very. The successor PixelGameEngine would be almost identical, But works with conventional imagery and files
@bubuche1987 Жыл бұрын
I haven't watched the video yet but I wonder if it would be hard to add hills (like in ... many games of this kind) easily. I liked the lotus racing games on Atari St and if Atari was capable of displaying that they should be implementable in Js/c++.
@ooxxeanАй бұрын
but i can’t run it with visual studio 2022. the car disappear and the background is cutted by sth.maybe the character rendering does not fit…
@erc0re5267 жыл бұрын
Heya ! Super video :D I was wondering, whats the editor you're using on the bottom right screen ?
@javidx97 жыл бұрын
Thanks ArcOre! Oh dear I'm showing my age here - its a pre "Emerald" release of "Crimson Editor" - a text editor I can use with my eyes closed. I should make the effort to jump to sublime or something, but I just love it.
@erc0re5267 жыл бұрын
Ahhhh Crimson yesss I knew I saw that editor somewhere before haha! Well if it works for you, I don't see why you would change :D
@GrowlingM1ke5 жыл бұрын
I edited the code to make the game a bit more interesting, basically randomly generating the track each time the player starts the program, it's just a few lines of code :) Add this to the private: float generateBiasedRand(float min, float max, bool biased) { if (biased && 0 + (rand() % (1 - 0 + 1)) == 1) { float extremeTrack = 0.75 + static_cast (rand()) / (static_cast (RAND_MAX / (0.25))); if (0 + (rand() % (1 - 0 + 1)) == 1) return extremeTrack; else return -extremeTrack; } else { return min + static_cast (rand()) / (static_cast (RAND_MAX / (max - min))); } } Then add this to the OnUserCreate() function in protected: // randomly generate track srand((unsigned)time(NULL)); int number = rand() % 3 + 4; vecTrack.push_back(make_pair(0.0f, 10.0f)); // Short section for start/finish line for (int i = 0; i < number; i++) { // making it biased for the turns so the player 50% of the time receives more extreme turns vecTrack.push_back(make_pair(generateBiasedRand(-1.0f, 1.0f, true), generateBiasedRand(100.0f, 400.0f, false))); vecTrack.push_back(make_pair(0.0f , generateBiasedRand(100.0f, 200.0f, false))); } Then remove all the previous vecTrack.push_back stuff you had originally My next step is to make some sort roadblock that the car will crash into and slow down the player, but I'm wrapping my head around how to implement that.
@javidx95 жыл бұрын
Thanks GrowlingMike. Im always pleased when people modify my programs like this - its great to see what people do with them!
@davep71764 жыл бұрын
I used this vid to make a c++ racer in SFML. But say I want to add road signs, for example to tell player when left/right turn is coming, what would be a good way to approach that?
@amber18626 жыл бұрын
Firstly, this is amazing! Secondly, the use of that sine function is confusing me; I understand the formula you used and its purpose, but it looks to me that increasing the x value will increase the frequency, but the graph says it's doing the opposite. I'm aware that I'm probably forgetting something really simple lol. Thanks!
@johnconley49554 жыл бұрын
I do like watching you and the programming you do...you're obviously a good one. Can you help me on this though? I'm using Notepad++....how do I transfer from ++ to CMD?
@pythonsqlite776011 ай бұрын
Im trying to understand sin function here. If i reset the distance variable which helps to control the phase to zero, screen stutters. How can i smoothly reset the distance variable so i have a infinite scrolling road ?
@jsceo5 жыл бұрын
this is amazing, how and where did you learn that mechanics for making 2d or even pseudo 3d games?
@GamerSaga6 жыл бұрын
hello, i copied the text for the olcconsolegameengine and have enabled unicode but i am still getting the error saying i need to enable it when trying to run the program.
@memevel3 жыл бұрын
Welcome to the CIY channel
@gnoath56842 жыл бұрын
what's missing now is a low pitched hum that will change based on the player speed.
@BrekMartin7 жыл бұрын
Very nice again :) if I had the room, I think I'd prefer this in my microcontroller. Great that you have some more viewers onboard!
@javidx97 жыл бұрын
I was considering your micro project when I was editing :-) On the one hand, it requires very little RAM as the whole screen (except for the car) is generated each frame, but on the other, I use loads of the new C++ stuff, which of course wraps up loads of micro instructions - it would certainly be a challenge.
@BrekMartin7 жыл бұрын
Just checking in again for a refresher :D It’s working on the Sony PSP, but only for a few frames and appears to get stuck (but not crash). It behaves the same full screen 480x272, or just using 160x100. I haven’t found or remembered how to use any hardware timer yet, so not sure what to do with “elapsed time”. I’ve tried incrementing it for each frame, and leaving it constant. Not sure if that’s a running time, or the time between frames. I see the white line, and a straight, and then I think a right turn. If I were to screen shot it, it does look exactly like what I see on KZbin though. funny stuff :D
@javidx97 жыл бұрын
I would imagine leaving the elapsed time (between frames) constant would be correct (ideally something similar to the frame rate of the system) if there's no hardware timer, I guess it would just speed up and slow down depending on the CPU load but should remain playable. I don't believe I accumulate time directly as part of the functioning of the algorithm, and I can't think of any stall risks other than vectors not behaving, but I imagine your code is not 1:1 like mine :D. Could it be that the algo thinks the car is off the track and sets the speed to 0? But... hang on... more interestingly, you've got something like this running on a PSP? I'd love to see that (and the code)!
@BrekMartin7 жыл бұрын
I’m totally trying to steal this, only changing what needs be for the platform, and in plain C the track is a pair of float arrays, your ASCII blocks are pixels in a frame buffer. ASCII would be fine but it’s a small screen anyway. It’s been a ling time for the PSP, but I think it would do this 30-60fps, so that’s 30.0? I’ll definitely give it another look tomorrow, and happy to share. I haven’t even printed out those debug values yet, and the car is misbehaving, yes.. watching the x value for that would help too.
@javidx97 жыл бұрын
It would be 1.0/30.0 for the elapsed time then. This may explain a few things, as all the interpolation assumes the elapsed time will be tiny - In fact it may fall to pieces with an elapsed time >= 0.1 (10fps).
@ishida37305 жыл бұрын
Well, I wan't to make that 'Retro Arcade Racing Game' but My Visual Studio IDE shows some errors in your Header File, Please Help!
@justaprogrammer60315 жыл бұрын
you dont show where all these files come frome
@mikul92045 жыл бұрын
I'm making this in java with a 1000 by 800 frame and it's already running at 14 fps all I have made so far is moving forward. Drawing pixel by pixel seems to be hard for it, how could I optimise?
@javidx95 жыл бұрын
Hi Mikul, fundamentally you are making about 11,200,000 draw calls per second, so yes pixel by pixel may be a challenge at such a high resolution. There are two golden rules with rasterizing, 1) Only draw what you can see, 2) Draw as much as you can in one go. Dont forget old games like this were low resolution! Going to a higher resolution probably does require a different approach even though the theory remains the same.
@darkfrei210 ай бұрын
Nice game, thanks for your video!
@رضیہالدین7 жыл бұрын
32:24 *Insert 'Evil Kermit' meme here* "Let's see who exceeds the scope of 'minutes' and takes hours or days to finish a lap.
@eddieloius45923 жыл бұрын
What's the earliest point at which you can test or preview what you have on screen?
@lXBlackWolfXl5 жыл бұрын
I got lost when you started talking about sine waves. I've never learned anything about trigonometry. And yes, I'm taking programming classes, so I can make sense of your code (even though I've only learned the basics of C++), but my professor believes that programming classes focus too much on math (a student from our small community college actually won a national contest recently, because he was the only one who actually knew how to code, seriously). The only math class I've taken taught statistics, that's it. Also, this looks like an atari racing game. How much of this would be used in a more advanced game, like say the original mario kart? That game has other racers on the track, along with other sprites either on the road or beside it. Would it be that hard to add things like rocks and tufts of grass to the sides of the road? To me it looks like the landscape in Mario Kart is a texture that's been distorted to appear to look like its a flat plane on the ground. This same technic appears to have been used in other SNES games too. Final Fantasy III and Secret of Mana also seem to use this. Though I've noticed that the ground in Final Fantasy III acts like its on a curved surface.
@javidx95 жыл бұрын
Hi BlackWolf, To an extent I agree with your professor, the majority of programming doesnt involve any "maths" at all, other than some simple arithmetic. I dont have any advanced maths training beyond what you learn as a teenager, some linear algebra, a bit of calculus and some geometry/trigonometry. Applications such as games or simulations, often exploit more advanced maths because they need to, but the bulk of programming does not. However, consider this. Take the photo viewing app on a phone, you can swipe left and right, and the photos have the feeling of "weight". Someone somewhere has implemented inertia, acceleration and forces, then had to break that up to suit the system of the phone, so most likely they are using the derivatives of these properties. I guess even in basic code, knowing a bit of maths can make you stand out. lol just my 2p. Regarding other forms of racing game rendering, I point you towards: kzbin.info/www/bejne/r5Ovi6yPa5pon7s
@KJ7JHN Жыл бұрын
do you have a video on how to install and setup Visual Studio for C++? I've got VS installed, but it's throwing all of these hoops at me. I'm not quite sure how to dance around them. Thanks.
@javidx9 Жыл бұрын
It's pretty default as an installation, make sure you check Desktop Development C++ package though. You need that for the things I show
@ticiusarakan3 жыл бұрын
that's amazing!!! can you explain in you future videos how sega genesis kawasaki game works?
@ZboneWalker7 жыл бұрын
Your videos are awesome. Thanks!
@javidx97 жыл бұрын
Hey thanks Zbone, I appreciate that!
@1...........123-t9b4 жыл бұрын
Are there multiple versions of the olcConsoleGameEngine? If so, am I using the right version of the olcConsoleGameEngine? I don't know why I have exceptions. Sorry about asking you too much. I guess I should stop asking, and try to figure it out myself. 😳 👉👈
@d.s.h6629 Жыл бұрын
love your videos man
@alfiewhitson77265 жыл бұрын
very nice however I'm slightly puzzled on as to how exactly it is that you set the character output color in c++ in the way that you have it doing so within your framework ? Just that the only way in which I can actually think of with regards to how to actually change font colours in c++ console applications is using the windows.h and then using the system("set color ") functionality however obviously that returns a string output alongside actually updating the text colour... are you using that function and then clearing the output message off of the screen then drawing the appropriate output chars to the screen
@alfiewhitson77265 жыл бұрын
if so, how could this be compensated for in Linux i.e Linux has no system("set color") command as far as I know or would it just be logical to port it to wine ? alongside that I also just thought it might be of some use if you can find some sort of dosbox API which you could use so as to run the game at higher resolutions. For instance, if you used a display driver emulator within dosbox and you have it so that each output char in the original version of the game is paired to a second font which is only 1 pixel in size then that 1 pixel sized font is printed in substitution of the ascii art you were using, then theoretically speaking you could add waaaaay more detail into graphics for example as that could allow you to increase the output bit depth for example, alongside the fact that generally speaking a pixel would have a size in memory of 12 bytes, then you're only having to use up 1 byte worth of memory per "pixel" therefore meaning that you could get higher frame rates because the memory size of the console output buffer would be smaller. also that could mean that you could have the ability to use bitmap graphics instead. I think there's a way in C# at least that you can output images to the console however, I don't know how complex it'd be to convert the code used in that example to C++ nonetheless, here's a link : stackoverflow.com/questions/33538527/display-a-image-in-a-console-application
@kasunsanuka5 жыл бұрын
nice work....but i wanna know how to do this in 3D game....plz...can u hlep me...now stduying in game programming collage in Japan.
@jianhengmao68156 жыл бұрын
Does this method work when you have opponents and obstacles on the track?
@random50644 жыл бұрын
Is there a way to add in shifting up and down gears?
@abdullahajeebi9 ай бұрын
This makes me want to code an NES's APU into it.
@devlogsandgaming4 жыл бұрын
is there a way to add sound to this and make the tracks randomised
@FrostGamingHype2 жыл бұрын
javid how can we make something like that out of console pixel without using your game engine and how to set the console 8 char wide like how you did without the olc console game engine
@jimgordon60174 жыл бұрын
You define the meaning of amazing
@thomasabramson1004 жыл бұрын
PLEASE could you do one for "Pong" only retro you don't have a video for
@misterj98176 жыл бұрын
I love you !
@javidx96 жыл бұрын
:blush:
@achtsekundenfurz78764 жыл бұрын
To put it the C++ way: nFaceColour = FG_RED;
@nocontentfound506 жыл бұрын
one question...could we add some other cars? NPC's?
@javidx96 жыл бұрын
Of course you can! They would follow the exact same procedure as the player, so the algorithm would be quite simple.
@nocontentfound506 жыл бұрын
Thanks for that quick response! Its really interesting what you can all do with coding. :)
@XDandrewsDX6 жыл бұрын
This is incredible!
@javidx96 жыл бұрын
lol thanks Andre
@Lambdaphile6 ай бұрын
This is perfect, thanks!
@quaxiscorporationforresear55576 жыл бұрын
is there any way I can do this on a mac with visual studio on mac. I have Xcode
@javidx96 жыл бұрын
Hi JP, the short answer is not really - the mac/linux terminal is a very different tool to the windows command prompt. However, I'm imminently about to release a linux/mac compatible file that emulates what you see in these videos, so non-windows users can join in too.
@ArthurDetaille7 жыл бұрын
THANK YOU A LOT ! i love you SO MUCH !
@javidx97 жыл бұрын
lol, YOU'RE WELCOME!, I'm pleased you have FOUND IT USEFUL!
@theRealDonaldTrump6663 жыл бұрын
this is great i can make a road rash clone with this for pi pico using arduino to use C++ (i hate visual studio) i think. just a little adjustment to the horizon point to have it adjust here and there to give variance and replace the manual draw of pixles with sprite slices being called (custom sd chibi guys and cartoony road slices). subscribed just for that
@رضیہالدین7 жыл бұрын
There's just one phrase for the key idea in the video: "The Simplicity of Complexity."