Applies to all software development, in my experience…
I think it applies to basically any goal you set your mind to.
It’s like someone looked deeply into my past.
One thing I disagree with: Why not YAML? I like using that for gamedev, plenty of libraries to handle the parsing for you and minimal bullshit. After all, you need something to define your entities in and chances are that you are using something where it is easier to reload a text file than dynamically recompile your code.
Lua! Reloading a text file and dynamically recompiling your code are equally easy.
The only caveats being the Lua file can technically do whatever it wants to global scope. On the flip side, who cares this is way easier.
The only caveats being the Lua file can technically do whatever it wants to global scope.
Eh; it takes about three additional lines to sandbox it so it can’t touch global scope. <3 Lua for this kind of thing.
From experience of integrating Lua in two different projects getting the VM 100% watertight is easy to get wrong. When you get a void* from the VM it can really be any pointer you ever passed to it, so if you have two different kinds of structs you expose to Lua, you’ll have to add magic numbers to catch abuse. The default module loader uses the file system so you’ll want to replace that with your own (with little docs and example code on how to do that). More troubles I remember: Having multiple wrapper objects for the same native object. Having to maintain lists of Lua objects within the VM but hidden from usercode to loop over all X to inject data from the native side / run callbacks.
It was very nice in the end. I even had non-transitive imports (A imports B, B imports C, B can use all objects of C in its scope but only the globals originating from B are visible from A) But it took many many hours and I’m not quite sure if it saved time overall.
Takeaway from OP is probably: “Just use Unity/C#” Personally I like following up on all these interesting problems like how to integrate Lua despite it not being the best thing to do right now because my actual goal is exploration of technlogy, not making a game.
When you get a void* from the VM it can really be any pointer you ever passed to it, so if you have two different kinds of structs you expose to Lua, you’ll have to add magic numbers to catch abuse.
I just make sure all my [light]userdata have metatables. Before I cast them in C I check the metafield __name is what I gave in luaL_newmetatable. You could thwart this by changing the metatable name to some other valid name, but there isn’t really a way to do that on accident.
I even had non-transitive imports (A imports B, B imports C, B can use all objects of C in its scope but only the globals originating from B are visible from A)
Pretty sure this is standard practice. It’s described in PIL chapter 15.
PIL suggests achieving this by explicitly listing every single symbol one more time at the end. I didn’t want that.
I draw UML diagrams…
(although, not “real” ones, like following standards closely. I just think UML is a great notation for hand-drawing of component layout)
If you never strayed from the path you would never come upon that pond and you might not end up late to school. Afterwards when you went to the pond after school you saw a girl there fishing and you went up to her and talked about stuff because you were too young to be afraid of girls. And when you grow up you have forgotten all those days that you were not late to school.
This is a contrived example but so many times when I ask people “How did you get into X?” the answer is the guy was doing Y but saw a glimmer in the woods and strayed from the path.
So don’t close your eyes and pretend the rest of the world is “not your problem” because as a lot of people say: problems are really opportunities in disguise.
There’s plenty of good advice in this article. Though it feels like I’ve learnt these lessons even though I’ve never released any game or another “real” project for that matter. There are a few points I disagree on; maybe these are the lessons I’ve yet to learn, or maybe it’s just that I’ve got some “expert” experience on my side. For instance, I’ve been programming as a hobby for 18 years, and I’ve used C for most of that time. Pointers, make? I don’t need to learn them. So yes I would actually start making my own cross-platform game engine in C, it’s totally within my comfort zone, and indeed it is what I want to do.
The single biggest stumbling block I can think of up front is selling myself, unfortunately. See, I’m a shy awkward introverted nerd, a pessimist, and a little too honest for my own good. I don’t have enough money in my pockets to keep me working on my own project for the next 12 months, so I’ll have to sell myself as a capable person and my idea as a good one in order to be eligible for the startup fund (monthly allowance comparable to unemployment benefits, barely covers the rent, it’s taxpayer money) and a loan preferrably backed by the state.
If I can overcome that obstacle, the biggest and most important challenge will be to stay completely focused, keep the project actually moving forward, not get distracted, not get overly ambitious and start working on too many features than I can deliver in the given time budget.