News for hackers. Stuff that matters.
Re:Building an Economy Simulator from Scratch by Nezteb on Friday September 15, 2023 @04:31PM (#37528740)
Is the source code for this simulator available anywhere? The post's code itself is minimized/obfuscated: https://thomassimon.dev/assets/cashloss.1fca21f6.js

I couldn't find anything on the author's GitHub. I'm mostly just curious how it's built.

Re:Building an Economy Simulator from Scratch by Ruddle on Friday September 15, 2023 @05:05PM (#37529119)
Author here, if there is enough interest I can clean the code up and put it on GitHub. It is basically a state machine.
Re:Building an Economy Simulator from Scratch by coderintherye on Friday September 15, 2023 @05:27PM (#37529336)
I'd love to see it, even in unpolished state.

It'd go well as comparison vs. this code I've been playing around with from Phillip Rosedale (Founder of Second Life) where he's simulating economy for purposes of determining wealth distribution scenarios: https://editor.p5js.org/PhilipRosedale/sketches/odl5elMWy

Re:Building an Economy Simulator from Scratch by xwdv on Friday September 15, 2023 @05:28PM (#37529339)
State machine? Why not entity component system?
Re:Building an Economy Simulator from Scratch by jll29 on Friday September 15, 2023 @06:17PM (#37529763)
Would be nice to see a post written about the high-level design and then about the implementation.
Re:Building an Economy Simulator from Scratch by Nezteb on Friday September 15, 2023 @06:43PM (#37529984)
I'd appreciate it. :D
Re:Building an Economy Simulator from Scratch by _false on Friday September 15, 2023 @06:50PM (#37530034)
Just to add to others; I'd be interested to take a look at the source, particularly for animations.
Re:Building an Economy Simulator from Scratch by LeonB on Saturday September 16, 2023 @06:44AM (#37533651)
Yes please! Fantastic work by the way.

I’d love to see the code with a permissive license for others to build upon.

Reminds me a little of ncase’s fantastic simulations — for example: https://ncase.me/sim/

Re:Building an Economy Simulator from Scratch by neilwilson on Saturday September 16, 2023 @12:14PM (#37536078)
Another +1 from me.

For me I’m particularly interested in how you’ve done the presentation interface.

Re:Building an Economy Simulator from Scratch by codeonline on Saturday September 16, 2023 @11:20PM (#37541203)
I'd love to take a look too. Just a suggestion, push it to github then clean it up. It's always helpful to see not just the product but the process. Great work.
Re:Building an Economy Simulator from Scratch by ldd on Sunday September 17, 2023 @09:56PM (#37551324)
Not the author, but I am trying to replicate it[1] without looking at the code (so sort of blackboxing it)

If you just want the javascript file (195 lines of code), let me know too

I'm currently working on Simulation 15

[1]: https://github.com/ldd/economy-test/tree/master

Re:Building an Economy Simulator from Scratch by Ruddle on Tuesday September 19, 2023 @06:43AM (#37568001)