Thrive Game Development

Development of the evolution game Thrive.
 
HomeHome  PortalPortal  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log inLog in  
Welcome new and returning members!
If you're new, read around a bit before you post: the odds are we've already covered your suggestion.
If you want to join the development team, sign up and tell us why.
ADMIN is pleased to note that this marquee has finally been updated.
ADMIN reminds you that the Devblog is REQUIRED reading.
Currently: The Microbe Stage GUI is under heavy development
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Quick Links
Website
/r/thrive
GitHub
FAQs
Wiki
New Posts
Search
 
 

Display results as :
 
Rechercher Advanced Search
Statistics
We have 1675 registered users
The newest registered user is dejo123

Our users have posted a total of 30851 messages in 1411 subjects
Who is online?
In total there is 1 user online :: 0 Registered, 0 Hidden and 1 Guest

None

Most users ever online was 443 on Sun Mar 17, 2013 5:41 pm
Latest topics
» THIS FORUM IS NOW OBSOLETE
by NickTheNick Sat Sep 26, 2015 10:26 pm

» To all the people who come here looking for thrive.
by NickTheNick Sat Sep 26, 2015 10:22 pm

» Build Error Code::Blocks / CMake
by crovea Tue Jul 28, 2015 5:28 pm

» Hello! I can translate in japanese
by tjwhale Thu Jul 02, 2015 7:23 pm

» On Leave (Offline thread)
by NickTheNick Wed Jul 01, 2015 12:20 am

» Devblog #14: A Brave New Forum
by NickTheNick Mon Jun 29, 2015 4:49 am

» Application for Programmer
by crovea Fri Jun 26, 2015 11:14 am

» Re-Reapplication
by The Creator Thu Jun 25, 2015 10:57 pm

» Application (programming)
by crovea Tue Jun 23, 2015 8:00 am

» Achieving Sapience
by MitochondriaBox Sun Jun 21, 2015 7:03 pm

» Microbe Stage GDD
by tjwhale Sat Jun 20, 2015 3:44 pm

» Application for Programmer/ Theorist
by tjwhale Wed Jun 17, 2015 9:56 am

» Application for a 3D Modeler.
by Kaiju4u Wed Jun 10, 2015 11:16 am

» Translator to Serbian here
by Simeartherist Sun Jun 07, 2015 6:36 am

» Presentation
by Othithu Tue Jun 02, 2015 10:38 am

» Application of Sorts
by crovea Sun May 31, 2015 5:06 pm

» want to contribute
by Renzope Sun May 31, 2015 12:58 pm

» Music List Thread (Post New Themes Here)
by Oliveriver Thu May 28, 2015 1:06 pm

» Application: English-Spanish translator
by Renzope Tue May 26, 2015 1:53 pm

» Want to be promoter or project manager
by TheBudderBros Sun May 24, 2015 9:00 pm


Share | 
 

 Tech Object Construction

View previous topic View next topic Go down 
AuthorMessage
NickTheNick
Overall Team Co-Lead


Posts : 2312
Reputation : 175
Join date : 2012-07-22
Age : 20
Location : Canada

PostSubject: Tech Object Construction   Wed Aug 08, 2012 12:57 am

So, I was browsing through the forums and the current research web models and I noticed that many things are said to "give production" or to "increase happiness", but we have no numbers set for them.We dont have it set clear if 100 production is a lot or 1000. If we can model some equations as to the in game workings and effects of the values, we can start plugging in numbers and pinning down variables. Like a Sudoku puzzle, once we get a couple of numbers we can use those to get the rest.

An idea I had for an equation to determine construction time is as follows.

t = Time taken to construct (in seconds)
C = Total Construction Value
P = Production
V = Volume
r = Resource/Function Part Construction Value

R1, R2, R3 ... = Total Resource/Function Part Construction Value

First, you need to determine the total construction value of the TO. This variable represents the effort required to construct the TO. Obviously, a massive steel structure will take much more effort to construct than a canvas tent. Using this model, that will be simulated by the steel structure having a much greater construction value than the tent.

Here is the equation.

C = R1 + R2 + R3 ...

aka

The total construction value = Construction value of first resource/function part + construction value of second resource/function part + construction value of third resource/function part ...

But first we need to determine the construction value of all of its materials. Let's use a medieval hut for example. The two materials it is built of are clay and thatch. Clay has a Construction Value of 20, thatch a value of 10. To find the construction value for ALL the clay used in the house, you multiply the volume of clay by the construction value of the resource, and likewise for the thatch. Therefore, let's assume the hut is a perfect square, having four walls 0.1m thick, 3m tall, and 3m wide. That would result in each wall containing 0.9m3 of clay, and the entire house containing 3.6 m3. The construction value of all the clay in the house would be determined as follows. (R1 represents clay, the first resource/function part used in the structure)

R1 = Volume x Resource Construction Value

R1 = V x r

R1 = 3.6 x 20

R1 = 72

For the thatched roof, let's assume it is enough thatch to fill a 1x1x1 crate.

R2 = V x r

R2 = 1 x 10

R2 = 10

And, we cannot forget, the hut needs a door. Therefore, we add the Construction Value of whichever door you select from your list of TO's. Your door's construction value will be determined in the Tech Editor, once you design it. It will be based off of the resources that it is made of and the volume of each one. Resources (eg. wood, limestone, clay, iron) will all have their own construction values as part of their properties. (I do not know how resources work in the game).

So, the door is made of wood, and wood has a construction value of 20 as well. A wooden door with a volume of 0.2m3 will thus be have a construction value of 4. (The doorknob is not worth considering)

R3 = 20 x 0.2m3 = 4

Altogether, the clay (R1), thatch (R2), and door (R3), constitute the hut.

C = R1 + R2 + R3

C = 72 + 10 + 4

C = 86

Bam!

Now you have the construction value of a hut! This will be determined once you finish creating it in the tech editor, and when you select this TO from you list/panel of TO's to order the construction of it somewhere on the map, the construction value will be displayed.

Now there are two things to be determined.

1. What is the relationship between the Total Construction Value (C), and the Time taken to construct (t)?

I was thinking that C should just directly translate into t, meaning the hut would take 86 seconds to build. However, we could also modify the relationship to increase or decrease the median construction time of TO's.

2. How will you nation's production (P) affect or speed up the build time?

This I really have no idea. All I know is that it has to be modeled in a way that your production bonus cannot surpass the TO's construction value, because remember, production constantly increases with new technology. If the production surpassed the construction value, you could have insta-building, or even worse, negative construction values (would that mean it gets built before you even think of building it?). Suggestions?

NOTE: To increase or decrease the overall time taken for construction of buildings, another possible solution is to reduce the construction values of all resources.

*PHEW*

_________________
Look at how far we've come when people thought we'd get nowhere. Imagine how far we can go if we try to get somewhere.


Last edited by NickTheNick on Wed Dec 24, 2014 3:52 pm; edited 1 time in total
Back to top Go down
View user profile
Holomanga
Newcomer


Posts : 83
Reputation : 3
Join date : 2012-04-01
Age : 18
Location : Earth

PostSubject: Re: Tech Object Construction   Wed Aug 08, 2012 9:58 am

I have an idea for the construction bonus.

Basically, I think the construction bonus dropoff should use diminishing returns. I have maths!

Let t be the construction time of the TO and b be your construction bonus. The total construction time would then be 2^(-b/t) t. So for example, a construction time of 86 seconds and a bonus of 86 would make the total construction time 43 seconds, instead of 0 seconds as your idea results in.

The results are more extreme with higher bonuses. A bonus of 1000 results in a construction time of 0.027 seconds instead of -914 seconds.

Is that good?
Back to top Go down
View user profile
NickTheNick
Overall Team Co-Lead


Posts : 2312
Reputation : 175
Join date : 2012-07-22
Age : 20
Location : Canada

PostSubject: Re: Tech Object Construction   Wed Aug 08, 2012 11:31 am

As far as I see, it works great. Diminishing returns is exactly what I was looking for. Now, all we have to do is make sure that the production value of the player's nation should never exceed 1000, or else construction becomes unrealistically fast. Now we know to keep the player's production within a scale of 0 - 1000, and using that, we can start to assign numbers to the different production bonuses offered in game from policies, techs, and anything else.

However, the only thing I would criticise of your equation is that you should replace the variable b (construction bonus) with P (Production), because production IS construction bonus. If I had 120 production, that would equate to a construction bonus of 120. Your construction bonus is the value of your production, so the two should be synonymous. Therefore, the new equation would look like:

2^(-P/t) t

I must say though, your equation works quite well.

_________________
Look at how far we've come when people thought we'd get nowhere. Imagine how far we can go if we try to get somewhere.
Back to top Go down
View user profile
~sciocont
Overall Team Lead


Posts : 3406
Reputation : 138
Join date : 2010-07-06

PostSubject: Re: Tech Object Construction   Wed Aug 08, 2012 2:55 pm

This is really fantastic work, guys, I'm proud.

There is one problem with this that you couldn't be expected to know about. It's extremely difficult for a computer to determine the volume of an irregular solid. In fact, it's extremely difficult for anyone to determine the volume of an irregular solid without cheating and using displacement. This means that volume isn't going to be extremely accurate, since we'll have to break everything down into basic solid shapes to determine volume. It will mean that some TOs are going to have a deceptive cost to build, especially ones with more complex shapes.

_________________
Remember our goals: simplicity, science, and playability. Keep them in mind always.
[OE]|[FAQ]|[Wiki]|[My Blog]
Back to top Go down
View user profile
Holomanga
Newcomer


Posts : 83
Reputation : 3
Join date : 2012-04-01
Age : 18
Location : Earth

PostSubject: Re: Tech Object Construction   Wed Aug 08, 2012 3:10 pm

~sciocont wrote:
This is really fantastic work, guys, I'm proud.

There is one problem with this that you couldn't be expected to know about. It's extremely difficult for a computer to determine the volume of an irregular solid. In fact, it's extremely difficult for anyone to determine the volume of an irregular solid without cheating and using displacement. This means that volume isn't going to be extremely accurate, since we'll have to break everything down into basic solid shapes to determine volume. It will mean that some TOs are going to have a deceptive cost to build, especially ones with more complex shapes.

Algorithms exist to turn 3D models into voxels, so couldn't the game do that behind the scenes and then just count up the voxels to work out the volume?
Back to top Go down
View user profile
~sciocont
Overall Team Lead


Posts : 3406
Reputation : 138
Join date : 2010-07-06

PostSubject: Re: Tech Object Construction   Wed Aug 08, 2012 3:39 pm

Holomanga wrote:
~sciocont wrote:
This is really fantastic work, guys, I'm proud.

There is one problem with this that you couldn't be expected to know about. It's extremely difficult for a computer to determine the volume of an irregular solid. In fact, it's extremely difficult for anyone to determine the volume of an irregular solid without cheating and using displacement. This means that volume isn't going to be extremely accurate, since we'll have to break everything down into basic solid shapes to determine volume. It will mean that some TOs are going to have a deceptive cost to build, especially ones with more complex shapes.

Algorithms exist to turn 3D models into voxels, so couldn't the game do that behind the scenes and then just count up the voxels to work out the volume?
That's basically what it will do, except it will use preprogrammed primitives based on the shapes you make the to out of instead of all cubes. It's probably faster not to voxelize the entire thing, and just use the primitives that the shapes are most like.
Some volumes will be based on surface area, for things like sheet metal.

_________________
Remember our goals: simplicity, science, and playability. Keep them in mind always.
[OE]|[FAQ]|[Wiki]|[My Blog]
Back to top Go down
View user profile
Seregon
Regular


Posts : 263
Reputation : 37
Join date : 2011-08-10
Location : UK

PostSubject: Re: Tech Object Construction   Tue Aug 14, 2012 4:41 pm

This is looking really good, but there is one thing we need to deal with, which is how to deal with building multiple buildings/items.

The equation above effectively assigns all your production ability to a single building. This'd be fine if we only allowed the player to build one thing at a time (but if you've ever played the original command & conquer, or red alert, you'll know how annoying that can be), or if buildings were assigned to a queue and built one by one.

While a queue works, it's not realistic. When we build a city with a huge workforce, we don't expect skyscrapers to pop up one by one ever few minutes, instead they're built more slowly, but many at a time.

Which also brings me to a second problem: there's only so much production you can realistically assign to any one building. The whole of humanity couldn't build a skyscraper (or even a canvas tent) in under a minute, although we could build many at the same time, and effectively produce one per minute.

I have two questions then: How do we determine the maximum amount of production which can be assigned to a single creation? and How do we divide available production between multiple creations?

I don't have answers yet, but a few suggestions to start us off. Firstly, in an ideal scenario we only need to calculate these things once, when production starts. This makes things more preditable for the player, and less work for the cpu. This would mean having all the required materials ready before you begin work though (or perhaps pausing construction any time we have a deficit), so I'll explain an alternative later on...

If we can calculate the maximum amount of production we can assign to a single building, we actually solve the second issue, we simply assign as much as is available until theres none left. Or alternatively we can divide the total available production between all projects, weighted by the maximum they can take, so that each project gets the same proportion of its maximum production capacity.

For calculating this production capacity, we start by looking a the size of the project. Bigger projects can accomodate more labour, that much is straight forward. However, again we're looking at diminishing returns, you can't double the workforce on a building every time you double its size, sooner or later some of them will end up idle while waiting for someone else to finish what their doing. As a very simple starting point then, I suggest the following equation:

pc - production capacity of a project
C - production cost of a project

pc = ln(C)

where ln is the natural logarithm.

To build on this, and in keeping with your 'theme' of linking various bonuses to research, I'd suggest that the amount of labour you can efficiently assign to a project (i.e.: the production capacity) is increased. Early examples of this would be specialisation and the division of labour, more recently: the production line and mass production, then CAM (computer aided manufacture), 3d printing, and future techs allowing you to 'materialise' just about anything, though presumably for a huge energy cost. The equation then becomes:

cb - capacity factor, starts at 1 and increases with research

pc = ln(C/cb)

Now for the alternative. This again is based on what I'm working on with the compound system. It is more cpu intensive, possibly less intuitive for the player (who is used to games giving fixed production times for buildings), but more dynamic and realistic.

Rather than production time, we have a production cost and a production speed. The total time taken for production will be the cost divided by the average speed, but as the speed won't be constant this can't be predicted beforehand. Production speed depends on the amount of production available at the time (depending on other projects, and the maximum capacity as above), but also the availability of the resources needed to build the project. If those resources are scarce it becomes much harder to supply them to the project, and production will slow. I won't go into any more detail here, as I need to work out the details to this system for other applications in the compound system. I'm also leaning towards using the fixed production time model, but it's nice to know the options.
Back to top Go down
View user profile
NickTheNick
Overall Team Co-Lead


Posts : 2312
Reputation : 175
Join date : 2012-07-22
Age : 20
Location : Canada

PostSubject: Re: Tech Object Construction   Tue Aug 14, 2012 11:28 pm

Very good point...

Personally I'm leaning towards the first model you mentioned as well, but it is your choice which one you wish carried through.

Also, I think that if during construction there is a deficiency of resources, construction just halts until the condition is broken. A very simple trigger I would imagine from my Warcraft 3 World Editor triggering experience...

_________________
Look at how far we've come when people thought we'd get nowhere. Imagine how far we can go if we try to get somewhere.
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: Tech Object Construction   Today at 11:58 am

Back to top Go down
 
Tech Object Construction
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Thrive Game Development :: Development :: Design :: Gameplay Stages :: Society-
Jump to: