It is currently Tue Feb 25, 2020 10:49 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Research Time
PostPosted: Sun Jul 11, 2010 3:09 pm 
Offline
Moderator
Moderator
User avatar

Joined: Mon Mar 17, 2008 6:03 pm
Posts: 1130
Location: Denmark
Technologies.txt, found in Data1\Data\GameInit, contains information about all technologies – what nations can research them, what other technologies they require, what lab extension is necessary and, perhaps the most interesting part, the time it takes to research the technology.
This is what it looks like:
Code:
TECHNOLOGY  45
NAME "Solar engine"
NATIONS 1 1 0
REQUIRES 1  35
LAB  9
TIME 20

This is technology with identifier “45”, called “Solar Engine”. It is available to Americans and Arabians but not Russians and requires one other technology: Technology number 35 (which is “Solar Power”). It must be researched in lab extension number 9 which is the basic lab (btype “b_lab_basic”).
Now what about “TIME”? What does 20 refer to?

The value after “TIME” is a “technology-research-time modifier” which makes it harder to research the technology. Before we can comprehend how this works, we must study the research mechanism.
As with so much else in OW scientists research in “batches”; that is they research a bit of the technology every certain interval of time. The interval of time is constant: 25 ticks. The amount of research done every 25 ticks depends both on the scientists skill and the technology-research-time modifier.
The values below show how great a “part” a scientist with skill 0 to 10 researches per 25 ticks of a technology with technology-research-time modifier = 1. The “part” is determined using function “GetTechProgress” – a technology fully researched has a tech-progress of 250,000 if you ask this function.
Code:
Level 0: 25,000 per 25 ticks
Level 1: 30,000 per 25 ticks
Level 2: 35,000 per 25 ticks
Level 3: 40,000 per 25 ticks
Level 4: 45,000 per 25 ticks
Level 5: 55,000 per 25 ticks
Level 6: 65,000 per 25 ticks
Level 7: 75,000 per 25 ticks
Level 8: 85,000 per 25 ticks
Level 9: 100,000 per 25 ticks
Level 10: 115,000 per 25 ticks

A mathematical eye quickly spots the logic in these numbers: They are linear in certain intervals. From level 0 to level 4 the “research part” per 25 ticks raises with 5,000 per level. From 4 to 8 it raises with 10,000 per level. And from 8 to 10 it raises with 15,000 per level.
This gives us the following functions to calculate the “research part” per 25 ticks for any level:
Code:
P = “research part”
L = level in skill_scientistic (integer, 0 <= L <= 10)

For 0 <= L <= 4
P = 25,000 + L * 5,000

For 4 < L <= 8
P = 55,000 + (L – 5) * 10,000

For 8 < L <= 10
P = 100,000 + (L – 9) * 15,000

Now for the technology-research-time modifier: The real “research part” is found by dividing the “research part” found through these function with the technology-research-time modifier. That simple!
So our functions for calculating the real “research part” are as follows:
Code:
RP = real “research part”
L = level in skill_scientistic (integer, 0 <= L <= 10)
TRT = technology-research-time modifier

For 0 <= L <= 4
P = (25,000 + L * 5,000) / TRT

For 4 < L <= 8
P = (55,000 + (L – 5) * 10,000) / TRT

For 8 < L <= 10
P = (100,000 + (L – 9) * 15,000) / TRT

If there are multiple scientists working in the lab at the same time, their real ”research parts” are simply added together.
So let’s say we have three scientists in the lab with skills 2, 8 and, 9 in skill_scientistic. They are researching the Solar Engine technology, so the real “research part” researched every 25 ticks will be:
Code:
(25,000 + 2 * 5,000) / 20 + (55,000 + (8 – 5) * 10,000) / 20 + (100,000 + (9 – 9) * 15,000) / 20 =
1750 + 4250 + 5000 =
11,000

How long will it then take to finish researching the technology (assuming none of the scientists level up while researching the technology)? Well, every 25 ticks they research 11,000 and when they reach 250,000 they are done, so it would take
Code:
(250,000 / 11,000) * 25 = 568,182 ticks -> 569 ticks

For the curious: That’s 16,25 seconds (35 ticks = 1 second).

_________________
I have an if that has an else, but that if has another if with an else inside... My question is... If an if has an else, if there is more than one line in that if, should it have a begin and an end?


Top
 Profile  
 
 Post subject: Re: Research Time
PostPosted: Sun Jul 11, 2010 3:41 pm 
Offline
Soldier level 4
Soldier level 4
User avatar

Joined: Wed Nov 01, 2006 2:04 pm
Posts: 392
Location: Poland, Wrocław
Awesome :shock: .

Did you measure it all by yourself?


Top
 Profile  
 
 Post subject: Re: Research Time
PostPosted: Sun Jul 11, 2010 6:13 pm 
Offline
Original-War.Net Owner
Original-War.Net Owner
User avatar

Joined: Wed Jan 25, 2006 10:21 am
Posts: 2786
Location: Poland, Białystok
Gwrhkhsh wrote:
Awesome :shock: .

Did you measure it all by yourself?

It's not so hard to measure it if you have editor.


Top
 Profile  
 
 Post subject: Re: Research Time
PostPosted: Sun Jul 11, 2010 8:00 pm 
Offline
Moderator
Moderator
User avatar

Joined: Mon Mar 17, 2008 6:03 pm
Posts: 1130
Location: Denmark
It's not the measurements that's the problem - it's actually the booring part where you simple collect data. The tricky part is finding the pattern in the data :P

_________________
I have an if that has an else, but that if has another if with an else inside... My question is... If an if has an else, if there is more than one line in that if, should it have a begin and an end?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Original War is an RTS / RPG game by Altar Games
Original War Support is not part of Altar Games but is maintaining Original War for Altar Games

Privacy Policy