Sign in to follow this  
oamsath

A New DSL for Games

Recommended Posts

Hello.

I've posted here a few weeks ago about an idea i was hammering. I've refined it and removed some unnecessary features as it wasn't really needed.

I'm a last year computer science student and this idea is for my graduation project.
It is about a new programming language for games. It will be written in C++.

This new language is a DSL. this means that it will contain features specific to games only. Screen, Texture, Sound, and Model will be data types just like int, float, and double in other languages.

The main focus will be on two things:
1- Easy to learn: I intend to have a learning curve of maximum one week. It will be very easy for starting programmers to develop good games with it.
2- Fast: this language will not be translated to executable files, but will be translated into C++ using OpenGL library for drawing, and then calling MingW compiler to build the executable.

I know many people were dreaming about this idea. But all the existing languages didn't really focus on easy to learn rather that fast. I want to create THE BEGINNERS LANGUAGE for games.

I've tested many aspects and an initial design and was ready to start this project. but an experienced friend of mine asked me this one question:
[QUOTE]Him: Did you hear of a big Gaming Software company making a language just like yours?
Me: none that I heard of..
Him: Why?
Me: I don't know. how can I find out?
Him: post on online forums and ask more experienced programmers.[/QUOTE]

And here I'm. Really need your comments.

Share this post


Link to post
Share on other sites
I thinking that making a new game-oriented language isn't a very useful exercise, but:[quote name='oamsath' timestamp='1313332861' post='4848977']I want to create THE BEGINNERS LANGUAGE for games.[/quote]^^^ this makes it a much more useful idea [img]http://public.gamedev.net/public/style_emoticons/default/wink.gif[/img]

The main competitor that comes to mind is [url="http://www.thegamecreators.com/?m=view_product&id=2030"]DarkBASIC[/url].

Share this post


Link to post
Share on other sites
Really?
I don't get your point. To write a game you have to understand how a programm works and how to implement certain mechanics. There are already alot of languages out there and to be honest from a user point of view i don't really see a difference. Certain languages have some cool extra features but in the end its all about creating objects and run functions on data. What you want to create a game is an API that allows you to quickly create certain behaviours. But that is already there its called a game engine. This engine implements interfaces to quickly load/display graphics, play sounds, process user input, send data across the network, save/load data from memory. Now you can create such APIs in all avaible languages. I don't really think there is a need for another language just for games. It doesn't make any sense. If you really want to make it easy for a person to create a game then ask that person which language he/she is comfortable with and then create an API in that language.
Another way you could approach it which would really be easy for a beginner is a graphical way. basicly you have precoded stuff and you link it together.
just like with unreal engine 3 it graphical scripting interface is really simple to grasp and makes it easy for someone to implement behaviour.

Share this post


Link to post
Share on other sites
[quote name='Sudi' timestamp='1313334667' post='4848988']
Really?
I don't get your point. To write a game you have to understand how a programm works and how to implement certain mechanics. There are already alot of languages out there and to be honest from a user point of view i don't really see a difference. Certain languages have some cool extra features but in the end its all about creating objects and run functions on data. What you want to create a game is an API that allows you to quickly create certain behaviours. But that is already there its called a game engine. This engine implements interfaces to quickly load/display graphics, play sounds, process user input, send data across the network, save/load data from memory. Now you can create such APIs in all avaible languages. I don't really think there is a need for another language just for games. It doesn't make any sense. If you really want to make it easy for a person to create a game then ask that person which language he/she is comfortable with and then create an API in that language.
Another way you could approach it which would really be easy for a beginner is a graphical way. basicly you have precoded stuff and you link it together.
just like with unreal engine 3 it graphical scripting interface is really simple to grasp and makes it easy for someone to implement behaviour.
[/quote]

The difference between a library and a language is great.
[list][*]if you had no experience what so ever to programming, and I gave you a language / IDE that you can learn in one week, to produce excellent 2D games (as an example), it handles all the complex stuff ![*]If I told you I will make a C++ library to handle these things, and you have to call it alone, you will spend months getting good in c++ before actually learning the features of my library.[/list]This is not about creating stunning 3D scenes and shader effects. It is about providing the normal person a wan to make games without having experience in advanced languages. if we take DarkBasic for example (although this is not the best example), of coarse most game companies will prefer working with Direct X or Unreal Script to produce their games, but a team of two or three students will prefer DarkBasic ALOT to make a casual game during a summer vacation.

Share this post


Link to post
Share on other sites
[quote name='oamsath' timestamp='1313332861' post='4848977']
This new language is a DSL. this means that it will contain features specific to games only. Screen, Texture, Sound, and Model will be data types just like int, float, and double in other languages.

The main focus will be on two things:
1- Easy to learn: I intend to have a learning curve of maximum one week. It will be very easy for starting programmers to develop good games with it.
2- Fast: this language will not be translated to executable files, but will be translated into C++ using OpenGL library for drawing, and then calling MingW compiler to build the executable.
[/quote]

I'm working on the exact same thing, or at least it started out as the exact same thing and there are a few problems that I encountered with this design. First of, converting it to C++ (or C since that was my idea) forces you to program a standard library which is basically a C++ game engine (a huge task in itself), simplifying it into your language means simplifying it in C++ (or at least write the code that simplifies it) first so why not use C++? So I went of to create a scripting language, which turned out to be so low level (since the speedup that games need require you to a lot of stuff which C++ already does (pointer, classes (with inheritance) and the whole rendering library will just be extra). I then went on to write a assembler (which is more or less complete) and now I'm writing the intermediate compiler which will allow me to go [compiler written in c++] -> [intermediate compiler in my language in interpreter (in c++)] -> [assembler in my language (in interpreter in c++)], and then implement the compiler and end up with a language which is a lot slower then C++ and will never have any use in games. So I would ether go about writing a scripting language (or maybe a real programming language) if that is what you want to do (I think its fun), or write a library for C++. If you want to know more about creating a language I can really recommend the red dragon book, I'm a big fan of using free resources on the internet to learn things but when it comes to this kind of programming I have not been able to find something comparable on the internet for free (without resorting to the ancient profession of pirating, but that isn't quite the same without the boats and parrots).

chargh,

Share this post


Link to post
Share on other sites
[quote name='oamsath' timestamp='1313335493' post='4848993']
[quote name='Sudi' timestamp='1313334667' post='4848988']
Really?
I don't get your point. To write a game you have to understand how a programm works and how to implement certain mechanics. There are already alot of languages out there and to be honest from a user point of view i don't really see a difference. Certain languages have some cool extra features but in the end its all about creating objects and run functions on data. What you want to create a game is an API that allows you to quickly create certain behaviours. But that is already there its called a game engine. This engine implements interfaces to quickly load/display graphics, play sounds, process user input, send data across the network, save/load data from memory. Now you can create such APIs in all avaible languages. I don't really think there is a need for another language just for games. It doesn't make any sense. If you really want to make it easy for a person to create a game then ask that person which language he/she is comfortable with and then create an API in that language.
Another way you could approach it which would really be easy for a beginner is a graphical way. basicly you have precoded stuff and you link it together.
just like with unreal engine 3 it graphical scripting interface is really simple to grasp and makes it easy for someone to implement behaviour.
[/quote]

The difference between a library and a language is great.
[list][*]if you had no experience what so ever to programming, and I gave you a language / IDE that you can learn in one week, to produce excellent 2D games (as an example), it handles all the complex stuff ![*]If I told you I will make a C++ library to handle these things, and you have to call it alone, you will spend months getting good in c++ before actually learning the features of my library.[/list]This is not about creating stunning 3D scenes and shader effects. It is about providing the normal person a wan to make games without having experience in advanced languages. if we take DarkBasic for example (although this is not the best example), of coarse most game companies will prefer working with Direct X or Unreal Script to produce their games, but a team of two or three students will prefer DarkBasic ALOT to make a casual game during a summer vacation.
[/quote]

A language which will be easy to learn, ultra fast, and hide away all complex things. I don't see a use in a ultra fast simple language that gives you all the power you need but hides away all data structures in which you might want to use that power, I think implementing this game library in C++ and allowing it to be called from within a scripting language will give you all the power you need. GameMaker (if that's still around) is what you are looking for.

Share this post


Link to post
Share on other sites
[quote name='Chargh' timestamp='1313335579' post='4848994']
I'm working on the exact same thing, or at least it started out as the exact same thing and there are a few problems that I encountered with this design. First of, converting it to C++ (or C since that was my idea) forces you to program a standard library which is basically a C++ game engine (a huge task in itself), simplifying it into your language means simplifying it in C++ (or at least write the code that simplifies it) first so why not use C++? So I went of to create a scripting language, which turned out to be so low level (since the speedup that games need require you to a lot of stuff which C++ already does (pointer, classes (with inheritance) and the whole rendering library will just be extra). I then went on to write a assembler (which is more or less complete) and now I'm writing the intermediate compiler which will allow me to go [compiler written in c++] -> [intermediate compiler in my language in interpreter (in c++)] -> [assembler in my language (in interpreter in c++)], and then implement the compiler and end up with a language which is a lot slower then C++ and will never have any use in games. So I would ether go about writing a scripting language (or maybe a real programming language) if that is what you want to do (I think its fun), or write a library for C++. If you want to know more about creating a language I can really recommend the red dragon book, I'm a big fan of using free resources on the internet to learn things but when it comes to this kind of programming I have not been able to find something comparable on the internet for free (without resorting to the ancient profession of pirating, but that isn't quite the same without the boats and parrots).

chargh,
[/quote]

I'm currently reading it :D it is college course material. :D

Share this post


Link to post
Share on other sites
Why are no big game companies making a language like yours?

Because:

[quote]
It will be very easy for starting programmers to develop good games with it.
[/quote]

is an impossible requirement to fill.

Share this post


Link to post
Share on other sites
As a research topic and final project, I don't see a problem with any combination of the ideas discussed here, aside from maintaining a scope that is doable -- you're talking about doing a game library, game engine, and programming language all together. Each is a rather large undertaking in their own right, unless you aims are simple. Consider focusing on one or two of these components.

There are several popular scripting languages that could serve as the language component of you game -- LUA, Python, Ruby, Javascript. In fact, the popular PyGame sounds similar to what you're talking about.

For engines/libraries you can look to RPG Maker, Flash and Unity for inspiration. All of these have tooling which is beginner friendly.

I think there are already tons of beginner-friendly scripting languages out there and I also think that creating an easy, game-centric language that is also fast is something of a false goal. "easy" almost always means that you hide a lot of decisions and take the general path -- this flies in the face of speed, where you make specific decisions that are not widely applicable. Also, a beginner needs ease of development and speed is a secondary decision, while a professional needs the opposite -- there is no overlap.

If it were my decision, I would concentrate on the engine/library, and use LUA for the scripting solution, or maybe JavaScript. Both are fast enough, widely-known, and would be a transferable skill for anyone that used your product. You can concentrate on making the scripting API extra friendly, and on providing some useful wysiwyg tools to further aid the beginner friendliness of the package.

Share this post


Link to post
Share on other sites
[quote name='Telastyn' timestamp='1313341964' post='4849025']Why are no big game companies making a language like yours?
Because: "It will be very easy for starting programmers to develop good games with it." is an impossible requirement to fill.[/quote]Seeing as "good" is entierly subjective, then space invaders might be "good" for a beginner... Making a language library that specifically makes the development of space-invaders easier seems possible.


The reason that big game companies don't ([i][url="http://www.garagegames.com/products/torque-3d"]o[/url][url="http://game-editor.com/Main_Page"]f[/url][url="http://www.yoyogames.com/"]t[/url][url="http://en.wikipedia.org/wiki/Gamestudio"]e[/url][url="http://www.blitzbasic.com/"]n[/url][/i]) produce this kind of thing is that the "[i]beginner-programmer who is interested in making games[/i]" market isn't a great demographic to reap large profits from. They're all too busy actually making games, or making libraries that they can market to actual game developers.

Share this post


Link to post
Share on other sites
Consider me skeptical. If it only takes a [b]week [/b]to learn enough syntax, debugging and program design skills to create even space invaders, the language is essentially space invaders already.

Share this post


Link to post
Share on other sites
There is an inverse relationship between power and ease of learning. The more capable your language is, the harder it will be to learn and master, by nature; and the easier it is to learn and do things with, the less capable it will need to be, by necessity.

You also have a steep limitation on what you can practically do by yourself and with limited time. Since you've already decided to settle for limited scope (2D games), you may as well make a couple more tradeoffs and make the whole thing a lot more feasible. For instance, why not make a simple system like the Game Maker type applications of old, where people can draw their own simple sprite art and make basic platformers or top-down games using simple settings? Lean towards a visually-oriented, minimalistic (but flexible) framework, and leave programming out of it entirely.

The problem is that programming is not something you can "learn" in a few days, [i]and that has nothing to do with programming languages themselves[/i]. The very process of controlling a machine via exactingly precise commands is not something that comes naturally to people. Even the most talented programmers I know of took at least several months to get to a point where they could write simple programs and games, and that was again mostly the process of learning how to program more than the process of learning the language(s) involved. Learning to be a [i]good[/i] programmer is at least a ten year job, no matter who you are, and no matter what tools you use.

If you're really interested in helping people make simple games fast, then eliminate the middleman. There's no need for complex programming to make a game [i]if your tools are powerful enough[/i]. Hell, look at engines like Source - you can make entire games with all kinds of cool puzzles, moving parts, animation, whatever without touching a line of code.

IMHO that's the route to take.

On the other hand, if you want to learn how to make a programming language, just make a programming language and do it right. Trying to make an easy-to-learn language is not the place to start; it's akin to trying to make an easy-to-fly airplane just because you play a lot of flight simulators. Using and making a programming language are very different activities, and you need to be very good at both using and making them to understand how to make them easy to use... if that made any sense at all :-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this