|
Post by howdy on Apr 11, 2007 8:10:46 GMT -5
Hello, everyone! I have made a set of *UNOFFICIAL* source code patches. If fixes the (un) evolve bug and possibly many others. The drawback is a slight change to arguments of 2 functions exported to LUA - see the enclosed readme.txt. Do download, use this link: www.megauploads.gr/download.php?id=5FC3BA01Variaz, if you are interested, I will send it to you via e-mail.
|
|
|
Post by Variaz on Apr 11, 2007 8:44:51 GMT -5
Err... thanks, but you should have told me that you were going to make a source code patch! I mean, I do work on the source code on my own too!
Yes, please, e-mail it to me. (variaz@hotmail.com). Tell me which files and which functions you modified... unless they're all described in the readme...
|
|
|
Post by howdy on Apr 11, 2007 8:52:39 GMT -5
Hello, Variaz!
Check your e-mail!
ps. Maybe it would be a good idea to add a public SVN server, so everyone could get the newest code?
|
|
|
Post by Variaz on Apr 11, 2007 9:13:30 GMT -5
Don't have access to my hotmail from where I am at the moment, but I'll take a look tonight.
As for public servers...hmm...don't have one. Know any?
|
|
|
Post by howdy on Apr 11, 2007 9:23:16 GMT -5
If you want, you may check the Megauploads link in my first post. Click on it, go to the end of page, enter a 3 digit code that will show up, wait 60 secs, click "download" and enjoy the work :] As for the SVN server, I do not have any experience. I have found this address: www.assembla.com/They claim that their service is free. I have checked them in the past and it worked; I have not used it for any important things though.
|
|
|
Post by Variaz on Apr 11, 2007 9:57:45 GMT -5
Got the file, thanks you. I'll take a look at it!
|
|
|
Post by howdy on Apr 11, 2007 10:08:50 GMT -5
Good to hear that! After you take a look, write what you think about this patch. If you think this is going in the right direction, I will make some more patches for you to work on . Do not hesitate to write me an e-mail if you want to discuss some of the changes I made (I do not think, this will be needed, as 99% of them are really trivial).
|
|
|
Post by Variaz on Apr 15, 2007 19:46:51 GMT -5
hmmm... well, I tested an Evolve spell, and while it doesn't crash anymore... it doesn't work? I tried to evolve a monster, and it should have been possible, but it didn't work... Did it work for you?
|
|
|
Post by Variaz on Apr 16, 2007 8:24:14 GMT -5
All right, I might have tested it in a wrong way, as I forgot there was a monster level constraint with Evolve... However, I did fix the problem in a different way. This may not be a "nice" way, but at least it works. Basically, I create a new variable, and it starts at 1. Then, it counts up to max_r_info, but will stop if it encounters an empty monster slot. So right now, it will choose between the 241 first monsters. I tested it, it works! Of course, this assumes there is contuinity in the monsters numbers, so it's not perfect, and right now, it doesn't count monsters with id 1000+(because it stops at 242 since 242 is empty), though this is not necessarely a bad thing, since these monsters shouldn't be available anyway. But at least it works. Still better than a crash. I might give your patch a second try though, as I forgot about the monster level check, and I was only on dungeon level 5 when I tried...
|
|
|
Post by howdy on Apr 16, 2007 12:50:40 GMT -5
Hello, Variaz! 1) Could you give an example of "unevolveable" monster? I have checked it and it works with my source . I think that you might have simply been unlucky - note that my path still uses the "random selection" algorithm to select next "candidate". For some monsters, like "p" there are many good candidates (simply because there are a lot of those monsters defined), where for some "uncommon", like I, the chances of finding it are slim. I thought that this is 'by design'... 2) I do not like your idea about searching until I find empty slot. It is very error-prone and, as you know yourself, the source is already quite messy... I think that the simplest, and the most elegant solution is to give an additional flag, e.g. "SUMMONABLE" or similar that could be checked to see, if the evolve spell would "generate" the given monster. NEVER, *EVER* USE ANY IDEA THAT CAN BE SUMMARIZED AS THIS DREADFUL SENTENCE. If you do, we will have a messy mess that will be next to impossible to develop further. I know, sometimes the pressure is simply too much, but it always pays off to use the elegant solution. Always prefer elegance to speed. I know that the "pre-mature optimization" demons lurk, but try to put them in their cages until you check and double check that the optimization is really needed. I am very sorry if you fill bad about my comment, but we all want to see a bug-free, enjoyable game! Did you have a look at the other changes I have made? I beg you, Variaz, do not drop those changes (like returning proper values, using compatible variable types etc.) because of the "I do not care, noone uses this old *.* - it works anyway" syndrome. Someday someone WILL use it and cause more trouble than this is worth. Did you take a look at changes in the LUA (e.g. in "summon_specific_friendly_name")? Please compare the resulting .c file that tolua.exe produces - you will be shocked!!! (or I do not understand something - if it is the case, feel free to teach me some tricks - I will be grateful). 3) Have you checked the public SVN server I wrote about in the second comment? This would really pay off if all the developers could have access to the same source (not to mention the ordinary "gamers, who can compile" ).
|
|
|
Post by howdy on Apr 16, 2007 12:52:40 GMT -5
Oooops - disregard the 1) (goes to read the book "Introduction to reading comments and understand them")
|
|
|
Post by Variaz on Apr 16, 2007 14:16:51 GMT -5
1. I'll give your patch a second try, don't worry. I, myself, do not actually like my own solution, but it was still better than a crash. That you can't deny! And it was coded in like 30 minutes this morning on my laptop while I was taking the bus, and that time includes compiling, trying to figure out what causes it, etc etc... So taking that into account, it's actually amazing that I managed to fix the crash. 2. For the other changes, well, some of the functions you modified were actually obsolete, so I deleted some. Some functions were still used and indeed returned wrong values. Not sure I fixed all of them, but I did fix a couple of those you pointed out. I think I changed the bool types of some functions to a void type, like that fireball function... As for LUA, didn't exactly look at the summon_specific_friendly_name function, or don't remember it, will need to check that again. 3. Haven't looked at any server options yet. Not sure when I will though, not exactly a priority right now... Now let me explain something here. No, the easy way is not always nice, but remember that when you have like 10000 other bugs reported, and then requests for gameplay-related stuff, focusing all the attention on one thing doesn't solve the other stuff, and thus the game takes much longer to release, and peoples can't use the features in the meantime. And then there's making the game world. You can have the best, most stable, source-friendly, bug-free application in the world, if there's no gameplay content, the game won't be fun, and peoples won't play it. The code could be easier, more organized, more optimized, you are right. But if I focus all my attention on this, I forget about everything else. The "return num" in the void functions for example... no, they shouldn't return that in a void function, but it doesn't affect anything. It's not nice, and certainly does not do any good, but the time I would take to clean all it's instances may be the time it would have taken to add stuff to the gameplay. The "return num" won't change anything to the actual game, so it gets low priority in terms of "todo"...
|
|
|
Post by Variaz on Apr 16, 2007 18:33:37 GMT -5
Well, your patch for Evolve/Unevolve DOES work after all! I completely forgot about the monster level things, sorry about that. I've implemented it now, and the spells shall work once again! You wondered about that strange +19 in the chosenbody variable? That's an old NewAngband things... the first monsters, you see, were not used, but they were reserved numbers I believe, so they had to stay empty. To make sure the game would never select them, I did that +19 thing. And randoms about static numbers, instead of max_r_info? Well, the evolve code is rather old you know(it dates back to versions older than NewAng 1.7)...and at the time, I was not aware of that variable!
|
|
|
Post by howdy on Apr 17, 2007 7:09:19 GMT -5
I get your point and agree with your comment. If you take a look at all my patches, it will not take long for you to add all, or at least, some of them. It took me about 15 hours to write all the comments and check the results, so you could implement the patches in an hour or so... I propose an alternative solution - give yourself 30 minutes and go through my patches. If you see anything obvious - implement it (do not think, whether it really is worth it or not - just do it.). Leave the changes from char to unsigned char for now - I think that those are not yet fully finished (but obviously work fine). If you have any doubt - leave the code as is. This way we will have about 90% of the benefit of my patches without sacrificing too much time for any game-contents. You may be surprised, but it is possible that some bugs might get removed by those obvious changes. I have some more patches, but I will make them against the newest sources when you make them available (otherwise you will not want to talk to me ) - you will need to have some time to implement the newer cities . There are some functions I am sure are wrong but I need to think about an acceptable solution myself (I am talking about functions returning an explicite string; something like >>return "ABCD";<<).
|
|
|
Post by Variaz on Apr 17, 2007 8:29:58 GMT -5
I've already added a few things from your patch, like some return values, and of course, the important fix for Evolve/Unevolve. I'll take a look for more stuff... Though I might attack some more serious bugs first, like the money exploits and stuff... I want to release 0.2.1 soon too... I've got an idea... Once 0.2.1 is released, I will let you patch it all you want before working on it again. This way, our works won't be conflicting! And meanwhile, I will make that Ivhala kingdom.... or expand Jindar. (Both?)
|
|