Nightinggale
Deity
- Joined
- Feb 2, 2009
- Messages
- 5,284
Ok I committed the allowed yield cache. I implemented it in some locations where we benefit from it. I skipped a number of locations as implementations there wasn't strait forward. On the other hand I added a number of TODO around the code (you do know that VC++ can make an interactive TODO list based on TODO keyword in comments, right?).
I added player.canUseYield(eYield) to python interface, though I didn't touch any python code and as such it isn't used yet. I figure it could be useful in the future.
The return value is simple. True mean the civ can use the yield here and now (invented or started with it) while false means it has yet to be invented. Also now that we use one function to calculate this, we will either get a bug everywhere or not at all. If a bug is everywhere, then we are more likely to discover it. Do use this function whereever it appears useful instead of reinventing the calculations.
I removed all hardcoded reference to yields when it comes to inventions. Now inventions vs yields are 100% controlled from XML.
I spotted bIsMustBeDiscovered in yield XML. I think that's a bad design decision. I propose that we remove it and instead set it to false for all yields at startup. At the end of XML load we then loop all inventions and set bIsMustBeDiscovered to true for all yields, which is enabled by at least one invention. That way invention and yield XML settings can't get out of sync as it will be controlled by inventions only. One less location to mess up.
It gives me a blue screen with white numbers each time I turn it on
There is actually a rather interesting story about the early floppy drives. A company developed a small version of the 8" main frame floppy for home users and went to expos and stuff with it, though nobody really paid it any attention. One day they had a bum in the lobby and one of the developers were assigned the task of getting rid of him. It turned out to be a real bum/hippie, with worn out cloth with holes in it, haven't washed himself in ages etc. That bum stood up and said "I have a business preposition for you". It turned out to be Steve Jobs and Steve & Steve at Apple Computer had figured out that if you insert a disk and do not remove it, you can easily read any part of it whenever you wanted. This meant that if you filled the disk with the application and instead of loading all at once, you loaded it when you need to, you would be able to have an application so complex that it wouldn't fit in memory. In other words with some clever coding applications could become 10 times as big. Basically they wanted to use the floppy as a system HD, but this is before the HD. They wanted two drives where the other one should be... well basically the user home dir. People could then have access to everything at once and they could replace disks to switch user or system. At that time one system was one application. No big deal today, but in a world with tapes this was visionary. The only real demand was that each drive should be lowered to $100. (from 125 or 150 or something like that).
It must have caused havoc at Commodore when Apple released their floppy drive computer in 1984. Commodore 64 is from '83 and didn't have a floppy. They made an external one for it, but it was ridiculously pricy. Still it was production costs and not profit which made it that pricy. The problem was that they never considered any other data storage than floppy when they designed the Commodore 64. Adding one after it's produced and is already at home with the customers was a huge challenge. They ended up building a drive and then set a computer together with it. The commodore 64 could then access that computer though a serial network cable. It worked rather well, but the extra computer was expensive. On the other hand you could daisy chain the drives and add multiple to one computer.
I added player.canUseYield(eYield) to python interface, though I didn't touch any python code and as such it isn't used yet. I figure it could be useful in the future.
The return value is simple. True mean the civ can use the yield here and now (invented or started with it) while false means it has yet to be invented. Also now that we use one function to calculate this, we will either get a bug everywhere or not at all. If a bug is everywhere, then we are more likely to discover it. Do use this function whereever it appears useful instead of reinventing the calculations.
I removed all hardcoded reference to yields when it comes to inventions. Now inventions vs yields are 100% controlled from XML.
I spotted bIsMustBeDiscovered in yield XML. I think that's a bad design decision. I propose that we remove it and instead set it to false for all yields at startup. At the end of XML load we then loop all inventions and set bIsMustBeDiscovered to true for all yields, which is enabled by at least one invention. That way invention and yield XML settings can't get out of sync as it will be controlled by inventions only. One less location to mess up.
I have a Commodore 64 in the closet with both tape and floppy driveAh those were the days In one of my first schools as a child they had an ancient Commodore PET gathering dust in the back. It had a cassette tape drive, where you had to physically press Play and then type >LOAD DUNGEON or whatever.
Come to think of it, it booted almost 20 times faster than Windows 8
It gives me a blue screen with white numbers each time I turn it on
There is actually a rather interesting story about the early floppy drives. A company developed a small version of the 8" main frame floppy for home users and went to expos and stuff with it, though nobody really paid it any attention. One day they had a bum in the lobby and one of the developers were assigned the task of getting rid of him. It turned out to be a real bum/hippie, with worn out cloth with holes in it, haven't washed himself in ages etc. That bum stood up and said "I have a business preposition for you". It turned out to be Steve Jobs and Steve & Steve at Apple Computer had figured out that if you insert a disk and do not remove it, you can easily read any part of it whenever you wanted. This meant that if you filled the disk with the application and instead of loading all at once, you loaded it when you need to, you would be able to have an application so complex that it wouldn't fit in memory. In other words with some clever coding applications could become 10 times as big. Basically they wanted to use the floppy as a system HD, but this is before the HD. They wanted two drives where the other one should be... well basically the user home dir. People could then have access to everything at once and they could replace disks to switch user or system. At that time one system was one application. No big deal today, but in a world with tapes this was visionary. The only real demand was that each drive should be lowered to $100. (from 125 or 150 or something like that).
It must have caused havoc at Commodore when Apple released their floppy drive computer in 1984. Commodore 64 is from '83 and didn't have a floppy. They made an external one for it, but it was ridiculously pricy. Still it was production costs and not profit which made it that pricy. The problem was that they never considered any other data storage than floppy when they designed the Commodore 64. Adding one after it's produced and is already at home with the customers was a huge challenge. They ended up building a drive and then set a computer together with it. The commodore 64 could then access that computer though a serial network cable. It worked rather well, but the extra computer was expensive. On the other hand you could daisy chain the drives and add multiple to one computer.