and I have another question, I have noticed that several games struggle A LOT to produce a decent framerate even when the graphics are terrible to begin with, how do you avoid this problem with framerate lag?
@e102ewan Sometimes it could be down to a memory leak. In case you are not familiar with programming, games create resources using your memory while the game is running. When the game is about to quit, it should delete those resources. If it doesn't, you get a memory leak (the resource is still in memory even though the game quit). Run the game again, the same thing will happen and you'll add another leak on top until you restart your machine. This would slow down the game as you play thru it.
@e102ewan I wish there was more space to write in these comments :) Generally, low framerate is to do with the hardware. You could put checks in the code to test your machine's specs and if its crap, it could default to a low level of detail. Online games suffer because it depends on your internet/the server and because you are sending/receiving data in (pseudo) real time, while drawing/updating/handling input etc. There is so much going on in a game its hard to pinpoint where low fps comes from
In a 3D game with DirectX, are all polygons triangular and are they the same size? I know this might sound like an incredibly stupid question to someone who has made games and worked with polygons forever but can you even expect the average Xbox 360 gamer guy who wants to make a video game like me to know that 3D computer graphics are made with polygons? And, can there be a texture with multiple colours on one polygon? Or does every pixel in a texture need its own polygon?
Hi, polygons (whether they are defined as triangles or not) are pretty much always rendered as triangles since its the simplest of polygons for DirectX to render. They wouldnt all be the same size, some complex shapes like a sphere would be broken down into many small triangles and would be rendered as such so you wouldnt notice. You can think of a texture as any image. Each pixel in an image has its own colour and you can apply this image to a 3D model (or the triangles that make up the model)
And if I were to turn on wireframe mode you would see all the 3D models split up into triangles. If you have a look at the spheres when I'm shooting the other ships, they are actually made up of really small triangles. If I wanted more detail in the sphere, I would just increase the triangle count, and make even smaller triangles.
@RubixVerve But with the textures I meant that can a single triangle have a detailed texture on the one polygon? Or are multiple polygons required for a flat texture?
@e102ewan You generally use one texture and map it against multiple polygons using UV coordinates (aka texture mapping). With really detailed models that have many, many polygons, it wouldn't be efficient to apply a texture to each polygon. For example in a Lego game, the face might be a single flat texture which is mapped around the head (the head is basically a cylinder made up of many polygons). Btw I use polygon and triangle interchangeably. Feel free to ask again if I misunderstood you
@Ultimarox Thanks. I didn't use any books to learn DirectX. I can't post the URLs to the websites I used in a comment. Do a search for directx tutorial and you come to a site with a black background which is what I used to learn the basics.
Also do a search for Toymaker.info and thats another site I used
Yeah DJZybez, I'm using point-in-AABB for crashing into buildings, ray-sphere intersection for shooting (bullets just for show) and sphere-sphere for bumping into the other ships/tanks.
@ yo3443, like I said, GML (game maker language) hardly showcases ones programming skills. I don't have any interest in making viruses so why would I want to?
Fair enough if you like making viruses, I'm only into games programming really :) DirectX is a graphics API that lets you make 2D/3D games in C++. You can download it for free and theres plenty of websites out there that offer tutorials on how to use it. I recommend it if you want to get into more hardcore games programming.
Thanks FireSign27. I think I'll do that when I have time to extend this demo further. I'll probably add some particles when the ships die and implement a bit of AI later.
Awesome!
SuperYuxuan 7 months ago
and I have another question, I have noticed that several games struggle A LOT to produce a decent framerate even when the graphics are terrible to begin with, how do you avoid this problem with framerate lag?
e102ewan 1 year ago
@e102ewan Sometimes it could be down to a memory leak. In case you are not familiar with programming, games create resources using your memory while the game is running. When the game is about to quit, it should delete those resources. If it doesn't, you get a memory leak (the resource is still in memory even though the game quit). Run the game again, the same thing will happen and you'll add another leak on top until you restart your machine. This would slow down the game as you play thru it.
RubixVerve 1 year ago
@e102ewan I wish there was more space to write in these comments :) Generally, low framerate is to do with the hardware. You could put checks in the code to test your machine's specs and if its crap, it could default to a low level of detail. Online games suffer because it depends on your internet/the server and because you are sending/receiving data in (pseudo) real time, while drawing/updating/handling input etc. There is so much going on in a game its hard to pinpoint where low fps comes from
RubixVerve 1 year ago
In a 3D game with DirectX, are all polygons triangular and are they the same size? I know this might sound like an incredibly stupid question to someone who has made games and worked with polygons forever but can you even expect the average Xbox 360 gamer guy who wants to make a video game like me to know that 3D computer graphics are made with polygons? And, can there be a texture with multiple colours on one polygon? Or does every pixel in a texture need its own polygon?
e102ewan 1 year ago
Hi, polygons (whether they are defined as triangles or not) are pretty much always rendered as triangles since its the simplest of polygons for DirectX to render. They wouldnt all be the same size, some complex shapes like a sphere would be broken down into many small triangles and would be rendered as such so you wouldnt notice. You can think of a texture as any image. Each pixel in an image has its own colour and you can apply this image to a 3D model (or the triangles that make up the model)
RubixVerve 1 year ago
And if I were to turn on wireframe mode you would see all the 3D models split up into triangles. If you have a look at the spheres when I'm shooting the other ships, they are actually made up of really small triangles. If I wanted more detail in the sphere, I would just increase the triangle count, and make even smaller triangles.
RubixVerve 1 year ago
@RubixVerve But with the textures I meant that can a single triangle have a detailed texture on the one polygon? Or are multiple polygons required for a flat texture?
e102ewan 1 year ago
@e102ewan You generally use one texture and map it against multiple polygons using UV coordinates (aka texture mapping). With really detailed models that have many, many polygons, it wouldn't be efficient to apply a texture to each polygon. For example in a Lego game, the face might be a single flat texture which is mapped around the head (the head is basically a cylinder made up of many polygons). Btw I use polygon and triangle interchangeably. Feel free to ask again if I misunderstood you
RubixVerve 1 year ago
great work man,
what resources would you recommend to learn this stuff? did u use a book?
Ultimarox 1 year ago
@Ultimarox Thanks. I didn't use any books to learn DirectX. I can't post the URLs to the websites I used in a comment. Do a search for directx tutorial and you come to a site with a black background which is what I used to learn the basics.
Also do a search for Toymaker.info and thats another site I used
RubixVerve 1 year ago
Hey, I recognise that UFO model. It's from the XNA 3D Game Tutorial!
Kelarre653 2 years ago
dan dosent know anything about making games cos he has never played any XD
Timic83amv 2 years ago
it would be pretty cool if you would make map bigger and add skybox
bushidopride 2 years ago
Yeah DJZybez, I'm using point-in-AABB for crashing into buildings, ray-sphere intersection for shooting (bullets just for show) and sphere-sphere for bumping into the other ships/tanks.
RubixVerve 2 years ago
@RubixVerve i could do this in gamemaker easy!
yo3443 2 years ago
@ yo3443 so could I, anyone can use drag and drop... but that and the GML doesn't exactly showcase ones programming skills.
RubixVerve 2 years ago
@RubixVerve i don't use dragon drop i use pure code and i can make my own viruses. can you?
yo3443 2 years ago
@ yo3443, like I said, GML (game maker language) hardly showcases ones programming skills. I don't have any interest in making viruses so why would I want to?
RubixVerve 2 years ago
@RubixVerve because it's fun and don't think that i send the ones i make
yo3443 2 years ago
This has been flagged as spam show
@RubixVerve i don't use dragon drop i use pure code and i can make my own viruses. can you?
yo3443 2 years ago
@RubixVerve and what is directx? how can i use it?
yo3443 2 years ago
Fair enough if you like making viruses, I'm only into games programming really :) DirectX is a graphics API that lets you make 2D/3D games in C++. You can download it for free and theres plenty of websites out there that offer tutorials on how to use it. I recommend it if you want to get into more hardcore games programming.
RubixVerve 2 years ago
yo3443, stop being a noob and learn how to make games
Timic83amv 2 years ago
Thanks FireSign27. I think I'll do that when I have time to extend this demo further. I'll probably add some particles when the ships die and implement a bit of AI later.
RubixVerve 2 years ago
im guessing collision is detected?
DJZybez 2 years ago
Not bad. You should try making the map bigger
FireSign27 2 years ago