Re: ideal way of creating a map parcer?
Ethin, you need to stop. If people feel as you do, then they simply won't take ctoth up on his advice. If you're right, then they'll take him up on it and come back and join you in your crusade. If you're wrong, then you learn that you're wrong and you can make the same jump, and you become more productive. In none of these cases do you actually lose anything. You are consistently trying to "correct" people who have an additional 10 years of experience, is it inconceivable that an additional 10 years of learning might teach something you don't know? Perhaps that the things you think are good are actually things you're going to have to completely unlearn at some point, if you want to keep becoming a better programmer? Because both of us have been there and we've had other threads on this forum by other people who were there too. I spent a significant amount of time in the basic variant
s, all they do is teach you how to program in a manner that is so far from what everyone else is doing that it's like traveling to an alternate universe when you finally try to leave.
Parsing your map is not a performance-intensive task. If a parser in C++ takes 10 MS and we make it 100 times slower by using languages that are even slower than Python is perceived to be, it is still 1000 MS. This is still almost instant in human time and doesn't affect the rest of your game's performance. You're complaining about a blink or you'll miss it while the game loads for a second pause. Furthermore, basically every popular interpreted language has a way to implement the really performance intensive parts in C; PyYaml, Json, and the Python-only pickle format have C implementations. There are yet more, if none of those are to your taste.
You're also assuming that the map is stored as a string: while this is useful, it's
not the only way, and when you're in a language that can basically dump anything at all to disk in a couple lines, you can often just save the map in a faster and smaller binary format. While this may be avoided in favor of not having to write in-game map creation tools, you can still use it to cache pre-parsed maps and load them in one line: pickle.load(file("map.cached")). In fact, one of the easiest ways to do it is to simply do map.py, manipulate the game objects to be however you want, and then to serialize them with your favorite format, usually in just 2 or 3 lines; this is the initial game state, and further updates caused by the player can also be pickled without much effort.
There is no best programming language. I can technically do everything from C. It will technically be fast. But fast doesn't matter in most cases, all that matters is fast enough. If you need an OS kernel for a project, then you're at t
he point in your programming career where language doesn't matter so much anyway, and you'll just switch for that part. While some languages can technically "do everything", no language can do everything well, and you have to make trade-offs based on the project. Libaudioverse is a multi-language project because C++ is not good at the parts that I'm using Python for, namely performant string manipulation without undue effort.
As for basic, if basic were really so good for beginners as you claim, then all of our universities would still be teaching it in the introductory classes. They aren't. Basic is good for the days when we had only 64K of ram and you couldn't do stuff like look at other lines than the current one. It's a fallback and choosing it is a way to avoid 20 or 30 years of "How can we get your programming languages to automatically solve problems so we don't have to solve them ourselves o
ver and over?" BGT takes us down to 20, or thereabouts, but it's still behind everyone else by a very significant margin. These languages manage to do some things okay, but they fail to do anything well.
I would say that since Ctoth is one of the small minority of game devs who has written an FPS, quite probably knows Python better than I do, and is making a living off his programming, his advice carries more weight than Ethin's. And he's offering to help you move to a language where people will want to give you significant amounts of money for being good at it, too.
_______________________________________________ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector