Usefull Ideas

Got a favourite DM type game? Enjoy Eye of the Beholder? Adore Amberstar? Cherish Captive? Discuss these and more here!
Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
takis76gr
Journeyman
Posts: 73
Joined: Sun Oct 12, 2003 1:22 pm
Location: Greece , Athens

Usefull Ideas

Post by takis76gr »

I am very happy when I found this site and all Dungeon Master like
sites.

I dream was to create a RPG like Eye of the Beholder with Editor.

I have Eye of the Beholder 1 , Eye of the Beholder 2 , Eye of the Beholder 3 , Dungeon Hack , Dungeon Master 1 , Dungeon Master 2 , Lands of Lore 1
and 3 Years ago I had a Game with name Under a Dark Sun. Was in German and I din't understand nothing when I played. Was from Nine Red Shoes Company.

This game was a Mix of Lands of Lore and Eye of the Beholder 1
with Cubic Step by Step Engine (Dungeon Crawler) This is the real name of this engine.


When I descover Dungeon Master Java I where very happy.


Since 1996 I am working on with a Project with name Dark Ages.
Dark Ages will be my Dream. This project Does not Completed Yet.
Because some files was lost and some times become bored to programme :(


Dark Ages is A New Dungeon Master like game Not exactly Dungeon Master looks more Eye of the Beholder and Lands of Lore 1 like.

I have Grab all graphics from Eye of the Beholder 1 , Eye of the Beholder 2 , Eye of the Beholder 3 and Lands of Lore 1 , I made a lot of Changes
in wall sets and back drops. I mixed a lot of graphics together , I draw new of them and Now I have complete sets of walls and Backdrops.
Castle , Mines , Caves , Tower , House. Not yes for Forrest.
I have Grab Many monsters From Eye of the Beholder 1 , Eye of the Beholder 2 and Eye of the Beholder 3. So far I can Use Lands of Lore Graphic monsters , because there is a problem with color palettes and Monsters will destroy the palette , so The monsters of Eye of the Beholder siries have static frames of movement and Lands of Lore Monster Have
smoother Animation and more frames for Each monster.

For example a Eye of the Beholder Fighter has
only 2 Frames when facing North and Flip it self and create the illusion of movement. The same thing when it moving left or moving right.
I you want to do your monster move to different way , flip them.
But there is other Frame when you see the Back of the Monster.
In all cases there are 2 frames for each direction.

In Lands of lore , when a monster Pass through a square , is moving smoothly like Dungeon Master 2.
When You hit a Monster in Eye of the beholder 1,2,3 The bonster Become White , But In Lands of Lore and Dungeon Master 2
Drop Blood and have other frames and Monster look like feels pain
because you are hiting it and is more realistic.

In Eye of the Becholder when a Monster changes square , movement is
little spasm you see the monster far a way one square suddenly.
In Lands of Lore has many frames until Changes a Square.
When a monster moves behind a wall , first you see part of monster until
disappers behind the wall , In Eye of the Beholder , monster makes spasmodic movement and disappers suddenly behind the wall.

When Kill a Monster In Eye of the Beholder monster disappears but in Lands of Lore and Dungeon Master breaks down to the floor with smooth
animation and many frames. :D And The Problem is

I need to Draw a lot of Monsters , or I choose what kind of Monster will use.


I prefer to User Eye of the Beholder siries Monsters , because are
easiest in Capturiong , Drawing , Changing and program them and fit in my game.


From Eye of the Beholder Siries I have Collect for about more than 30 Monsters but From Lands of Lore and Dungeon Master , I have different color Palette and Monster Capturing is very hard work.
And Lands of Lore is only one game and has less monsters than Beholder siries.


I have a great collection of Background Horror , Caves , Tavern ,Castle , Inn , forest music.

I have all Lands of Lore background music in midi format . I have all Ultima underworld Background music.

I have many other RPG generic music from the Internet. So I have a lot of Graphic collection , Backgrounds , Interfaces skins.

I have a lot of Sound effects like , spells , monster roars , monster sounds , kliks , levers , buttons.

In some forums , I saw someone who wants to create a Game Like Dungeon Master 3.


I am C and little C++ programmer since 1996. I am allready working on
with RPG dungeon Crawller engine If someone wants idias or techniques how to Construct or how to disign the engine , can ask me.

I am C Programmer , but I am not the best Programmer.

Object oriented programming is very difficult to understand and when I programmed my game , I had the problem how to put infinity items on the floor. One other problem for me is the size of my source code.

I am copying and pasting a lot of lines if I want to do something many times :( sucs. My code for now is more than 12000 lines and I have allready finish 1 level. :( .

The Artificial Interligent engine took me 2 years and I made my Monsters
moving and trying to find a way to reach the player and kill him.
This is not a Path engine is only a lot of "if (variables==1) " to found where monster is in the map and compare my possition and possition of the monster and move the monster if possition of monster is less than
players possition make monster to go in other way.

This makes a complex engine with a lot of source code.

If you want to manipulate graphics easy and if you are C and C++ programmer there is a site which has a great library.

www.allegro.cc

This library is very good library and there you will find free compiler for windows and library is free.

This library makes miracles. You can program many things easy.

You are able to play Background music
in Midi , Wav , Mod , S3m , Xm , It , Mp3.

You can load a PCX , JPG , BMP images and make sprites very easy.
You can Change Color palettes very Easy.
You can Change video resolusion and make 8 , 16 , 24 ,32 bit colors

You can load fli , for your intro
You can write many frue type fonts
and create your own font and supports Unicode fonts
so your game will be in Greece , Inglish , Russia , Chinese and other languages if you want.

You have infiniti mamory of RAM is breaking the Convertional 640 kb Memory from Old Turbo C , and you can Use DPMI and you can Have
All you Hard Dride and Physical Memory.

You can Put your graphics in Data files and not loosely images in a directory like Dungeon Master Java. You can make Similar file as
Graphics.Dat of Dungeon master. :wink:

You can handle all of your keyboard and all 101 keys
You can use your Joystic if you want.

And You can make recording routine this subject I have not research yet.
but you can make VOICE RECOGNITION for spell. Someone in forums looks for this.

There are ready functions to Recordand play Wavs and Vocs with your microphone. But I dont know now how to compare them and cast spell from your microphone :P

But this is very interesting and I want to manage it. A very good idea is to
say the spell.

For example if you want to cast a fire ball , you will say.

Trecuno , micoides , trecoram (Bullshit magic words) hihi 8) and your spell will appear in your hand mmmmmmmmmmmmm!

VERY NICE.

If you want to READ a SCROLL and make a Heal Spell. You can Read the scroll and say the words on your Microphone.

But this is very difficult. Because every human's voice is different for males and females and program need to compares the voice. This needs a lot of mathematics and waveform comparison with the stored spell in program and your voice. Must be like a voice analyser.

VERY VERY HARD :P

SO FAR SO GOOD.

If someone wants graphics I will give them but my graphics are
in low resolution 320x200 pixels

I have a lot of screen shots ready from All of my RPG games but needs
alot of work. I have convert in 16 bit all of them but if you try to risize them from 320x200 to 800x600 :? you will have a but large pixel image
tooo bad. and then needs blur and other filter with photoshop , paintshop

all of kis kind 8)


So if someone needs to create a game from the begginging needs many hours of programming , many hours of experience and try to understand
finaly how this dungeon crawler engins works.

GOOD LUCK and I am looking AFTER to PLAY a GAME like
Dungeon Master 3.

my e-mail is takis76@yahoo.com
I will give you some help and ideas to bring DM3 in life
and if you wand graphics I am here.

Thank you vary much....
User avatar
PicturesInTheDark
Arch Master
Posts: 1154
Joined: Mon Aug 26, 2002 4:47 pm
Location: Vienna, Austria

Post by PicturesInTheDark »

Very impressive essay. Do you have any screenshots to show yet ?

Regards, PitD
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

You played DM1+2 ; Did you also play CSB? If not, you should do so, it's the best dungeon ever!

I agree with PitD: Some screenshots would be nice!
Parting is all we know from Heaven, and all we need of hell.
User avatar
andyboy_uk
On Master
Posts: 647
Joined: Thu Feb 20, 2003 1:51 am
Location: London, UK

Post by andyboy_uk »

Voice Recog for spells.. Now that WOULD be cool for RTC :)

Can we see some screenies from your enigne, it sounds impressive. If you are going the whole hog, you should have a look at the P5 Glove as well, then you could use it to interact with the dungeon even more.

http://www.essentialreality.com/p5_glove.asp
Regards,

Andy
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

Your program sounds very interesting. I like your style also!
Do you have a website, demos or screenshots?
Do you know there are utilities to rip the graphics of the DM series?
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

While I hate to sound negative, roice recognition takes a massive amount of processing, and had stumped the best programmers for many years -- I don't think this guy is really serious when he says the game will have it! ;)

takis76gr, I really admire your enthusiasm, it's great to have a new member who is excited about what they're doing! I know from experience that it's very hard to maintain that enthusiasm once the real scope of a project comes to light. I hope you achieve what you set out to do! :)
User avatar
andyboy_uk
On Master
Posts: 647
Joined: Thu Feb 20, 2003 1:51 am
Location: London, UK

Post by andyboy_uk »

@Gambit: I remember my old man getting an awe 32 when they were brand new (ages ago now) on something like a P166-200 or around that, and yeah, it could only recognise a few words (OPEN, CLOSE, MINIMIZEm MAXIMISE, EXIT, etc) - basic windows commands, but it did get them right like 90+% of the time (esp after a lot of training - it was pretty good). And although then yes it was slow, thats on a machine that is sooo bloody old now that surely todays PC's have some sort of wicked bash at it.

(not having a go at ya mate if it seems that way) but it might not be to unrealistic to see this sort of thing very soon. Surely there is a library or something (like A Voice recog equivilent of allegro) for C++?

Admittedly though, I have no experience whatsoever of programming this sort of thing. Anyone shed any light?
Regards,

Andy
User avatar
takis76gr
Journeyman
Posts: 73
Joined: Sun Oct 12, 2003 1:22 pm
Location: Greece , Athens

Post by takis76gr »

Hi my friends Again!


Sorry I am late because I had a lot of work.


I am very happy , you saw my Message :D


First of all I answer my friend's andyboy_uk the programma which you
say , was the Voice Assist from Creative Labs in Awe32 and Include
Copy Parrot programm , was a Talking Parrot. 8)

and Voice Assist Recognize your voice and make some simple windows
commands like as you said (OPEN, CLOSE, MINIMIZEm MAXIMISE, EXIT, etc) :wink:


I have Great News , here is my Url of my RPG what I have create
so far.


http://www.geocities.com/takis76/rpg.zip



If you can hear music or sound effects
I will correct this problem , because I have programm the game to play
with my soundcard only so far.

But no problem newer versions will be greater.


Tell me I you like my game :D


If some one wants to give info about my engine and how it works

ask freelly.


But I have may questions too.

This version you will download Does not support Voice Recognition
Because I din't understand Waveform comparison functions Yet.


I think in very future version will be make something.


But in the final version my game I want to have


Monster Editor
Charachter and Party Transforming from on adventure to other
Charachter and Party editor
Item editor
Map editor
Trap editor
Events editor

Music Editor
Spell Editor

Intro Editor
Finale Editor



I have many questions about , how can I put Infinity items on the floor.
But I need improvement. My game is in very early stages.


Perhaps I need to Change the Resolution fro 320x200 to 640x480 or 800x600 and make my game in Windows

Because this varsion is for DOS


and my Game works In Windows 98 only.

The next Version will be compatible and Windows XP. :P



When the game beggins you are in fron of a key lock.

If you have Sound Blaster Card you will hear some music or effects.

If someone have other onboard soundcard , perhaps hear nothing :?

:(




This version of my game is a test version and learning c and c++ function
and testing my game trigers


like

if I put this key in this keyhole , the door in courdinates(30,10) will open

if I pull the lever from this courdinate , which drap will enabled?

and if my spells work (e.t.c)

8)



Look my game and tell me if you like it.


Thank you very very much
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

Hello Takis,
you asked how to put infinity of objects on a tile.
Here's how work the DM engine (I think):
DM has databases, where all the existing objects are defined. Each entry has an index to identify it.
Each tile can refer to one of these indexes to say which object is immediatly above the tile.
Each object has also a reference for the next object on it.
And so on.
Special objects like chests have several references. At least one for the first contained object, and another for the object above the chest.
Hope this helps...
User avatar
takis76gr
Journeyman
Posts: 73
Joined: Sun Oct 12, 2003 1:22 pm
Location: Greece , Athens

Post by takis76gr »

Did you download my game demo?


Tell me your opinion :D


if you haven't downloaded yet I have a Url to download


[Url]www.geocities.com/takis76/rpg.zip[Url]



In my game I have items database too but in fact not exactly database.


If you are a C++ programmer you will understand this.

I have a dimension variable like

items[20][50][50];

or items_on_level1[50][50];


if I want to put many dimensions for each level

I use this

items[1][50][50] = item_palette; //the number of item


or item_on_level1[50][50] = item_palette; or
item_on_level2[50][50] = item_palette;


e.t.c

with this way I can have 20 levels with 50x50 squares for each Item
but this will be more complex if I want to put more than one item per
square

the three dimension like this


int items_on_level1[50][50][100];

this means items_on_level1[max_x_squares][max_y_squares][max_droped_items];


and if I wand to put an Item in level1 on 13 , 45 square I am using
this


items_on_level1[13][45][1] = skull_key;

skull_key is a variable which contains the vaule of skull_key;


If you want to put many items on one square I use this


item_number1=1; //leather_armour
Items_on_level1[13][45][1] = item_number;

now the dimension on 13,45, on item slot 1 has the item number 1

if you want to put other one item in same square

call the funcion again


item_number=2; //number 2 = wooden shield
Items_on_level1[13][45][2] = item_number;

item_number=3; //number 3 = stone key
Items_on_level1[13][45][3] = item_number;

item_number=4; //number 4 = heal potion
Items_on_level1[13][45][4] = item_number;

.
.
.

and the 13,45 square on level 1 has 4 items :D

but this make a lot of source code line and complex code
Go and download my game and I will see how to improve my code.
In my game there is and source code too.
and Tell me your opinion about my game. :wink:

BUT You need to be a programmer to understand what I say :P

So with this way I can have limited items on the floor with complex code.
Guest

Post by Guest »

Dungeon Master uses linked lists to implement
a potentially infinite number of items in each cell
of the dungeon. It works very well. You need to be
a programmer to understand this.
User avatar
Lubor Kolar
Artisan
Posts: 178
Joined: Thu Jan 25, 2001 10:21 pm
Location: Prague, Czech Republic, Europe

Post by Lubor Kolar »

Anonymous wrote:Dungeon Master uses linked lists to implement
a potentially infinite number of items in each cell
of the dungeon. It works very well. You need to be
a programmer to understand this.
I completelly agree with that. Using fixed fields like a[10,10,10] is way to hell. Use at least some STL elements like maps.
User avatar
PicturesInTheDark
Arch Master
Posts: 1154
Joined: Mon Aug 26, 2002 4:47 pm
Location: Vienna, Austria

Post by PicturesInTheDark »

The link does not work for me (anymore ?) ...

Have you changed the name ?

Regards, PitD
User avatar
takis76gr
Journeyman
Posts: 73
Joined: Sun Oct 12, 2003 1:22 pm
Location: Greece , Athens

Post by takis76gr »

My game's link is

www.geocities.com/takis76/rpg.zip

in UPPER CASE is WWW.GEOCITIES.COM/TAKIS76/RPG.ZIP

I typed my link in uppercase to see the letters.

Some people uses q or g (Q or G) no RPQ :D


So far I have not understand how can I create a list with Items
and I am using dimension tables to store my data. :(

If i want to strore 1000 items I use this

a[1000];



and I am using a for loop to scan all of my items in the table.



for (item=0; item<=1000; item++) like for a=1 to 1000 in basic
{
a[item];
}


I ask many people about list and said that "I need to understand pointers"


But this forum is not programming forum , is only a Dungeon master Fun forum.

Thank you very much about your help.

And I am not here to ask about C++ Programming Lessons because here
most people are players not programmers.


First I must understand the Pointers.


and then Improve my code.



But the final player , does not care how games was created.

One player cares about how plays the game.


For example when you are playing Diablo 2 , You are not care how
this game was programmed and created , the only thing you care about this is , if the story is good and how can kill diablo at the end. :wink:


Similar about Dungeon Master 2 from FTL when I am playing the game ,
only thing which I am thinking is , how to finish the game
and how to kill all monsters and unlock all the doors and where can I found a map editror and create my own adventure.


I am not care how programmer create the game and how many hours
took him in programming :?


But in fact I am trying to find the source code of Dungeon Master
and try to understand how to improve my code and make my game
better.


Thank you very very much.


This versions which you download is the most improved version than
the older versions , the olders versions where worst.

:P
User avatar
takis76gr
Journeyman
Posts: 73
Joined: Sun Oct 12, 2003 1:22 pm
Location: Greece , Athens

Post by takis76gr »

Geocities cite has a bug

do not clik on the link


but retype all Url from the beginning and oper other explorer

I tryed to klick on the ling and geocities redirect me in error page

do not press the link from here retype the URL


In fact the page is correct but


rewrite all url



http://www.geocities.com/takis76/rpg.zip


in browser's addressbar Thank you
Guest

Post by Guest »

It is clear that you are going to learn a lot before you
make your project a success. But you received bad
information.....pointers are not necessary to construct
lists. An array of structures can contain lists, in which
each list element contains an index of the next element
of the list. Example:

struct TELEPORTER
{
int next;
DESTINATION dest;
};

and the array:

TELEPORTER teleporters[1000];

And code to traverse the list:

for (i=index of first teleporter; i>=0; i=teleporters.next)
{
process(teleporters); //Process one teleporter in the list.
}

It is rather standard practice to have the available elements
of the array linked together in an 'available' list so that
allocation and deallocation are trivial.

End of lesson. Good Luck.
User avatar
takis76gr
Journeyman
Posts: 73
Joined: Sun Oct 12, 2003 1:22 pm
Location: Greece , Athens

Post by takis76gr »

The good news is I know something about stucts in C++


In my game when I was to put a lot of doors I made a struct like this.


struct THE_H_DOOR //that means if have stuck for horizontal doors
{

int x; //x on the map
int y; //y one the map
int locked; //if my door is locked
int key; //the key that door can be unlocked
int door_frame; //door animation frame
} h_door[1000]; //number of horrizontal doors in array.


and if I want to put a horizontal door on the map I used this

first I initialize a map array


int level1[50][50]; //a map array with 50x50 squares

and I initialize the position in intiger variables

int x_pos,y_pos;

int scan_no; //this is an integer variable that contains the number of door

when I want to scan all of my doors I say:


for (scan_no=0; scan_no<=1000; scan_no++)
{

for (x_pos=0; x_pos<=50; x_pos++)
{

for(y_pos=0; y_pos<=50; y_pos++;
{

level1[x_pos][y_pos]=hdoor[scan_no].key = rand() % 10;

}

}


}


with this routine I put in a map 50x50 squares , 1000s horizontal doors locked with 10 different keys randomly




and if I want to control and see what door am I in front;

I use this:


I had other two integer variables:

int player_x,player_y;

but I can have and struct for my player


struct PLAYER1;
{

int x; //x on the map
int y; //y on the map
int mana; //mana magic points
int health; //hit points for health
long int level_exp; //experience points
int level; //level
int inventory[20]; //inventory slots for 20 items
int status; //status of player if is dead , poisoned
char *name; //name of players
int class; //the class of player fighter , mage , cleric etc;
int ac; //armour class of player
int weapon_on_left_hand; //weapon on the hand
int weapon_on_right_hand; //weapon on other hand
int food_level; //how hungry is the player
int water_level; //how thirsty is the player

} player1;



But I want very large and complex code of loops to scan all of them.



can I use the same way with items on the floor?


sturct FLOOR_LEVEL1;
{
int x; //x of item
int y; //y of item
int item_slot_on_the_floor[1000]; //number of items on the floor


} floor_on_level[50]; //50 level floors


this is a good idea :D


but I need to define something and put some loop

#DEFINE key 1;
#DEFINE sword 2;
#DEFINE shield 3;
#DEFINE apple 4;


for (no_scan=0; no_scan<=50; no_scan++)
{

floor_on_level[no_scan].x = rand() % 50 + 1; //random position of droped_item on x
floor_on_level[no_scan].y = rand() % 50 + 1; //random position of droped_item on y

for (item_slot=0; item_slot<=1000; item_slot++)
{
floor_on_level[no_scan].item_slot_on_the_floor[item_slot]=key;
floor_on_level[no_scan].item_slot_on_the_floor[item_slot]=sword;
floor_on_level[no_scan].item_slot_on_the_floor[item_slot]=shield;
floor_on_level[no_scan].item_slot_on_the_floor[item_slot]=apple;
}

}


and with this I put on 50 levels 4 items randomly in each square




and if I want to see which item lies on the floor each time to press my
mouse button perhaps need this


all loop from the beggining

so I can create other dimentsion or struct like this

sturct FLOOR_LEVEL1;
{
int x;
int y;
int item_slot;


} floor1[50][50][1000];

for (item_slot=0; item_slot<=1000; item_slot++)
{

if (level1[player1.x][player1.y][item_slot]==key) { taking my key }
if (level1[player1.x][player1.y][item_slot]==sword) { taking my sword }
if (level1[player1.x][player1.y][item_slot]==shield) { taking my shield }
if (level1[player1.x][player1.y][item_slot]==apple) { taking my apple }

}

and putting thise items in my inventory like this



struct PLAYER1;
{

int x; //x on the map
int y; //y on the map
int mana; //mana magic points
int health; //hit points for health
long int level_exp; //experience points
int level; //level
int inventory[20]; //inventory slots for 20 items
int status; //status of player if is dead , poisoned
char *name; //name of players
int class; //the class of player fighter , mage , cleric etc;
int ac; //armour class of player
int weapon_on_left_hand; //weapon on the hand
int weapon_on_right_hand; //weapon on other hand
int food_level; //how hungry is the player
int water_level; //how thirsty is the player

} player1;



player1.weapon_on_left_hand = sword;
player1.weapon_on_right_hand = shield;

for (inventory_slot=0; inventory_slot<=20; inventory_slot++)
{

if (player1.inventory[inventory_slot]>0)
{
player1.inventory_slot++;
if (player1.inventory > 20)
{
write "Hey Guy you are full of items drop something";

}

}
if (player1.inventory[inventory_slot]==0)
{
player1.inventory_slot=apple;
player1.inventory_slot=key;
}

}

And I scanned if I have an empty pocket and put these items in
my inventory


hmmmmmmmmmmmm!! GREAT IDEA


I need to create my game from the beggining :lol:
Tom Hatfield
Ee Master
Posts: 688
Joined: Mon May 07, 2001 7:00 pm
Location: Indiana, USA
Contact:

Dual-Linked Lists

Post by Tom Hatfield »

You seem to have lost general interest by dumping a lot of code here.

Here's some advice: I understand you're excited about your project, and that makes you want to type more than usual. Most people who visit this forum are not technical. Keep your posts short and well-organized, and only post code when you feel it's absolutely necessary. You're far more likely to receive positive feedback that way.

I must admit to not having read all the posts here. Being a programmer myself, there may be a great many subjects in here I could comment on. Quite frankly, the thought of digging through all this mud exhausts me. (Were it better organized, I would take a look.) Of course, C++ is not my language of choice, either.

Guest is correct, in that you don't need pointers to create a list, or even a linked list. (I believe previous posters were referring to the use of pointers to create a memory-friendly object-driven linked list. Pointers are indeed necessary to do this.) However, the technique he gives for iterating every item in an array is extremely slow and inefficient. No self-respecting programmer would ever do this.

Below is a technique for using a dual-linked array that works extremely well for a given domain and eliminates the biggest problem with object-driven lists: memory fragmentation. I came up with this technique on my own. There may be better ones.

The drawback to this technique is that the list takes up an equal amount of memory whether it's full or empty. This means you do not want to create a dual-linked list like this for every tile in your game. In fact, I don't know that you've a use for it in your particular case, but I'll post the code anyway because it may be helpful.

The code is given in pseudo-Basic.

Data structures for the list are created as follows:
_________________________

Type ListNode
ItemData
NextOpenNode
NextUsedNode

Type List
Item() As ListNode
ItemCount
FirstOpenNode
FirstUsedNode
_________________________

Initialize the list as follows:
_________________________

ReDim List.Item(0 To maxNodes)

For i = 0 To maxNodes
List.Item(i).ItemData = Empty
If i < maxNodes Then
List.Item(i).NextOpenNode = i + 1
Else
List.Item(i).NextOpenNode = -1
End If
List.Item(i).NextOpenNode = -1
Next i

List.ItemCount = 0
List.FirstOpenNode = 0
List.FirstUsedNode = -1
_________________________

This is how you add an item to the list:
_________________________

// can't add an item if the list is full
If List.FirstOpenNode < 0 Then Exit

Let i = List.FirstOpenNode

// set item data to whatever you want
List.Item(i).ItemData = genericSetItemData

// maintain list structure
List.Item(i).NextUsedNode = List.FirstUsedNode
List.FirstUsedNode = i
List.FirstOpenNode = List.Item(i).NextOpenNode
List.ItemCount++
_________________________

The next part can get pretty confusing. This is how you remove an item from the list:
_________________________

Let i = indexNodeToRelease

// clear item data at this node
Let List.Item(i).ItemData = Empty

If i = List.FirstUsedNode Then List.FirstUsedNode = List.Item(i).NextUsedNode
List.Item(List.Item(i).NextOpenNode).NextUsedNode = List.Item(i).NextUsedNode
List.Item(i).NextOpenNode = List.FirstOpenNode
List.FirstOpenNode = i
List.ItemCount--
_________________________

I've double-checked the code for accuracy, but if you find an error, please let me know.

Remember: you should not do this for every tile in your game. You can use this technique to create a general list of items. For item references per-tile, you'll need to use pointers. Since I didn't read the entire thread, I don't know if pointers were discussed thoroughly or not. If you have problems, please let us know.
Tom Hatfield
Ee Master
Posts: 688
Joined: Mon May 07, 2001 7:00 pm
Location: Indiana, USA
Contact:

Voice Recognition

Post by Tom Hatfield »

One other thing:

Voice-recognition is not difficult to implement, provided you use an SDK. I've been seriously considering this myself for a MUD-style project. (I pretty much gave up on the MUD idea for now, but the notion of using voice-recognition lingers.)

If you're interested, you can download the latest Text-to-Speech (and vice versa) SDK from Microsoft, but I recommend you step back and use one of the older ones. Personally, I keep a copy of TTS SDK 5.1 on my backup drive because it doesn't require the .NET framework, and thus is better in my particular case. If you prefer .NET, then by all means get the newest one.

Here is a link to TTS SDK 5.1:

http://www.microsoft.com/speech/download/sdk51/

And here is the new one:

http://www.microsoft.com/downloads/deta ... laylang=en

Bear in mind, the new SDK is over 600 megabytes. (In contrast, the old one is 68 megabytes.)
Post Reply