FAQ Search
Memberlist Usergroups
Profile
  Forum Statistics Register
 Log in to check your private messages
Log in to check your private messages
Moonpod Homepage Starscape Information Mr. Robot Information Free Game Downloads Starscape Highscore Table
August-04: Networking and Scripting
Goto page Previous  1, 2, 3, 4, 5  Next
Post new topic   Reply to topic    Discussion Pod Forum Index -> Developer Diary View previous topic :: View next topic  
 Author
Message
Moonpod Developer Diary RSS feed -RSS Feed
r000000b
Starscape Jedi
Starscape Jedi


Joined: 10 Jan 2004
Posts: 63
Location: Staffordshire



PostPosted: Fri Aug 27, 2004 10:32 am    Post subject: Reply with quote

Fost, have you done any artwork for the aracnid forces? (sketches or anything)
Back to top
View user's profile
r000000b
Starscape Jedi
Starscape Jedi


Joined: 10 Jan 2004
Posts: 63
Location: Staffordshire



PostPosted: Fri Aug 27, 2004 11:26 am    Post subject: Reply with quote

What the **** Goober?
Quote:
I've also gotten a simple script language working. Currently it's only the virtual machine and a simple form of assembly language, next up will be a high level language that compiles to the VM bytecode.


Why are you writing a scripting language? It seems like a world of pain, have you done it before and what kind of functionality will it have that you need and cant do without it? Ive never even imagined a situation where i would need to do this.

Well, on reading it again I suppose I can imagine situaltion where existing languages are too bulky, and you could make the things you need to do easier if you dont have to work arround the rest of the language.

A very high level language for controlling units and game events is one thing......... hummmm,

I guess you know what your doing (have you done it before?) any chance of seeing the design documetns Wink

good luck!


Fost: can we have a single use rocket pack for the mechs? you can quickly get them into a fight but cant get them out Very Happy
Back to top
View user's profile
Goober
Pod Team
Pod Team


Joined: 11 Oct 2002
Posts: 449
Location: Moonpod Central



PostPosted: Fri Aug 27, 2004 2:48 pm    Post subject: Reply with quote

r000000b wrote:
Why are you writing a scripting language? It seems like a world of pain, have you done it before and what kind of functionality will it have that you need and cant do without it? Ive never even imagined a situation where i would need to do this.


It's not a world of pain, it's pretty straightforward really. If you implement the VM as a stack based system then it's even easier, the problems of register allocation and instruction reordering don't come into play, although it's definitely worth doing expression simplification (essentially, identifying common sub-expressions) on the AST to reduce operation count.

Regarding functionality, I'm looking at a light version of C (no doubles, removing stuff like const and redundant stuff like volatile), but with some extensions. First thing is to support vectors, matrices and quaternions intrinsically so that they don't need to be fudged in using the language itself and appear as native types like ints or floats, then there's the issue of calling native code supplied functions (and native code calling script). Other script languages do it reasonably enough, but it seems overly convoluted. I'm planning on something very simple, but that works (fingers crossed Wink).

Another factor for me is being able to code the whole thing in C++ (or, at least, offer a C++ interface to it). Other script languages I've seen have aimed at the lowest common denominator (C) so that they'll compile on any platform and can be used in any project. That's not a consideration for me, so I can aim higher and use some of the nice useful features of C++, and allow the script language to access other objects and such without having a nasty C binding.

Another aspect is being able to hook the parser into the parsers for other script systems we have. One example is the shader system we're using. We define our shaders using a text file (much like the d3dx .fx file, but better Smile) and it's be really useful to be able to inline script functions to control things like texture coordinate matrices, vertex and pixel shader constants, that sort of thing. All other script languages I've looked at have put obstacles in the way of doing something like this, unless you wanted to define the entire shader in the script language, which is a waste when you think about it (our shaders get "compiled" to a really streamlined internal format that can be applied very quickly, the idea then is to only execute what's needed in script, everything else is just data that can be shoved at the graphics API as quickly as possible).

r000000b wrote:
A very high level language for controlling units and game events is one thing......... hummmm,


Poo Bear isn't using the language for the Battlescape logic, because it wasn't usable when he started coding it and so he's using C++ (with parameters from various text files). It's too painful to use half-finished systems when you're trying to build AI and such, and we don't want the game to be delayed because he's waiting for me to complete the compiler.

r000000b wrote:
I guess you know what your doing (have you done it before?) any chance of seeing the design documetns Wink


I've dabbled with compiler construction before, using Lex/Yacc (actually Flex/Bison) and self-built parsers for generating native x86 code, and I've built VMs and cpu emulators before. It's just a small matter of putting it all together Wink

As for design documents, none really, although I am using a book called "C A Reference Manual" by Samuel P Harbison III and Guy L Steele Jr, for its description of the C syntax in BNF (in appendix B, if you're interested), and a very good book called "Modern Compiler Design" by Dick Grune, Henri E Bal, Ceriel Jacobs and Koen Langendoen. The second book is actually overkill for what I'm doing, but it's a very good book on building compilers, and definitely worth a read if that's the sort of thing that floats your boat.

r000000b wrote:
good luck!


cheers Smile
Back to top
View user's profile
SqurielLord



Joined: 24 Aug 2004
Posts: 15
Location: USA; FL



PostPosted: Sun Aug 29, 2004 5:15 pm    Post subject: Reply with quote

HA! Found teh dev. diary!

I dont ahve a clue what 'code' is. All blew througth my head.... isnt java code?

Confused

Rocket-mechs are a coolio idea. But what good woudl rocket-mechs do when you could have orbital dropships (maybe just atmosphereic) that could move mechs, tanks, or troops? A bit more vestile.

But there is hight possiblity that there wont even BE dropships or air units!

NO! Evil or Very Mad

EDIT

But thsi should probably go in teh unit ideas thread. OPPS. >_<

Thank you for your time

SqurielLord
Back to top
View user's profile Visit poster's website AIM Address
Goober
Pod Team
Pod Team


Joined: 11 Oct 2002
Posts: 449
Location: Moonpod Central



PostPosted: Sun Aug 29, 2004 7:18 pm    Post subject: Reply with quote

SqurielLord wrote:
I dont ahve a clue what 'code' is. All blew througth my head.... isnt java code?


"Code", as most programmers refer to it (and specifically, as I refer to it), is simply whatever computer language you use to develop. Yes, Java is code, as well as C, C++, assembly, Python, Perl, PHP, LISP, ML, Smalltalk, Eiffel, and many many more Smile
Back to top
View user's profile
James



Joined: 28 Nov 2002
Posts: 153
Location: Sheffield



PostPosted: Mon Aug 30, 2004 4:36 am    Post subject: Reply with quote

I'm curious as to why you're doing a scripting language. I've always suspected that there must be some reason for having one that I've missed.

I've never quite worked out who is supposed to use a scriping system. If it's programmers, then why not just use C++? If it's level designers/artists then wouldn't they prefer something more graphical? Or is the idea to generate the script from a graphical editor or something? Most of the artists I've ever worked with would, rightly, run a mile if you gave them a text editor (although that's not actually true in your case; Fost even managed to get something good out of that awful text file-based particle system I wrote).
Back to top
View user's profile
Fost
Pod Team
Pod Team


Joined: 14 Oct 2002
Posts: 3734



PostPosted: Mon Aug 30, 2004 6:46 am    Post subject: Reply with quote

r000000b wrote:
Fost, have you done any artwork for the aracnid forces? (sketches or anything)

Battlescape's initial release is going to concentrate on human units, and if the game proves popular we of course have plans to release further upgrades. We decided a long time ago that it made sense to have 1 perfectly balanced unit rather than 5 poorly implemented ones.

That said, I have ideas, but I will probably keep them close to my chest even if they appear in an upgrade, because we have to leave some surprises. Very Happy
Back to top
View user's profile Visit poster's website
Fost
Pod Team
Pod Team


Joined: 14 Oct 2002
Posts: 3734



PostPosted: Mon Aug 30, 2004 7:31 am    Post subject: Reply with quote

James wrote:
Most of the artists I've ever worked with would, rightly, run a mile if you gave them a text editor (although that's not actually true in your case; Fost even managed to get something good out of that awful text file-based particle system I wrote).

Artists (as a rule) tend to find the whole thing daunting. Really, text editing particle systems isn't that hard, but most people don't realise it. I've started to think that the really big issues for artists, are feedback speed, and error handling.

Take Gun Metal as an example (For those who aren't following, James wrote the Particle system used by the xbox game GunMetal, at Rage Games, where we all used to work). It wasn't the particle system's fault, but, if I changed any of the particle text files, then the game had to be restarted to see if they were working. Thinking back, 90% of my frustration was caused by this. Waiting an age for a game to load just to see if a particle has gone blue quickly enough is soul destroying Sad

Of course, getting the game to reload changed data on a button press isn't always something that's easy to achieve, and always seem to be the first thing to break over multiple code iterations. It's something we've suffered from to a smaller extent with the Starscape's particle system. It seems worth the effort to fix though - I could do effects a minimum of 4 times faster if that were the case.

The other problem (for artists) is error handling, most commonly, someone entering a file name into a script, and the file doesn't exist|name is spelled incorrectly|file is in the wrong folder. They shouldn't need to call a programmer over to debug a missing file error - It makes them feel stupid (almost all errors are stupid parse mistakes or file location mistakes), and wastes the programmer's time.

If you alleviate the above problems, and artists try things and quickly see the results, you'll probably find they are pretty happy to play with text files. I'm sure these thoughts translate to using scripting languages, but with even greater coding problems Very Happy
Back to top
View user's profile Visit poster's website
Goober
Pod Team
Pod Team


Joined: 11 Oct 2002
Posts: 449
Location: Moonpod Central



PostPosted: Mon Aug 30, 2004 11:42 am    Post subject: Reply with quote

James wrote:
I'm curious as to why you're doing a scripting language. I've always suspected that there must be some reason for having one that I've missed.


The big reason for me is that we can embed little bits of script code in other data files, have the code and configuration in one place rather than spread across multiple data and cpp files, and not require programmer intervention or a recompile whenever a change is required (however major/minor). Shader files, for example. We have our own shader file system (because I wrote it before .fx files became usable), and it'd be nice to be able to add functionality to a shader that doesn't require a load of specific code adding to the game; which is especially useful if there's different code for different shader fallbacks, or you're playing around with a shader to get a specific effect.

There are a whole bunch of other uses we have planned as well, but I'm not going to expand on that until we've got some more stuff to show publically Smile

Think back to how useful Graham's* RPN texture matrix stuff was on Gun Metal and Crash and then expand that to a more feature rich language, and applied to whatever data files you like. For consoles the shader stuff isn't as important, but a script system could still be cool for allowing level designers to add one-off features to the game without requiring a programmer to get *too* involved, and alleviates the need for (alot of) extra code to support it.

As you say, if you wanted to wrap it all up in a nice shiny gui with boxes and lines etc then it'd be even nicer to use, but ultimately it's going to end up as a bunch of bytecodes for the VM to chew through. I don't have time to develop a nice visual development system, but a simple compiler isn't going to be a big timesink and could give a decent return on investment. That's the hope anyway Smile




[*] Graham was another programmer back at Rage Sheffield. DVD guru and 3d graphics ninja Smile
Back to top
View user's profile
HunterXI



Joined: 26 Dec 2003
Posts: 476
Location: Playing like there is no tomorrow.



PostPosted: Tue Aug 31, 2004 2:40 am    Post subject: Reply with quote

Goober wrote:
SqurielLord wrote:
I dont ahve a clue what 'code' is. All blew througth my head.... isnt java code?


"Code", as most programmers refer to it (and specifically, as I refer to it), is simply whatever computer language you use to develop. Yes, Java is code, as well as C, C++, assembly, Python, Perl, PHP, LISP, ML, Smalltalk, Eiffel, and many many more Smile


You forgot FORTRAN, BASIC, Javascript, Visual Basic, C#, and whatever DOS is considered. But yeah, now that I think of DOS... Why not make a simple "command" system, just like MS-DOS (commands are programs), or mIRC scripting?

Originally I had thought that a high-level programming language would be good, but that applies to, like, myself and 5 other members here, and something as simple as like the starcraft trigger editor would take decades to make, but a low-level, somewhat extensive command-scripting-system could work easily, and for optimal efficiency, you could have a compiler that compiled the necessary parts of code FROM the commands into a single file - kinda like the #include function in C/C++!
Back to top
View user's profile
Goober
Pod Team
Pod Team


Joined: 11 Oct 2002
Posts: 449
Location: Moonpod Central



PostPosted: Tue Aug 31, 2004 4:53 am    Post subject: Reply with quote

HunterXI wrote:
You forgot FORTRAN, BASIC, Javascript, Visual Basic, C#, and whatever DOS is considered. But yeah, now that I think of DOS... Why not make a simple "command" system, just like MS-DOS (commands are programs), or mIRC scripting?


Nope, I didn't forget any of those, I just couldn't be bothered typing them all out Wink. Also, I have no idea about mIRC scripting, but the DOS batch file system isn't a language, it doesn't support enough constructs to be considered as such (IMO).

HunterXI wrote:
Originally I had thought that a high-level programming language would be good, but that applies to, like, myself and 5 other members here, and something as simple as like the starcraft trigger editor would take decades to make, but a low-level, somewhat extensive command-scripting-system could work easily


By "high level language" I mean something higher level than assembly, nothing flash like Prolog or ML or any madness like that. Trigger systems can be good (the level design for Gun Metal used a trigger system that Poo Bear wrote), but I prefer the added flexibility of a proper language.

I should point out that my primary reason for writing this script language isn't for anyone's benefit but Moonpod's. That may sound harsh, but, given our tight schedule for doing anything, we need to prioritise development based on what we require, rather than what we'd like to do to support modding or whatever. Not to mention that I'm hoping the script language will be used for much more than just level design tasks.

HunterXI wrote:
, and for optimal efficiency, you could have a compiler that compiled the necessary parts of code FROM the commands into a single file - kinda like the #include function in C/C++!


I haven't the foggiest idea what you're talking about there. It sounds like you're mixing up a whole bunch of completely unrelated things and ending up with a bucket of monkeys.
Back to top
View user's profile
r000000b
Starscape Jedi
Starscape Jedi


Joined: 10 Jan 2004
Posts: 63
Location: Staffordshire



PostPosted: Tue Aug 31, 2004 2:37 pm    Post subject: Reply with quote

Quote:
By "high level language" I mean something higher level than assembly
ha, your showing your age

<old man voice>
"when i was a lad we had to write programs in mud, and not the soft mud like you youngns have these days but propper mud. Bits? Bits?the youth of today dont appreciate bits, we had to mine bits out of t'rock face with our teath, and we were gratefull, i didnt see a compiler till i was 103 and it didnt do me any harm, the youth of today have no respect "
<\old man voice>

Im a python boy, I stick as high as I can but drop into C when i need the extra grunt. I regard C as as low as im prepared to go.

I think i understand why your making a scripting language, I allways underestimate the amount of work that gos into a game ( a drive full of half finished 'good' ideas will attest to that) and it would have to be a lot to justify designing, writing, debugging and using your own langage to make things easier.

Are you apprehensive about the script language (you need a name) isnt it a gamble? Do you guys do things the right way (cos you can as you work for youself) or the safe way (cos delays come out of your pocket)? just curious,
Back to top
View user's profile
Darth Dallas



Joined: 18 Oct 2003
Posts: 411



PostPosted: Tue Aug 31, 2004 6:33 pm    Post subject: Reply with quote

In your grumply old man rant, you left out that they had to go back and forth to work/school/home in the snow....up hill....both ways and barefoot! Smile
Back to top
View user's profile
starscape junkie



Joined: 15 Jun 2003
Posts: 177
Location: The Thirteenth Colony



PostPosted: Tue Aug 31, 2004 6:40 pm    Post subject: Reply with quote

and how when they got old enough they had to help move the town up and down the hill so that they could walk uphill both ways Very Happy
Back to top
View user's profile
Goober
Pod Team
Pod Team


Joined: 11 Oct 2002
Posts: 449
Location: Moonpod Central



PostPosted: Thu Sep 02, 2004 7:12 am    Post subject: Reply with quote

r000000b wrote:
Quote:
By "high level language" I mean something higher level than assembly
ha, your showing your age


<real old man voice>
I remember spending hours and hours hand assembling z80 assembly language into machine code (yes, actual machine code) to tap into my Spectrum. I thought Christmas had come early the day I got an assembler on a magazine cover tape. Smile
</real old man voice>

r000000b wrote:
Im a python boy, I stick as high as I can but drop into C when i need the extra grunt. I regard C as as low as im prepared to go.


Generally we only use C++, although I like to play around with other languages (particularly languages that are very different to C++, like LISP and such) sometimes to see if there's anything that would benefit development in some way. At a (very) rough guess, our production code is pretty much 99.9% C++, with the other 0.1% being C and assembly.

r000000b wrote:
I think i understand why your making a scripting language, I allways underestimate the amount of work that gos into a game ( a drive full of half finished 'good' ideas will attest to that) and it would have to be a lot to justify designing, writing, debugging and using your own langage to make things easier.

Are you apprehensive about the script language (you need a name) isnt it a gamble? Do you guys do things the right way (cos you can as you work for youself) or the safe way (cos delays come out of your pocket)? just curious,


The intention is that the script language will allow us to save time in the long run. That's the underlying concept of a lot of the code I've produced for Moonpod. We're a small team and we need to save time where possible, having a big bag of code tricks that we can pull stuff from when necessary is definitely an advantage. So, while we do try and do things the "right" way (for us, at least), the idea is that over a period of time that also becomes the safe way due to us saving time in various areas. That's the general idea anyway Smile. The nicest thing about the script language is that it's not on the critical path for anything we're working on, so it's kind of a bonus feature that could mean we add some cool stuff later if we get time. I'm hopeful that we can get it embedded early and used in earnest in future projects though.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Discussion Pod Forum Index -> Developer Diary All times are GMT
Goto page Previous  1, 2, 3, 4, 5  Next
Page 2 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group