• 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.

Veron2

How to handle/design RPG event ???

20 posts in this topic

Hello Everyone I''m newbie here, and I have a problem about event in RPG (i.e. when man talk to man2 and there is something happen, or when man walk to some position there is something happen but once ,or after fighting there is something happen , and all event happen once) if I desing it to state machine I will have a huge thousand states I try to search previos topic here but not found. Please advice me how to design event in RPG ..... how to keep all information about event ?? (words of people,item in ..., ...) Thank you very much .. Veron 2 Veron@rome.com
0

Share this post


Link to post
Share on other sites
I don''t know in what stage of the project you are, but I''m guessing design stage...

Maybe it''s a good idea to sum all things up you want to use.
In one of my previous games I implemented doors, enemies, objects(equipment) and other events with the folowing structure:

typedef enum
{
ELEMENT_TYPE_DOOR_LEFT,
ELEMENT_TYPE_DOOR_TOP,
ELEMENT_TYPE_DOOR_RIGHT,
ELEMENT_TYPE_DOOR_BOTTOM,
ELEMENT_TYPE_DOOR_ENEMY,
ELEMENT_TYPE_DOOR_EQUIPMENT,
ELEMENT_TYPE_DOOR_EVENT,
...etc...
}
ELEMENT_TYPE;

typedef struct
{
int iRoom;
int iCondition;
ELEMENT_TYPE eType;
int iX;
int iY;
...etc...
}
ELEMENT;

The condition is used if element is valid. For example:
- the player must have a key to open door.
- the player with a level below 10 gets enemy A.
- the player with a level above 10 gets enemy B.


Then I made a large list of "events".
When the player moved, I checked it''s position with those in the list.

Hope this is what you meant,
Bas.
0

Share this post


Link to post
Share on other sites
Generally your game plot will advance as a result of key ''events''. Is that the kind of thing you are thinking of? You can represent this generally with a load of flags (encapsulated in a ''progress'' or ''events'' class, if you like.)

Perhaps something like this:
bool completed_intro_area;
bool killed_green_dragon;
bool talked_to_bard_and_got_main_quest;
bool found_spell_book;

etc etc. 4 flags allows you to represent 16 states, essentially. If there are certain parts which progress in order, you can use an enum:
enum DragonQuest { NOT_STARTED, STARTED, FOUND_DRAGON, KILLED_DRAGON, RETURNED };

These flags and enums can easily be checked by other events to see whether it is time to fire them or not. When you want to check something that should only happen once, check the flag to see if it''s happened yet. If not, make it happen, and flip the flag so it won''t happen next time.

Individual conversations and mini-scripts you probably want some sort of scripting language for, which is called by your event and loops a line every second or so. That is a little more complex
0

Share this post


Link to post
Share on other sites
Hey you all I have a question .

- Kylotan sorry to this stupid question ,but
if I design a big RPG event then and use
your suggestion then I have many 1000 BOOL
variableS !!! ( although I use enum Dragonquest
it still have a big state)

- baskuenen , I don''t understand your condition
please show your example condition please ....
( when player level 11 what flag tell that meet enemy A or B ?)


0

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster

Hey you all I have a question .

- Kylotan sorry to this stupid question ,but
if I design a big RPG event then and use
your suggestion then I have many 1000 BOOL
variableS !!! ( although I use enum Dragonquest
it still have a big state)


Well, if you''re worried about size, then 1000 bools isn''t much compared to your graphics If you''re thinking about complexity... well I doubt you''d need 1000 separate flags. I measure a game''s immensity by comparing it to my all-time favourite, Ultima VII, and I doubt they had more than 100 flags. Lots of stuff doesn''t need a flag, for example when you need a certain item (just check the inventory) or you need to kill a certain creature (just check if the creature is still alive). A common puzzle is the key-door type, and you need no flags for that either. You only need a flag when completion of an event is difficult to find out by some other means.

Either way, when you write your story, you might want to separate out the individual events and number them or something. That way, you can reference events in a predictable way, eg "Event 35: Encounter with Green Dragon. Will not occur if player did not meet Wizard (Event 12)." You will probably want to go back to Event 12 and write in "precondition for Event 35", to help keep track.

How to do this effectively is an interesting question. Perhaps making a flowchart of your game detailing major plot elements would help. Number these 1...n, then separate each sub part out, make a flowchart for that part, number them 1.1 to 1.n, etc etc.

Any other ideas?
0

Share this post


Link to post
Share on other sites

Um...
Other question ...
in RPG games whick information we should keep in file ???
0

Share this post


Link to post
Share on other sites
Hi All!

What about making your events part of the map? And then use a OOP approach to model it. For example you could have a tile class like this:

class Tile {
Terrain terrain; // reference to terrain type
Monster monster; // reference to monster occupying tile
Event event; // reference to event
}

When a character steps in to a tile where event is not a null reference, you do:

if (Tile.event.preConditions() == true) {
tile.event.activate();
}

And the activate method sets off a trap, shows a piece of dialog or a cut-scene or something. And possibly update a quest log, add or remove items from the characters inventory and so on.

The Event class would then be subclassed to give many different event types (ie. TrapEvent, EndOfLevelEvent and so on) which all shared the common method of the base Event class. Or maybe you would just have a single event class capable of doing all kind of events through some scripting.

Well, what do you think?

Regatds

nicba

[Sorry for all the editing of the message, just trying to make my code look better using some HTML tags. It didn't work]

Edited by - nicba on May 10, 2000 8:07:10 PM

Edited by - nicba on May 10, 2000 8:09:36 PM
0

Share this post


Link to post
Share on other sites
hello again .
nicba when you use
if (Tile.event.preConditions() == true) {
tile.event.activate();
}
Is the eventpreConditions() function
build in concept like Kylotan?
(check BOOL,flag)
0

Share this post


Link to post
Share on other sites
Nicba, you won''t want all events to just be triggered on where you are. What about:

  • A wandering minstrel, who could be anywhere between 2 cities, walks over to talk to you,

  • When 2 certain objects are brought together, they summon somebody,

  • When a certain monster dies, a certain item is created


Etc etc.
0

Share this post


Link to post
Share on other sites
I wonder if it would be useful to build a kind-of tool to make flowcharts for stories, that are directly translatable into code?


#pragma DWIM // Do What I Mean!
~ Mad Keith ~
**I use Software Mode**
0

Share this post


Link to post
Share on other sites
quote:
Original post by Kylotan

Nicba, you won''t want all events to just be triggered on where you are. What about:

  • A wandering minstrel, who could be anywhere between 2 cities, walks over to talk to you,

  • When 2 certain objects are brought together, they summon somebody,

  • When a certain monster dies, a certain item is created


Etc etc.


Hmmm, the wandering minstrel would be in some kind of ''no space'' because the game is broken up into different maps, sort of like ''Baldurs Gate''? Maybe I could make the ''traveling events'' be part of the ''Leave Area'' event in either (or both) of the two cities. Or simply don''t allow events while traveling between cities.

The ''combine two items puzzle'' event is harder. But it could be solved by letting events not only be associated with tiles, but also with objects. So each (important) object has a event which is fired when it is ''activated'' (like a potion getting ''activated'' when you drink it and boost the players mana ect.). These events on the objects would then also have pre-conditions requiring the user to be in possesion or have activated other objects.

Finally the ''kill dragon and release item'' event would not be an event at all. I think its somehow strange when objects just pops up from nowhere when you kill an enemy. Instead I would allow monsters to have inventories when apropiate and leave the contens of these inventories behind for the player to collect.

The reason why I so badly wants to have my event class is that I believe this is the proper Object Oriented way to go. And I also think it would ease the creation of the story and the ''interactivity'' of the game if the developer was not required to think so much in terms of a branching story ''three'' but could instead think in terms of ''events'' with distinct pre- and post-conditions.

Also I think building a world with events would be more intuitive because it could happend from inside the map/world editor. Here you could place and script events in the same way you would place monsters and obstacles, instead of having to write the story in a seperate ''authoring tool''.

Regards

nicba
0

Share this post


Link to post
Share on other sites
For event keying, you might just want to have a single variable like:
long story_pos;

Then have defines for key events needed to be completed before the next:
#define TALK_TO_PARENTS 1
#define TALK_TO_VILLAGE 2
#define DEFEAT_BULLY_IN_BAR 3

and when the next objective has been completed:
story_pos++;

just check the story_pos somewhere in the game like when moving to a new room, the code to be executed after the room change might go like this:
if(player.room == BAR){
switch(story_pos){
case DEFEAT_BULLY_IN_BAR:
//blah move bully and have him fight you
story_pos++;
break;
}
}

Edited by - iwasbiggs on May 12, 2000 12:00:00 PM
0

Share this post


Link to post
Share on other sites
quote:
Original post by iwasbiggs

For event keying, you might just want to have a single variable like:
long story_pos;

Then have defines for key events needed to be completed before the next:
#define TALK_TO_PARENTS 1
#define TALK_TO_VILLAGE 2
#define DEFEAT_BULLY_IN_BAR 3

and when the next objective has been completed:
story_pos++;

.....



It would make an incredible linear game if you implemented it that way. Then you have to do things in the order described by the story_pos and the #defines.

What if your player entered the bar as the first thing (s)he did (before talking to anyone). Then the bully wouldn''t attack you? And if you then left the bar and talked with the parents and the villagers and then re-entered the bar the bully would suddently attack you now?

I think the idea about using some sort of "incrementing counter" to keep track of the story would be too restrictive to create a more non-linear story where the player can go about different goals in the order they wish.

Regards

nicba
0

Share this post


Link to post
Share on other sites
point well taken nicba. I also understand the problems with such an event sequencer.
However, depending on the game, linear may be all you need or want.
The single story variable is good for conserving space (instead of an array of 100 event objects) and also it seems that you *should* force the player to do some things before moving on. Otherwise you would have nothing but d&d on the computer (which makes it really hard for the designer to tell a story).

quote:

What if your player entered the bar as the first thing (s)he did (before talking to anyone). Then
the bully wouldn't attack you? And if you then left the bar and talked with the parents and the
villagers and then re-entered the bar the bully would suddently attack you now?



Perhaps you're a bad guy and you talked trash to your parents and the villagers about this 'bully' and now he wants to beat you up where he didn't before?

Of course the single variable storyline would have to be well designed to avoid sensless time wasting (like having to talk to villagers even though what they say will have nothing to do with the next objective).

In a final fantasy game, you often need to talk somebody else in order to 'fight the bully', I wouldn't be surprised if the designers used a hybrid of linear counter and multiple bools or event objects (thus depending on the objective completed you might increase or decrease the story variable).

Edited by - iwasbiggs on May 13, 2000 4:50:56 AM
0

Share this post


Link to post
Share on other sites
How do you do scripts?

like commands maybe
movperson(person, here, there)
Speak(person,string)?
type stuff
with time delays in between?
I dunno.
0

Share this post


Link to post
Share on other sites
Anybody make a flow chart sort of liek program I''ve been asking this group I''m in but they seem to ignore me?

Sort of like tree''s?
with comparison data?

Like compare such and such data
and have all the different scenario''s coming from it
like a tree type structure?
so you can see all the possible outcomes?
that would be really cool.
0

Share this post


Link to post
Share on other sites
quote:
Original post by iwasbiggs

...and also it seems that you *should* force the player to do some things before moving on. Otherwise you would have nothing but d&d on the computer (which makes it really hard for the designer to tell a story).




I''ve adopted Kylotan''s idea of using pre-conditions to events to make it possible to force player to do something before he can do something else.

But the point about telling a story is good. It might make it easier to tell a really good story if you have more control on the flow of the game.

Maybe you should use a compromise and do event objects associated with tiles for things like traps and such, and a progress counter for the "big picture" storyline. Maybe you could spawn smaller progress counters for sub-quest and keep more than one of these progress counters in memory at once to allow for some quests to run in parallel?

Regards

nicba
0

Share this post


Link to post
Share on other sites
quote:
Original post by CodyVa

Anybody make a flow chart sort of liek program I''ve been asking this group I''m in but they seem to ignore me?

Sort of like tree''s?
with comparison data?




There''s already plenty regular of flowchart programs out there. Why don''t you just use one of these? Or even draw good old pen and paper?

Or are you thinking of a program where you can import the generated flowchart data in your game somehow? How would you then make a game flexible enough to load its storyline from a datafile?

Regards

nicba
0

Share this post


Link to post
Share on other sites
quote:
Original post by CodyVa

How do you do scripts?

like commands maybe
movperson(person, here, there)
Speak(person,string)?
type stuff
with time delays in between?
I dunno.


Scripts can be accomplished through writing a text parser. It goes along a file pointer and just scans the entire file and acts based on what it hits. Later check the string you scanned in against a list of available functions in a 2d-array of chars. Then (usually) you can save just the raw code of the text that was converted into a more compact array of bytes or ints (sort of like machine code) and just cycle through this array when you go to execute the script.

For delays... make a wait function for the script.

0

Share this post


Link to post
Share on other sites