Sign in to follow this  
Juster

Programming a quest game

Recommended Posts

Juster    102
Hey! I started making a casual quest game and I've already designed some architecture and wrote part of TDD, but still thinking about how to implement it better. What I have: - The quest game with tree dialogues and simple actions like clicking on a object, applying an item from the inventory to an object on a screen. No ability to walk, no different SCUMM-like actions (use, push, pull, etc). Plain and simple. - Python scripting engine powered by stackless (www.stackless.com), this extension manages coroutines without threads, like fibers in WinApi. Do you have an idea how to better implement a scenario? Now I set up static description of objects (characters, items, screen layouts, passageways, etc) in bunch of xmls and dynamic description (behaviour, reactions on player actions, animation, etc) in python scripts. Game creates a scene from a xml which has references to python functions or classes. Brief sample:
<character name="tim" position="200,300" image="tim_stand" on_click="tim_dialogue.py:on_click_Tim" />

And tim_dialogue.py might look like this:
def on_click_Tim(tim_obj):
   tim_obj.change_state("greeting")

What I don't like is what the game is going to have plenty of uncoordinated python functions and this may lead to unwanted complexity in future. I wonder if there is a more convenient approach? I understand that this question is very broad and perhaps I'll detail my need later. Any suggestions? Your experience? Thanks! [Edited by - Juster on November 6, 2009 2:57:51 AM]

Share this post


Link to post
Share on other sites
Juster    102
Guys, I started thinking about scenario scripting in Warcraft-3 way. Let's say we have triggers which is set of events, conditions and actions, and set of these triggers makes your scenario!

Share this post


Link to post
Share on other sites
Juster    102
Hey, there is a new idea!
I looked at some flex videos and noticed that objects defined from mxml might be addressed by their identifier directly.
For example, how it might work in a quest game. In xml:

<character name="tim" position="200,300" image="tim_stand" on_click="tim_dialogue.py:on_click_Tim" />
<item name="blob" position="300,200" image="blob" />


In a python script names "tim" and "blob" are in the current namespace (or in real life in a special dedicated namespace):

def func():
tim.start_dialogue()
blob.position = Point(301, 201)

Share this post


Link to post
Share on other sites
Juster    102
the last feature could be done in python via accessing a module's dict

import sys
mod = sys.modules[__name__]
mod.__dict__[object_name] = object_ref


still not interested? :)

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