by loafingcoyote » Sun Sep 16, 2012 12:23 am
Roody_Yogurt wrote:Writing efficient code- It seems that some variations of Nate Cull's original code runs slow on some computers, as this review by Emily Short can attest:
http://www.ifreviews.org/index.php?analise=970
Of course, it's harder to check for code efficiency as our computers get faster and faster, but it's still a nice goal to shoot for.
Yeah, I had heard about this problem and believe it too. I don't read I6(or T3) code very well, but I have had a good look at his RAP code. It didn't strike me as being very efficient, with a lot of duplicate code that runs in a roundabout way. After very little time studying the code I realized that it would have to be completely redone. All I took from Nate Cull's code are a couple of concepts and some naming conventions.
I don't mean any of this to be disparaging of his work, by the way, since it inspired me to do something similar. I just tried to make it more efficient and flexible.
Speaking of which, it may surprise you to find out that I already used the new RAP in my last game. I developed a version of it just as I was finishing
Escape from Ice Station Hippo and used it to control Findbot's behavior while he was acting independently. The amount of code needed was tiny and the overall increase in the final size of the game was negligible. This was because my RAP is made up of two parts. The first is the core of the extension, which shouldn't be modified but is very small and (I hope)efficient. The second part can be as small or large as needed, depending on how complex you need your characters behavior to be. What I really like is that you can drop the RAP into the middle of a game and have it control all or just some of your npc's behavior(easily). Therefore it made sense for me to include it in a game with a single character.
Roody_Yogurt wrote:Making the output prose pretty- Ideally, an extension would have several options on how the text is presented, like whether the player can be appraised of the actions of NPCs both in and out of scope, whether you can group the description of NPCs who share the same current action (so instead of "An archer aims at you. Another archer aims at you.", etc., it could be "A group of archers aim at you. Some barbarians run at you." or whatever), and whether you can, of course, randomize how certain actions are described (knowing your Hugo Clock code, I'd guess you have this one covered).
This is a real problem but I like your suggestions. Adding switches which would tell it to not report certain actions or to group types of actions when a lot is going on might be the way to go. My RAP is in an early stage of development, so it's a good time to start considering these things.
I especial like what Emily Short had to say about it in the review you referenced above:
Emily Short's review wrote:
I think the solution probably involves representing all the actions that are going to occur in a given turn as data, then running some algorithms on that data to discard anything too ineffective to be worth reporting, cluster related actions together into compound sentences and related sentences into paragraphs, introduce variations of phrasing, etc. Which would be a massive undertaking to write, frankly, even after you have a fully functional set of RAP routines for your NPCs.
This is a brilliant idea and I think she's a bit too pessimistic about how hard it would be to pull off. It would be a lot of work, but it could be as simple as assigning values to character properties. I'll give an example:
There are three characters in a room with the player. The RAP determines that two of the characters want to move north and can legally do so, while the third character moves east. It doesn't move them yet, it just assigns a value to a predetermined property. The character property misc #2 could be used for moving, with 1 representing a move north, 2 east, 3 south, ect...Therefore, the first two characters misc #2 is assigned to 1 and the third is given a 2. After the rap has finished assigning all values, it then calls another set of routines. These determine what characters are acting that turn, which ones are acting within the scope of the player and what messages should be eliminated or grouped.
Thus you get:
- Tom and Dick move north. Harry moves east.
As opposed to:
- Tom moves north.
Dick moves north.
Harry moves east.
Roody_Yogurt wrote:Coming up with a good game idea for RAP- To be honest, I haven't heard of most of the games that use this system, and having opened "Battle", it's pretty easy for me to guess that most of them aren't especially entertaining. The idea is definitely a lofty goal, but I can imagine that coming up with the right game idea for it might be as hard as writing the extension itself.
This is my biggest problem right now. I need to make a proper proof of concept game, but it's hard to avoid the zombie attack/rpg battle genre. I have a couple of fairly original ideas already, but they don't stray too far from the lots-of-npcs-wandering-around-attacking-each-other strain.
What doesn't bother me, though, is whether anyone will actually use it or not. I know that very few Inform and Tads users have made use of Nate Cull's RAP, so the prospects for anyone using mine are slim. I really don't mind, since I believe that the mere existence of a RAP for Hugo is just one more thing to make it a more attractive option for future IF authors, even if they have no plans to use it.
Roody_Yogurt wrote:I was thinking that, since the NPCs' motivation is re-calculated every turn, it especially lends itself to a simple-minded-enemy-games like zombie invasions where, for the most part, they only pursue what they see (you'd have to increase their scope a bit more just to keep things interesting).
All of your points are valid and I appreciate them, but you have to admit that this sort of game, done well, would be pretty cool :)
Anyway, Friday night I decided to write a small sample game to demonstrate where the project is at the moment. I meant to have it ready today but was diverted, so it should be ready tomorrow(Sunday). It isn't a full blown game; just a toy to be played with and hopefully fun too! I'll introduce it in a new thread. This one has gotten slightly off topic!
-lc
[quote="Roody_Yogurt"][b]Writing efficient code[/b]- It seems that some variations of Nate Cull's original code runs slow on some computers, as this review by Emily Short can attest: http://www.ifreviews.org/index.php?analise=970
Of course, it's harder to check for code efficiency as our computers get faster and faster, but it's still a nice goal to shoot for.[/quote]
Yeah, I had heard about this problem and believe it too. I don't read I6(or T3) code very well, but I have had a good look at his RAP code. It didn't strike me as being very efficient, with a lot of duplicate code that runs in a roundabout way. After very little time studying the code I realized that it would have to be completely redone. All I took from Nate Cull's code are a couple of concepts and some naming conventions.
I don't mean any of this to be disparaging of his work, by the way, since it inspired me to do something similar. I just tried to make it more efficient and flexible.
Speaking of which, it may surprise you to find out that I already used the new RAP in my last game. I developed a version of it just as I was finishing [i]Escape from Ice Station Hippo[/i] and used it to control Findbot's behavior while he was acting independently. The amount of code needed was tiny and the overall increase in the final size of the game was negligible. This was because my RAP is made up of two parts. The first is the core of the extension, which shouldn't be modified but is very small and (I hope)efficient. The second part can be as small or large as needed, depending on how complex you need your characters behavior to be. What I really like is that you can drop the RAP into the middle of a game and have it control all or just some of your npc's behavior(easily). Therefore it made sense for me to include it in a game with a single character.
[quote="Roody_Yogurt"][b]Making the output prose pretty[/b]- Ideally, an extension would have several options on how the text is presented, like whether the player can be appraised of the actions of NPCs both in and out of scope, whether you can group the description of NPCs who share the same current action (so instead of "An archer aims at you. Another archer aims at you.", etc., it could be "A group of archers aim at you. Some barbarians run at you." or whatever), and whether you can, of course, randomize how certain actions are described (knowing your Hugo Clock code, I'd guess you have this one covered).[/quote]
This is a real problem but I like your suggestions. Adding switches which would tell it to not report certain actions or to group types of actions when a lot is going on might be the way to go. My RAP is in an early stage of development, so it's a good time to start considering these things.
I especial like what Emily Short had to say about it in the review you referenced above:
[quote="Emily Short's review"]
I think the solution probably involves representing all the actions that are going to occur in a given turn as data, then running some algorithms on that data to discard anything too ineffective to be worth reporting, cluster related actions together into compound sentences and related sentences into paragraphs, introduce variations of phrasing, etc. Which would be a massive undertaking to write, frankly, even after you have a fully functional set of RAP routines for your NPCs.
[/quote]
This is a brilliant idea and I think she's a bit too pessimistic about how hard it would be to pull off. It would be a lot of work, but it could be as simple as assigning values to character properties. I'll give an example:
There are three characters in a room with the player. The RAP determines that two of the characters want to move north and can legally do so, while the third character moves east. It doesn't move them yet, it just assigns a value to a predetermined property. The character property misc #2 could be used for moving, with 1 representing a move north, 2 east, 3 south, ect...Therefore, the first two characters misc #2 is assigned to 1 and the third is given a 2. After the rap has finished assigning all values, it then calls another set of routines. These determine what characters are acting that turn, which ones are acting within the scope of the player and what messages should be eliminated or grouped.
Thus you get:
[list]Tom and Dick move north. Harry moves east.[/list]
As opposed to:
[list]
Tom moves north.
Dick moves north.
Harry moves east.
[/list]
[quote="Roody_Yogurt"][b]Coming up with a good game idea for RAP[/b]- To be honest, I haven't heard of most of the games that use this system, and having opened "Battle", it's pretty easy for me to guess that most of them aren't especially entertaining. The idea is definitely a lofty goal, but I can imagine that coming up with the right game idea for it might be as hard as writing the extension itself.[/quote]
This is my biggest problem right now. I need to make a proper proof of concept game, but it's hard to avoid the zombie attack/rpg battle genre. I have a couple of fairly original ideas already, but they don't stray too far from the lots-of-npcs-wandering-around-attacking-each-other strain.
What doesn't bother me, though, is whether anyone will actually use it or not. I know that very few Inform and Tads users have made use of Nate Cull's RAP, so the prospects for anyone using mine are slim. I really don't mind, since I believe that the mere existence of a RAP for Hugo is just one more thing to make it a more attractive option for future IF authors, even if they have no plans to use it.
[quote="Roody_Yogurt"]I was thinking that, since the NPCs' motivation is re-calculated every turn, it especially lends itself to a simple-minded-enemy-games like zombie invasions where, for the most part, they only pursue what they see (you'd have to increase their scope [i]a bit[/i] more just to keep things interesting).[/quote]
All of your points are valid and I appreciate them, but you have to admit that this sort of game, done well, would be pretty cool :)
Anyway, Friday night I decided to write a small sample game to demonstrate where the project is at the moment. I meant to have it ready today but was diverted, so it should be ready tomorrow(Sunday). It isn't a full blown game; just a toy to be played with and hopefully fun too! I'll introduce it in a new thread. This one has gotten slightly off topic!
-lc