• 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.
Sign in to follow this  
Followers 0
AnthonyVelazquez

Scripting

6 posts in this topic

I am having an issue with scripting. Im writing a Text Based RPG Game in C++ but I have a question about scripting. What would the best method be for writing out the story without directly writing every line in my C++ program?

0

Share this post


Link to post
Share on other sites

By 'scripting' do mean mean the story script / NPC chat? Or do you mean a scripting language?

 

You can load data from files (which is very important). Use the data loaded from files to create the content of your game.

You can use scripting languages to even load logic from files, but for a text-based RPG that's probably not needed (unless that's what you're looking for).

1

Share this post


Link to post
Share on other sites

My only experience with scripted RPGs was TES3: Morrowind.

It was a surprisingly painful experience as everything was essentially text-based and going through a rather buggish compiler/interpreter combo.

 

In general the part of the story I've looked at was just a set of if(...) switches based on conditional events.

There's of course a lot of advantages from not having those conditions in the engine code.

The higher amount of abstraction made it fairly easier to build complex entity relationships and I liked the idea of having a single scripting language to do everything from story to entity scripting.

 

Years ago I collaborated with a friend of mine in writing a text-based single-player MUD (it was supposed to be a real MUD someday).

The story was similarly based, with conditions to be set to true to evolve the world from a state to the other. It never satisfied me, but the whole thing was a akin to a quick hack rather than something serious so it was ok.

 

Looking back, I'd try to model a state machine using an appropriate language for story while dialogue and entity scripting would probably use yet another system.

0

Share this post


Link to post
Share on other sites
Similar to Krohm, I've written single and multi-player text MUDs (multi-user-dungeons), in both java and c++ and was heavily involved in working on our implementation of an lpmud at Plymouth University more years ago than I can remember.

I would recommend doing a google for 'lpmud', you can still download the drivers for it and get it up and running fairly painlessly on both Linux and windows.

The general idea behind it was that it was an extended version of C that added object orientation. It's main core was an interpreter which read files in this hybrid of C and 'LPC' (named after its creator Lara Pensj, sp??) and turned them into game objects with specialised and generic functionality.

If you do google it, you will no doubt find example files showing you how it looks and it will give you lots of ideas. Unless you want to use someone else's MUD engine, you may need to either write your own interpreter (gets pretty complicated but very addictive) or look at using an existing scripting engine (Lua?). I don't have any experience with Lua but I believe you might be able to put something together using that, c++ and some form of data modelling (XML?).

It's a really interesting and unfortunately somewhat-forgotten genre and one that holds many great memories for me so if you need any further help, don't hesitate to ask, it's great to hear people still wanting to investigate it.

Good luck
0

Share this post


Link to post
Share on other sites

I have just finished embedding Google v8 JavaScript engine in my game. The API is simple and flexible and quite easy (once you get past the basic concepts, such as contexts and Local/Persistent handles). The point is that JSON is a subset of JavaScript so you can employ the same v8 engine for data description (JSON) and scripting (JavaScript).

 

Writing your own scripting language and interpreter in the year of 2013 is just silly. You would be surprised how complicated modern-day scripting virtual machines are. For example, v8 does not interpret anything - it compiles the script directly to machine code. Furthermore, it patches the code on-the-fly optimizing it even further. Theoretically your v8 JavaScript code can run faster than C++.

0

Share this post


Link to post
Share on other sites

[quote name='Servant of the Lord' timestamp='1357096118' post='5016546']
You can load data from files (which is very important). Use the data loaded from files to create the content of your game.
[/quote]

I'm just going to restate this one for simplicity, given that some responses are getting into much more complex territory.  I apologize if this is missing the mark, but your post sounds fairly new to game programming, given that you're dealing with a C++-based text-based game.  You'd be best-served in that instance just writing your various text data to text files, and having your code read from those files to get the text you want in-console.  Look for a tutorial or resource on file I/O in C++ and that should get you most of the way there.

0

Share this post


Link to post
Share on other sites
The general idea behind it was that it was an extended version of C that added object orientation. It's main core was an interpreter which read files in this hybrid of C and 'LPC' (named after its creator Lara Pensj, sp??) and turned them into game objects with specialised and generic functionality.

Lars Pensjo. He's an active community member here and he's awesome. biggrin.png Edited by Khatharr
0

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  
Followers 0