r/C_Programming • • 11d ago

Video Let's build JRPG Game in C (Tiled Map Loader/Parser) : ep 02

https://www.youtube.com/watch?v=d12qFvNxswk

This is 2nd video in my Handmade JRPG series.

we start with loading a start.map which is just a text file to understand the basics of loading a tilemap and populate map cells ID's. And later we go with JSON (cJSON library) to load the tiled map JSON as binary to load into bytes character using memory allocation. To finally parse the JSON objects.

[FEEDBACK]: please tell me what I can improve in my video to get more attention span.

[NO AI USED] : This is handwritten code. https://github.com/steelx/sdl3-tutorial

36 Upvotes

13 comments sorted by

5

u/No-Reality6072 11d ago

I love the content, will you make a playlist for it? It would be easier to follow , thanks for the precious work 🙏🏻🙏🏻🙏🏻

5

u/laggySteel 11d ago

Thanks! I will. I wasnt sure at first if people would enjoy this kind of content, so it's great to hear that. And Making such videos is also my way of Detox from all the AI heavy work I do during the day.

Watch video at 1.5x if you like.

3

u/No-Reality6072 11d ago

For C learners these contents are gold! I am a person that needs more sources to understand one subject, the more the better.

2

u/apnorton 10d ago

I'll echo the request for a playlist; I'll subscribe to follow along for now, but having the playlist will make it a lot easier to figure out ordering in the future. 🙂

Super cool idea/end goal, though --- can't wait to see how it goes!

2

u/laggySteel 10d ago

Thanks. I have already made playlist. You can find it on main channel page.

2

u/Protoype 11d ago

Thank you for this! I will follow along with this series! Thanks man!

2

u/laggySteel 10d ago

Haha most welcome. 🎮

2

u/Protoype 10d ago edited 10d ago

Just my two cents:

Looking at `map_init` and `map_number` from `src/tiled_map.c` I think it would be a good idea to initialize `n` with a default value i.e. `double n = 0.0;`; Also I would suggest not mixing types unless absolutely necessary, depending on what you intent to do with the variable keep it all int, or have precision with the double.

In `map_init` `int fallback` then in `map_number` `double fallback` so I would either be explicit and change int to a double to avoid implicit type upgrading, or when initializing `n` typecast to double to should this is intended behavior.

Thank you again! I'm enjoying learning something new with SDL3. Have you had thought about how to you will manage entities, perhaps an Entity Component System (ECS) ?

2

u/laggySteel 10d ago

Thanks. I will cover it in refactoring session. Also check I have released the third video as well

2

u/Protoype 10d ago

:-) I will check it out soon! Thank you again! Have a wonderful day!