ID:1368674
Sep 3 2013, 8:55 am
|
|
Back when I had two major projects in alternating development cycles, every time I'd wrap up work on one and head back into the other, my first step was to run through the programming and clean it up, applying anything new I had learned, trying to make it more universal and less redundant, simplifying it, etc.
And every time, I was amazed by how poorly I had previously programmed things. Well, I've been working very heavily on a certain project lately, and I got a little tired of looking at it, so I opened the files for my other big project just for the heck of it (the one that may never see the light of day again; at least not through this website, aside from my member picture) And holy cow is it terrible! The DBTC code is so full of redundancy and just...garbage... I can hardly believe it. For example, there's a mob var, "importantmob", whose only job (so far as I can tell) is to include all of the "important" mobs in a couple of lists after their creation. This is pretty bad in and of itself, but it gets much worse... The number of NOT-important mobs is much greater than the important ones. But instead of setting importantmob variable's default value to 0 and only turning it "on" under the important mobs, I apparently thought it was a good idea to do the opposite... A great number of the mobs definitions contain "importantmob=0" (a search reveals 132 such entries in my code). importantmob=1 is the default value handed down from the base /mob type. Ugh. |
It's sort of a mixture. All long strings and AI dialogue are stored in text files and pulled out (thanks to Polaris8920's ".Txt Parser" library), but there are all kinds of more "minor" strings that are hard-coded (mostly game-control messages, like "Since you are carrying a Dragon Ball, you cannot decline the challenge...", and strings with embedded expressions that I didn't feel like figuring out how to evaluate using strings pulled from an outside file)
But that wasn't always the case. That was one of the improvements made on one of the middle versions of the game, as part of one of the mentioned "clean-up" phases. |
Well, it's great that you did that.
Most people can't figure out that having thousands of strings hard-coded into your environments is pretty silly. It's probably one of the easiest optimizations and cleanups that a programmer can do. note to self: figure out if you can use the text() proc with imported strings for embedded expressions |
In response to Super Saiyan X
|
|
I'm curious, how exactly does having strings hard coded effect the game?
|
In response to The Magic Man
|
|
There is an internal limit on the number of hardcoded strings you can have. Going over the limit causes compilation failures.
|
In response to LordAndrew
|
|
Makes sense, what is the limit?
|
In response to The Magic Man
|
|
~65,000 (256^2), I believe.
|
In response to Super Saiyan X
|
|
Super Saiyan X wrote:
Most people can't figure out that having thousands of strings hard-coded into your environments is pretty silly. It's probably one of the easiest optimizations and cleanups that a programmer can do. How is it an optimization to do this? |
In response to Jittai
|
|
Jittai wrote:
Super Saiyan X wrote: Shorter compile time, smaller DMB. |
In response to Jittai
|
|
He's talking about optimizing the thousand lines of string.
|
In my case, I'm not so much concerned with hitting the string limit, I just feel like large text strings in the code clutters it up a bit.
Plus, I think that it's easier to edit and add to the game text/dialogue if it's conveniently stored outside of the code, all by itself. It's also kind of a "CSS" mentality; separate the content from the formatting. I don't know that it could ever really be considered an "optimization", because I'd think that it would always be faster/more efficient to read strings directly from the code, rather than having to run a procedure to pull them from an outside file... |
Separating just the strings from the source sounds arbitrary. Is it more convenient for the dev? How often will the host want to change nothing else but a piece of dialogue?
Now, this is somewhat off-topic. I remember playing DBTC half a decade ago. Reading this post I was going to give your game another try, but it looks like the hub's been removed? |
In response to Toadfish
|
|
Toadfish wrote:
Separating just the strings from the source sounds arbitrary. Is it more convenient for the dev? How often will the host want to change nothing else but a piece of dialogue? Well, as for my own personal use, here's an example of a string that I opted to remove from the DBTC source and store in a .txt: "<font color = red>Now that you've named yourself, it's time to choose a race for your character... Do so by clicking one of the three options shown on the screen... You can be a Saiyan from the Planet Vegeta, a Namekian from the Planet Namek, or a Human from Planet Earth... Your choice will have an effect on the type of fighter you will be, so choose wisely... Saiyans are known for their strength, Namekians are known for their regenerative capabilities, and Humans are known for their expert Ki usage and determination... After selecting one of the three races, you will be given the chance to select your gender (or, in the case of Namekians, who are all one gender, you will pick which type of Namek you wish to be) Once that's all complete, you will be placed in the character creation room to select your clothing style, hair, etc...</font><CENTER>--------------------</ CENTER> " Now, this is somewhat off-topic. I remember playing DBTC half a decade ago. Reading this post I was going to give your game another try, but it looks like the hub's been removed? Yep, along with every other DBZ (and presumably One Piece?) game on BYOND. A few years back, FUNimation (the American copyright holders) brought down the Cease & Desist on BYOND, and all hubs for games based on FUNi properties (DBZ, One Piece, probably a few others) were removed. |
the hubs specifically listed on Funimation's list were (what I like to call) super-hidden or banned. They are only accessible by the hub owner and Lumtom. To others, the hubs look as if they're deleted (besides one minor detail). Hubs not on Funimation's list just do not appear on the public hub, but are still accessible.
|
Ohhhh, I see. So mine was one of the specifically called-out? Hooray! It's quite an honor...lol
I've read the FUNi C&D letter, but I forgot that there was an accompanying List of specific offenders. |
In response to SuperSaiyanGokuX
|
|
SuperSaiyanGokuX wrote:
Ohhhh, I see. So mine was one of the specifically called-out? Hooray! It's quite an honor...lol Yup. your game and mine. Basically, any listed Funimation-property, they only explicitly touched what they found publicly on the site. |
I always saw a bunch of text/XML files generated along side the host files, they contained pretty much all of the saga text and whatnot.