Announcement: Remember: you are giving away your fantastic ideas for free, and somebody else might even make money from them (or appear to). That's just how the world works! If you're worried about it, maybe you shouldn't post your ideas here.


Caravel Forum : DROD Boards : Feature Requests : Variables and Text-based revisited (After looking at complaints, here is what I've decided.)
New Topic New Poll Post Reply
Poster Message
coppro
Level: Smitemaster
Rank Points: 1309
Registered: 11-24-2005
IP: Logged
icon Variables and Text-based revisited (+1)  
First off, variables are allowable. Normally, the DROD engine prevents infinite loops by never executing the same line of script again. With variables, this system doesn't work due to loops. After thinking long and hard and discussing with others. I beleive that the following will work:

No character may have more than 8 variables.

Each variable may range from 0-65535 (1 short integer).

A line of script may execute as many times as it wants, unless it is a line that could change the current point in the script, in which case it may execute a maximum of 64 times (the highest number you could really want is 38, the width of a room), or until all variables are the same during a future pass. Calculations show that the memory consumption is negligible compared to the amount of memory DROD normally uses (approzimately 1K max per looping function, does not stack accross characters).

CPU consumption shouldn't be an issue: if someone makes a script that takes forever, just don't play it. Just be content that lockups aren't Mike's fault.

Or, you could just have "repeat loops" that repeat a number of times then stop, with the repeat count readable but not writable.

Also, you should be able to block off code that jumps to the end or the beginning of the block when executing starts for the turn. That way, you don't need to close everything and use complex variables, you can just call a command and expect everything to end itself.

Now, for text-based (Note: I'm a stickler for this, even if I have to use the syntax currently available. I hate drag-drop programming): I have found an excellent scripting language called Lua. The syntax is C-like, but the structure is like BASIC. Essentially, the language is fairly simple yet powerful and strongly adaptable.

That's all, folks!

PS: I'm doing this instead of reviving because I can get my thoughts down in one place and they all go in one thread.
03-01-2006 at 01:01 AM
View Profile Show all user's posts Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 2338
Registered: 06-14-2005
IP: Logged
icon Re: Variables and Text-based revisited (0)  
Variables that go up to 65535? The most that you could ever want would be 2096. That's about 800 more than the number of tiles in a room. Unless you have some brilliant plan for scripting, that would be the most you would need (even a move counter wouldn't need that much, the longest room in a hold has at best 66367 moves, the second most is 6789 moves. Besides, with a move counter you could always use something similar to "Wait for Turn"). The rest that you wrote I like (I definitely agree with you about drag and drop scripting). I think that, so as not to be cruel to people who can't code well, we should leave in drag and drop.
03-02-2006 at 12:11 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1309
Registered: 11-24-2005
IP: Logged
icon Re: Variables and Text-based revisited (0)  
It's for simplicity. In C++ (DROD's native language), you can define a variable as being from 0 to 65535 (that's just one of your options). That gives plenty of breathing room and is extremely easy to code.
03-02-2006 at 12:13 AM
View Profile Show all user's posts Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 2338
Registered: 06-14-2005
IP: Logged
icon Re: Variables and Text-based revisited (0)  
Ok. But wouldn't it use up less processing space, and therefore allow for more variables if you do it my way?
03-03-2006 at 10:02 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1309
Registered: 11-24-2005
IP: Logged
icon Re: Variables and Text-based revisited (0)  
Actually no because it would require more code to limit the variables that way as opposed to using the language structure to do it automatically.

Also, I'm surprised Mike hasn't posted.
03-03-2006 at 10:05 PM
View Profile Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5124
Registered: 02-04-2003
IP: Logged
icon Re: Variables and Text-based revisited (0)  
Yes, I agree that imposing artificial limits on integral values isn't necessary for optimization.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
03-03-2006 at 11:50 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1309
Registered: 11-24-2005
IP: Logged
icon Re: Variables and Text-based revisited (+1)  
mrimer wrote:
Yes, I agree that imposing artificial limits on integral values isn't necessary for optimization.

Is this to be taken as confirmation/celebration, or just Mike agreeing with someone for the sake of agreeing with someone?
03-04-2006 at 01:03 AM
View Profile Show all user's posts Quote Reply
Oneiromancer
Level: Legendary Smitemaster
Avatar
Rank Points: 2936
Registered: 03-29-2003
IP: Logged
icon Re: Variables and Text-based revisited (+1)  
I think it is Mike saying "No matter what I post in a Feature Request thread, people are going to take it as either confirmation or denial of that Feature Request. I don't want people to expect me to post in every single FR thread so I'm going to post something noncommittal and hope they take the hint that I'm very busy and am not here to satisfy their every whim."

Of course, I could be wrong. :)

Game on,

____________________________
"He who is certain he knows the ending of things when he is only beginning them is either extremely wise or extremely foolish; no matter which is true, he is certainly an unhappy man, for he has put a knife in the heart of wonder." -- Tad Williams
03-04-2006 at 01:22 AM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1309
Registered: 11-24-2005
IP: Logged
icon Re: Variables and Text-based revisited (0)  
Oneiromancer wrote:
I think it is Mike saying "No matter what I post in a Feature Request thread, people are going to take it as either confirmation or denial of that Feature Request. I don't want people to expect me to post in every single FR thread so I'm going to post something noncommittal and hope they take the hint that I'm very busy and am not here to satisfy their every whim."

Of course, I could be wrong. :)

Game on,

No, no. You're absolutely right.
03-04-2006 at 01:57 AM
View Profile Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Feature Requests : Variables and Text-based revisited (After looking at complaints, here is what I've decided.)
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.