Code center > Darwinbots Program Source Code

Bots' code

<< < (2/5) > >>

Botsareus:
Ah, well because of the new placment control the settings are NOT backword compateble... So...

To load settings just:


--- Quote ---'even? the stuff by bau
 '   For t = 0 To maxsp
  '  If Not EOF(1) Then Input #1, specie(t).PosCi 'Circuler Plasment
  '  If Not EOF(1) Then Input #1, specie(t).PosRe 'Regenerate with defult position
  '  Next
--- End quote ---

then after they load resave them again... and uncomment.
Note this WILL make the settings unusable for Non-Bau virsions.

***The Program still loads the defult.set fine, so It won't crash on you if you are constructing settings from scratch*** ***If you are wondering why autosave is completely %$%# , it is really not, I simply modified it to evolve first bot, and dont worry about "Good Factor" thats also part of the prosses***

Botsareus:
The following apply to data that can be any length, and there is no way to tell. (I hope you will get what I am talking about)

Num, from now on we make the program check what exactly is in the settings file , each "part" should have markers (incoded rubble that indicates what the settings file does or does not have.).

And this should happen if the settings file does not have any markers at all prompt: "Is it ok to convirt your old settings file into a newer settings file?"
Then if no , read it as the old one.

And this should happen if the settings file does have any new markers. prompt: "Is it ok to convirt your old settings file into a newer settings file?"
Then if no , read it as the settings file with the markers it has.

This way If we get a settings file with some new data missing, or we run a new settings file on a old virsion , we wont get any problems because the program will search for the markers before reading the settings.

The only problem is how to make it search? and then change the "get..." position.
Looks like we are going to load the whole think binary and then opperate on it, unless you know some commands I dont.

And the marker stuff must only apply to the new stuff because the old stuff must still work in the old DB pre 2.3 Db...

(although now that I think about it all above is not really nessisary If I just would of coded my stuff to the end of the file  :banghead: )

Numsgil:
You know, if you had just put your robot placement code a few lines lower in the settings files, it would have been backward compatible.  With 2.37 anyway.

All new features are added at the bottom of the settings files.  Older programs just don't read that far, and newer programs check to see if it's at the end of file early.  If it is, it stops reading.

They're both forwards and backwards compatible, more or less.

Griz:

--- Quote ---They're both forwards and backwards compatible, more or less.
--- End quote ---
is that anything like being sorta pregnant? ;)

Numsgil:
Exactly.

In theory they should all work with each other.  In practice they never do.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version