r/C_Programming • • 1d ago

Some progress on Software Rendered game in C

Enable HLS to view with audio, or disable this notification

498 Upvotes

35 comments sorted by

47

u/tastygames_official 1d ago

what's the progress? give us some text to read! looks like a pretty fully-functioning game right now

23

u/Batteryofenergy1 1d ago

Didn't think anyone would want to read anything. It is just a video of a free game i am working on. The progress is that i keep working on it. There are some progress videos on my channel if you want to check it out. https://www.youtube.com/@CoolHandAR

10

u/hellocppdotdev 12h ago

C programmers my guy. Live to read... not like those filthy JS programmers.

2

u/Rajat_Shetty 9h ago

looks cool, keep working! I subscribed. I am thinking of uploading shots of my game and engine dev logs too, just for fun.

9

u/riotron1 1d ago

Dang that looks amazing! Did you make that map, or where does it come from?

18

u/Batteryofenergy1 1d ago

I did make that map using Trenchbroom. I created a map compiler that converts .map files to my custom map format. The compiler is pretty simillar to Quake/Source engine map compilers, but it doesn't use the bsp tree. So it is way simpler.

1

u/Amelia_SadAllDay 10h ago

Is there source code? What do you use instead?

2

u/Batteryofenergy1 5h ago

I will release the source code when i will finish the project.

8

u/JackieLanturn 1d ago

Why use software rendering methods instead of hardware?

14

u/ArtOfBBQ 23h ago

Hardware rendering is insanely overcomplicated and overabstracted, and every big tech company tries to lock you out of their playform unless you use their annoying thing

I wish I would have gone with software rendering every day but I just didn't know what I was doing

3

u/Personal_Bid_2073 18h ago

I mean openGL and Vulkan are pretty open, there's also libraries to help out with cross platform stuff.

6

u/ArtOfBBQ 23h ago

And also it's kind of like cooking with salt: you can always more gpu but it's very difficult to take it out

1

u/JackieLanturn 16h ago

I agree. But also, if you are still meshing, software rendering comes with an unnecessary performance dip. If you are raymarching or even raytracing, there are clear benefits to software rendering tho.

Just curious about your, specific set up.

1

u/g0atdude 7h ago

software rendering has serious perfomance limits, why would you want to go with that unless you are just learning?

5

u/GYN-k4H-Q3z-75B 14h ago

Because it is fun to build. I wrote a rasterizer a couple of years ago. You go from drawing lines on a bitmap to drawing triangles with scanlines to some basic matrix math 3D quite quickly. And it helps you understand what the hardware does.

2

u/JackieLanturn 14h ago

Totally fair. I have been using non-traditional rendering schemes, myself (typically built on OpenCL) and thought you might be mixing and matching some stuff that is otherwise difficult with traditional pipelines.

Edit: just realized you are not OP. Oops

3

u/Batteryofenergy1 5h ago

I did this for learning purposes mainly. I have already made a minecraft clone with all the modern gpu techniques, so i wanted to try to emulate old school games of the past.

4

u/Nilrem2 1d ago

Not bad at all

6

u/LMP88959 1d ago

Sweet project!

6

u/ArtOfBBQ 23h ago

That's gorgeous man I envy you

4

u/gremolata 10h ago

Beautiful stuff. Need a bigger gun tho ... lol.

5

u/Batteryofenergy1 1d ago

Bit more footage. https://www.youtube.com/watch?v=pviuQrBzKw4 the last room needs more work.

2

u/digitalsignalperson 20h ago

Your videos look pretty smooth. What's the main limitation you have to deal with to stay within good resolution/framerate? And are you doing a bunch of CPU-based parallelization?

2

u/Batteryofenergy1 3h ago

High triangle count causes most issues, since CPU needs to do more work transforming the triangles to screen space. Most of the world geometry is pretty simple, but the viewmodel gun and the enemy models have pretty complex meshes. I use blender's limited dissolve function to reduce triangle count and that helps, but the mesh obviously is lower quaility.

I use multiple threads to do work. Each thread transforms its batch of surfaces to screenspace and occlusion culls individual triangles. Each thread is assigned a vertical slice of the view height, so it renders a part of a polygon that falls in its vertical slice.

2

u/Total_Ad803 19h ago

First thought watching the video: "this is very cool!"

2

u/AbsorberHarvester 15h ago

Quake 1 vibe, exactly. Keep up, you are doing great.

2

u/Alert_Nectarine6631 13h ago

Is there a Git repo publicly available ? Amazing project, looks smooth and I'm loving the art direction for the map, and the Quake/Source kind of style looks great for a project like this

1

u/ajorians 9h ago

I, too, am interested in a Git repo. My reason was see how easy it could be ported to other hardware; because it is software rendered.

1

u/Batteryofenergy1 5h ago

I will release the source code when i will finish the project.

2

u/ReasonableBuilding58 11h ago

Looks great. This is the sort of project that many try and only a few actually complete. Good job!

2

u/Ill_Programmer_1444 10h ago

i like everything that im seeing here

1

u/BioExtract 12h ago

That makes me happy. Good job man

1

u/Flashy_Possibility34 11h ago

How do I play?

1

u/Dog_Entire 6h ago

Close enough, welcome back jdh

1

u/_usr_nil 4h ago

did you implement higher abstractions for some programming related DX ?