English 中文(简体)
What features would you like to see in a game programming DSL?
原标题:

Me and my friend are in the first stages of creating a domain-specific language designed for game programming, for his thesis paper.

The language will be fairly low-level, it will have a C-like syntax, optional garbage collection, and will be geared towards systems that have little memory or processing power (ie. Nintendo DS), but should be powerful enough to facilitate PC development easily. It won t be a scripting language, but a compiled one, but as we don t want to spend months writing a normal compiler, the first implementation will basically be a LanguageName-to-C translator, with TCC or GCC as the end compiler.

Now, I have a question for all you game programmers out there:

What would you like to see in such a language? What features, implementation- and syntax-wise, would be best for it? What to avoid?

Edit:

Some things we already thought up:

  • state-based objects - an object can exist in one of it s states (or sub-states)
  • events and functions - events don t have to exist to be called, and can bubble up
  • limited dynamic allocation and pointer support - we want it to be as safe as possible
  • support for object compositing (Hero is composed (dynamically) of Actor, Hurtable, Steerable, etc.)
  • "resources" in states, loaded and unloaded automatically at beginning/end of state (for example, an OpenGL texture object is a resource)
  • basic support for localization and serialization
  • a syntax that is quickly parsable
  • we want to make the language as consistent as possible: everything is passed as value, every declaration has predictable syntax (eg. function retType name(type arg) is (qualifier, list) { }; no const, static, public qualifiers anywhere except in the qualifier list), etc.
问题回答

Something to make concurrent programming easier. A blend of Erlang and C++ perhaps. I ve been thinking about this on and off ever since the Cell processor was announced but it would take a serious chunk of R&D time to develop it and solve many of the problems that already have solutions in traditional C++ programs.

Personally I enjoy writing games that are able to access the wide, wide audience of the web. Would be beyond interesting to make it simple to interface between the desktop and the web.

That is probably more the domain of apps built with the language than the language itself, I suppose, but perhaps something that s useful to keep in mind during the design phase.

So, I don t want to really bust your bubble, but... maybe I should? As a professional game developer, I have to say that there really need to be three types of "languages" for game development.

First, there s your engine-level language. This is typically C++. It s all about performance. The artifacts of gameplay are not meant to be implemented here (sadly, they often are).

Next comes the gameplay language. This is lightweight, easy to understand, and designed for rapid iteration.

Finally, there is some sort of visual scripting language. This is the lightest of all and is geared toward non-programmers (level designers, etc.).

That being said:

Definitely check out UnrealScript. It s used throughout the industry (since the Unreal Engine is a cornerstone of FPS game development).

I would highly recommend supporting:

  • Concurrent programming (check out what CCP does with Stackless Python for Eve Online)
  • Network replication (check out UnrealScript, you can tag functions to run on either the server or the client, or to be safe to run on the client, etc.)
  • State (as mentioned) would be great. UnrealScript has this facility. This needs to be safely done (i.e., enter and exit at any point, complex transitions handled elegantly, etc.)

Good luck!





相关问题
Treetop: How to make combined rule?

I want to make a simple JSP parser by using Treetop. Now, I have the following problem: My basic grammar for starting is: grammar Jspgrammar rule jspToken <% end rule ...

Language neutral custom tool

I m working on a DSL tool, and for this tool, there exists a custom code generation tool that creates output files. Currently, this tool is registered with C# using a RegistrationAttribute on the ...

How should I construct a finance DSL?

I ve decided to build a database tracking the credit card offers I get in the mail, and one confounding factor has been how to represent the offers. With minimum finance charges and variable rates and ...

How do I build a domain-specific query language?

I have a biology database that I would like to query. There is also a given terminology bank I have access to that has formalizable predicates. I would like to build a query language for this DB using ...

Stop and continue while evaluation an expression tree

At the office, we ve applied simple Domain Specific Languages (DSLs) to several problem domains we encountered. Basically, we parse (lex/yacc) the custom script into an expression tree. Every node ...

Language to create flowcharts [closed]

This seems like something which must have been answered before, but I can t find anything appropriate in the question archives. Basically, I m looking for a little Domain Specific Language to create ...

热门标签