Author Topic: GUI: Production/Upgrade/Others Displayed in Seconds  (Read 2866 times)

ChupaReaper

  • Guest
GUI: Production/Upgrade/Others Displayed in Seconds
« on: 31 January 2011, 19:41:18 »
It would be nice if the tooltips for speeds in game could be displayed in seconds/minutes/hours.
So when choosing an upgrade rather than saying Upgrade Speed, state the time it takes to upgrade in seconds, I can't remember how long the time value is in seconds but assuming upgrade-time=300 means an upgrade takes 3 seconds to complete, rather than saying Upgrade Time/Speed 300, state that the upgrade will so 3secs.
« Last Edit: 3 February 2011, 17:45:12 by ChupaReaper »

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
One step ahead of you!!  :P
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Relatedly, how exactly does the speed work? I know that it varies based on the game speed, which is running at 40 world refreshes per second on normal speed, but how does this translate to actual time?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Relatedly, how exactly does the speed work? I know that it varies based on the game speed, which is running at 40 world refreshes per second on normal speed, but how does this translate to actual time?

time to build (/produce/morph/generate/whatever) in world frames =
   buildee.params.time / (builder.buildSkill.speed * 0.00025)

Then divide that by 40 (for normal game speed) to get the time in seconds.

This is a bit of interesting issue though, as these days GAE in single player games will drop frames at will, rather than racing to try to catch back up... so the displayed value may be something of an underestimate on slower machines, but that's life I guess.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

ChupaReaper

  • Guest
One step ahead of you!!  :P
Nice lol! Should be a rough estiamted based on some target framerate, if players can change the game speed then either display an estimate based on that or let the players assume it's goign to be faster due to faster game speed.
With upgrades, etc it could be ok if it went into miliseconds (1:02'43''23 = 1 hour, 2 minutes, 43 seconds and 23 miliseconds). Maybe some player options on how time is displayed, just "52 Seconds" would do if anything though.

Conzar

  • Guest
This is a bit of interesting issue though, as these days GAE in single player games will drop frames at will, rather than racing to try to catch back up...
So the single player GAE game is not deterministic?

Mark

  • Guest
Maybe it could just say the number of seconds, and after the number it would have a tiny icon of an hourglass.  Other games do that, too.

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
This is a bit of interesting issue though, as these days GAE in single player games will drop frames at will, rather than racing to try to catch back up...
So the single player GAE game is not deterministic?

It's deterministic... it just doesn't go into super-speed to try to "catch up", if a regular/mega-glest game only processes 20 world frames in a second, there will 20 more 'queued' up, and the game will go super-fast to try to catch up to where it should be. GAE doesn't do this (in single player).

Maybe it could just say the number of seconds, and after the number it would have a tiny icon of an hourglass.  Other games do that, too.

This sounds like a good idea, I don't really like the idea of saying 'seconds', because while that might be the reality, it's also not very realistic!
Glest Advanced Engine - Code Monkey

Timeline | Downloads

ChupaReaper

  • Guest
Yea, I like this hour glass idea, thing is what if some mega hard core long time game upgrades take huge amounts of time such as an hour? I doubt anyone would make this but with large games and the ability to save and load someone might.

Psychedelic_hands

  • Guest
Why not just have a world clock in twenty-four hour time? And then say how much it will take to research the upgrade.
I think they would be sleeker/fit the GUI better.

How long is a day ingame? I would think it would be 24 minutes?

Zoythrus

  • Guest
Re: Production/Upgrade/Casting/etc Speeds or Time, displayed in seconds.
« Reply #10 on: 3 February 2011, 15:59:37 »
Why not just have a world clock in twenty-four hour time? And then say how much it will take to research the upgrade.
I think they would be sleeker/fit the GUI better.

How long is a day ingame? I would think it would be 24 minutes?

this^

it'd be nice if the engine did the math for you

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Production/Upgrade/Casting/etc Speeds or Time, displayed in seconds.
« Reply #11 on: 4 February 2011, 01:46:29 »
Why not just have a world clock in twenty-four hour time? And then say how much it will take to research the upgrade.
I think they would be sleeker/fit the GUI better.

Two problems here, firstly the day length is pulled from the ini (should perhaps change this) and secondly during night time it is incremented at double the rate of daytime (should perhaps just change this too?)

Quote
How long is a day ingame? I would think it would be 24 minutes?

With the default settings, a 'time increment' is 0.024 (and this is applied once per 40 world frames (one second at normal game speed)), so assuming we remove the night time double increment, a game day will be 16 minutes and 40 seconds of real time (@normal-speed).

<math>
(0.024) * 60x = 24
x = 24 / (0.024 * 60)
x = 16.666....

</math>

With the night time double increment in place, the day length depends on the tileset (day/night ratio).

<math>
(0.024) * 60a = 24y
(0.048) * 60b = 24(1 - y)
x =  a + b

Where 'y' is the day ratio from the tileset.
</math>

Too much information ??  8)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: GUI: Production/Upgrade/Others Displayed in Seconds
« Reply #12 on: 4 February 2011, 04:54:18 »
I don't think Glest should have some other "day" ingame. I often found that confusing in other games (taking Oblivion for example, I'd have to bring up a dialogue to get the time of the day often, though you could "rest" without penalty to change the time easily). Regardless, Glest shouldn't use that, and as Silnarm mentioned, days are not of set length. For example, in Military, a day is 600 seconds, or 10 minutes, instead of 1000 seconds, or 16 minutes and 40 seconds (the reason for this is because 10 minutes is easier to keep track of than 1000 seconds / 16:40.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: GUI: Production/Upgrade/Others Displayed in Seconds
« Reply #13 on: 4 February 2011, 05:34:58 »
Considering a modder might eventually want to make a tileset where the nights are longer than the days (i.e. winter time) or a scenario that takes place entirely during the day, I think it's best to use IRL time-keeping for upgrades and whatnot.

Conzar

  • Guest
Re: GUI: Production/Upgrade/Others Displayed in Seconds
« Reply #14 on: 4 February 2011, 06:13:32 »
So is day/night determined in the tileset?  If so, how?

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: GUI: Production/Upgrade/Others Displayed in Seconds
« Reply #15 on: 4 February 2011, 06:22:09 »
Currently it's determined in tileset's main XML, I think.
For example:
Code: [Select]
<tileset>
...
<sun-light red="1" green="1" blue="1"/>
<moon-light red="0.3" green="0.3" blue="1"/>
[<day-night value="0.7"/>
<weather sun="0.99" rain="0.01" snow="0"/>
</parameters>
</tileset>

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: GUI: Production/Upgrade/Others Displayed in Seconds
« Reply #16 on: 4 February 2011, 19:05:56 »
In this case here, the day-night value is 0.7, which is our ratio out of a whole of 1. So day lasts 70% of the time, and night lasts 30%. This can be tweaked, of course, to fit the tileset. For example, a lower value (thus making the night longer) would be more realistic for winter based tilesets.

Unrelatedly, I wonder if setting it to 0 would make it always night and 1 would make it always day... (I would hope. It'd be really cool to try an always night tileset).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: GUI: Production/Upgrade/Others Displayed in Seconds
« Reply #17 on: 7 February 2011, 05:29:56 »
Unrelatedly, I wonder if setting it to 0 would make it always night and 1 would make it always day... (I would hope. It'd be really cool to try an always night tileset).

Interesting... my gut feeling is that the engine may well choke on this, or do wierd stuff at the least, will test it out and fix if there are any issues.
Glest Advanced Engine - Code Monkey

Timeline | Downloads