Защо старите игри стават твърде бързи на съвременните компютри?

Съдържание:

Защо старите игри стават твърде бързи на съвременните компютри?
Защо старите игри стават твърде бързи на съвременните компютри?

Видео: Защо старите игри стават твърде бързи на съвременните компютри?

Видео: Защо старите игри стават твърде бързи на съвременните компютри?
Видео: Building Apps for Mobile, Gaming, IoT, and more using AWS DynamoDB by Rick Houlihan - YouTube 2024, Април
Anonim
Image
Image

Ако някога сте се опитвали да получите реколта компютърна игра на модерна система, вероятно сте шокирани от това какбърз играта свърши. Защо старите игри са извън контрола на модерния хардуер?

По-рано днес ви показахме как да стартирате по-стар софтуер на съвременни компютри; днешната сесия за въпроси и отговори е хубав комплимент, който разкрива защо някои по-стари софтуер (по-специално игри) никога не изглежда да работят правилно, когато се опитате да ги пуснете на модерен хардуер.

Днешната сесия за въпроси и отговори ни идва с любезното съдействие на SuperUser - подразделение на Stack Exchange - обединяване на уеб сайтове с въпроси и отговори.

Въпроса

Reader на SuperUser TreyK иска да разбере защо старите компютърни игри се побъркат бързо на нов хардуер:

I’ve got a few old programs I pulled off an early 90s-era Windows computer and tried to run them on a relatively modern computer. Interestingly enough, they ran at a blazing fast speed – no, not the 60 frames per second kind of fast, rather the oh-my-god-the-character-is-walking-at-the-speed-of-sound kind of fast. I would press an arrow key and the character’s sprite would zip across the screen much faster than normal. Time progression in the game was happening much faster than it should. There are even programs made to slow down your CPU so that these games are actually playable.

I’ve heard that this is related to the game depending on CPU cycles, or something like that. My questions are:

  • Why do older games do this, and how did they get away with it?
  • How do newer games not do this and run independently of the CPU frequency?

И така, каква е историята? Защо точно спратовете в старите игри пламват по екрана толкова бързо, че играта става неподлежаща на игра?

Отговорът

Сътрудникът на SuperUser JourneymanGeek го разбива:

I believe they assumed the system clock would run at a specific rate, and tied in their internal timers to that clock rate. Most of these games probably ran on DOS, and were real mode (with complete, direct hardware access) and assumed you were running a iirc 4.77 MHz system for PCs and whatever standard processor that model ran for other systems like the Amiga.

They also took clever shortcuts based on those assumptions including saving a tiny bit of resources by not writing internal timing loops inside the program. They also took up as much processor power as they could – which was a decent idea in the days of slow, often passively cooled chips!

Initially one way to get around differing processor speed was the good old Turbo button (which slowed your system down). Modern applications are in protected mode and the OS tends to manage resources – they wouldn’t allow a DOS application (which is running in NTVDM on a 32-bit system anyway) to use up all of the processor in many cases. In short, OSes have gotten smarter, as have APIs.

Heavily based off this guide on Oldskool PC where logic and memory failed me – it’s a great read, and probably goes more in depth into the “why”.

Stuff like CPUkiller use up as many resources as possible to “slow” down your system, which is inefficient. You’d be better off using DOSBox to manage the clock speed your application sees.

Ако сте любопитни за това как действителният код е бил приложен в ранните компютърни игри (и защо се адаптират толкова зле към съвременните системи, без да са саксирани в някаква програма за емулация), бихме ви препоръчали да проверите тази продължителна, но интересна разбивка на процес в друг отговор на SuperUser.

Имате ли нещо, което да добавите към обяснението? Звучи в коментарите. Искате ли да прочетете повече отговори от други потребители на Stack Exchange? Вижте цялата тема на дискусията тук.

Препоръчано: