Tag Info

Hot answers tagged

65

Scripts are usually compiled at run time, while the host language will be compiled at compile time. This means that we don't need to recompile if the script changes. Recompiling a full game can take minutes to hours, which implies a big productivity hit. Usually, the critical code or backend code will not be scripted. This code should run fast and often ...


64

Scripting is a programming abstraction in which you (conceptually) have a program (the script) running inside another program (the host). In most cases, the language in which you write the script is different from the language in which the host is written, but any program-inside-a-program abstraction could be considered scripting. Conceptually, the common ...


38

No. At least, probably not. This is a very frequent case of reinventing the wheel is game development, a mistake that is still quite popular. If you're asking this question, you're very likely to be influenced by what others do, so just look at what Epic Games just did with the Unreal Engine: UE3 had a custom, weird, non-optimized, hard-to-debug ...


36

Unity is growing in popularity in the industry, mostly in smaller companies. However, it is an excellent teaching environment. It is an important teaching tool, but not particularly common among mainstream companies. It's okay that you don't prefer it. Let me note something here, though, as I often see a confusion among programming students. "C++ ...


33

Lua is widely used in the game industry. From independent games (Aquaria) to AAA titles (Civilization). The core reason? I would say because it is easy to learn and easy to incorporate into your games. But the same could be said for Python, I'm sure. Scripting, in general, isn't difficult. I think the real reason you should go with Lua is because it's ...


25

Unity is a perfectly valid solution in this context. Imagine for a second having 12 people, most of whom are still in the process of learning C++, writing a large and complex game application using it. In the amount of time spent debugging alone you will probably have been able to write another game in Unity. I'm not saying knowing how to use C++ is not ...


17

First of all, you should decide what part of your game is scripted. One option is to have a fully scripted game in the sense that while the time-critical backend operations are coded in C++, all the game logic is in the scripting language. Designers use the backend as a library called from the high level scripting language. On the other extreme, you can have ...


16

Scripts are written for a scripting language. People can use the words in slang sentences to get the muddling that you are referring to but ask anyone for the definitions of Script, Scripting and Scripting Language and you will get something like: Scripting is the act of writing Scripts using a Scripting Language. When you embed a scripting language into a ...


15

Dialogue could be provided in any form/structure you wish it depends on how you parse the information that makes the difference. I will provide you with a basic XML syntax to get you started without understanding your games structure or language I afraid i cant provide an implementation. <?xml version="1.0" encoding="UTF-8"?> <npcs> ...


15

I advocate not using a scripting language in C#. C# is already solves the vast majority of problems that a scripting engine is used to solve. Just use C# in the way you would use a scripting language. Because I've been over this several times before, here is some reading material for you: A scripting language for XNA (duplicate of your question, but on ...


14

My game uses an entity component framework and uses scripts to define entities (this doesn't directly define behavior, I'll talk more about that at the end). The scripts define the actual components to be used for creating each entity. It uses a simple scripting language I created. Here is a simplified version of one of my scripts: ENTITY:"Goblin" { ...


13

Squirrel Squirrel has an interesting history. It was built after a game architect had issues with Lua's unpredictable garbage collection, and crazy everything is null even if it doesn't exist. Squirrel is the sripting language used in Left 4 Dead 2. The API is very lua-like (Squirrel's author loves Lua's design). So Squirrel is an awesome language as ...


12

The term you want to search for here is "coroutines" (and usually the language keyword or function name is yield). Coroutines are program components that generalize subroutines to allow multiple entry points for suspending and resuming execution at certain locations. The implementation will depend first of all on your language. For a game you want the ...


12

The major advantage that comes to my mind is that it allows the configuration to be edited/managed by a non-programmer without requiring them to touch any of the game scripts.


12

Unity is using Mono behind the scenes. Every time you make a change to your C#/UnityScript scripts it recompiles the code almost instantly. If you look in the data directory of a standalone unity player, you can see it has compiled all the scripts into Assembly-CSharp.dll, or similar. So yes, the C# is being compiled.


11

I can't compare the two, as I've only had experience embedding IronPython in a C# game so far. Here's what I like about it though: 1) It's easy! Download the IronPython DLLs, add reference in project, using IronPython.Hosting; var engine = Python.CreateEngine(); var product = engine.Execute<System.Numerics.BigInteger>(@" print ' ...


10

Using scripting has many advantages over "core language". Some of these include: Moving (more) of the content from core developers to artists, freeing the core developers to engine tasks from gameplay tasks Scripts tend to be sandboxed, can't do anything really dangerous in it Modifying scripts does not require recompilation and re-execution of the game


10

There are a few ways you can work to avoid tight script coupling. Internal to Unity is a SendMessage function that when targetted at a Monobehaviour's GameObject sends that message to everything on the game object. So you might have something like this in your health object: [SerializeField] private int _currentHealth; public int currentHealth { get { ...


9

As far as simple, "one-liner" scripts are concerned, Lua is a perfectly legitimate choice. Function binding is easy, even with the native API (though there are plenty of helpers for this). It's syntax is pretty easy to learn. Oh, and the runtime is tiny, if that sort of thing matters to you. You won't even have to include its standard libraries, so it'll be ...


9

Treat scripts like the GPU treats shaders- no global variables, limited inputs and outputs, that is, enforce thread safety via language rules.


9

Are there a lot of companies using it because they can't afford to use something else? Yes, but "afford" is so much more than just straight up dollar values. Yes, the feature set that Unity Pro gives you at the cost they charge is ridiculous, especially considering the fact that it's seat licenses instead of per-title licenses. But on top of that, ...


9

Lua-scripted video games Lua-scriptable game engines I think Lua is the best shot. This article is about integrating Lua and C++. It says: LuaBind is great product but for me it looked too complicated. For one the code is not easy to follow where the classes and objects are. Also seeing that I wanted to integrate Lua into a wxWidgets application, using ...


9

Scripting languages for game logic is a very good example of the software architecture pattern Alternate Hard and Soft Layers. There's a good discussion on that site (and others I'm sure) on the benefits of doing so.


8

@Michael directed me to an excellent resource for exporting bones from Blender. It provides all the information I needed. It's actually already built into Blender, it's the DirectX Model Format. Go to user preferences, addon section, "Import-Export" category and install "DirectX Model Format (.x)". Then use File->Export to select the newly added format. ...


8

Both, in general. Your scripts should talk to an abstracted -- or at least intermediate -- layer of functionality and not the engine itself. First, this provides you an extra measure of control and security. It allows you to easily, cleanly define the interface a script is allowed to have with your game and thus what it can muck about with, as well as ...


7

I've figured out how to do this. As I expected, since IronPython compiles down to CLR, C# and IronPython objects can interact with each other just fine with no special treatment necessary. I've created a script which actually creates a new type of Component which can be referenced just fine from C#. A brief word on my game's structure: Its solution has two ...


7

My suggestion is honestly just to find a format that Blender will export its bones as well, and then look through the script of that format exporter. I was doing something similar and realized how much of a pain it was to find a good resource on exporting bones. But here's this specification that helped me a lot, on armature modules


7

V8 Javascript from google. PRO's : Quite easy to use Constantly getting better Powerful and flexible Others As many mentioned , javascript is a common programmer tool. Adding it to my games has opened far more people who feel capable than other languages. It also supports a huge amount of casting and conversion to save on work for the programmer, also ...


7

Each new lua class is two lines. Each new C++ class is pain. No whining about types when all you want is shuffle values around. Garbage collection. Script code is nicely isolated in virtual machines, away from all those nasty wandering segfaults and array overflows.



Only top voted, non community-wiki answers of a minimum length are eligible