Jump to content

Code Discussion Thread


Celtic Minstrel

Recommended Posts

  • Replies 990
  • Created
  • Last Reply

Top Posters In This Topic

Originally Posted By: Celtic Minstrel
Idea: should summoning be tweaked so that monsters can't summon other monsters of the same type through spell-casting?


So you're saying for example that a Nephil shaman shouldn't be able to summon Nephilim? That makes sense.

A different suggestion now: Is it reasonable to ask for customizable town sizes? i.e Instead of just Small, Medium and Large, you have Custom as well?

Also, any chance of increasing the limit on dialog slots per town to 32?
Link to comment
Share on other sites

Originally Posted By: Cryolemon
So you're saying for example that a Nephil shaman shouldn't be able to summon Nephilim? That makes sense.
Actually, it was more like the nephil shaman can't summon nephil shamans but can still summon other nephilim. Your version would be more complicated to implement.

Originally Posted By: Cryolemon
A different suggestion now: Is it reasonable to ask for customizable town sizes? i.e Instead of just Small, Medium and Large, you have Custom as well?
Theoretically, but unless you want a town size larger than Large I don't think it's worth it. You can just shrink the "active" town area if you want a smaller town.

Originally Posted By: Cryolemon
Also, any chance of increasing the limit on dialog slots per town to 32?
You mean the number of personalities per town? That limit will probably climb to about 232 - 1. That's about 400 million, I believe. Similarly with the limit on the number of town/scenario/outdoor strings. I'm not going to explicitly code the limit, though; it'll be a function of the maximum number of elements that can be held in an std::vector.
Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
Actually, it was more like the nephil shaman can't summon nephil shamans but can still summon other nephilim. Your version would be more complicated to implement.


Self-summoning isn't a concern with any of the monsters in the default bladbase, so if a scenario designer puts it in, they've presumably put it in on purpose. It's only in BoA that vampires can summon other vampires ad infinitum.
Link to comment
Share on other sites

Originally Posted By: echo $pdn;
I think having towns larger than large would be nice, so one could make larger cities (like those in the Adventurer's Club series) without having to mess with noding around everything or make all the buildings miniature.
Well then, we'd just have to add another town size. Perhaps 128x128? Anyway, functionally that would be easy. There would probably be a few difficulties though.

Originally Posted By: Thuryl
Self-summoning isn't a concern with any of the monsters in the default bladbase, so if a scenario designer puts it in, they've presumably put it in on purpose. It's only in BoA that vampires can summon other vampires ad infinitum.
Okay, fine.
Link to comment
Share on other sites

Originally Posted By: echo $pdn;
I think having towns larger than large would be nice, so one could make larger cities (like those in the Adventurer's Club series) without having to mess with noding around everything or make all the buildings miniature.


I agree, it would be useful for things like that.

Originally Posted By: Celtic Minstrel
Well then, we'd just have to add another town size. Perhaps 128x128? Anyway, functionally that would be easy. There would probably be a few difficulties though.


I'd prefer a "custom" option, but if it's too complex then it makes sense to just have a larger town size. I'm not sure anyone would want, say, a 512x512 town, but you never know lol.

Originally Posted By: Celtic Minstrel
Originally Posted By: Thuryl
Self-summoning isn't a concern with any of the monsters in the default bladbase, so if a scenario designer puts it in, they've presumably put it in on purpose. It's only in BoA that vampires can summon other vampires ad infinitum.
Okay, fine.


Vampires are an interesting point,since they can create other vampires, but not by summoning... Not sure there's anyway to model this in BOE's system though...
Link to comment
Share on other sites

Originally Posted By: Cryolemon
I'd prefer a "custom" option, but if it's too complex then it makes sense to just have a larger town size. I'm not sure anyone would want, say, a 512x512 town, but you never know lol.
This could theoretically be done, of course. However, the way it's currently handled is that there's a class for each size of town, all of which inherit from the town base class, so adding a larger size amounts to adding another class. Once that's done, it'll pretty much just "work", apart from possibly a few small things.

But as I already said, if you want an in-between-sized town, you can still do it: make the town one size too large, but don't use the whole area.
Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
This could theoretically be done, of course. However, the way it's currently handled is that there's a class for each size of town, all of which inherit from the town base class, so adding a larger size amounts to adding another class. Once that's done, it'll pretty much just "work", apart from possibly a few small things.


Hmm. Could you not just add a "custom Town" class that allows for the size to be variable?

I get how making an in-between town works, I'm thinking more of people who want to make larger towns.
Link to comment
Share on other sites

The thing is, dynamically allocating a two-dimensional array is a little tricky. So I'd prefer to avoid it.

 

Still, if you really think that town size limits should be removed, I can use a boost::multi_array to simplify it; this would also have the advantage of collapsing the current three classes into a single class, meaning there are only two types of towns: standard, and template.

Link to comment
Share on other sites

Quote:
The thing is, dynamically allocating a two-dimensional array is a little tricky. So I'd prefer to avoid it.

It not that hard:
Code:
	int rows, columns;	//somehow set rows and columns//with the STL:	vector< vector< foo > > array1;	array1.resize(rows);	for(unsigned int i=0; i<rows; i++)		array1[i].resize(columns);//with pointers:	foo** array2;	array2 = new foo*[rows];	for(unsigned int i=0; i<rows; i++)		array2[i] = new foo[columns];	//deletion is just the same process in reverse

(Disclaimer: I just stumbled out of bed, so those examples may be flawed, but the basic concept should be sound.)
Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
The thing is, dynamically allocating a two-dimensional array is a little tricky. So I'd prefer to avoid it.

Still, if you really think that town size limits should be removed, I can use a boost::multi_array to simplify it; this would also have the advantage of collapsing the current three classes into a single class, meaning there are only two types of towns: standard, and template.


Would collapsing the town classes into one help? If I was doing it from scratch it would seem sensible if it looked something like this (in C#, since I don't really know C++)

Code:
Class Town{   //attributes of the town   string sizeDescription; //Small, med, large, custom.   int townWidth;   int townHeight;   //constructor   public Town(int width, int height, string description)    {       sizeDescription = description;       width = townWidth;       height = townHeight;   }   //whatever methods apply to towns.   }


You then have code that automatically makes the variables correct if the user chooses "Small" "Medium" or "large", then let the user choose what the numbers are if they choose custom.
Link to comment
Share on other sites

Actually, that's already been done: there is a general town base class, and subclasses of it exist for the current specific sizes. At present, however, the base class is abstract, so while it has the entire interface for arbitrarily sized town, it disdains to supply an implementation (either that or CM does tongue ). This would be pretty easy to rectify; the tougher problems would be making the save format handle arbitrarily sized towns and setting up the user interface to create and manipulate them in the editor.

Link to comment
Share on other sites

Originally Posted By: Niemand
Quote:
The thing is, dynamically allocating a two-dimensional array is a little tricky. So I'd prefer to avoid it.

It not that hard:
[...code...]
(Disclaimer: I just stumbled out of bed, so those examples may be flawed, but the basic concept should be sound.)
Indeed, I've done something like that somewhere else. The alternate method would be something like this:
Code:
int rows,columns;foo *array;array = new foo[rows*columns];// etc
And then calculating the index as necessary. I believe that's how boost::multi_array does it, and I ended up using that class instead of the annoying pointer stuff. I could theoretically do the same here.

Originally Posted By: Cryolemon
Would collapsing the town classes into one help? If I was doing it from scratch it would seem sensible if it looked something like this (in C#, since I don't really know C++)

[...code...]

You then have code that automatically makes the variables correct if the user chooses "Small" "Medium" or "large", then let the user choose what the numbers are if they choose custom.
I don't see the point of storing a string description of the size. At present, the situation is much as Niemand described (presumably he's seen it). I have an abstract base class cTown, which contains most of the town data as well as pure virtual accessor-mutators (in Java terms, that's abstract methods; I'm guessing that's the same in C#?) for the variable-sized data. (I call them accessor-mutators because they return a reference to the data, allowing them to be used on the left hand size of an assignment.)

Then I have three subclasses for the different sizes. I also have incomplete subclasses for template towns in the three sizes (they aren't currently used).

So, if removing the size limits, I'd probably make template towns a subclass of the abstract town class (currently it's a completely separate class) and make a subclass to represent an ordinary town, which is basically the three existing classes merged into one.

Originally Posted By: Niemand
This would be pretty easy to rectify; the tougher problems would be making the save format handle arbitrarily sized towns and setting up the user interface to create and manipulate them in the editor.
The save format part would probably be much easier than the user interface part.
Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
I don't see the point of storing a string description of the size. At present, the situation is much as Niemand described (presumably he's seen it). I have an abstract base class cTown, which contains most of the town data as well as pure virtual accessor-mutators (in Java terms, that's abstract methods; I'm guessing that's the same in C#?) for the variable-sized data. (I call them accessor-mutators because they return a reference to the data, allowing them to be used on the left hand size of an assignment.)

Then I have three subclasses for the different sizes. I also have incomplete subclasses for template towns in the three sizes (they aren't currently used).

So, if removing the size limits, I'd probably make template towns a subclass of the abstract town class (currently it's a completely separate class) and make a subclass to represent an ordinary town, which is basically the three existing classes merged into one.


That makes sense. I still think it would be better to have one class for a town that has the size as variables, but having not looked at the code in great detail I'm not sure how plausible it is.
Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
That's not far off from what I said, though: the "regular town" subclass would have the size as variables. The only reason I'd keep a multi-class structure is to support the template towns, which have their terrain stored in quite a different way.


Makes sense, I didn't know how the template towns stored their terrain.
Link to comment
Share on other sites

Originally Posted By: Cryolemon
Makes sense, I didn't know how the template towns stored their terrain.
They're a feature that Exile 3 had which I intend to reimplement; the terrain will be stored in discrete chunks, and there may be multiple versions of some chunks.
Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
Originally Posted By: Cryolemon
Makes sense, I didn't know how the template towns stored their terrain.
They're a feature that Exile 3 had which I intend to reimplement; the terrain will be stored in discrete chunks, and there may be multiple versions of some chunks.


How is it stored now, as an array of terrain type values?
Link to comment
Share on other sites

My understanding of the template, modular towns is that you had town 20 consisting only of 64 modules, each 8*8.

In the 58 modular towns, the following occurred at the end of the town data record:

120 bytes: terrain modules[15]

100 bytes: terrain rectangles[10]

 

The terrain modules listing would tell you which module was being placed and where. It would also tell you about any angle of rotation.

The second tells you about things like footpaths&

Edit:

To see what the module town looks like in practice:

http://www.freewebs.com/ishadnha/ExThreeA.zip

See town 1, Module Town.

Link to comment
Share on other sites

Placed here so that I don't forget... I think these are good ideas.

 

Originally Posted By: Milla
Correct about BoE 'not yours' gold. When in that state you couldn't see how much the amount was either.
Originally Posted By: Lucheiah
Yeah, I recall - that was irritating, you could never tell if it was worth the theft or not.
Can be changed quite easily.

 

Originally Posted By: Celtic Minstrel
Originally Posted By: Replete with the Elite
—Alorael, who thinks a simple and satisfying version might just be the ability to import an old save so the heroes of the past actually get names.
You know, I bet this could be done in OBoE once it's "finished"... either with campaign flags or with a dedicated system.
Thoughts?
Link to comment
Share on other sites

That's already partially implemented. What I was suggesting there was an extension to allow string campaign flags to be stored as well as integer flags. Either that or a way of doing as Alorael said, ie retaining the names of the party members from a previous scenario in the campaign (to be used in special encounters or dialogue or whatever) yet starting with a new party.

Link to comment
Share on other sites

Originally Posted By: Miramor
That would break Brotherhood of the Hand, where to progress beyond a certain point you have to get rid of all your food.


I think all he was saying is that it should be like E2 where if there is gold or food around and you press "Get" the gold and food is added automatically and you don't need to click on each item of it.
Link to comment
Share on other sites

Originally Posted By: The Almighty Doer of Stuff
There could be a Preference for it, or just an LED in the Get window, that switches between automatically picking up gold and food and not automatically picking it up. Possibly.


That makes sense. Or maybe a scenario option, so the designer chooses whether it happens in that scenario, which defaults to off for compatibility.
Link to comment
Share on other sites

There must be some cap as long as one uses standard integer types. In this case, Jeff used a signed 16 bit integer to store the amount of gold so there is a fundamental limit of 32767 (2^15 - 1). He likely just decided that it would be easier for players to remember if the limit were set at an easier to remember number. What CM plans to do, I think, is to reclaim the sign bit of that integer (since amount of gold never needs to be negative), allowing the stored amount of gold to go up to 2^16 - 1 or 65535.

 

In general there are two alternatives to handle bigger numbers: The first is to use a wider integer type, which even on current computers is only practical up to requesting a 64 type as no commonly available CPUs have (non-vector) registers big enough to hold anything larger. The second is to implement one's own arbitrary precision type, which will entail far more programming work and cause arithmetic to be much slower, as operations will require many CPU instructions working on smaller chunks of the data.

Link to comment
Share on other sites

Using an arbitrary precision type is like writing out every operation and performing long addition/subtraction/multiplication/division. At least, that's true of the simplest implementation I know of; there are probably ways to optimize it...

 

I don't plan to use arbitrary precision, though.

Link to comment
Share on other sites

If there are more important items to be modified in programming, remember that there are other ways to 'possess' wealth than an amount of gold, limited to 30,000.

Not only are there already Standard Items such as Gems, Weapons, Armor, Real Estate, etc. that have financial value, an Author can create Special Items that could have exceptional value, such as Alcrita's 'Coins'.

It seems to me that re-writing the program is unnecessary when these alternatives already exist.

me

Link to comment
Share on other sites

Originally Posted By: Ahbleza

It seems to me that re-writing the program is unnecessary when these alternatives already exist.
These alternatives are workarounds. The existence of a workaround typically indicates something that could be improved.

If I recall correctly, I already made it unsigned, so at least if it wraps around you won't get negative gold.
Link to comment
Share on other sites

  • 3 weeks later...

Gah, I was stuck using the command-line SVN, and MS-DOS decided to mess up when I committed. So yeah, the r122 message was supposed to read 'Finished Doc cleanup' or something like that.

 

If anyone could point me to an SVN client that can work on a flash drive and that doesn't even touch the local computer (And works with win98 SE...jeez, I'm picky), I'd appreciate it. If not, I'll just stick with the command-line version, and hope it works better next time around.

Link to comment
Share on other sites

  • 1 month later...

I just updated the Editor to include an outdoor zone report.

I will introduce a command to reprint the last report, whatever it was, this is already found in the BoA 3D Editor.

At some point I will allow the option to print report files with generic names only or with specific scenario/outdoor zone/town names. Generic names allow you to go from town to town, or whatever, and compare given features of each.

I added the four scenario flags to the Scenario Object Report, because they reveal whether a scenario is Mac (10,20,30,40) or Windows (20,40,60,80). Reports may crash if the scenario is Mac.

Editor is found at:

http://www.freewebs.com/ishadnha/2009ClassicBoEScenarioEditor.zip

my source code is found at:

http://www.freewebs.com/ishadnha/2009BoESESource.zip

 

Link to comment
Share on other sites

Current line up is shown below, it may be altered as new functions are introduced.

MENUITEM " Edit Special Nodes\tCtrl+1", 213

MENUITEM " Edit Town Text\tCtrl+2", 214

MENUITEM " Edit Town Dialog\tCtrl+3", 222

MENUITEM " Advanced Town Details\tCtrl+4", 215

 

MENUITEM " Edit Special Nodes\tCtrl+5", 311

MENUITEM " Edit Outdoor Text\tCtrl+6", 312

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.

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


×
×
  • Create New...