Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: jsj795 on November 10, 2009, 06:54:23 pm

Title: Events detection
Post by: jsj795 on November 10, 2009, 06:54:23 pm
While coding TLM, I have problem trying to make events detection, like running into NPC and they start talking, running into door and they open, etc... I use matrix, but the thing is that if there's a lot of events going on, there's too much memory consumption. Like, the NPC has to talk about the quest when it's appropriate, and when you go into the door, it must get to right house, etc. How would you do that???
Title: Re: Events detection
Post by: Builderboy on November 10, 2009, 06:57:49 pm
If you are worried about speed, it is helpfull to sort all tile numbers by event or non event, so that all event tiles are larger than a # and all other tiles are less.  Then it is easy to check whether or not there is an event.  After that, you can jump to a seperate piece of code where you determine what event needs to be executed. 

The concept behind this is that we are adding speed to the main engine by taking it from other portions of the program where it is less important.

...unless that isn't what you wanted?
Title: Re: Events detection
Post by: jsj795 on November 10, 2009, 07:18:42 pm
Well, I'm not that worried about speed, and that's what I'm doing. It's just the huge amount of memory needed to see what kind of things need to be executed, like one of the opening thing is to get to the city. When you get to the gate, the guard says that the gate is closed because it's too late. So you worry about where to sleep, and then the door pops up where there once was a tree and you can get into there, which is a cave. Since the maps and matrix are hard-cored, how do I go changing matrix in smallest memory possible? There will be too many events to check up and change individual matrix number, since this will be pretty large game. T.T