OrbitalReign's career change
-
- Posts: 19
- Joined: July 17th, 2017, 1:24 pm
OrbitalReign's career change
Welcome to my journal.
Well all the cool kids are doing it so i guess i should do a journal thing.
So the short of it, I'm a 30 year old construction worker ( Plasterer to be specific ) that left halfway through the last year of high school to help my dad at work and Iv been stuck ever since.
13 years on or so and my joints are all buggerd to the point i sound like a walking sailing ship and with not much in the way of formal training I'm up a pretty shitty creek. But! there is hope in a odd way, my Fiance is on a Transplant list for new lungs and kidneys and as such i have to take 6 months of work to care for her post-transplant.
The wait list for the transplant is about 6 to 18 months they say and then shit hits the fan and our life gets flipped on its head....
annnd to digress from a probably share to much story, I get 6 months of sitting on my arse to start a new career.
So i chose probably to my detriment a career as a game programmer or more specific an indie developer with this thing as a record of my failings and successes.
This is the little isometric rts/circular tower defence I'm working on. its just an empty world that you can move around and zoom in and out at the moment and a little cube character that you can drive around. wsad moves the cube, arrows move the frame around the world and 'z'x' zoom in and out, and 'h' puts the frame back at "home".
60 Plus hours of hair pulling debugging to get it the where it is; just if you were wondering.
https://github.com/OrbitalReign/DigDefence.git
Well all the cool kids are doing it so i guess i should do a journal thing.
So the short of it, I'm a 30 year old construction worker ( Plasterer to be specific ) that left halfway through the last year of high school to help my dad at work and Iv been stuck ever since.
13 years on or so and my joints are all buggerd to the point i sound like a walking sailing ship and with not much in the way of formal training I'm up a pretty shitty creek. But! there is hope in a odd way, my Fiance is on a Transplant list for new lungs and kidneys and as such i have to take 6 months of work to care for her post-transplant.
The wait list for the transplant is about 6 to 18 months they say and then shit hits the fan and our life gets flipped on its head....
annnd to digress from a probably share to much story, I get 6 months of sitting on my arse to start a new career.
So i chose probably to my detriment a career as a game programmer or more specific an indie developer with this thing as a record of my failings and successes.
This is the little isometric rts/circular tower defence I'm working on. its just an empty world that you can move around and zoom in and out at the moment and a little cube character that you can drive around. wsad moves the cube, arrows move the frame around the world and 'z'x' zoom in and out, and 'h' puts the frame back at "home".
60 Plus hours of hair pulling debugging to get it the where it is; just if you were wondering.
https://github.com/OrbitalReign/DigDefence.git
Last edited by OrbitalReign on August 23rd, 2017, 10:43 am, edited 1 time in total.
Re: OrbitalReign's career change
Hmmm, this one went under my radar. I'll take a look and add it to the list for the next show-and-tell.
You seem to have rolled a big old snake-eyes; I hope you can turn it around mate. Good luck to you and your fiancee. I'll keep an eye on this thead.
You seem to have rolled a big old snake-eyes; I hope you can turn it around mate. Good luck to you and your fiancee. I'll keep an eye on this thead.
Chili
-
- Posts: 19
- Joined: July 17th, 2017, 1:24 pm
Re: OrbitalReign's career change
Cheers mate,
Just added a weird orbital (not a pun) affect to the enemy's in my game while messing around with their AI targeting. maybe someone is interested in making a tornado of poos??
Just added a weird orbital (not a pun) affect to the enemy's in my game while messing around with their AI targeting. maybe someone is interested in making a tornado of poos??
-
- Posts: 19
- Joined: July 17th, 2017, 1:24 pm
Re: OrbitalReign's career change
so iv been working on some thing called a half space triangle thingy from some guy called nick from devmaster forum http://forum.devmaster.net/t/advanced-r ... ation/6145.
My buildings in my game are all wire frame and basically i wanted to have a black mask behind my buildings so they could be drawn on top without other stuff showing through and wound up learning how polygons are rendered. I'm going to assume there is some easy way or built in to do this with direct x or something but it was handy to know.
Here's what i ended up with if anyone is interested in playing around with it or you can pull it from my repo https://github.com/OrbitalReign/DigDefence.git. I made a custom min max function too because the one i tried only had 2 inputs.
Anywho to get my head around the maths i pretty much had 3 pages of a grid book filled with triangles and equations to figure out what the hell was going on but persistence pays off and it works for what i want.
And yes i could have just drawn them with putpixel calls but i couldn't get the converter to work in the beginning so I'm stuck with wire frame till i get up to the intermediate lessons.
That being said I kinda like the challenge of the wire frame.
My buildings in my game are all wire frame and basically i wanted to have a black mask behind my buildings so they could be drawn on top without other stuff showing through and wound up learning how polygons are rendered. I'm going to assume there is some easy way or built in to do this with direct x or something but it was handy to know.
Here's what i ended up with if anyone is interested in playing around with it or you can pull it from my repo https://github.com/OrbitalReign/DigDefence.git. I made a custom min max function too because the one i tried only had 2 inputs.
Anywho to get my head around the maths i pretty much had 3 pages of a grid book filled with triangles and equations to figure out what the hell was going on but persistence pays off and it works for what i want.
And yes i could have just drawn them with putpixel calls but i couldn't get the converter to work in the beginning so I'm stuck with wire frame till i get up to the intermediate lessons.
That being said I kinda like the challenge of the wire frame.
Spoiler:
Re: OrbitalReign's career change
Haha, the tornado of boxes looks sweet. What you've got there is basically isometric projection. I do love me some isometric graphics.
Chili
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: OrbitalReign's career change
Some of the code reminds me of the barycentric rasterization stuff I did a while back. I didn't understand it then, the math portion, and I don't understand it now . Chili uses a scanline rasterization technique in his 3D Fundamentals and his old Advanced series and I think again in the HUGS series.
Each has it's pros and cons I'd say. The barycentric method does seem to require less calculations and once you find the barycentric coordinates, you can use those to interpolate values for texture coordinates and normals if you want to go that far. Another pro is there is no need to figure which vertex is at the top of the triangle as with the scanline method. The only con I've found is having to scan through a complete rectangle, well, not having to, but I've tried traversing the edges of the triangle (combining the two methods) and there doesn't seem to be much of a performance boost for very large surfaces. Basically, if it covers a large portion of the screen, you're still going to get low performance. On the other hand, looping through a rectangular region using SIMD instructions (handles 4, 8 or 16 pixels at a time) is easier than using the scanline method.
The scanline pro is that the maths are pretty much straight forward. Divide a triangle into two smaller triangles so you end up with one with a flat bottom and one with a flat top. Traverse the left and right edges scanning the line between the two using the slope of each as a starting and ending point. This means you never draw or even check outside of the triangle. The con(s) would be that you must reorder the vertices so that you can start from the top of the triangle and scan down, from left to right. Interpolation for texture coordinates and normals must be calculated at each step using linear interpolation. Since SIMD instructions are in clusters of 4, 8 or 16, you are stuck having two sets of instructions ( for simplicity sake ). One set for lines with a width < 4 and a set for lines with a width >= 4 just for SSE or >= 8 for AVX and >= 16 for AVX/512. Vertex transformations and setting up the triangles for rasterization is negligible compared to the actual rasterization portion of rendering to screen.
Anyway, looks cool thanks for sharing.
Each has it's pros and cons I'd say. The barycentric method does seem to require less calculations and once you find the barycentric coordinates, you can use those to interpolate values for texture coordinates and normals if you want to go that far. Another pro is there is no need to figure which vertex is at the top of the triangle as with the scanline method. The only con I've found is having to scan through a complete rectangle, well, not having to, but I've tried traversing the edges of the triangle (combining the two methods) and there doesn't seem to be much of a performance boost for very large surfaces. Basically, if it covers a large portion of the screen, you're still going to get low performance. On the other hand, looping through a rectangular region using SIMD instructions (handles 4, 8 or 16 pixels at a time) is easier than using the scanline method.
The scanline pro is that the maths are pretty much straight forward. Divide a triangle into two smaller triangles so you end up with one with a flat bottom and one with a flat top. Traverse the left and right edges scanning the line between the two using the slope of each as a starting and ending point. This means you never draw or even check outside of the triangle. The con(s) would be that you must reorder the vertices so that you can start from the top of the triangle and scan down, from left to right. Interpolation for texture coordinates and normals must be calculated at each step using linear interpolation. Since SIMD instructions are in clusters of 4, 8 or 16, you are stuck having two sets of instructions ( for simplicity sake ). One set for lines with a width < 4 and a set for lines with a width >= 4 just for SSE or >= 8 for AVX and >= 16 for AVX/512. Vertex transformations and setting up the triangles for rasterization is negligible compared to the actual rasterization portion of rendering to screen.
Anyway, looks cool thanks for sharing.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
-
- Posts: 19
- Joined: July 17th, 2017, 1:24 pm
Re: OrbitalReign's career change
Cheers guys,
also you gave me a lot to look into as i had to google half of what you were talking about albino.
I'm still amazed at how much goes into the graphics rendering yet it can keep up with the frame rate.. or not sometimes.
also you gave me a lot to look into as i had to google half of what you were talking about albino.
I'm still amazed at how much goes into the graphics rendering yet it can keep up with the frame rate.. or not sometimes.
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: OrbitalReign's career change
Yeah, look into C++ Amp if you really want to speed things up. SSE is upto 4x faster, AVX is upto 8 times faster and AVX/512 is upto 16x faster than normal x86/x64 float/int processing, but using your GPU is like 1000x faster. Even if you multithread and get perfect scalability with AVX/512 you still end up with 16 * threads, so 32x for 2 threade, 64x for 4 threads and 128x for 8 threads. So even if you could run on a AMD thread ripper with 16 threads, you'd only get a quarter of the power of the GPU.
Stick to directx for your 3D needs, it pays off. However, if you are looking to improve other aspects like physics, where the D3D pipeline doesn't actually help, then C++ AMP, OpenCL or DirectCompute is where you need to turn. C++ AMP is nice because you only need to know C++. DirectCompute requires knowledge of shaders and DX api and same with OpenCL, you need to learn the API.
C++ AMP, for VS uses DX11 DirectCompute under the hood, but you only need to know C++ to get it running. To make it run efficiently, I'm sure you need to understand multithreading, but you can start with the single threaded basics.
Stick to directx for your 3D needs, it pays off. However, if you are looking to improve other aspects like physics, where the D3D pipeline doesn't actually help, then C++ AMP, OpenCL or DirectCompute is where you need to turn. C++ AMP is nice because you only need to know C++. DirectCompute requires knowledge of shaders and DX api and same with OpenCL, you need to learn the API.
C++ AMP, for VS uses DX11 DirectCompute under the hood, but you only need to know C++ to get it running. To make it run efficiently, I'm sure you need to understand multithreading, but you can start with the single threaded basics.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: OrbitalReign's career change
Yeah this is correct. I've got a kid on the Discord right now making a 3D graphics engine using C++ AMP It's not a practical pursuit, but he is aware of it and is doing it shits and giggles I guess.
Direct3D will be able to make use of a bunch of specialized hardware units that you don't have access to in GPGPU, so no question using D3D/OGL/Vulkan is the way to go
Direct3D will be able to make use of a bunch of specialized hardware units that you don't have access to in GPGPU, so no question using D3D/OGL/Vulkan is the way to go
Chili
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: OrbitalReign's career change
I've been wanting to do the same for shits and giggles, just haven't gotten around to it. As far as I can tell, the only specialized portion you have access to in C++ AMP is the texture units. You can also access local member ( local in this case means to GPU ) by using tiles. This allows for faster access to data for a group of GPU threads thus improving performance. If you have seen any D3D shaders, the vertex shader for instance, you might have seen a constant buffer usually near the top of the shader file. This data is the same for all threads processing the vertices, tiles would be a good fit here.
In a game where so much is math based and there are usually so many entities to update, C++ AMP would be a great fit. It would take some planning though because there are restrictions. For the most part, you cannot use pointers or references ( there are exceptions ). You'd need to understand multithreading patterns and how to avoid data races. Still, C++ AMP is fun to mess around with and would be beneficial to someone who uses it correctly.
In a game where so much is math based and there are usually so many entities to update, C++ AMP would be a great fit. It would take some planning though because there are restrictions. For the most part, you cannot use pointers or references ( there are exceptions ). You'd need to understand multithreading patterns and how to avoid data races. Still, C++ AMP is fun to mess around with and would be beneficial to someone who uses it correctly.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com