5 ms·
...and this is how we get unnecessarily bloated software with ungodly dependency chains and complex build systems. Sometimes a purpose-built module that addres
by svvcfb1212 6y ago
...and this is how we get unnecessarily bloated software with ungodly dependency chains and complex build systems.
Sometimes a purpose-built module that addresses the need and maintains simplicity is preferable over complexity in the interest of some future potential feature that nobody has asked for yet, and may never ask for.
- outworlder 6y agoThose Scheme interpreters are tiny! I can guarantee you that a game will need a scripting language. Better get that done already. That's if you prefer Scheme. You could use Lua too.
- learc83 6y ago>I can guarantee you that a game will need a scripting language. Better get that done already. Myself and thousands of people before and after me have written games without a scripting language.
- outworlder 6y agoYou _can_ write a game without any scripting language support whatsoever. You could also write the whole game in assembly if you so desired. However, if every single time you want to change any piece of logic in your game, you have to do the edit/compile cycle, your development will be extremely slow. Especially if you compare with the ability to change code while the game is running. Not having all the game logic in C or what have you makes the game easier to mod too.
- pengaru 6y agoFast iteration can be achieved with compiled game logic as well, it all comes down to how things are factored in your project. An excellent example most with OpenGL experience may be familiar with is supporting hot reloading of GLSL for fast vfx development iteration. It's a compiled language, it gets compiled at runtime without significant delay, and most of us making games have created simple tools to support live editing of GLSL, maybe even supporting it in-game for dev builds. The demoscene has even turned it into a form of competitive performance art: https://github.com/Gargaj/Bonzomatic https://github.com/Gargaj/Bonzomatic Edit: Forgot to mention Casey also goes through support of hot-reloading game logic using C in the Handmade Hero series on YouTube.
- learc83 6y ago>However, if every single time you want to change any piece of logic in your game, you have to do the edit/compile cycle, your development will be extremely slow. Especially if you compare with the ability to change code while the game is running. 1. I'm working on a game in Unity right now that takes about 10 seconds to compile and reload the assemblies for the scripting language (only about 2 seconds of that is actual compilation, the rest is time that would be applicable to an interpreted scripting language). 2. I've built games in C where the entire project took 4 seconds to compile. Incremental compilation and modular architecture can get that down to near instantaneous for most changes. >Especially if you compare with the ability to change code while the game is running. Take a look at handmade hero for an example of an architecture that allows you to hot-reload C code while the game is running. >Not having all the game logic in C or what have you makes the game easier to mod too. That's completely architecturally dependent. You can make a game easy to mod for non programmers by storing data in a human readable/editable format. If you want to make it easy for players to write code there's a lot more work that needs to be done than just using a scripting language. For most games worrying about allowing modders to easily edit code is premature optimization.
- svvcfb1212 6y ago> For most games worrying about allowing modders to easily edit code is premature optimization. I was involved in a game project that died extremely quickly a few years ago. The project lead made every decision re: architecture, tooling, etc. somehow involve worrying about modding. As a result, we ended up with nothing to show since everything got derailed by a bizarre obsession by one person with modding before we even had anything to mod. I believe that person doesn't take lead roles on projects any longer...
- heavenlyblue 6y agoYou could just expose the logic as DLLs though
- pengaru 6y ago> I can guarantee you that a game will need a scripting language. Better get that done already. Is that really so certain? http://www.youtube.com/watch?v=y2Wmz15aXk0 http://www.youtube.com/watch?v=y2Wmz15aXk0
- dfox 6y agoThe issue with scripting engine for game is that for game your almost certainly need scripting engine with completely different semantics than whatever existing implementation will provide. Ie. you either need to save the state or replicate it over network, both with reasonable performance. And looking at various AAA games (from modding standpoint) there is embedded Lua or Python that mostly only changes state of some lower level VM, which more often that not is itself turing-complete.
- pansa2 6y ago> I can guarantee you that a game will need a scripting language. Embedding a scripting language (e.g. Lua) seemed to be very common around 2010, but I get the feeling that it's much less common today. Has the use of embedded scripting languages in games declined over the last 10 years? Any particular reasons?
- zem 6y agos7 scheme is pretty trivial to embed in a c project, it consists of an s7.c and s7.h file that you just add to your source tree, no other dependencies. https://ccrma.stanford.edu/software/snd/snd/s7.html https://ccrma.stanford.edu/software/snd/snd/s7.html
- Turing_Machine 6y agoS7 is definitely the way to go if you want to embed Scheme with the absolute minimum of hassle.