Jump to content

Code Discussion Thread


Celtic Minstrel

Recommended Posts

Originally Posted By: Chokboyz

Originally Posted By: Celtic Minstrel
Hm, not a bad idea. I actually have no idea whether my code does that. Probably not.

Not founding a native WIN32API function that does so, i've wrote the code so that it scan "scenarios/" and its subfolders for "*.exs" files, populating a listbox with its founding. The rest of the loading procedure is unchanged (except the dynamic allocation thing).
Tested and working with about 44 scenarios and 2 level subfolders.
You're still using the BoE scenario dialog, aren't you? Actually, this sounds like you're using a Choose File dialog... smirk

Originally Posted By: Chokboyz
Originally Posted By: Celtic Minstrel
How did you do this? Did you use malloc(), realloc() and free(), new[] and delete[], or a vector which will do all the work for you? I used a vector (though there's something fishy going on – somehow the relevant variable is not at the same address in both files where it is referenced? )

I refrained from using malloc(), realloc() and free() C functions, but used new[] and delete[]. Basically, each time the scen_headers are build, the game alloc the necessary memory for data_store2 and scen_headers.
The memory is freed (delete[]) each time a new allocation needs to be done (i.e each time the scen_headers are build and memory was previously allocated) and on program shutdown.
Well, okay, that'll do. A vector is easier though.
Link to comment
Share on other sites

  • Replies 990
  • Created
  • Last Reply

Top Posters In This Topic

Originally Posted By: Celtic Minstrel
You're still using the BoE scenario dialog, aren't you? Actually, this sounds like you're using a Choose File dialog...

Yup, i'm still using the BoE scenario dialog. The Listbox is only a collection of strings (names of file found with extension "exs"), destroyed at the end of the function (already here in the original code).

Chokboyz
Link to comment
Share on other sites

So far, the program seems pretty robust, but i've come across a bug that makes a legacy scenario ("The Fog") unwinnable (and even stuck the player).

 

Unfortunately, that's mostly a scenario bug : before entering the final confrontation room, the player is forced to pass under a gate, with a node that silently set the SDF[14][2] to 0 (which is the life flag of the "boss"). A few steps later, the "boss" is placed using a special encounter. Unfortunately, he doesn't appears because the life flag/encounter bug has been fixed (even after, when the boss is supposed to come back to life if you don't do a special action, he never reappears).

 

I've checked the whole sequence and there's no flaw in it (life flag is set to 0, each time the boss is supposed to (re)appears). After further debugging, i found that a one-time message was called in an (optional) town (the Bat Cave) with the same SDF. The way one-time special are handled make any node with the same SDF not to be set at any further town loading, resulting in the previously "Set SDF" node not appearing, thus messing the whole final sequence.

 

There may be other occurences of that, but i haven't notice any.

 

Bad SDF management is the culprit here, but i was wondering if we should change the way One-Time specials are handled (bypassing the "is SDF 250 ?" part) ?

 

(by the way, for those who wants to play the scenario, either don't search the chest in the Bat Cave, or set the SDF[14][2] to 0 after exiting the cave (using Debug Mode). Or if you feel like it, change the SDF using the Scenario Editor)

 

Chokboyz

 

Edit: i should add that the one-time special removing behavior is quite inconsistent since it happens only in town (you can retrigger one-time specials by resetting the SDF if the special happens outdoor).

Link to comment
Share on other sites

Originally Posted By: Chokboyz
Edit: i should add that the one-time special removing behavior is quite inconsistent since it happens only in town (you can retrigger one-time specials by resetting the SDF if the special happens outdoor).
Then perhaps we need a new mechanism for it. I'll think on it, or if you have an idea I'll consider it.



Now, today I did two major things. First, the code no longer uses the storage sheet and party template sheet. Second, the extended debug mode is fully implemented (though possibly with small differences) plus a ghost mode to pass through walls.

I also made three tiny changes to the Windows code. I highly doubt they'd prevent compilation, but you might want to update just to make sure. I added the Easter egg present in the Mac code (type "&*()"!), added shopping and talking help to the '?' case, and added a check for horses to the Return to Start case.
Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
Then perhaps we need a new mechanism for it. I'll think on it, or if you have an idea I'll consider it.

We've got at least three options :
  • We don't remove the special (if i'm not mistaken, the special won't be called if PSD[a] is set to 250)
  • We remove the outdoor special after being triggered as well
  • We remove the triggered special (and only the triggered special) leaving other potentials specials with same SDF alone.

We need the community opinion about it though, as it may break some scenarios ...

Originally Posted By: Celtic Minstrel
First, the code no longer uses the storage sheet and party template sheet. Second, the extended debug mode is fully implemented (though possibly with small differences) plus a ghost mode to pass through walls.

Great, those temporary sheets were slowing the game down smile
I've not yet made a Ghost-Mode (but put that on TODO list, low-priority though).

Originally Posted By: Celtic Minstrel
I also made three tiny changes to the Windows code. I highly doubt they'd prevent compilation, but you might want to update just to make sure. I added the Easter egg present in the Mac code (type "&*()"!), added shopping and talking help to the '?' case, and added a check for horses to the Return to Start case.

The "Burma Shave" thing is clearly a leftover of Exile III, but i've added it for consistency. Just for information, aren't the keys making the messages appears supposed to be '1','2','3' and '4' or something adjacent ?
For the same reason, i've added the check for horse (but it was working while on horse as well). You should also add a print_buf() after filling the buffer or the text will appear after the next move.
Adding shopping and talk mode to the '?' call is a great idea and i've implemented it (you put the code in the not talking or shopping mode though; i moved it to the right place).

Chokboyz
Link to comment
Share on other sites

Originally Posted By: Chokboyz
The "Burma Shave" thing is clearly a leftover of Exile III, but i've added it for consistency. Just for information, aren't the keys making the messages appears supposed to be '1','2','3' and '4' or something adjacent ?


Those four keys are adjacent. Shift-7, Shift-8, Shift-9, Shift-0.
Link to comment
Share on other sites

Originally Posted By: Chokboyz
We've got at least three options :
  • We don't remove the special (if i'm not mistaken, the special won't be called if PSD[a] is set to 250)
  • We remove the outdoor special after being triggered as well
  • We remove the triggered special (and only the triggered special) leaving other potentials specials with same SDF alone.

We need the community opinion about it though, as it may break some scenarios ...
The problem with the first one is the special dot. It needs to be removed, and if a second special that accidentally uses the same SDF also has a special dot, it will be removed too I think. The second one seems fine. The third one also has a problem: what if you have a one-shot special that should be triggered only once, the first time a room is entered? And the room can be entered from several directions? Or perhaps the entry is more than one space wide? Or both? Triggering one of those needs to disable them all.

I think the easiest way would be to check if the special is in the One-Shot range before removing it. This would also fix potential problems where the first node in a chain is an If-Then special that checks to see if a One-Shot has been triggered (if I'm not mistaken, it would be removed as well in the current system?).

Originally Posted By: Chokboyz
Great, those temporary sheets were slowing the game down smile
I've not yet made a Ghost-Mode (but put that on TODO list, low-priority though).
It was really easy because the code was already there – all I had to do was make a bool variable to activate it.

Originally Posted By: Chokboyz
The "Burma Shave" thing is clearly a leftover of Exile III, but i've added it for consistency. Just for information, aren't the keys making the messages appears supposed to be '1','2','3' and '4' or something adjacent ?
I added it at the top of the switch statement in the Windows code – '&', '*', '(', and ')'. We should probably change "Valorim" to something more Blades-related, though... I just copy-pasted from my code to yours.

Originally Posted By: Chokboyz
For the same reason, i've added the check for horse (but it was working while on horse as well). You should also add a print_buf() after filling the buffer or the text will appear after the next move.
Well, I put it in there too in your code.

Originally Posted By: Chokboyz
Adding shopping and talk mode to the '?' call is a great idea and i've implemented it (you put the code in the not talking or shopping mode though; i moved it to the right place).
Wait, what? What do you mean it's in the wrong place? smirk
Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
I think the easiest way would be to check if the special is in the One-Shot range before removing it. This would also fix potential problems where the first node in a chain is an If-Then special that checks to see if a One-Shot has been triggered (if I'm not mistaken, it would be removed as well in the current system?).

Thanks for your comments, i've in fact negliged some aspects of "specials" removing.
I think that checking if the special is One-Shot is indeed a good solution smile

Originally Posted By: Celtic Minstrel
It was really easy because the code was already there – all I had to do was make a bool variable to activate it.

I'll check and if it's the case in Windows code too, i'll gladly activate/add it.
It was there and is done smile

Originally Posted By: Celtic Minstrel
Well, I put it in there too in your code.

Don't bother, i've already done that (i'll upload the whole bunch soon).

Originally Posted By: Celtic Minstrel
Wait, what? What do you mean it's in the wrong place?

You put it under the case '?', but a few lines before a check is done (in the Windows code at least), excluding the shopping and talking mode (which have their own check prior to that). The added code should so be moved to its corresponding mode check.

Chokboyz

Edit :
Originally Posted By: The Almighty Doer of Stuff
The &*() Easter egg is present in Windows already, from the original, non-open-source BoE. Had someone removed it between then and now?

Seems so ... Nonetheless, it's back right now.

Edit2 : Ghost mode added, debug_on variable deleted. Seems like the cleaning was not total smile
I also noticed you were wondering what the 'I' case was in the debug code : feel free to delete it, it's my own personnal debug command (to output some value while in the game ... Dev-C++ debugger is not reliable enough, so i'm not using it).

Oh and it seems like the case 'B' wasn't correctly putting the party back if splitted.
Here is the code i used to make it do so :
Click to reveal..
case 'B':
if (in_scen_debug) {
party.stuff_done[304][0] = 0;
for(i=0;i<6;i++)
if(adven.main_status > 9)
adven.main_status -= 10;

if(overall_mode == MODE_OUTDOORS){
Link to comment
Share on other sites

Originally Posted By: Chokboyz
Thanks for your comments, i've in fact negliged some aspects of "specials" removing.
I think that checking if the special is One-Shot is indeed a good solution smile
We should define constants ONE_SHOT_MIN and ONE_SHOT_MAX, then, so that it can be easily changed if we radically alter the range assigned to one-shot specials. I'd probably define them as part of the special node type enum.

Originally Posted By: Chokboyz
Originally Posted By: Celtic Minstrel
Well, I put it in there too in your code.

Don't bother, i've already done that (i'll upload the whole bunch soon).
Actually, I already have. Oh well. You'll get an edit conflict on that file then.

Originally Posted By: Chokboyz
Originally Posted By: Celtic Minstrel
Wait, what? What do you mean it's in the wrong place?

You put it under the case '?', but a few lines before a check is done (in the Windows code at least), excluding the shopping and talking mode (which have their own check prior to that). The added code should so be moved to its corresponding mode check.
I just checked the Windows code, and you're only half right. Yes, there's a check there, but the function continues to execute after that check. So, it should work equally well in either location.

Originally Posted By: Chokboyz
Ghost mode added, debug_on variable deleted. Seems like the cleaning was not total smile
If you didn't notice, I assigned it to the shift-G key (I said that already, didn't I?) and also added it to the ? key (not shift-?) documentation.

Originally Posted By: Chokboyz
I also noticed you were wondering what the 'I' case was in the debug code : feel free to delete it, it's my own personnal debug command (to output some value while in the game ... Dev-C++ debugger is not reliable enough, so i'm not using it)
Okay, consider it gone... for now, anyway. Just like the '`', '[', and '+' cases which were totally useless.

While we're here, are there any other debug codes that could be added that might be nice?

Originally Posted By: Chokboyz
Oh and it seems like the case 'B' wasn't correctly putting the party back if splitted.
Here is the code i used to make it do so :
Okay, done.



I'm going to delete cartoon_happening now.
Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
We should define constants ONE_SHOT_MIN and ONE_SHOT_MAX, then, so that it can be easily changed if we radically alter the range assigned to one-shot specials.

I second that smile

Originally Posted By: Celtic Minstrel
I just checked the Windows code, and you're only half right. Yes, there's a check there, but the function continues to execute after that check. So, it should work equally well in either location.

Actually :

Click to reveal.. (No)
if (overall_mode == MODE_TALKING) {
if (chr == ' ')
chr = 'g';
for (i = 0; i < 9; i++)
if (chr == talk_chars) {
pass_point.x = preset_words.word_rect.left + 9;
pass_point.y = preset_words.word_rect.top + 9;
are_done = handle_action(pass_point,wParam,-1);
return are_done;
}
}
else if (overall_mode == MODE_SHOPPING) { // shopping keystrokes
for (i = 0; i < 8; i++)
if (chr == 97 + i) {
pass_point.x = shopping_rects[1].left + 9;
pass_point.y = shopping_rects[1].top + 9;
are_done = handle_action(pass_point,wParam,-1);
return are_done;
}
}

if ((overall_mode != MODE_TALKING) && (overall_mode != MODE_SHOPPING)) {
for (k = 0; k < (short) LOWORD(lParam); k++)
switch(chr)
{
case 'D':
[...]
case '?':

And i've tested it with the first configuration and it didn't worked. That or we're not using the same code wink

Originally Posted By: Celtic Minstrel
If you didn't notice, I assigned it to the shift-G key (I said that already, didn't I?) and also added it to the ? key (not shift-?) documentation.

For sake of consistency, i've also assigned it to Shift-G and added it to the documentation.

Originally Posted By: Celtic Minstrel
Just like the '`', '[', and '+' cases which were totally useless.

Either those were deleted from Windows code or they were not there in the first place confused

Originally Posted By: Celtic Minstrel
I'm going to delete cartoon_happening now.

Delete store_anim_type while you're at it, since the two are often called together (and store_anim_type is dangerous because uninitialized).

Chokboyz
Link to comment
Share on other sites

Originally Posted By: Chokboyz
Originally Posted By: Celtic Minstrel
I just checked the Windows code, and you're only half right. Yes, there's a check there, but the function continues to execute after that check. So, it should work equally well in either location.

Actually :
And i've tested it with the first configuration and it didn't worked. That or we're not using the same code wink
Oh wow, you're right after all. The incredibly bad indentation confused me. (Possibly not your fault, since the original Mac code is also very badly indented where I haven't fixed it up.) In the Mac code, that check for excluding the talking and shopping modes is closed before the switch statement – it only checks for the numeric keypad.

Originally Posted By: Chokboyz
Originally Posted By: Celtic Minstrel
Just like the '`', '[', and '+' cases which were totally useless.

Either those were deleted from Windows code or they were not there in the first place confused
They did basically nothing – one set debug_ok to true (or something like that) and the other two called print_nums with integer constants (which is obviously useless).

Originally Posted By: Chokboyz
Originally Posted By: Celtic Minstrel
I'm going to delete cartoon_happening now.

Delete store_anim_type while you're at it, since the two are often called together (and store_anim_type is dangerous because uninitialized).
Okay, will do.
Link to comment
Share on other sites

I also added a MODE_CUTSCENE = 51 to the mode enum. I'm not sure whether it'll be a permanent addition; that'll have to wait until I get to cutscenes.

 

And I commented out some unused variables that were also theoretically related to cartoon_happening.

Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
I also added a MODE_CUTSCENE = 51 to the mode enum. I'm not sure whether it'll be a permanent addition; that'll have to wait until I get to cutscenes.

Ok, i've added MODE_CUTSCENE to CONST.h for now.

Finally, i've released Classic Blades of Exile Beta 2. It's pretty stable but hasn't been tested on a greater scale (tested on 3 different computers, but that's not great scale,hence the beta). If everything goes ok, i'll drop the beta flag for the next release.

Download it here : http://code.google.com/p/openexile/

Things to keep an eye open for : graphical glitches (never encountered one during the whole testing process, but then every computer is different), Empties (one cause has been found and fixed, maybe they're others causes always unidentified), Scenario Editor (never got any problem with it, intensive testing should be a nice thing here : it's the main thing that justify the beta flag), scenario loading procedures (subfolders in subfolders in ..., large number of scenarios, etc), compatibility breakings (even if it results from a bug in the scenario design), misc bugs in general smile

Click to reveal.. (Changelog)
Classic Blades of Exile Beta 2 :

Bug Fixes :

- Giant Strength ability and Skill ability now use the ability strength rather than the item level to calculate effect.
- Won't take damage when moving boats over damaging terrains (fire, cold, magic, poison, disease) anymore.
- Won't take damage when horses refuses to enter a damaging terrain (fire, cold, magic) anymore.
- Horses won't enter damaging terrains (fire, cold, magic) or "horse blocking" terrains when outdoors anymore.
- Boom effects won't be displayed at random places when being damaged outdoors anymore.
- Damage won't be displayed in boom animation when attacking invulnerable monsters, when they are, in fact, unharmed ...
- The first pc won't become active with 0 AP anymore when a pc get killed by backshots.
- Fixed the town loading behavior so that Empties won't appear in Place Town Encounters anymore.
- Cleaned the ressource file (smaller executable).
- Changed the "force place monster" function to preferably flush a summoned monster if flushing is needed. Also prevent a potential infinite loop if trying to force place a monster and all the 60 monsters of a town have a life flag.
- Tweaked exploding arrows firing animation to be smoother (arrow fired, then explosion).
- The spell usable Stinking Cloud ability was protecting against acid instead of the Protection from Acid ability. Fixed.
- The Protection from Disease item ability should now works to the full extent.
- Removed a check on the item graphic when deciding whether to play the"swallow" sound; now checks only for item variety. (Celtic Minstrel)
- Corrected the code so that the party cannot be split again if already split.
- Various messages code cleaning/fixing (Celtic Minstrel)
- Removed the 50 node limit. To prevent infinite loop an interrupt sequence has been implemented (Ctrl-C).
- Cave Bridges battlefield should now appears instead of basic cave floor.
- Wall trims are now working.
- Slowdowns due to trims drawing (animated water, ...) should be fixed now.
- Scenarios in subfolders (under Scenarios/) are now found.
- No more limit for the number of listed scenarios.
- Clicking '?' icon on shopping and talk mode now gives help, even if in 'No instant help' mode.

Changes :

- All terrains and monsters sheets now loaded in memory to bypass storage sheet. That should speed up the game and fix some graphical oddities. Mac and Windows graphics can now be swapped on the fly (i.e without restarting the game). That also removes any graphical limitation in the game.
- In the same way, PC graphics will now be drawn directly to the game gworld.
- You can't end the scenario via a special node if the party is dead anymore (prevent saving an "all dead" party)
- Added a safety check to monsters with Absorb Spells ability to prevent negative health.
- Jobs dialog reimplemented (not useable for now).
- 'Burma Shave' Easter Egg readded.
- Debug Mode : ghost mode implemented.

Classic Scenario Editor Beta 2 :

- Dumping functions won't change current town/outdoor section anymore.
- Finished porting the file IO functions to 32 bits.
- Added a rudimentary custom intro picture behavior : if the intro picture is set to 100, the first icon on the custom sheet will be displayed in the scenario selection menu. Scenario intro pics must be drawn on the same scale as talk icons.
- Whenever the “Place Random Items” function is used, the editor will inform the user that it could not place all items because the town item # limit has been reached, regardless of how many items are actually in the town. That has been fixed (the message now displays only if the max number of items is indeed reached).
- Cleaned the ressources (smaller executable).
- Added a Monster data dumping function (dumps all info about monsters : wandering/special enc/town monsters details ...)
- Added a Specials data dumping function (dumps all info about specials : number, types, variables, ...)
- Town Room/Outdoors Info rectangles are now initialized at ((-1,-1),(-1,-1)) freeing the 0 coordinate and fixing the "Rectangle X" description at (0,0) in the game.
- Cleanse Rectangle SDF1 info rewritten to match actual behavior (0 leave force/fire/webs/crate/barrel, 1 cleans all).
- Corrected the Do SFX Burst info text (1 - telep., 2 - elec.)
- When placing an item with a custom graphic in a town, the editor will display the graphic in the upper-left corner of the space it is placed on. Fixed
- If you edit a monster’s abilities and click Cancel, the ability of that monster will be removed. Fixed.
- If you edit a item's ability, all previously unsaved modifications are erased. Fixed.
- Disappearences of right scroll bar fixed.


Any comment, suggestion, bug report can be done here or on the Issues page of the repository.

Have fun, wink
Chokboyz
Link to comment
Share on other sites

As well as clicking on the ? icon, pressing shift-/ (ie typing a ? on the keyboard) should also bring up the help in shopping / talking mode. Maybe I just misunderstood what you said, but it sounded like you were saying that clicking the help button now brings up the help?

Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
As well as clicking on the ? icon, pressing shift-/ (ie typing a ? on the keyboard) should also bring up the help in shopping / talking mode. Maybe I just misunderstood what you said, but it sounded like you were saying that clicking the help button now brings up the help?

Yes, clicking the ? icon (the one on the dialog, not on the item screen) while in Talk Mode or Shop Mode now brings the help, even if "No instant help" is checked (that's the correct behavior).
Typing a '?' on keyboard brings up the help too (implemented a few post ago if i remember correctly).

Chokboyz
Link to comment
Share on other sites

Originally Posted By: The Almighty Doer of Stuff
Speaking of the HP doubling: I don't know if this has already been done, but designers should be able to disable HP doubling if they want, or perhaps set the doubling to occur only at levels set by the designer. I don't know why you'd want to set HP doubling, since it's pretty much one of the most hated "features" of BoE by designers and players alike, but at least it should be possible to disable it.

I've added a switch, in the Scenario Editor, under the Scenario Detail menu, that would activate/deactivate the automatic adjustement of difficulty (i.e increasing health and damages) for the designed scenario.
It's tested and working (legacy scenarios will have this off by default).
Technical notes : variable flag_i in the scenario structure renamed adjust_difficulty and checked, if > 0, then difficulty_adjust() returns 1.
All of that is subject to change (name of the variable used, method, ...), but the mechanism is basically done.

Chokboyz
Link to comment
Share on other sites

Originally Posted By: Chokboyz
the last two scenarios under the "Alcritas - ARC Series" section are giving 404 errors.
Are those the only broken links? (I'd check myself, but it would require downloading each one, which I don't particularly want to do right now.) Does anyone know the correct links?


Shouldn't geocities links be changed to, since they'll probably be broken soon? If nothing else, we could always link to Kelandon's archive...

Actually, on a second look, the only questionable links are some of Alcritas's scenarios, and TrueSite. All the rest of the scenarios are hosted at Spiderweb itself, and the other links at the far right (apart from TrueSite) don't seem like they would be a problem... except for Khoth's graphics archive, which is a 404.


So, I guess what I'm asking for is links for Alcritas's scenarios that aren't hosted at Spiderweb, and a link to Khoth's archive if it still exists somewhere on the web.
Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
Are those the only broken links? (I'd check myself, but it would require downloading each one, which I don't particularly want to do right now.) Does anyone know the correct links?

That's the only broken downloads i know of. A solution would be to upload the scenario at the spidweb ftp or link to the corresponding TrueSite page (with owner permission).
Or you can always link to the source (Alcritas' site), but that's doesn't solve anything because :

Originally Posted By: Celtic Minstrel
Shouldn't geocities links be changed to, since they'll probably be broken soon? If nothing else, we could always link to Kelandon's archive...

Yes, i think they should.
The only non-scenario link that is pointing to Geocities is TrueSite, which is now hosted at http://www.truesite4blades.com .

Hope it helps,
Chokboyz

Edit :
Originally Posted By: Celtic Minstrel
So, I guess what I'm asking for is links for Alcritas's scenarios that aren't hosted at Spiderweb

http://www.geocities.com/alcritas/

Originally Posted By: The Ghost of Jewels
And this (http://khoth.ath.cx/~khoth/) is the only site I have for Khoth. Does he have another?


Originally Posted By: Khoth's response
I used to, in the mists of time. It's gone now, and it wasn't Geocities.
Link to comment
Share on other sites

Good work Celtic Minstrel, those links are better organized (not to mention valid) now.

(really trivial things : Spears and Sign and Portents scenario names are misaligned)

 

Some progress :

 

When loading an outdoor battlefield, the c_town.town_num is not reset. If there's a boat or horse in the previously visited town, then pcs won't be able to enter the square with the same coordinates as the square the boat/horse was, in town.

To fix it, i set the c_town.town_num to -1 at the beginning of start_outdoor_combat().

(It seems it's a BoE original bug, but i'm not sure of it)

 

I've also changed the "Set SDF" debug command to display the value of the specified SDF if value to set it to is -1 (BoA style, seemed like a good idea).

 

I forgot to comment the (working but non-canon) feature "when specials happens interrupt wait/rest" in the previous release. I've added a compatibility switch for it in the next release.

 

I've made some adjustment to misc. battlefields : "forest" battlefield doesn't show a road anymore (erroneous documentation made me introduce this glitch, i think), road (cave/grass/mountains) battlefields appear correctly, cave bridge now has cave trims rather than grass.

 

Finally, i've added the ability to play sound asynchronously : if the sound number specified to the "Play a Sound" node is -sound_num, then it is played asynchronously.

 

By the way, Celtic Minstrel, is the new "trims drawing" method complete ?

I think i'm going to tweak trim drawing, and avoiding Mac/Windows "code divergence" would a be good thing. wink

 

Chokboyz

Link to comment
Share on other sites

One thing about specials interrupting waiting: I don't know how it works in Ormus's version (or the original BoE, I haven't played it in a while since I've been playing the Exile trilogy), but some scenarios include timers that call Play Sound nodes, for ambiance. Usually it's dripping in caves or birds chirping above ground. These probably shouldn't interrupt waiting, as sometimes they're quite frequent. I don't know how you want to work with this, but I'm sure you can figure something out.

Link to comment
Share on other sites

Originally Posted By: The Almighty Doer of Stuff
One thing about specials interrupting waiting: I don't know how it works in Ormus's version (or the original BoE, I haven't played it in a while since I've been playing the Exile trilogy), but some scenarios include timers that call Play Sound nodes, for ambiance. Usually it's dripping in caves or birds chirping above ground. These probably shouldn't interrupt waiting, as sometimes they're quite frequent. I don't know how you want to work with this, but I'm sure you can figure something out.

That's exactly the problem I encountered (Adventurers Club comes to mind, let's say a bird chirp every ten steps outdoor), and that's why the special interrupt code was supposed to be commented ... But i somehow forget to do it crazy

For now i've made a compatibility switch for the user to decide if the wait/rest needs to be interrupted or not.
The whole process isn't definitive and may change as well (another possibility is to say that sound playing never interrupt anything ...).

I've also implemented asynchronicity because of those ambient sounds (originally they would freeze the game the time to be played). smile

Chokboyz
Link to comment
Share on other sites

Originally Posted By: The Almighty Doer of Stuff
Sounds need to freeze the game for the frame animation technique to work, though.

No problem, the legacy behavior (freezing) has not been deleted : if the "sound to play" specified number is positive (as it was supposed to be in the legacy Scenario Editor and as it is in all legacy scenarios) the game will freeze when playing the sound (legacy behavior).
What has been added : if the specified number is negative, the sound played (which is the opposite of the specified number) will be played asynchronously (for those bird chirps for example).

Both options are then available for designers (and legacy scenarios are not modified).

Chokboyz
Link to comment
Share on other sites

Originally Posted By: Chokboyz
Good work Celtic Minstrel, those links are better organized (not to mention valid) now.
(really trivial things : Spears and Sign and Portents scenario names are misaligned)
That can be easily fixed, hopefully.

Originally Posted By: Chokboyz
When loading an outdoor battlefield, the c_town.town_num is not reset. If there's a boat or horse in the previously visited town, then pcs won't be able to enter the square with the same coordinates as the square the boat/horse was, in town.
To fix it, i set the c_town.town_num to -1 at the beginning of start_outdoor_combat().
(It seems it's a BoE original bug, but i'm not sure of it)
It seems more sensible to do this when leaving town rather than when starting combat. I may have done something similar already (but 200 instead of -1).

Originally Posted By: Chokboyz
I've also changed the "Set SDF" debug command to display the value of the specified SDF if value to set it to is -1 (BoA style, seemed like a good idea).
Okay, that can be done.

Originally Posted By: Chokboyz
I forgot to comment the (working but non-canon) feature "when specials happens interrupt wait/rest" in the previous release. I've added a compatibility switch for it in the next release.
I don't think I implemented that yet...

Originally Posted By: Chokboyz
I've made some adjustment to misc. battlefields : "forest" battlefield doesn't show a road anymore (erroneous documentation made me introduce this glitch, i think), road (cave/grass/mountains) battlefields appear correctly, cave bridge now has cave trims rather than grass.
I'll do this too, hopefully soon...

Originally Posted By: Chokboyz
Finally, i've added the ability to play sound asynchronously : if the sound number specified to the "Play a Sound" node is -sound_num, then it is played asynchronously.
...That wasn't already possible? Well, I'll fix that then.

Originally Posted By: Chokboyz
By the way, Celtic Minstrel, is the new "trims drawing" method complete ?
I think i'm going to tweak trim drawing, and avoiding Mac/Windows "code divergence" would a be good thing. wink
I think it was finished quite a while ago, actually.

So yes, it's done.
Link to comment
Share on other sites

Originally Posted By: The Almighty Doer of Stuff
One thing about specials interrupting waiting: I don't know how it works in Ormus's version (or the original BoE, I haven't played it in a while since I've been playing the Exile trilogy), but some scenarios include timers that call Play Sound nodes, for ambiance. Usually it's dripping in caves or birds chirping above ground. These probably shouldn't interrupt waiting, as sometimes they're quite frequent. I don't know how you want to work with this, but I'm sure you can figure something out.
I've added a new mechanism to make ambient sounds easier to use, so if the scenario creators are still around they could update them (once we get a stable release, of course).
Link to comment
Share on other sites

A couple things, having just poked around the Win32 CBoE Beta 2 scenario editor:

 

Ctrl+C and Ctrl+V work oddly. Ctrl+C copied some text from the Who Wrote field, but would not copy text from the Scenario Intro Text fields. I had to use the context menu. Also, Ctrl+V did not work at all. I found out about the weird copying behavior when I tried to paste Intro Text into Notepad.

 

Also, why does the Brew of Lethe in BLADBASE.EXS have "(delete)" attached to the name?

Link to comment
Share on other sites

I looked for the other one and couldn't find it, although I know it should be there. Anyway, I think the other one should be deleted instead, as those four potions (Knowledge Brew, Ironskin Brew, Brew of Battle, and Brew of Lethe) are a set. Silverlocke sells them in Exile II.

Link to comment
Share on other sites

I thought we chose based on the stats of the item. Unless they're absolutely identical I don't think we should change that.

 

You'll still be able to make a shop sell them as a set though. I intend to do two things to facilitate this, the first being a way to swap two items in the list simply by clicking on them, and the other being a way to add an arbitrary set of items to a shop.

Link to comment
Share on other sites

Oh, I see what happened with the Brew of Lethe now, and why there's two of them. This is the way it was in Exile II, so I guess it's the reason it's like this in BoE:

 

One of them, valued at 500 GP simply to make it more expensive to purchase and weighing only 1 unit, is Silverlocke's potion. It also has a So-So (20-200 GP) item treasure class.

 

The other, valued at only 50 GP, weighing 5 units and having a treasure class of Lousy (1-20 GP), is meant to trip up inexperienced parties who drink unidentified potions they find on the battlefield.

 

Since they both serve different purposes gameplay-wise, they should probably both stay, in my opinion, although perhaps the lower-value one could be changed to "Potion of Lethe" to avoid confusion. Anyway, if someone didn't notice the (delete) tag when they made their scenario, they could end up having monsters dropping the potion with that tag still attached, and this could potentially make it through beta-testing as well since it's random.

 

Also, for some reason there's a Helm of Speed, an Amber Periapt, and a Scale Necklace on the ground in the middle of Warrior's Grove. I assume those are there from when their item abilities were being tested, but perhaps they should be deleted now.

 

I just implemented those changes and uploaded the Bladbase.exs here: http://ados.ermarian.net/BoX/Bladbase.exs

If you want to use it this way, go ahead. If not, it doesn't really matter to me. :-P

Link to comment
Share on other sites

Originally Posted By: The Almighty Doer of Stuff
A couple things, having just poked around the Win32 CBoE Beta 2 scenario editor:

Ctrl+C and Ctrl+V work oddly. Ctrl+C copied some text from the Who Wrote field, but would not copy text from the Scenario Intro Text fields. I had to use the context menu. Also, Ctrl+V did not work at all. I found out about the weird copying behavior when I tried to paste Intro Text into Notepad.

For some reason, the Ctrl+C/Ctrl+V shortcuts were assigned to others functions (town editing). I've fixed that and the copy/pasting shortcuts now works.

I'm glad someone is using the Scenario Editor (and reports glitches/bugs ), thanks for the comments smile

Originally Posted By: The Almighty Doer of Stuff
Also, for some reason there's a Helm of Speed, an Amber Periapt, and a Scale Necklace on the ground in the middle of Warrior's Grove. I assume those are there from when their item abilities were being tested, but perhaps they should be deleted now.

Wait, did that means i didn't updated the bladbase.exs in the archive ... My bad then, i'll update it crazy
(Edit: indeed, i forgot to update it (the one in the repository is up-to-date), it's done for the next release. For the Lethe problem, we'll see what Celtic Minstrel decides, since he is the one the more qualified (new item selection method, etc ...))

Chokboyz
Link to comment
Share on other sites

I have no objection to keeping both Lethe potions if the weaker one is renamed. I only object to having two distinct items with the same name.

 

What's the use of buying that potion from Silverlocke or any other shop, though? It's obvious what it is (because it's a shop) and I can't see a reason why anyone would want to buy it...

Link to comment
Share on other sites

Its ability is concealed, and Silverlocke is a little crazy. If you know what it does you won't want to buy it, but if not, then you're in for a surprise, I guess. Also, perhaps it tastes good? tongue

 

I know in Exile II, in Fort Duvno, there's shop that sells alcoholic beverages. They're expensive and all they do is curse you and make a small message that says "Hic... That's good stuff!", but they add atmosphere.

Link to comment
Share on other sites

Just a minor thing regarding dialogue: If you Ask About... "name", "buy", or "bye", you get the standard Don't Know response, rather than the Name message, the talk node for "purc", and ending the conversation, respectively, as they should be (or I think they should be, maybe there's a reason for this). I know that asking about "job" or "work" will bring up the Job response, and asking about "look" will bring up the Look response.

 

Actually, now that I think of it, perhaps the "Ask About..." button could be replaced with plain text "Ask about..." and a text entry field, eliminating the dialog box that pops up and allowing for easier keyboard asking, like in Exile 1 and 2. I always find myself trying to ask about things that way and accidentally choosing Name by pressing N when what I want is to ask about something starting with N. Perhaps the one-letter shortcuts to the buttons could be changed to entering the one letter in the field and hitting enter instead. I think the convenience of not having to click the Ask About button would outweigh the convenience of having the standard button keyboard shortcuts, as I imagine the Ask About button is used far more often than the shortcuts (at least for me. Before I got used to the E1/E2 system, I always clicked on the buttons.)

 

Just an idea, and not a terribly important one.

Link to comment
Share on other sites

Originally Posted By: The Almighty Doer of Stuff
Just a minor thing regarding dialogue: If you Ask About... "name", "buy", or "bye", you get the standard Don't Know response, rather than the Name message, the talk node for "purc", and ending the conversation, respectively, as they should be (or I think they should be, maybe there's a reason for this). I know that asking about "job" or "work" will bring up the Job response, and asking about "look" will bring up the Look response.

There was a typo in handle_talk_event() preventing name from working (name was spelled nama), that has been fixed.
I've also added the "buy" and "bye" keywords (which were not in the original BoE if i'm not mistaken).

Originally Posted By: The Almighty Doer of Stuff
Actually, now that I think of it, perhaps the "Ask About..." button could be replaced with plain text "Ask about..." and a text entry field, eliminating the dialog box that pops up and allowing for easier keyboard asking, like in Exile 1 and 2. I always find myself trying to ask about things that way and accidentally choosing Name by pressing N when what I want is to ask about something starting with N. Perhaps the one-letter shortcuts to the buttons could be changed to entering the one letter in the field and hitting enter instead. I think the convenience of not having to click the Ask About button would outweigh the convenience of having the standard button keyboard shortcuts, as I imagine the Ask About button is used far more often than the shortcuts (at least for me. Before I got used to the E1/E2 system, I always clicked on the buttons.)

That's definitely an idea. Don't worry about the shortcuts, the keyboard input won't trigger anything if the focus is on the edit box ...

Chokboyz
Link to comment
Share on other sites

Originally Posted By: The Almighty Doer of Stuff
Actually, now that I think of it, perhaps the "Ask About..." button could be replaced with plain text "Ask about..." and a text entry field

Ok, i've added a preference switch that makes an edit box (that's the text entry field) appears next to "Ask About".
The box is tested and fully functional.

Chokboyz
Link to comment
Share on other sites

Added to Todo list.

 

Originally Posted By: Chokboyz
Nonetheless, I'll correct the fact that the game thinks you're moving to a bridge square if moving over lava (it thus displays a "Land or under" dialog).
Oh, here's something I missed earlier... I can't implement it very easily at the moment, but I've put it on my todo list (which is pitifully short – I've probably forgotten a zillion things that should be on there).

 

Originally Posted By: Chokboyz
Edit2: ah, that's more problematic : the previous glitch also applies to horse blocking terrains. Fixing it would prevent horses from entering such terrains (after all there not supposed to enter them in the first place smile ) when outdoor and, again, force the party to continue by foot ...
So, um... what did you do to fix this?
Link to comment
Share on other sites

Originally Posted By: Chokboyz
While the bug is annoying, this "fix" is far worst because it give all monsters a free turn if they manage to kill a pc during the monsters turn (needless to say, that makes them wipe the party really fast). A real fix to this bug is to set the variable done_something to TRUE after pc_combat_move() call (in the handle_action() function) if the pc is dead (a possible way to see if it's the case, is to check if the current_pc variable has changed ...).
I've checked the Mac code in the repository and the previous faulty "fix" has, thankfully, not been applied.
The current fix has been tested and works wink
Since this is already done whenever the pc_combat_move() function returns true, and there was already a check to see if current_pc had changed in pc_combat_move() which then returned false, I simply changed it to return true.

Originally Posted By: Chokboyz
I've also implemented a very crude custom intro picture handling : if the scenario.intro_pict is set to 30 (29 is the last one in SCENPICS.BMP), then the first picture of the custom sheet is used as the scenario intro icon (note that the dimensions of the intro picture are the same that the talking portrait ones, so the first two squares of the custom sheet will be used and they need the same formatting as the talking portrait).
This is on my todo list; I intend to copy all custom scenario icons to a storage sheet so that I don't have to reload them every time they're needed. Then whenever scenario icon 100 is requested by the scenario (eg in a dialogue node) it will look up the appropriate icon, which may be either in the main scenario icon sheet or the storage sheet.

Originally Posted By: Chokboyz
Edit : Changed the way the town room/outdoor info rectangles were handled by the Scenario Editor ; the 16 rectangles are now initialized to coordinates((-1,-1),(-1,-1)), freeing the 0 coordinate and fixing the rectangle X description appearing at (0,0). Note that, for legacy scenario, the rectangles being saved in the scenario file, the "Rectangle X" description will always appears at (0,0) because the rectangles are saved at (0,0) (can be fixed by opening the scenario and deleting the rectangles via the menus).
A really trivial enhancement, but it's done smile
So many of these things can't be done in the present state... this is when creating a scenario, right? Since that code is nonexistent at the moment I'll have to just add it to the todo list.

I could add initializers to the constructor, but it wouldn't help unless I changed the code to deconstruct and reconstruct (with explicit destructor invocation and placement new) when making a new scenario (since the same location in memory is used for all scenarios).

Originally Posted By: Chokboyz

Possible Workarounds :

- Refrain from summoning (and pray that Disco Joe keeps on tossing Firestorms and Divine Thuds)
- Kill the two and third forms in the same round (i've seen NPC do that, especially when hasted grin )
- Have some NPC killed frown
- Open the scenario in the Scenario Editor, go to town 28 and change the town special 54 to No Special (or whatever that does nothing), save and redo the encounter (if you're already in the Nuclear Bomb town, that you won't work).
- Persist on trying, one moment or another the free slot won't be 10 (the thing is not to summon anything after the second pink is dead. Note that if Disco Joe cast Major Haste, then it will likely be ok, given that Bladesman Wasazore will have 24 AP that is often enough to single-hand two pink forms).
Possible fix: create a copy of the monster to be killed at the top of the kill_monster() function, and reference that instead of the original thereafter. This works provided that the monster needn't be altered (apart from clearing the slot, which would still access the original).
Link to comment
Share on other sites

Originally Posted By: Arachnid
6. Is there any way of modifying the training screen so that scenario authors can change what skills a trainer allows you to increase, and the costs? Otherwise, we have to increase skills with special nodes, and that's not fun.
I have thought of three ways in which this could be done: introduce a cost adjust factor like with regular shops, provide a method to allow the designer to choose the cost for each skill separately, or allow skills to be included in regular shops. I'm leaning towards the first and third, myself (I think both together would be good), but does anyone think the second would be worthwhile?

Originally Posted By: Chokboyz
Here's a (very) simple proposition of a corrected augment weapon calculation formula :

Originally Posted By: Code
if(adven[pc_num].items[item_num].value <=1400)
val_to_place = max(aug_cost[shop_identify_cost] * 100,adven[pc_num].items[item_num].value * (5 + aug_cost[shop_identify_cost]));//original behavior
else
val_to_place = 1400 * (5 + aug_cost[shop_identify_cost]) + (30000 - 1400 * (5 + aug_cost[shop_identify_cost]))* (adven[pc_num].items[item_num].value - 1400)/8600;//really smoothen the price curve

The (really simple) idea used here is to let the program calculate the price as usual for the 1400 first gold pieces then to the add a fraction of the remaining (30000 - 1400 * multiplier) gold pieces depending of how "far" the item value is from the max value (10000).
The value 1400 is used because the highest multiplier is 20 (and 1500*20 = 30000, so let's use 1400).
Weapons with prices more than 1400 are few (Steel Greatsword, Steel Great Mace, Steel Halberd, ...), but this calculation method will give them about the same price of enchantement.
Example :
Steel Halberd => flaming : 28139, +1 : 13813 Value : 2000
Steel Greatsword => flaming : 28093, +1 : 13409 Value : 1800
Steel Great Mace => flaming : 28069, +1 : 13206 Value : 1700


If the maximum value (10000) is reached, then the enchantement cost 30000.
We still haven't decided on this, have we?

Originally Posted By: Chokboyz
safety check for Absorb Spell done. Tested and work.
Originally Posted By: Example of code

if (((dam_type == 1) || (dam_type == 3) || (dam_type == 5))
&& (victim->m_d.spec_skill == 26)) {
if((victim->m_d.health + how_much) < 32767)
victim->m_d.health += how_much;
ASB(" Magic absorbed.");
return FALSE;
}

(note that there's two occurences of the Absorb Spells check in the code)
Sorry, which function is this in?

Originally Posted By: Chokboyz
Err, seems like the Protection from Acid check is done with the wrong ability number (hasAbilEquip(122) - Spell : Stinking Cloud), should be replaced by 36.
There's also a check for a non-existing 67 object in the handle_disease() function. I think it should read 62 (Protection from Disease).
A search did not reveal any instance of checking for ability 122 – where did this occur, in case I missed it? The other one has been fixed (and now uses the enum instead of a number to make this clear).


By the way, I think I've implemented the difficulty adjust disabling (if difficulty_adjust() is the only place I need to change anything).
Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
So, um... what did you do to fix this?

http://code.google.com/p/openexile/sourc...ile/ACTIONS.CPP , line 2519.

Originally Posted By: Celtic Minstrel
Since this is already done whenever the pc_combat_move() function returns true, and there was already a check to see if current_pc had changed in pc_combat_move() which then returned false, I simply changed it to return true.

Wow, i've overlooked this ... Thanks. smile

Originally Posted By: Celtic Minstrel
Possible fix: create a copy of the monster to be killed at the top of the kill_monster() function, and reference that instead of the original thereafter. This works provided that the monster needn't be altered (apart from clearing the slot, which would still access the original).

That should works ... but i really think this is a design flaw ...

Originally Posted By: Celtic Minstrel
We still haven't decided on this, have we? (about weapon augmentation cost)

I've left the code in state it was at this point (that is legacy cost + slower linear increase for the last 100 gold). I'll gladly change it, if needed.

Originally Posted By: Celtic Minstrel
Sorry, which function is this in?

Boolean damage_monst() if i'm not mistaken.
The second occurence is in adjustMagic() (name may vary, since it's a class member in my version of the code).

Originally Posted By: Celtic Minstrel
A search did not reveal any instance of checking for ability 122 – where did this occur, in case I missed it? The other one has been fixed (and now uses the enum instead of a number to make this clear).

May be windows only (as it is often the case with typos like that).
The function is member acid of the class pc_record_type (translates to acid_pc() which checks the correct ability, i've just checked in the original Mac code ... smirk )


Originally Posted By: Celtic Minstrel
By the way, I think I've implemented the difficulty adjust disabling (if difficulty_adjust() is the only place I need to change anything).

It's indeed the only place to change, so it's implemented wink

Chokboyz

Edit : did you do something with the unused fields in town_record_type (res1, res2, specials1, specials2) or can use one for a hide_map field ? (if i remember correctly we decided it was supposed to be a town property ...)
Link to comment
Share on other sites

Originally Posted By: Chokboyz
Originally Posted By: Celtic Minstrel
So, um... what did you do to fix this?

http://code.google.com/p/openexile/sourc...ile/ACTIONS.CPP , line 2519.
Thanks.

Originally Posted By: Chokboyz
Originally Posted By: Celtic Minstrel
Possible fix: create a copy of the monster to be killed at the top of the kill_monster() function, and reference that instead of the original thereafter. This works provided that the monster needn't be altered (apart from clearing the slot, which would still access the original).

That should works ... but i really think this is a design flaw ...
Perhaps. Do you have any better suggestions?

Originally Posted By: Chokboyz
Originally Posted By: Celtic Minstrel
We still haven't decided on this, have we? (about weapon augmentation cost)

I've left the code in state it was at this point (that is legacy cost + slower linear increase for the last 100 gold). I'll gladly change it, if needed.
I might as well do the same then.

Originally Posted By: Chokboyz
Originally Posted By: Celtic Minstrel
Sorry, which function is this in?

Boolean damage_monst() if i'm not mistaken.
The second occurence is in adjustMagic() (name may vary, since it's a class member in my version of the code).
Class member of what?

Originally Posted By: Chokboyz

Edit : did you do something with the unused fields in town_record_type (res1, res2, specials1, specials2) or can use one for a hide_map field ? (if i remember correctly we decided it was supposed to be a town property ...)


I did this:
Code:
bool strong_barriers : 1;bool defy_mapping : 1;char reserved_bits : 6;

The one you're talking about is defy_mapping. If you're trying to keep compatibility with the struct, you can delete any char variable and replace it with those three.

I think it would be fine to omit the name for "reserved_bits" too, since there should be no reason to access it.

I've already deleted the unused fields in my code, since I'm not worried about compatibility (the original struct is still used anyway for loading). I believe your code also uses the original struct for loading?
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...