Jump to content

Using "OPEN #1:....." Help...


Recommended Posts

How you handle uniques depends somewhat on how you build the game levels. If you go the ToD route and build everything up front, then you track in the builder if the unique creature/item has been added yet, and if it has, don't allow it to be added again if the random generator tries to. If you build your levels on the fly as players enter them, then it's better to have an array of boolean values for all the uniques, and then when one is called up set that boolean to "true", indicating it has occurred once and should not occur again. Both mechanism are very similar, it just depends on when the unique gets created as to how you handle it.

Link to comment
Share on other sites

Wow... That's way beyond me as yet.. I need to do some more studying and research... Hoping I can learn what I need to learn soon--- Thanks for the advice and I'm really excited about getting into the engine building here... I've been practicing on a few small programs testing out these Ideas... Need more input--- like Johnny 5 from Short Circuit. :)

Link to comment
Share on other sites

I know I'm a little late, but I'll try to throw in my two cents.


First Adamantyr hit is right on in the very reply to your initial post. XB sucks for doing record based data management. You really have no control over where things go in memory, so it is "very hard" to make efficient use of memory.


The problem with numbers is that XB stores all number as 8-byte radix-100 numbers, so even a simple variable holding a number that would normally fit in a single byte (between 0 and 255) is going to consume 8-bytes. However, you can use the logical operators on XB's numeric variables, so you can use bit flags to make better use of a numeric variable. I know this works when treating numeric variables as bytes, but it should also work up to word (16-bits) values as well (just read in the XB manual where is states numeric variables can be used with the logical operators up to 16-bits.) The only down side is that you have to define the bit-masks, and it will take a little more code and processor time (but not much). In return you get really density. Also, in XB with the memory expansion, numeric variables are stored in CPU RAM.


The problem with strings is that they are always stored in VDP RAM, so exclusively using strings does not take advantage of the fact that you have 24K of high memory sitting there. However, all your code is in high memory too, so it depends on if you need more string space or code/numeric variable space.


Disk buffers will also consume the top of VDP RAM.


Using numeric arrays will be more efficient that individual numeric variables because an array only needs a single entry in the symbol table. So DIM A[4] gives you 5 numeric variables, where as A=0::B=0::C=0::D=0::E=0 also gives you 5 variables, but each variable requires a symbol table entry, and each symbol table entry is 8-byte minimum. So, with the discrete variables you just used 32 more bytes than the array.


I would suggest a mix of using strings and numeric arrays. The problem with storing numbers in strings is that each digit takes up a byte. And if that digit is a simple yes/no indicator (something you would use 0 or 1 to represent), then you are better off using bit-flags to track such information. XB's strings are binary safe, since the length is maintained separately from the data, you can store any byte value in a string's data.


When doing the whole "parsing" thing, your ':' separator is a waste. If your format is well-known (which it is, you made it up), and you can guarantee the format (which you can), you can just say "the first character is an object identifier, the second character is a sub-identifier, the 3rd character is a quantity".


Then say object types are:


C - Chest

Subtypes for a chest:

L - locked

U - unlocked


M - Monster

Subtypes for a monster:

S - skeleton

Z - zombie


So, I could store in a string:




That means there are 3 skeletons and 1 locked chest. You can define the lists any way you want, and you don't have to stick with letters either, since like I said, XB strings are binary safe you can use any value from 0 to 255 in any character position. You would simply parse the numeric values like this:


10 A$=CHR$(1):: A$=A$&CHR$(1):: A$=A$&CHR$(3)
15 A$=A$&CHR$(2):: A$=A$&CHR$(2):: A$=A$&CHR$(1)
20 A$=A$&CHR$(1):: A$=A$&CHR$(2):: A$=A$&CHR$(5)

60 DATA$=A$

105 I=1
115   IF I>LEN(DATA$)THEN 200
120   ITEM=ASC(SEG$(DATA$,I,1)):: I=I+1
125   TYPE=ASC(SEG$(DATA$,I,1)):: I=I+1
130   QTY=ASC(SEG$(DATA$,I,1)):: I=I+1
135   ON ITEM GOSUB 1000,1100
140   PRINT STR$(QTY)&" "&P$
150 GOTO 110

210 END

1010 IF TYPE=1 THEN P$="SKELETON" :: GOTO 1090
1015 IF TYPE=2 THEN P$="ZOMBIE" :: GOTO 1090



In this example I'm using binary data in the data string, but if you could "see" the bytes in the string as values, it would look like this:




Of course things get much more complicated and you need to work it all out to cover everything. It also puts the knowledge of the data into the code, which may or may not be desirable. However, on older computers with limited space, the "meta-data" typically must be in the form of program code. For an example of meta-data that is stored with the data, think XML. However, you could also make up a very compact meta-data format and then have it included with the data. This would make the data much more flexible and remove the requirement for a rigid format at the cost of at least double the data space on disk.


It goes on and on. There are too many possibilities to come up with a solution for them all. I suggest you start by defining what you want to have in your game, then figure out how to store it and act upon it. If you try to come up with a storage method first, you will be limiting what you think you can do within you game right from the start, or you will be constantly changing your data format and that gets old after a while (especially once you have a lot of code written.)



Link to comment
Share on other sites

Something else I just thought about. You don't want code in literal strings that you use more than once. If you use a literal in your code, XB will store it every time, it is not smart enough to know that you used "SKELETON" 6 times in your code and to point all occurrences to one string in memory. It will store the string expression 6 times. You are better off making an array of item names and such, and using indexes into that array. You could also keep this object list on disk and load it into a string array at run time. That would let you maintain the object list separate from the game code, i.e. easier to change. The only thing you can't do with an indexed list like that is change the index of an object name once you start using it (unless you update all the references to that object's old index.)


Something you are going to run in to very quickly is the need for tools to makes all this game data. You will create it by hand for a little bit, but you will get really tired of that in a hurry. I suggest utilizing a modern PC for your data creation, there is no shame in that.



Link to comment
Share on other sites

I'll address your last statement first... I do 90% of all my development on a modern computer--- anything to be efficient and effective. I am by no means a purist, and whatever tools are available, I want to use them if they make my development easier and more organized. As to your other post and information therein, I have to say that I'll be studying this stuff heavily over the next couple of days. I am entering a new realm of complexity in coding here and I'm ill-equipped to handle all this stuff as if now... I will start today by writing a list of all items, weapons, spells, enemies, etc. that will be in the game and post it here when it's

complete. That seems to be the starting point here, and once that is done, I will proceed further. I've never done anything of this scope before, and I have to say in all honesty that the majority of what you have suggested makes sense, I just don't have any clue about how to manipulate the data. I'll be studying this thread and working on some stuff today and tonight and report back to you this evening. Thanks again Matthew. Your input is brilliant.

Edited by Opry99er
Link to comment
Share on other sites

When you say "I just don't have any clue about how to manipulate the data.", be specific so we can help you learn what you don't know. There is a lot to cover when talking about data manipulation and it would be a waste to write an essay on something you already know.


There is something else you might consider: do this one in assembly. Since you said "I am entering a new realm of complexity in coding here", why not take it a little further? Simply due to the amount of data moving and control you will need, I think you will have a better chance of success by leaving XB behind. However, if you are set on doing this in XB, then you are probably going to have to settle for less that you initially want to achieve.



Link to comment
Share on other sites

I should reiterate that using a separator character is indeed wasteful in your datafile if you are using fixed-format data entries. For example, in the original ToD, all monster data entries are the same length, with some attributes multiply encoded into a single byte. This is fine if you have rigid data and plan carefully in advance how to lay it out (or write a tool to reformat it on demand if you change that data format). I use colon separators in ToDR because my data is of dynamic length, plus it makes it easy to tack on new attributes when the data model changes. But of course even 10,000 extra data characters is not a big deal on a PC, where you have memory and drive space galore. Especially when you consider that these are in text files that can be compressed. Those same extra characers can be a make-or-break issue on a computer like the TI however, as every byte counts. So spending time up front developing a rigid data format might be the way to go. The result is less "human-friendly", but it will save you vital space down the line.

Link to comment
Share on other sites


Really the biggest problem for me is looking at all these marvellous suggestions and knowing how to tailor them to my particular needs... Part of that comes from not having a skeletal structure in place already--- I am in the process of remedying that as we speak. The data manipulation I'm speaking about is really 3 things:


1) finding the proper parsing method, write a tool, and implement it

2) setting up data access for the program on disk

3) learning to load said data into the program in a usable form...


None of that really makes much sense without the "skeleton" for the game, so I'm working on that now. I will post it when I am finished with it so that we may look at something literally as opposed to theoretically. Again, thanks. :)

Link to comment
Share on other sites

Codex--- I think the ToD method will be the most logical here... In a "fixed" format, even with "0"s taking up the place of unneeded segments of the string, I will save a ton of space. A good thought, and I don't mind it being inhuman... I've seen assembled object code--- doesn't get any more inhuman than that. Matthew suggested writing this game in assembly... I have considered that... But I don't think I can handle it at this point.. Even with using assembly, I'll still have to learn these methods---they will just be in a foreign language to me. I'm not against learning assembly, as a matter of fact, with Matthew's help, I have already learned some... But for this project, I am not confident in my ability to learn a new language and get this game written in any kind of reasonable timetable. BTW, Matthew has written a few brilliant assembly tutorials which I have uploaded to my website. :).

Link to comment
Share on other sites

Data modeling can be an art that's for sure, and the golden rule for any program, format, solution, or whatever is: "KNOW YOUR DATA". Good solutions come from solving a specific problem, not by being general purpose (and on a limited resource computer you can not afford to be general purpose.)


You have to define your problem before you can solve it. So, like you intend, get your lists made, think about the game play and how those items will be found, used, identified, and manipulated. Think about the map, the visual representation of things, layouts, sounds, graphics, everything. *Don't* think about "how am I going to store all this on disk??" That does not help you at this point. Also, keep in mind that you are going to have to pick some realistic limitations based on what you can fit in memory at once and what will fit on disk. Infinitely expandable is not an option.


IMO the hardest part will be balance and replay value. You need to define the goals and challenges very carefully. I have a lot of books on making games "fun" and a few things I have distilled from them all are:


1. Our brains perceive "fun" as learning and solving puzzles or problems.


2. Have 10 second, 2 minute, and 10 minute goals. The player should always be engage and have something they are doing towards a larger goal.


The small goals are the "candy" or reward that keeps them going. Think about one of the most popular games of all time: Tetris. Getting a single line is the 10 second goal. Building up to get 2 or more lines is a 2 minute goal. Keeping away from the top is the 10 minute goal. The "fun" of it is puzzle solving.


In a CRPG I think the "fun" aspects are character development and hacking-and-slashing monsters. The pinnacle game that captured these concepts better than any other is Diablo. 10-second goal: kill that monster in front of me. 2-minute goal: get that chest. 10-minute goal: clear this dungeon. Long-term goals: go to next level, get better gear, develop my character.




Link to comment
Share on other sites

I've posted the original "Legend of Beryl Reichardt" mission statement (so to speak.) Below that is a list of all the enemies (static and random) the items (static and random)





The Legend of Beryl Reichardt



Character History:


Beryl Reichardt is a half dragon, half man hero from the ancient days before recorded time. His destiny as a young child was to become the greatest swordsman and champion the world had ever seen. His mother, Anifax the Black dragon, died at birth, and his father, Beryl the first, died when Beryl was a young boy and left his son with a great burden. Beryl Reichardt, the heir to the throne of Kings, was without the legendary "Sword of Wooldridge." When his father was killed, the dark prince of Angmar took the fabled sword from Reichardt's lair and hid it deep within the dreaded mountain. Raised by Reptoslicer the reptilian wizard, Beryl was always practicing swordplay, learning to manipulate magic, developing his experience and character to one day lead a small group of champions into the deep caves beneath the mountains and recover the sword which was his birthright.


Beryl Reichardt is accompanied in this quest by a few friends, of which you can choose. The other champions are:



*Sir Markus the Valiant: (Fighter)


-Strong magic


-Average attack


-High charm



Sir Marcus the Valiant is a welcome companion on your quest to retrieve your birthright. His speed and Magic are nearly as strong as yours, and he is a very accurate striker, although his strength lies mostly in his attack magics. He will be of help to you when there are multiple enemies present in a room or tunnel passageway.



*Reptoslicer: (Wizard)


-Strong Magic


-Strong attack


-Weak Charm



Reptoslicer is a very important member of your team of champions. His speed is second to none, and his close range attack is vicious. He is the reptilian version of a great wizard, as his magical abilities are well trained in the ways of healing and regeneration. By far the strongest and most loyal member of your team. He won't win any popularity contests, though, because as he is a shape-shifting lizard, he doesn't speak in a language most can understand. Because you are Beryl Reichardt, you can understand Reptoslicer's words.



*Skylar Twilight: (Thief)


-Average Magic


-Weak attack


-Strong Charm


Skylar Twilight can be very useful in a pinch!! She is the fastest member of your group, and her small dagger is accurate, though it does not deliver many hitpoints. Skylar has special powers of persuasion... When she casts spells, often the enemies cower away. She prefers to avoid physical conflict, but is never afraid to slice up an Ice Demon or an Ork with her magical elven dagger!!!








You will see many enemies as you travel down through the many levels of the Tunnel Dungeon. Many common enemies like "Cave Spiders," "Orcs," and "Goblins." But as you reach the lower levels of the game and as your experience points rise, you will face 3 fierce and powerful enemies:



*The Doppleslicer



The Doppleslicer is an evil clone of your team member "Reptoslicer." The Doppleslicer has the same strengths, the same weaknesses, and even looks the same in many ways. The Doppleslicer is one of the worst enemies you will face. Be sure to use a balanced attack on this enemy. Swords, Axes, Slings, magics... all at once. You will see what I mean.






Not a lot is known about the dreaded Unipanx. His battling skills have left many-a-champion without a head or torso. He has a single giant horn atop his massive black head that is said to give him super strength and an uncanny ability to avoid close range blows.






It is unknown how the demons of the depths conjured up the undead spirit of Anifax, Beryl's mother. Her soul has been trapped within the twisted body of an ancient demon and made to stay deep within the mountain's heart. Over the centuries, what was left of Beryl's mother has long since faded. All that is left now is a twisted, hateful, terribly dangerous Demagon. It is understood that Beryl Reichardt has conflicting emotions... On one hand, he knows his mother is now nothing more than a twisted demon-spawn bent on murder and power. But on the other hand, she is his mother... Use whatever precaution you can. There is no more dangerous enemy than Anifax. Can you muster the strength to kill your own mother to acquire "The sword of Wooldridge?"



Characters have the following statistics:

1) HP

2) MP

3) EP

4) Attack

5) Defend




Enemies: (Attrubutes) +X (X=benefit from defeating)


Forest/town World***

Scorpions (15 HP) +1 Attack, +2 EP

Skeletons (20 HP) +1 Attack, +2 EP

Giant Spiders (10 HP) +1 Attack +2 EP

**no static characters

Desert World***

Sand Sentinels (30 HP) +2 Attack, +3 EP

Giant Spiders (10 HP) +1 Attack, +3 EP

Skeletons (20 HP) +1 Attack, +3 EP

Scorpions (15 HP) +1 Attack, +3 EP

Whirlwinds (25 HP) +1 Attack, +3 EP

*Static characters (uniques)

Doppleslicer (80 HP, Whirlwind Magic) +5 HP, +25 EP, +10 Attack, +10 Defend *universal (affects all characters)


Caves World***

Skeletons (20 HP) +1 Attack, +4 EP

Cave Spiders (10 HP) +1 Attack, +4 EP

Cave dwellers (30 HP) +2 Attack, +4 EP

Scorpions (15 HP) +1 Attack, +4 EP

*Static characters (uniques)

Unipanx (100 HP, Melee Magic) +10 HP, +50 EP, +15 Attack, +15 Defend *universal (affects all characters)


Dungeon World***

Lost Souls (40 HP) +3 Attack, +5 EP

Skeletons (20 HP) +1 Attack, +5 EP

Cave Spiders (10 HP) +1 Attack, +5 EP

Demagons (50 HP) +3 Attack, +5 EP

Dungeon Scorpions (25 HP) +1 Attack, +5 EP

*Static characters (uniques)

Anifax the black dragon (250 HP, Lightning Magic, Whirlwind Magic, Melee Magic) ***GAME OVER*** great job, you win



***Items (non-"world"-specific/random)

(((based on who "takes" the item)))


Ruby Amulet (+2 HP)

Ruby Ring (+2 MP)

Diamond Amulet (+4 HP)

Diamond Ring (+4 MP)

Red Potion (+5 HP)

Green Potion (+5 MP)

Scroll of Martial Arts (+5 Attack)

Scroll of Meditation (+5 Defend)

Gold stashes (varying amount of gold)



***Items (world-specific/static)

(((based on who "takes" the item)))


***Town/Forest World

1) Elf Key/Elf Treasure Box (containing 100 gold, 5 red potions, and the "password" to move on to the next level)


***Desert World

1) Amulet of Wind (increases MP by +20 for the character chosen to wear it)

2) Hero's Sword (once the Doppleslicer is killed, the sword appears-- Only Beryl can wield it. Increases attack by +20---This moves the party to the next level)

3) Magic Key/Magic chest (containg the Magic Wand--- increases MP by 15 universally *all characters benefit)


***Cave World

1) Helm of Reichardt (Can only be worn by Beryl, increases Defend by +20


***Dungeon World

1) Staff of Reckoning (Increases Attack by +15)

2) Shield of Reichardt (Inreases Defend by +15--- Only Beryl can use)



Whew!!! That's it for now. Of course the characters will be able to buy items from the store at the beginning of each level... but ONLY at the BEGINNING of each level. Hope this all makes sense!



Of course MUCH of this will be changed and edited... This is just a starting point.






Edited by Opry99er
Link to comment
Share on other sites

Hey Owen, have you worked out the formulas for combat? If so, care to detail it for me? It seems you must have a plan already, because without understanding how +1 to attack can help you, it means nothing to the player. This has always been my biggest bitch about playing CRPG's, you don't really have a concept of how good an item is if you don't know how the stats help you. I played WoW for almost 5 years and never did get a grasp on how much a certain bonus would or would not help.


I have to imagine that coming up with formulas that work well over the range of characters, mobs (NPC monsters), and gear is rather difficult.



Link to comment
Share on other sites

Hey Owen, have you worked out the formulas for combat? If so, care to detail it for me? It seems you must have a plan already, because without understanding how +1 to attack can help you, it means nothing to the player. This has always been my biggest bitch about playing CRPG's, you don't really have a concept of how good an item is if you don't know how the stats help you. I played WoW for almost 5 years and never did get a grasp on how much a certain bonus would or would not help.


I have to imagine that coming up with formulas that work well over the range of characters, mobs (NPC monsters), and gear is rather difficult.


Yeah, World of Warcraft had both the primary attributes (strength, dexterity, etc) and the secondary attributes (attack power, spell power, haste rating, etc.) And of course, what ends up happening with such systems is that the secondaries are the most powerful, and the most desirable. For example, only items give you spell power, which was needed for any serious power as a spellcaster.


The next expansion (Cataclysm) is actually doing away with most of the secondary attributes being independent of the primaries. So Intellect directly increases spell power, strength directly increases attack power, etc. And items that add directly to secondaries are going to be changed/removed. So that's going to really change the dynamics in the game.


It's good to do research into other RPG's and CRPG's, even board games, to see how they resolve disputes and conflicts, for ideas on how to design your own system.



Link to comment
Share on other sites

I have a general idea...


**General attack for the Player---EP/10+Attack=RSE (relative strike effectiveness)

**Magic attack for the player---EP/10+MP=RME (relative magic effectiveness)


Since enemies do not have a "defend" statistic, their defenses do not need to be factored in. The enemies only have HP. Therefore, the RSE or RME will be equated to an enemy's "level" and an equation will determine whether a Strike will be effective and HOW effective. As I said, this is a "general" idea... The +1, +2, etc. stuff in the previous posts are placekeepers until I develop this engine better--- But it IS the general outline, and as I refine and develop, of course things will change. My goal with the values in the above post was to give me a starting point. =)



Link to comment
Share on other sites

Adamantyr: You play WoW? What realm? I turned my account off some months ago, but I may get back into it in the future. It would be fun to play with a fellow TIer. That goes for anyone else too, if you are into WoW or some other CRPG, give a shout out. I'm glad to hear they are going to change that up. I have quite a few complaints about WoW, mostly that they focus on hardcore players and make getting gear way to important. Also, the stuff the players can make is all but useless, so why bother with crafting... The best gear in the game is a drop from a boss in a high level instance, which I'll never even see - so they lost my business. Ah well, we'll see.


Owen: That's a start for sure, but you may want to have a few more factors in there so you have a little more flexibility for balancing. And note what I said about WoW! :-) If you take the player totally out of the equation then they get frustrated or bored. And please please please don't make us *grind*!!



Link to comment
Share on other sites

I really wanted to add more variables/factors but I was afraid of creating something that was too ambitious or near-impossible to implement in XB. I have many variables that I could add in, and remember that this will be a turn-based combat engine with potential interrupts. For instance,








-Sand Sentinel


***Interrupt -Sand Sentinel



***Interrupt -Sand Sentinel


etc. etc. etc.


I hate a grind engine myself... Minimae is great, but it's pretty lame on the combat-engine side. =) I'll keep modifying and adding and I'll post to my "Legend of Beryl Reichardt" thread from now on. Keep your eyes open for that stuff. =) Thanks again



Link to comment
Share on other sites

If you don't mind playing with a Sega Genesis emulator, two of the greatest party-combat RPG series ever were on that system. The first is the Shining Force series, which has combat that plays out almost like chess, with a variable sequence as you describe above Owen. It's a very addictive game, with each battle forcing you to choose the right characters and get them in advantageous positions (plus setting the enemy up for area effect spells). And the individual party members gain experience and can upgrade their class eventually.


The second is the Phantasy Star games. While not as compelling to me as the Shining Force titles, they are extremely popular even now and continue to spawn sequels. The group combat mechanics in that game work quite well too. Both titles eschew D&D complexity for more strategic thinking, so check them out if you want to see how a party RPG can be constructed outside the typical formulas used today.

Link to comment
Share on other sites

I will DL a Genesis emulator now and check them out... Codex, on looking at my formulas/concepts, do you think I'm on the right track? Have any further suggestions? Matthew and Adam have been great help today, I was just wondering about YOUR ideas. =) Mr. ToD himself here, everyone.


Obviously many things will be updated/massaged/changed... I'll be moving forward here a piece at a time, and I wanted to hear your input. I hope I'm working down the right path. I'd hate to get a month into this engine development only to get frustrated because I didn't do the right things.




BTW... Grandia II, man... Sega Dreamcast. The most unreal RPG I've ever played. Graphically flawless and probably the most amazing battle engine I can recall seeing. Since Grandia II, most new RPGs have copied their combat engine. =)

Link to comment
Share on other sites

I will equivocate and say that the style I like depends on the RPG type. For a combat-centric RPG like ToD, Shining Force, and those types, I think a leaner system is better, with a few primary attributes and very clear skills and effect modifications. For world-based RPGs like The Elder Scrolls series or roguelikes, I favor a more complex system, because the player needs to develop many different kinds of abilities and part of the fun comes from playing with different styles (how far can I get as a low-IQ berserker? as a frail mage? as a clumsy assassin?). Your game seems so far to be very much in the former school, so simplicity should reign, though with enough leeway that the player feels like they are making some strategic growth choices along the way. That's one thing ToD omits - you don't control anything about your party's growth, apart from trying to decide who gets the killing blow and therefore the experience for each monster. A little extra depth keeps the game from being a glorified Gauntlet-with-storyline, but keep it towards the lighter side so that it doesn't over-complicate the dungeoneering, but rather enhances it.


One way to add some strategic complexity without gumming everything up is to give some monsters a special aspect. For example, ghosts can be immune to melee attacks, while a magic vortex randomly turns any spell cast against into a different one, and a quantum gremlin is hard to hit with ranged weapons because you can never quite tell where it really is. Not every creature needs to have something like this, but a few quirky types like this scattered about can make combat sessions more tense and tactical. Just think back at the "fun" of ToD monsters cursing you with bad luck, damaging your armor with acid, or regenerating all the damage you just did to them. :)


By the way, what function does Charm take on in your system? Is there a chance of winning over foes, similar to the ToD negotiation system?

Edited by The Codex
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...