Welcome, Guest

Author Topic: Coding  (Read 261923 times)

Gordon Freeman

  • *****
  • Posts: 480
Re: Coding
« Reply #450 on: December 07, 2014, 08:03:37 AM »
All other music is in-game music. It makes me want to understand this.

atomic7732

  • Global Moderator
  • *****
  • Posts: 3848
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #451 on: December 07, 2014, 11:52:06 AM »
What I ran overnight...



Now I'm trying it without coriolis as kip suggested to see if that has any affect on the corruption



compare with (from yesterday)



and a higher resolution:



???
« Last Edit: December 07, 2014, 12:31:51 PM by atomic7732 »

blotz

  • Formerly 'bong'
  • *****
  • Posts: 813
  • op pls
Re: Coding
« Reply #452 on: December 07, 2014, 01:15:35 PM »
:O

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #453 on: January 01, 2015, 11:19:35 PM »
Code: [Select]
time = calendar.timegm(datetime.datetime(*[int(val) for val in re.split('-| |:',line[line.index("[") + 1:line.index("]")])]).utctimetuple())
this a beautiful one liner than turns a line like this:

Code: [Select]
[2011-10-05 17:27:05] <matty406> screenies\n
into a timestamp like this:

Code: [Select]
1317835625

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #454 on: January 19, 2015, 09:44:00 AM »
parses a eu4 save game into a csv file which i've imported into a sql database

(wars, sorted by largest number of boats destroyed)


(battles in which both sides had more than 50000 participants. note the 17th century battle)

atomic7732

  • Global Moderator
  • *****
  • Posts: 3848
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #455 on: January 19, 2015, 09:51:38 PM »
I wrote a program to calculate the current time on Universalis...

Fiah and dar came up with year 984, but I'm not sure how. I got 988.

Here's the code: http://pastebin.com/KUeGYDZ1

Output for the value on line 2

Code: [Select]
Universalis days: 245240.501362
Universalis years: 988.470426812
Base Universalis Time - 988-116, 15.70824
Calendaric Universalis Time - 988-107, 11.0399999997
Soleani Calendar - 988-2-25, 11.0399999997

Base Universalis Time is basically just the time i got by dividing 22.02 and 248.101, the exact hour and day values. This differs from the Calendaric Universalis Time (should it really differ by 9 days though?) because that is calculated as a calendar would calculate it out, in blocks of days per year, and not just a raw time value. The Soleani Calendar is a modified version of CUT which uses the method of dividing into months. At the moment, it does not have an offset, but it will be offset to whenever the nearest Universalis winter solstice is to January 1, 1399, 00:00 UTC, Earth time. For ease, I assumed it synced up exactly with midnight January 1.

I posted this so that, if I made a mistake, someone will be able to understand what went wrong.
« Last Edit: January 19, 2015, 10:01:58 PM by atomic7732 »

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: Coding
« Reply #456 on: January 19, 2015, 09:56:23 PM »
what did you define as 000-01-01 00:00:00? how about 1399-10-21 17:00:00 UTC+0 is 000-01-01 00:00:00?

atomic7732

  • Global Moderator
  • *****
  • Posts: 3848
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #457 on: January 19, 2015, 09:59:19 PM »
0 hours is January 1, 1399, 00:00 UTC

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #458 on: January 20, 2015, 04:06:30 PM »
drag the ball.
(requires tkinter)

atomic7732

  • Global Moderator
  • *****
  • Posts: 3848
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #459 on: January 20, 2015, 04:37:00 PM »
the ball is a slow pony

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #460 on: January 20, 2015, 04:40:11 PM »
well at least it works

atomic7732

  • Global Moderator
  • *****
  • Posts: 3848
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #461 on: January 21, 2015, 08:53:45 AM »
I figured it out, who would have known .001 was one per thousand and not one per hundred...

that might account for the 9 day discrepancy.

I'll update the code when I get home to see if that's accurate and then maybe I can host a thing on my site showing Base Universalis Time for conversion and maybe people's calendars

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: Coding
« Reply #462 on: January 21, 2015, 09:17:18 AM »
fixx pygwm

atomic7732

  • Global Moderator
  • *****
  • Posts: 3848
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #463 on: January 21, 2015, 10:03:38 PM »
i can confirm that i messed up the calendar thing, but it is fixed now

so if people want to work on their calendars, and decide on a time for winter solstice of universalis, that would be helpful and then i can start working on a calendar/time conversion which i can put on my site

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #464 on: January 29, 2015, 02:59:55 PM »
so i'm coding an evolution simulator for trees and it's neat how every single possible bug gets exploited by the evolutioning.

for example, i made the cost of growing a branch proportional to its height off the ground -- this lead to the forest become a carpet of branches at y = 0

i implemented a variable in the genes that determined how much energy the offspring would start off with, but used a constant value for that instead. the trees exploited this by using 1 energy to create offspring with 10 energy

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: Coding
« Reply #465 on: January 29, 2015, 04:01:13 PM »
for the first issue you could keep that feature but make the cost decrease from 0 to 5 then increase and never let it reach 0, also if a tree occupies the same space as another one the cost increases

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #466 on: January 29, 2015, 04:08:37 PM »
eh. i just made cost be proportional to 1 + height

then i removed the height term because i was trying to get taller trees to grow

---

i don't need to to do the tree occupying the same space thing because i actually measure the amount of sunlight absorbed by each branch on a tree and if a branch is covered by another branch higher up it gets less energy (50% less for every additional overlap)

---

i'm having problems with speciation -- all my trees have evolved to be tall, but theyre all exactly the same tallness

Bla

  • Global Moderator
  • *****
  • Posts: 1013
  • The stars died so you can live.
Re: Coding
« Reply #467 on: January 29, 2015, 04:53:16 PM »
Maybe coding a giraffe could help?


Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: Coding
« Reply #468 on: January 29, 2015, 06:48:42 PM »
speciation only happens when a population is isolated from another or put under pressure by itself

FiahOwl

  • *****
  • Posts: 1234
  • This is, to give a dog and in recompense desire my dog again.
Re: Coding
« Reply #469 on: January 29, 2015, 08:15:20 PM »

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '146683'.

« Last Edit: March 22, 2021, 01:44:17 AM by FiahOwl »

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #470 on: January 31, 2015, 08:13:20 PM »
tfw doing data processing and there's an io bottleneck

atomic7732

  • Global Moderator
  • *****
  • Posts: 3848
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #471 on: February 20, 2015, 04:04:52 PM »
A simple little program which can be used as a memory game for learning your own conlang (or any language really)

not full definitions, but simple vocab glossing



if people want to help add to files or use it, just ask

the way it works is the english will always show up and you have to type it in the conlang, so if you need to specify things, then you can do that

I still have to test to see if special characters work and such.

And actually, I'd like to try to put it on my website so that it's always there to use when you want. Although the personal version would allow you to dump vocab things you want to work on, on demand.

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #472 on: February 20, 2015, 04:20:52 PM »
a brute force solver for https://en.wikipedia.org/wiki/24_Game

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #473 on: March 24, 2015, 05:06:25 AM »
i find this data structure useful because if your code crashes unexpectedly in the middle of processing a large amount of data, you don't have to redo everything

Code: [Select]
import cPickle

class IOlist(list):
    def __init__(self, filename, sentinel):
        list.__init__(self)
        self.count = 0
        self.sentinel = sentinel
        self.filename = filename
    def add(self, elem):
        self.append(elem)
        self.count += 1
        if self.count >= self.sentinel:
            self.save()
    def save(self):
        self.count = 0
        with open(self.filename, 'wb') as ouf:
            cPickle.dump(list(self), ouf)
    def load(self):
        with open(self.filename, 'rb') as inf:
            self[:] = cPickle.load(inf)
       

it saves itself to a file every so often

FiahOwl

  • *****
  • Posts: 1234
  • This is, to give a dog and in recompense desire my dog again.
Re: Coding
« Reply #474 on: March 24, 2015, 08:18:05 AM »

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '148891'.

« Last Edit: March 22, 2021, 01:35:08 AM by FiahOwl »

blotz

  • Formerly 'bong'
  • *****
  • Posts: 813
  • op pls
Re: Coding
« Reply #475 on: March 31, 2015, 11:04:58 AM »
it's time to up the byebla game
there's a 0.1% chance it'll break when starting up

oops quickly squashing a bugs

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #476 on: March 31, 2015, 12:05:56 PM »

blotz

  • Formerly 'bong'
  • *****
  • Posts: 813
  • op pls
Re: Coding
« Reply #477 on: March 31, 2015, 12:38:34 PM »
ok its call blabotc cuz its so crude
my complex design is in the process of breaking

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: Coding
« Reply #478 on: March 31, 2015, 12:45:37 PM »
kol

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #479 on: March 31, 2015, 01:34:45 PM »
you can't stop me!