Darwinbots Forum

Code center => Bugs and fixes => Confirmed & Outstanding bugs => Topic started by: Testlund on January 26, 2014, 07:33:57 PM

Title: Weird teleporter problem.
Post by: Testlund on January 26, 2014, 07:33:57 PM
I've tested this several times over tonight. In 1 out of 3 sims the bots that get teleported out through the outbound teleporter never comes back in through the inbound teleporter.

Can anybody else confirm this. This doesn't make any sense! First I thought it was because I was running two instances in the same DB folder with Safe Mode turned on, but it doesn't seem to have anything to do with that.
Title: Re: Weird teleporter problem.
Post by: Testlund on January 26, 2014, 08:56:41 PM
So I've been doing this for about two hours now. This is what it looked like in my last try. I've typed the folder paths I'm using for the teleporters. The bots teleports as they should at the left side but not at the right side as the picture shows. Sometimes none of the teleporters work. The program seem to decide whether it should work or not when I start a new sim with new teleporters!
Title: Re: Weird teleporter problem.
Post by: Testlund on January 26, 2014, 09:17:02 PM
It gets weirder! I just dragged one of the bots that had come in through the inbound teleporter to the left in the lower instance, over to the outbound teleporter at the right side and THAT ONE got through. But the other bots swarming around it doesn't get teleported!

The teleporter is counting them all, but they just disappear. They don't even show up in the folder!
Title: Re: Weird teleporter problem.
Post by: Botsareus on January 27, 2014, 11:09:49 AM
I never setup teleporters actually, other then IM.
Some questions:

Do I need two instances of DarwinBots?
What values am I supposed to set for the teleporters?
Also, can you give me the settings file (lastran.set) and the robots you are using, (do not include the mrates)?
 :thinkey: Are you sure you have teleport vegys enabled or else trying to teleport vegys (just an idea)?
Title: Re: Weird teleporter problem.
Post by: Testlund on January 27, 2014, 12:43:30 PM
I don't think this is specific to any settings. It should be enough to just have two instances of Darwinbots and have them connected via teleporters like the picture shows. One folder for teleporting in one direction and another folder for teleporting in the other direction.

So I'm wondering if you could just check this out quickly if teleporting works. If it works for you then maybe there is some tiny thing I'm doing that cause this. But what I've seen so far this seem to be completely random.

I'll experiment with this some more and if it might be depending on some settings after all I should discover it myself. I'll upload some files for you later.
Title: Re: Weird teleporter problem.
Post by: Testlund on January 27, 2014, 02:31:42 PM
Alright, follow these steps:

1. Delete all files that DB creates the first time it is run to make sure you start out clean and to replicate this procedure properly.

2. Put my global.set file, robot files and sim files in the proper directories.

3. Start one instance of Darwinbots, press pause and load the sim named A.sim.

4. Start another instance of Darwinbots, press pause and load the sim named B.sim.

5. Put these two instances next to each other, for example like the picture shows and press play on both instances.

6. You need of course set your own paths for your teleporters. One folder for bots to go from sim A to B and another folder for bots to go from sim B to A like the picture shows.

7. Just run these sims and see what happens. Bots may or may not teleport correctly. The result may differ from each time you start the sims! You may have to close and open the instances again before you load and start the sims to get a different result.

Sometimes I get an error message that says "File already open and that the bot is not a valid bot." This is also a new phenomenon. I had my antimalware software turned off when I tested this so there shouldn't be anything outside of Darwinbots that could access the files. If I just close those dialogs the sims continue to run.

So I've been repeating the process several times but now it has decided to work fine everytime!
Title: Re: Weird teleporter problem.
Post by: Testlund on January 27, 2014, 03:39:37 PM
Now I've been trying the above mentioned steps on my laptop with Win XP. After several failures I finally got the teleporting to work. Only difference was that I got the dialog boxes popping up several times that the files were already in use. After clicking away those the teleporting started to work without any more issues. I had antimalware software turned off there too. I think DB sometimes has problems with file access when using teleporters.
Title: Re: Weird teleporter problem.
Post by: Botsareus on January 27, 2014, 04:56:03 PM
ok, thank you for more info, I'll test this further when I have time, but I am putting this on reasonably lower priority at the moment as you demonstrated a work around.

I am assuming it (works) under any settings and any robots...
Title: Re: Weird teleporter problem.
Post by: Testlund on January 27, 2014, 05:01:12 PM
Yes, you can can put it on lower priority. This is definitely a bug though. I just tested version Darwin2.46Beta.exe and it works perfect. I'm trying a workaround. Maybe if I load and save the sims in this version first and then load them in version Darwin2.46.02BetaD.exe I might be able to get it to work.  :P
Title: Re: Weird teleporter problem.
Post by: Botsareus on January 27, 2014, 05:20:46 PM
Really? It is that resent? Ok I'll play with it tomorrow, what could have changed between Beta and version D that will cause this?  :blink:
Title: Re: Weird teleporter problem.
Post by: Testlund on January 27, 2014, 06:31:55 PM
Yeah, it's strange cause you haven't mentioned doing anything with the teleporters in the latest drops.

My workaround only worked once when I loaded the sims. Then I tried to switch on the new mutation features and restart the sims and the problem was back. Maybe there is new data that DB can't transfer properly through the teleporters.
Title: Re: Weird teleporter problem.
Post by: Botsareus on January 28, 2014, 01:58:28 PM
The teleporters are plain buggy. Try running your sim again but start with 130 robots. That seems to fix it. There will never be a sim that just has a fixed number of robots, so I don't see a big issue here.

The logic to save a simulation is used for teleporting robots as well, the simulations seems to save fine, therefor I know I have not introduced a broken feature here.

There is a secondary problem here with loading an existing sim file though, but it seems to resolve itself in most cases as well. I recommend however, not to load existing simulations while running teleporters.

I must have edited this post atleast 5 times, sorry for the confusion.

Attached is a working version of the experiment described by Testlund above.
Title: Re: Weird teleporter problem.
Post by: Testlund on January 28, 2014, 04:26:10 PM
Yes, this worked right away! A good template for teleporters I think. Thanks!   :)
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 02, 2014, 01:14:32 PM
Quote
There is a secondary problem here with loading an existing sim file though, but it seems to resolve itself in most cases as well. I recommend however, not to load existing simulations while running teleporters.

This is that error 55 stuff again.

 :thinkey: Can the autosave routine interfere with robot teleoporting? I think I may have something here.
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 02, 2014, 01:44:59 PM
I have assigned unique file numbers to save and load organism. I also disabled the autosave timer if simulation saving is in progress.
Play with this tell me if it works.
Title: Re: Weird teleporter problem.
Post by: Testlund on February 02, 2014, 02:22:55 PM
I was just going to upload a zip here where I caught this error in Safe Mode. Whenever I try to restart DB after that I keep getting "Invalid procedure call or argument". I'll try this drop first and see if it solves anything.
Title: Re: Weird teleporter problem.
Post by: Testlund on February 02, 2014, 02:49:39 PM
I'm afraid this drop didn't work. It gave me this:
Title: Re: Weird teleporter problem.
Post by: Testlund on February 02, 2014, 02:53:02 PM
Here is the zip file. I decided to zip the whole DB folder. I know that's not what you want but I'm thinking the folder structure is important to see how this problem relates to the teleporters. Just double-click the DB exe file in the "Instance A" folder and you should get an "Invalid procedure call or argument".

The picture shows the error when it occured in Instance A.
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 02, 2014, 04:26:51 PM
I will have to revert them changes then. But not today. I am going to go watch the super ball.
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 02, 2014, 04:51:40 PM
Ahm, Testlund Ignore most of your PMs on this topic. ' File already open' is a very ambiguous error message. Here is what it actually means:

Code: [Select]
Open "C:\Users\Owner\Desktop\ok.snp" For Output As #1
Open "C:\Users\Owner\Desktop\yo.txt" For Output As #1 'This is the only way apparently to cause "file already open"
Close #1
Close #1

This basically means I am using the same file number for more then one file (as I thought) What I do not know is why my current mod was a complete fail or even if it has to do with the seeding system I started development on.

It is a good thing that you gave me the whole damn DB folder, it gives me things to work with.
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 04, 2014, 01:18:39 PM
Ok,

1.) The new tag component I added brakes reverse compatibility, I totally forgot to check for a continue code, lol.
2.) I had to move the saving loading label termination code so it encapsulates the whole routine.
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 04, 2014, 01:44:46 PM
Here it is, apparently the test first philosophy has not helped my sloppiness much, If you see any more problems I'll set up a long term and try to catch it. I have your DB directory I can base my experiment off that.
Title: Re: Weird teleporter problem.
Post by: Testlund on February 05, 2014, 07:10:48 AM
OK, I will put this to the test. I'll let you know later.  :)
Title: Re: Weird teleporter problem.
Post by: Testlund on February 05, 2014, 07:36:38 AM
20 minutes later...  :P

You should be able to reproduce this by just loading "A.sim" and "B.sim" and wait until a bot enters a red teleporter.
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 05, 2014, 02:44:34 PM
That is a different error then you had before, I am on the right track.  :P
Spent the day cleaning up the league engine, more Friday.
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 07, 2014, 12:47:56 PM
Once I figured out that you can only use file numbers in the range of 1 trough 511 (how quaint) I got the save organism code to work.
Now I only need to figure out why load organism still does not work.
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 07, 2014, 01:08:57 PM
Testlund, I have faith in this drop  :D
Don't mind that the option tabs open up weird, I will reset them later.
Title: Re: Weird teleporter problem.
Post by: Testlund on February 07, 2014, 02:21:16 PM
This looks like it might be the real deal; the fix that will take DB to it's alpha state, after 10 years of development. The bots goes through the teleporters as they should.

I'll run this sim through the weekend. Then I'll start a new sim and see how that works. So far this teleporter problem has been very random, so it might take a few tests to be sure.
Title: Re: Weird teleporter problem.
Post by: Testlund on February 10, 2014, 11:03:04 AM
The problem is still there. Have you tried to run these sims with all the mutation features enabled? The ones you got from me had these features disabled. I still think this has something to do with the likelyhood of this bug to manifest itself.
Title: Re: Weird teleporter problem.
Post by: Testlund on February 10, 2014, 11:50:50 AM
So if I understand this right there were two things that caused problems with the teleporters. The one that I think you fixed with version Darwin2.46.02BetaH that involved file names/access.

The other seem to involve what's being written into the bot files. It looks now like it's the "Epigenetic Reset" and "Normalize default mutation rates..." on the Mutations tab in "Global Settings" that makes the teleporters unable to teleport. The bots just goes in and disappears.
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 11, 2014, 11:38:40 AM
edit: Let me refraze this:

As soon us the advanced mutations are enabled the teleporters completely stop working?

another edit:

Do I have to use a specific robot?

I want to get to this some time Wednesday.



Quote
I think you fixed with version Darwin2.46.02BetaH that involved file names/access.

 :Party6:  :)
Title: Re: Weird teleporter problem.
Post by: Testlund on February 11, 2014, 07:25:16 PM
No, you go into the Global Settings tab and put checkmarks in all the boxes on the mutations tab, then you have to click start/change and then quit DB for those settings to take affect.

Next time you start DB you start new sims with A and B instances like before, but you will now run with the new mutation features.

I've doing tests where I started off with your template as I call it, then I've added stuff/settings a few at a time to figure out where the teleporter problems begins.

So far I seem to have narrowed it down to be the "Epigenetic Reset" and/or "Normalize default mutation rates..." to be what's messing up the teleporting.

We're getting closer! It's getting hot!  :D
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 12, 2014, 11:40:03 AM
Sounds like any robot will suffice to me. I will set one up with 'TheOne'

edit: I will also try it with

Code: [Select]
0
0
0
0
0
0
0
0

If I can not get theone to fail. That is the smallest zero bot I have ever seen!
Title: Re: Weird teleporter problem.
Post by: Testlund on February 12, 2014, 04:38:13 PM
Yes, the kind of bot shouldn't matter in this case. For my bots and settings I have a weakness for 8 bit increments (actually I favor the number 32 and like to go from there). Just something I like to use which I don't think matters much. I use this for music projects too as a starting point.  :P

I think this teleporter bug is the nastiest I've seen so far in DB. Very hard to track what the exact cause is. I'm just telling you what appears to me to be the most likely cause of the bug; some new data is being put into the bot files that the teleporter program don't understand. So something hits a red teleporter and the teleporter goes like "what the hell is this?"

Right now I'm running two instances with the two (what I think) culprits unchecked and it runs fine.
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 13, 2014, 06:22:42 PM
I have decided to adapt Numsgils naming convention, any revision will now have the last two digits change instead of "betaA" "betaB" etc.
Any major improvement in functionality will have the second set of digits change such as "2.47" instead of "2.46" The next big one will be called 2.47
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 18, 2014, 10:59:12 AM
Ok, the overall speed and stability has been improved.
Title: Re: Weird teleporter problem.
Post by: Testlund on February 20, 2014, 08:23:49 AM
The problem is still there. If I have the two features I've mentioned above selected bots can't teleport.

Personally I don't mind. I don't think I will be using them in my own sims, cause I don't even know what they do. I've just been testing them to see if they work.
Title: Re: Weird teleporter problem.
Post by: Peter on February 20, 2014, 04:20:43 PM
I suspect the organism validation looks at something it doesn't recognize. You might throw in a popup if a organism is misformed and look what it does.

Also, it could happen that DB1 loads the file while DB2 saves it and deletes it upon wrong validation. I don't think it'll be as much as 1/3 losses, but can account for some bots. More likely to happen with more cycles/second as directories are at default accessed every 10 cycles.
Title: Re: Weird teleporter problem.
Post by: Botsareus on February 21, 2014, 04:39:15 PM
I found a very rear accruing error and fixed it. It indeed had to do with 'normalize default mutation rates' It did not happen all the time because of how DB instantiates a new robot. Anyway, try this drop and let me know if it works now.

Just found another related bug, now with sunbelt mutations disabled a robot that is being transferred from such a simulation to one where the stuff is enabled will have zero for these values. This does mean however that if you load a simulation that is pre 2.46.05 the sunbelt mutations will be automatically disabled for all robots.