• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Mike

Scripting Language project...

15 posts in this topic

For an independant study in high school I am developing a scripting language. I don''t really know what I''m doing; just kinda figuring it out as I go. The goal of the language is for it to be easily implemented it various projects. I''m not very far along, but eh... If you want to look at the code yourself to get ideas or to tell me what I''m doing wrong go here: mike010.hypermart.net Let me know what you think about the web page to. Once you see the page you will see the humor in the previous sentence.
0

Share this post


Link to post
Share on other sites
Mike, check out http://root.cern.ch/root/Cint.html because you''ll need something like this.
0

Share this post


Link to post
Share on other sites
I''m not sure what you mean by "you''ll need something like this."

I''m guessing that you mean it would be a good example to look at. Thanks for the link, and if you have some spare time do me a favor and take a look at my code (actually you would need alot of spare time concidering my project has surpased the 1500 lines of code mark) and let me know what you think.
0

Share this post


Link to post
Share on other sites
Haven''t read too much of the source, but my first question has got to be, why is the opcode function called "Exicute"? Otherwise I can''t say much, as it seems like the project is still in its infancy.
0

Share this post


Link to post
Share on other sites
SiCrane-

The Exictute function actually does something. Each OpCode class holds the actually C++ code that the virtual machine actually runs in its exicute funtion. As the virtual machine goes through the script''s op codes it calls the op code''s exicute function to actually do something. If you know of a better way to do it please share it with me. I''m new to the this game and open to suggestions.

Brad-

I read the articles at flipcode quite a while ago (before I actully had any desire to write a scirpting language). The problem I have with that series is that the author uses lex and yakk (or was it flex and bison... or flex and yakk...) to generate the lexer and parser. I plan to write my own. However, i think that i am using some of the ideas that the author presented. To be honest I''ve read alot about scripting languages, but what i read is always implemented useing a lexer and parser generator or its implemented in a C style (not C++). I''ve pretty much decided to go my own way (don''t get me wrong, I will still listen to advice). I''m just trying to make sure I don''t completely screw things up.
0

Share this post


Link to post
Share on other sites
You misunderstand me, I understand what the function does, I''m wonder why it''s called "Exicute". Rather than, for example, "Execute."

Traditionally, though, the execution of opcodes has been a property of the VM rather than the opcodes. This is, more or less, a necessity when the code is compiled to true byte-codes. However, again, I stress I''ve only given your project a cursory look, and can''t make any judgements yet.
0

Share this post


Link to post
Share on other sites
Oh... that''s any easy one; I can''t spell. It''s kinda funny that I would messup that one considering that you run a ".exe".
0

Share this post


Link to post
Share on other sites
No offense bud but I seriously doubt you can write a non-ambiguous parser without the help (and ease of use) of Flex and Bison. Don't get cocky. Until you have read and understood the Dragon Book (Aho) and you understand LR(1) and LALR(1) parsers writing your own C-syle recursive descent parser is ludicrous. Flex and Bison are extremely easy and powerful tools. Hell, even GNU g++ uses them for its C++ grammar parser.

There is no one on this planet that can write a scripting parser in C or C++ faster than I can write the parser/lexer in Flex/Bison, eat a Pizza, shoot some pool, and take a nap. It just isn't possible; the larger the grammar gets the more you will thank yourself you spent the time reading Levine's book on Flex and Bison.


Edited by - Lance on 2/29/00 3:41:49 PM
0

Share this post


Link to post
Share on other sites
Um, Lance, did you see his instruction set? For a project on this scale it''s pretty easy to handcode an RDP for the grammar. Even without lex and yacc (or flex and bison) you can use other similar tools, such as Johnston''s RDP generator or JavaCC. So you don''t need to preach flex/bison like it was gospel.
0

Share this post


Link to post
Share on other sites
Lance:

I''m not ignorant (I just can''t spell) nor am I cocky. I know my place at the bottom of the programming chain. You don''t seem to realize that this is a simple language that I am creating for an aditional credit in HIGH SCHOOL. I''ve completed the code to handle input, output, and ifs from the syntax tree to compilation. This means that I have roughly 10 weeks to write a simple parser.

I know that parsers and lexers are insane tasks to take on and if I were to write a very complex (or even somewhat complex) language I would use flexx and bison (or flexx++ and bison++... but I''ve heard that those aren''t to good); however, as SiCrane pointed out, I''m not about to write the language to replace Python.

Please realize that I am doing this to further my programming abilities. Generating code with lexx and yak is not exactly going to enrich my programming abilities (in perticualar: problem solveing). Even if I fail at writing the parser I will still get the additional credit and I will still learn something.
0

Share this post


Link to post
Share on other sites
Check into Forth. It is an extremely simple language which runs on a word-based system. Even things like math are in reverse notation, so instead of having to parse x = 3 + 4, you get 3 4 + x ! (the ! sets the variable x to the top integer on the stack). It has polymorphic variables of global scope only. It requires that you become very familiar with the whole "stack" thing, but you can only become better because of it. I believe MUCKs are programmed with a Forth derivative.

I wrote a Forth interpreter as a Freshmen in College, and I don''t think the thing was more than 700 lines. Geez, that wasn''t that long ago, yet I am so much better at programming. Maybe for kicks, I''ll rewrite it or something...maybe make it OOP. That''d be worth a giggle or two...
0

Share this post


Link to post
Share on other sites
I've also tried to write a scripting language parsing C++ scripts and compiling them into bytecode in singlepass (don't laugh!). The bytecode was risc-like and it mainly used registers (rather than being a stack machine).

Well, a huge bunch of unexpected problems arised, so I stopped and decided to use something like GENTLE or PCCTS, because bison/flexx doesn't seem like it's learnable in a week or so

Anyway, what I've completed yet could easily transformed into a good, solid tokenizer (preprocessor), so if someone likes to take a look at:
http://www.lunaticsystems.de/scrix.zip

-Markus-

Edited by - Cygon on 3/15/00 9:46:09 PM
0

Share this post


Link to post
Share on other sites
I don''t really know why I''m writing this here, just thought I''d share my experience.

I tried to construct my own scripting language for a game project I''m working on (using flex and bison). I had attained the level of functionality that C provides and I wanted to give it the ability to define and use user-defined objects. That''s where the brick wall approached. As a 2nd-year programmer, I hardly knew enough to handle objects, and I certainly didn''t understand the recursive nature of the parser. So I gave up. But now that I look back, I think it''s actually quite good. I even figured out how to export C functions on my own (Mike - I posted the solution I used in another post somewhere) and get the byte code to execute quite nicely on the virtual machine. It even did a two-level compile, making virtual assembly first and then converting to bytecode.
Anyway, I wish you the best of luck Mike and hope you get the language working.
0

Share this post


Link to post
Share on other sites
I''ve figured out how to export native functions to the scripting language on my own (I asked how to do it, but I didn''t really like the way that other people did it so I went my own way). I have no plans to implement objects or user defined data types. I only need to add functions to the scripting language (it will not take long to acomplish based on the fact that I''ve already implemented a label and a jump virtual machine op code) and I will be almost done. I only need to write a lexer and a parset (unlike the functions, this will take for ever to get done).

Just incase you wondered.
0

Share this post


Link to post
Share on other sites