r/C_Programming • • Oct 18 '26

Some progress on Software Rendered game in C

755 Upvotes

47 comments sorted by

59

u/tastygames_official Oct 18 '26

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

30

u/Batteryofenergy1 Oct 18 '26

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

26

u/hellocppdotdev Oct 19 '26

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

2

u/tastygames_official Oct 20 '26

*MODERN javascript (aka typescript/ECMAScript 5) programmers

I was doing javascript (ECMA 3?) for decades, back when it was considered "DHTML" and long before the "JS frameworks" took over. But once they did, boy do I ever agree with you.

I actually like javascript (and PHP) for web technologies because they are actually quite C-like (albeit not strongly-typed) and very simple. Or again - at least they WERE. PHP5 introduced OOP concepts and it was all downhill from there. Just like how ES4 (I think - maybe 5) introduced lambda notation and typescript as a superset of JS/ECMA that turned the landscape into an OOP shitfest.

But yes - reading is good ;-)

2

u/hellocppdotdev Oct 20 '26

My main language is PHP, reading is so hard...

1

u/tastygames_official Oct 20 '26

the language doesn't make a person - it's how you use it. Just look at "high English" vs. "street slang". Obviously they both have their use cases and neither is right or wrong, but when used CORRECTLY; any language can be perfect for the job. If you use a framework like Zend or Laravel, then reading is indeed hard as it's all about just writing a line or two and letting the framework do the work (at the cost of performance and understanding and extensibility). If you write each script from scratch (using the language properly) then it's another story...

2

u/Rajat_Shetty Oct 19 '26

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

13

u/riotron1 Oct 18 '26

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

19

u/Batteryofenergy1 Oct 18 '26

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 Oct 19 '26

Is there source code? What do you use instead?

3

u/Batteryofenergy1 Oct 19 '26

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

11

u/JackieLanturn Oct 18 '26

Why use software rendering methods instead of hardware?

8

u/Batteryofenergy1 Oct 19 '26

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.

21

u/ArtOfBBQ Oct 18 '26

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

8

u/Personal_Bid_2073 Oct 19 '26

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

9

u/ArtOfBBQ Oct 18 '26

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

4

u/g0atdude Oct 19 '26

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

2

u/JackieLanturn Oct 19 '26

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.

7

u/GYN-k4H-Q3z-75B Oct 19 '26

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 Oct 19 '26

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

5

u/Alert_Nectarine6631 Oct 19 '26

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

3

u/Batteryofenergy1 Oct 19 '26

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

1

u/mikeblas Oct 28 '26

Since you've not posted code, this is off topic -- there's no C programming here. We don't accept demos. Sorry, but I've locked your post.

2

u/ajorians Oct 19 '26

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.

5

u/Batteryofenergy1 Oct 18 '26

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

2

u/digitalsignalperson Oct 19 '26

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?

3

u/Batteryofenergy1 Oct 19 '26

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.

1

u/digitalsignalperson Oct 20 '26

I wonder if this concept would apply well to software rendering: https://www.dgtlgrove.com/p/multi-core-by-default

2

u/AsexualSuccubus Oct 20 '26

It does! The only annoying part is accounting for the triangles gained from clipping.

7

u/LMP88959 Oct 18 '26

Sweet project!

5

u/Nilrem2 Oct 18 '26

Not bad at all

5

u/ArtOfBBQ Oct 18 '26

That's gorgeous man I envy you

4

u/gremolata Oct 19 '26

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

1

u/Dapper-Message-2066 Oct 21 '26

Excuse my ignorance, but how are you actually getting images onto the screen? I get how you can software render everything to a buffer, but what api are you using to actually get it displayed - don't you have to talk GPU at least a bit at that point?

1

u/Batteryofenergy1 Oct 21 '26

I use openGL to upload the buffer.

2

u/Total_Ad803 Oct 19 '26

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

2

u/AbsorberHarvester Oct 19 '26

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

2

u/ReasonableBuilding58 Oct 19 '26

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

2

u/Ill_Programmer_1444 Oct 19 '26

i like everything that im seeing here

1

u/Synaptic-Sugar Oct 22 '26

Beautiful! I assume you're multi-threading the rendering? And do you use SIMD instructions (or libraries that use them under the hood, a la glm)?

(I've coincidentally been writing a software renderer in ... JS (no WASM nor external libraries for the fun and challenge of it) 😅 Because my initial inspiration was to make 3D in a game's scripting language that's quite JS-like, so relatively portable. It's now just become a fun learning experience foremost - I'm not sure I'll ever actually port it to that game but I've been considering porting it to C++ (my usual language of preference) :P)

1

u/Bona_Fide3 Oct 22 '26

vibe coded?

1

u/BioExtract Oct 19 '26

That makes me happy. Good job man

1

u/Dog_Entire Oct 19 '26

Close enough, welcome back jdh

1

u/_usr_nil Oct 19 '26

did you implement higher abstractions for some programming related DX ?

1

u/United-Asparagus-940 Oct 19 '26

I hope this game blows up so 20 years later we get to play it on white blood cells level

1

u/Winter_Rosa Oct 20 '26

cool work, I like the environment a lot.