Modding Stonehearth's Graphics Test Program

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 :wink:

It’s like what @not_owen_wilson said:

We compiled the Lua as a warning to you–that everything inside belongs to us and might change at any moment. :wink: 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.

Thanks for being so sensitive. :slight_smile: We really appreciate it.

7 Likes

This is what I did with mine its nothing special:

cough awesome show off cough

:smile:

1 Like

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?

5 Likes

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

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.

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

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.

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.

3 Likes

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).

1 Like

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

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

@Xavion I think they have their own compiler and they are not using the official lua compiler :stuck_out_tongue: . 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. :wink: When i have more time i will look into this.

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. :smile:

19 Likes

ahhhh!! too much awesomeness for my fragile eyes to absorb!! :scream:

3 Likes

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 :smiley:

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

1 Like

Wow.

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

3 Likes

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

2 Likes