# Modding Stonehearth's Graphics Test Program

**URL:** <https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540>\
**Category:** Modding\
**Created:** [November 16, 2013, 9:54am UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540 "2013-11-16T09:54:54Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![Alesfatalis](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/alesfatalis/32/3023_2.png) [@Alesfatalis](https://discourse.stonehearth.net/u/Alesfatalis)\
**Post date:** [November 18, 2013, 8:11pm UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/61 "2013-11-18T20:11:52Z")

</div>

You can decompile their code to read it and to learn some lua but you can’t compile it back and use it in the Graphic Test. So publishing the code shouldn’t be a problem. But before everyone now tries to decompile it wait until Radiant is going to publish a modding api or something else.

PS: Most of the decompiler modifie the code to prevent errors so what you get after decompiling isn’t 100% the original code 😉

---

<div class="post-metadata">

**Author:** ![sdee](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/sdee/32/65441_2.png) [@sdee](https://discourse.stonehearth.net/u/sdee)\
**Post date:** [November 18, 2013, 8:18pm UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/62 "2013-11-18T20:18:35Z")

</div>

> [@Ramcat](#):
>
> Oh, Radiant, where do you stand?

It’s like what @not_owen_wilson said:

> [@The Stonehearth Graphics Test Thread](https://discourse.stonehearth.net/t/the-stonehearth-graphics-test-thread/3531/101):
>
> Just to be clear: go right ahead and have fun, but we reserve the right to change absolutely anything in our mod structures, so any modifications you make might break with future releases.

We compiled the Lua as a warning to you–that everything inside belongs to us and might change at any moment. 😉 We don’t mind if you take a look and play with whatever you like as long as you accept that whatever you build is like a sandcastle–almost inevitably, the foundation it’s built on will get eroded by the tide of stuff-changing/ performance/bug/feature optimization. (For a sense of scope, my carpenter code has changed a dozen times since I first wrote it in June, in reaction to various optimizations we made to stuff lower down.) If you choose to make it easy to share what you’ve learned on the forum, make sure to share that warning around too.

> [@Ramcat](#):
>
> I want to respect Radiant Entertainments wishes but I want to also learn from their luac.

Thanks for being so sensitive. 🙂 We really appreciate it.

---

<div class="post-metadata">

**Author:** ![LunarWolf](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/lunarwolf/32/43524_2.png) [@LunarWolf](https://discourse.stonehearth.net/u/LunarWolf)\
**Post date:** [November 18, 2013, 10:04pm UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/63 "2013-11-18T22:04:05Z")

</div>

This is what I did with mine its nothing special:

 ![](https://us1.discourse-cdn.com/flex022/uploads/stonehearth/original/3X/a/e/ae456294ac2f684f111067567f571c562a609c33.png)

---

<div class="post-metadata">

**Author:** ![SteveAdamo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/steveadamo/32/13955_2.png) [@SteveAdamo](https://discourse.stonehearth.net/u/SteveAdamo)\
**Post date:** [November 18, 2013, 10:12pm UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/64 "2013-11-18T22:12:53Z")

</div>

_cough_ awesome show off _cough_

😄

---

<div class="post-metadata">

**Author:** ![Xavion](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/xavion/32/43501_2.png) [@Xavion](https://discourse.stonehearth.net/u/Xavion)\
**Post date:** [November 18, 2013, 11:31pm UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/65 "2013-11-18T23:31:16Z")

</div>

Would anyone out there have any idea why compiling functionally identical lua code be causing it to fail? Oh Radiant what did you use to compile it that is eluding us?

---

<div class="post-metadata">

**Author:** ![SteveAdamo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/steveadamo/32/13955_2.png) [@SteveAdamo](https://discourse.stonehearth.net/u/SteveAdamo)\
**Post date:** [November 19, 2013, 12:48am UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/66 "2013-11-19T00:48:51Z")

</div>

> [@Xavion](#):
>
> Oh Radiant what did you use to compile it that is eluding us?

 ![](https://us1.discourse-cdn.com/flex022/uploads/stonehearth/original/2X/c/ca2aa4f8cd8483bf2c504ca0dd21fbdfa1dfb9fc.JPG)

---

<div class="post-metadata">

**Author:** ![ownerpure5](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/ownerpure5/32/19747_2.png) [@ownerpure5](https://discourse.stonehearth.net/u/ownerpure5)\
**Post date:** [November 19, 2013, 1:52am UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/67 "2013-11-19T01:52:29Z")

</div>

Hey can anyone create a mod for ther hraphic test where you can control the folks to make them chop down the tree plz?

---

<div class="post-metadata">

**Author:** ![Xavion](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/xavion/32/43501_2.png) [@Xavion](https://discourse.stonehearth.net/u/Xavion)\
**Post date:** [November 19, 2013, 2:27am UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/68 "2013-11-19T02:27:36Z")

</div>

We’d need to solve the issue with the lua first. If you can figure it out though than I’d take a crack at it.

---

<div class="post-metadata">

**Author:** ![LunarWolf](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/lunarwolf/32/43524_2.png) [@LunarWolf](https://discourse.stonehearth.net/u/LunarWolf)\
**Post date:** [November 19, 2013, 4:39am UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/69 "2013-11-19T04:39:30Z")

</div>

What issue is there with the lua? As I used unluac to decompile and things for me so far are going smooth.

---

<div class="post-metadata">

**Author:** ![Xavion](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/xavion/32/43501_2.png) [@Xavion](https://discourse.stonehearth.net/u/Xavion)\
**Post date:** [November 19, 2013, 4:43am UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/70 "2013-11-19T04:43:40Z")

</div>

Try recompiling some of the lua and running it with the new luac. I can’t get it to work and my test was to decompile than recompile start\_game without making any changes to the code so it’s definitely a problem with the compiling process on my end.

---

<div class="post-metadata">

**Author:** ![Xavion](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/xavion/32/43501_2.png) [@Xavion](https://discourse.stonehearth.net/u/Xavion)\
**Post date:** [November 19, 2013, 7:23am UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/71 "2013-11-19T07:23:23Z")

</div>

Just noticed no one seems to have posted some analysis of some of the stuff in there so here’s some of the interesting things I’ve come across.

Given names and Surnames for the three factions  
Rayya’s Children  
Surname: Djanni, Megas, Rynn, Sardis, Umayya, Zab, Tolem, Tigri, Aibah, Sayyar  
Male: Dumar, Ardashir, Talin, Basid, Senn, Mani, Sunur, Ahom, Raj, Luqar  
Female: Uma, Khora, Abhi, Nagara, Roxana, Zand, Negan, Atusa, Tira, Chista  
Ascendancy  
Surname: Burlyhands, Farstrider, Gwarin, Boltoose, Freywind, Carvad, Edessa, Nonac, Keloch, Brightwell, Northpoint, Berall, Carlwine, Framer, Hunterton, Winset, Jondal, Baub  
Male: Mer, Campton, Brom, Illowyn, Sean, Gareth, Nol, Pantor, Daff, Willad, Irving, Chopper  
Female: Dara, Alaina, Abi, Scarlett, Elena, Leah, Autumn, Senn, Raven, Vio, Jess, Marianne  
Northern Alliance  
Surname: Finn, Odilep, Ketil, Haft, Sovi, Guthrum, Igurd, Moror, Erlinn, Vemund  
Male: Kiran, Sel, Jos, Gurd, Karr, Skarf, Valin, Lovil, Sineus, Hakon, Ragnar  
Female: Geira, Asta, Olva, Tovi, Indunna, Finna, Jodis, Mora, Brynn, Katla

Names of hours and months  
Hours: Aughtaur, Twivaur, Thrisaur, Quarthaur, Fifaur, Sesaur, Sevaur, Ochaur, Neinaur, Tethtaur, Elehaur, Dovaur  
Months: Bittermun, Deepmun, Dewmun, Rainmun, Growmun, Goldmun, Feastmun, Warmun, Newmun, Azuremun, Hearthmun, Northmun

That’s most of it, the only other thing of mild interest I’ve found is that it seems that there is code to ensure you have at least one female but not code to ensure a male.

---

<div class="post-metadata">

**Author:** ![voxel\_pirate](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/voxel_pirate/32/2309_2.png) [@voxel\_pirate](https://discourse.stonehearth.net/u/voxel_pirate)\
**Post date:** [November 19, 2013, 7:49am UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/72 "2013-11-19T07:49:37Z")

</div>

Have you found this names also hard coded somewhere in the Lua-code (as they are accessible in the .json-files)?

In addition we see in one of the .json-files how the day-night-cycle is calculated:

- “ticks\_per\_second” : 5
- “seconds\_per\_minute” : 20
- “minutes\_per\_hour” : 20
- “hours\_per\_day” : 24
- “days\_per\_month” : 30
- “months\_per\_year” : 12
- “starting\_month” : 1
- “starting\_year” : 1000

We can also see that different parts of the environment are colored via .json and that there are different “layers” of environment:

- soil = dark\_color, light\_color, detail\_color
- light\_grass = ring\_0\_color, ring\_1\_color, ring\_2\_color
- dark\_grass = ring\_0\_color, ring\_1\_color, ring\_2\_color, dark\_color
- rock = layer\_1\_color, layer\_2\_color, layer\_3\_color, boulder\_color
- wood = dark\_color
- dirt\_road = center, edges

Trees seem to have 3 growth-stages with different durabilities:

- large tree = durability 20 / 15
- medium tree = durability 12 / 9
- small tree (sapling) = durability 4 / 3

… different durabilities also depending on the type of a tree (oak vs. juniper).

---

<div class="post-metadata">

**Author:** ![Xavion](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/xavion/32/43501_2.png) [@Xavion](https://discourse.stonehearth.net/u/Xavion)\
**Post date:** [November 19, 2013, 7:59am UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/73 "2013-11-19T07:59:49Z")

</div>

> [@voxel\_pirate](#):
>
> Have you found this names also hard coded somewhere in the Lua-code (as they are accessible in the .json-files)?

I think I know what you mean and if so I have indeed found those. In fact here you go people, the stonehearth smod file with all luac attempted to convert to lua, it’s not perfect but it mostly works.  
[https://www.dropbox.com/s/hkzujzpljhfvx52/stonehearth.zip](https://www.dropbox.com/s/hkzujzpljhfvx52/stonehearth.zip)

Also @Radiant, Out of interest what reasons did you have for choosing 5.1 over 5.2? Just wondering.

---

<div class="post-metadata">

**Author:** ![Alesfatalis](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/alesfatalis/32/3023_2.png) [@Alesfatalis](https://discourse.stonehearth.net/u/Alesfatalis)\
**Post date:** [November 19, 2013, 2:40pm UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/74 "2013-11-19T14:40:05Z")

</div>

@Xavion I think they have their own compiler and they are not using the official lua compiler 😛 . What makes sense because they coded their own engine. The fact that the remcompiled code isn’t working is easy to explain. When you decompiled your code with unluac or luadec you maybe have seen when you used luadec variables which looked like this `(1_1_1)` and when you use unluac the same variables look like this `_self`. The problem is our decompilier can’t see all the files as one project and so he is going to interpret them wrong. To get this working i think we have to decompile everything then we have to reverse engineer all variables to make them match with the other files and than we have to compile everything back. This should work but i am not sure. 😉 When i have more time i will look into this.

---

<div class="post-metadata">

**Author:** ![Miturion](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/miturion/32/43498_2.png) [@Miturion](https://discourse.stonehearth.net/u/Miturion)\
**Post date:** [November 19, 2013, 5:43pm UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/75 "2013-11-19T17:43:59Z")

</div>

I put some of my mod into the engine. You would not say, but is was pretty hard to keep the landscape into place. The slightest adjustment and the landscape was placed into space. It also includes bug bunnies under the sand. 😄

 ![](https://us1.discourse-cdn.com/flex022/uploads/stonehearth/original/2X/4/4d7f332a4152c267e044fa0280164ecd5bfe3fe4.jpg)

 ![](https://us1.discourse-cdn.com/flex022/uploads/stonehearth/original/2X/e/ed27e802d25e1517d5847c3f10a7258239197bc2.jpg)

---

<div class="post-metadata">

**Author:** ![SteveAdamo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/steveadamo/32/13955_2.png) [@SteveAdamo](https://discourse.stonehearth.net/u/SteveAdamo)\
**Post date:** [November 19, 2013, 5:57pm UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/76 "2013-11-19T17:57:31Z")

</div>

> [@Miturion](#):
>
> I put some of my mod into the engine.

ahhhh!! too much awesomeness for my fragile eyes to absorb!! 😱

---

<div class="post-metadata">

**Author:** ![Sidewinder](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@Sidewinder](https://discourse.stonehearth.net/u/Sidewinder)\
**Post date:** [November 19, 2013, 6:36pm UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/77 "2013-11-19T18:36:24Z")

</div>

Holy moly Miturion that looks impressive! You even increased the size of the World(or the small chunk^^)  
After all these years it is still exciting for me to see talented people 😃

---

<div class="post-metadata">

**Author:** ![Alesfatalis](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/alesfatalis/32/3023_2.png) [@Alesfatalis](https://discourse.stonehearth.net/u/Alesfatalis)\
**Post date:** [November 19, 2013, 6:55pm UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/78 "2013-11-19T18:55:49Z")

</div>

@Miturion Do i see that correct you just placed a big landscape cubbicle model on top of the little square world? 😉

---

<div class="post-metadata">

**Author:** ![not\_owen\_wilson](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/not_owen_wilson/32/43503_2.png) [@not\_owen\_wilson](https://discourse.stonehearth.net/u/not_owen_wilson)\
**Post date:** [November 19, 2013, 7:06pm UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/79 "2013-11-19T19:06:35Z")

</div>

Wow.

(And here are more characters for this post, because Discourse demands it).

---

<div class="post-metadata">

**Author:** ![sdee](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/sdee/32/65441_2.png) [@sdee](https://discourse.stonehearth.net/u/sdee)\
**Post date:** [November 19, 2013, 7:15pm UTC](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540/80 "2013-11-19T19:15:18Z")

</div>

Seriously, seriously cool. 🙂 I feel like our two little Ascendancy people are really confused as to why they’re suddenly in the desert.

[Previous page](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540.md?page=3)

[Next page](https://discourse.stonehearth.net/t/modding-stonehearths-graphics-test-program/3540.md?page=5)
