ForumTechnical Corner ► Kylljoy's Devblog : Efficiencity

Kylljoy's Devblog : Efficiencity

Github Repo

What is this?
I've noticed that I work better when people are observing and silently judging me, and I've also noticed that I've had a dry spell recently where I haven't really been working on any Crayon games. Combining the two, I think that perhaps starting a public Devblog here on the forum will motivate me to actually work, since people will be able to see where the work stalls.

It may also spur new people into developing for Crayon, since they'll be able to see the repo as it develops in real-time, and get an idea for how the development process works. It could also work as a pseudo-tutorial, since you would be able to watch the code get written into the repo and dissect it yourself.

As such, I'm starting this thread, devoted to my work on a new Crayon-based CitySim, Efficiencity.

What is Efficiencity?
Efficiencity is my response to the CitySim genre. It will be primarily focused on industrial optimization, starting from a small village and building your way to an urban city. The core of the game focuses on urban planning and logistic networks, which I think could be a fun, self-imposed puzzle.

The reason I want to work on this game idea in particular is fourfold:
1. It's complex. Every game since Accelerative has been simplified with one or two core mechanics. This will be a much more complex and ambitious project, and therefore something I want to get back to.
2. It's established. The city sim genre is already prevalent enough that there are plenty of ideas and example to draw from. I can therefore use those as inspiration going forward, and as landmarks if I get stuck, while still being able to put my own unique spin on it.
3. It's continuous. This is one of the first game ideas I've had where I can see myself using a continuous update model. There are many features (national systems, complex economies, diseases, war systems, etc.) I have ideas for implementing, so if the interest is strong, I can continue to work on the game once it's "finished".
4. It's long. This is one of the only potential games (again, besides Accelerative) that has a long-term play window. Every other game is something where the average session lasts two to five minutes. This could feasibly be spun out to a client-side game that could last anywhere from minutes to days.

What should I do?
I'm going to be posting daily updates (barring days where I have exams or lots of work) on this project going forward. If you are interested in it, follow the thread. More importantly, post your disappointment if I miss an update. That way, I am pressured into putting work into this.

Why should I care?
If this system works and I actually manage to produce something within a decent amount of time, I will be producing more games using a devblog system. This means a more populated arcade, and more opportunities for you guys to goof off during class, or play games on the site.

Sound good? Cool.

Day 1 update will be posted tomorrow evening.
I'm so following this thread
I love city building games. I'll be watching from the shadows.
City building game? You have my attention.
It'll be fun watching the repo develop! I haven't gotten into Crayon but this may be my chance to see what's it's like to develop in.
Simcity owned by Kylljoy, oh boy I can't wait to play
Now, does Kylljoy have the energy to do it? Does he need some caffeine?
Devblog - Day #1

I'm going to establish a style for these posts. Standard black means just a general thought or update. Blue indicates tips or tricks that I use while working, in case people are using this as an impromptu tutorial. Bold references key ideas or mechanics. Italics represents asides.

As with most games, the first few days are focused on key mechanics and ideas. I have a notebook set aside where I jot down ideas for mechanics so they can be easily documented. At its core, Efficiencity is a resource-balancing game. Balancing your workers, your resources, and your well-being is essential to the system the game is built on. I think that the statistics that the game uses can be split into two separate sections - status and resources.

Status statistics represent the well-being of your city as a whole. The core statistics that status represents are overarching elements that apply to the entire city. These are the hardest to change with the introduction of a single factory, and require planning ahead of time to balance out.
  • Population represents the total amount of people working for you. Population is key to the city, as you can't have one without it, and is the single most important status statistic. You need people to run resource nodes (which produce raw resources), work in factories (which produce refined resources), run transport (unless factories are chained, you need a method of transporting the products of one into the ingredients of another), and build structures (how any new buildings are made in the first place). Population increases when happiness passes a certain threshold, when food and water are adequately met, and when there is space in dwelling units. Population decreases over time as members die out, or if food and water reach a dangerously low level.
  • Food represents the total amount of food in stores for the city. Food is consumed based on the amount of population, and is consumed at an increased rate if more people are working. Food is produced by assigning workers to the relevant farming resource nodes. Food will also rot over time, preventing massive stockpiles from lasting forever.
  • Water is similar to food, although it requires a different production node and does not rot.
  • Happiness represents your population's overall satisfaction with your city. Happiness will rise if certain leisure buildings (such as theatres or parks) are built. Happiness will fall if food and water requirements are not being met, or if taxation is too high. Buildings are overall more productive if population happiness is being met.
  • Money represents the available fiscal assets you may expend in order to grow your city. Money is required in constructing most buildings. You may acquire money by either taxing your population at a variable rate (between 0-50%), or selling products to a market which I plan to have a supply-demand economy, preventing singular products from being mass-sold. Money is also consumed in order to pay wages in factories this may be subject to change
  • Power represents the overall electrical energy in your city's power grid. Non coal-powered buildings consume power in order to operate. Power is increased through the introduction of power-generating buildings. The power consumption of your buildings must be met, otherwise your factories will begin to go offline.

Resources represent your city's inventory of products. This ranges from the raw resources (such as copper, iron, coal, or oil) to the intermediate products (such as metal plates, pistons, wiring, or piping), to the final products (such as engines, vehicles, or computers).
  • Raw resources are produced by resource nodes. I plan for six raw resources - Iron, Copper, Stone, Oil, Coal, Wood. These may be produced by planting a resource node anywhere in the city - although certain spots have a designated "richness" that will produce more of specific types of resources (for example, a plot may be copper-rich, stone-rich, or both). Food may also be produced in a similar manner, with both food and wood depending on the fertility richness of a plot. As resources are extracted, the richness of a plot decreases. Fertility is the only richness that is returned over time, providing incentive for fields to lay fallow for a season.
  • Products are produced by factories, which take a certain set of ingredients in, and produce a certain product as a result. Factories take power of some form (with the exception of some early refineries, which require only a steady supply of coal), and produce a certain resource, which may be sent to another factory for further refinement into a final product.

That's it for this update. Tomorrow will be focused on logistics.
I think as Devery, I should be involved in the devblog. And also this sounds like my sort of game.
You may write a quote of the day for each post, if you would like.
How do I get this game
It doesn't even exist yet. But when it's ready, it'll probably be available in the arcade.
Sounds awesome! Lmk if I can help with anything!
Does crayon have a built-in means to save data using cookies or something like that, or are you going to have to implement saving yourself? Or is this going to be a shorter game that can be completed in one sitting?
aprzn123 said:
Does crayon have a built-in means to save data using cookies or something like that, or are you going to have to implement saving yourself? Or is this going to be a shorter game that can be completed in one sitting?

I need to check with Blake, but the answer is yes and no. Saving is possible, but I'm unsure if the TCaS library supports it or not. Chances are, there will be an embedded "unsavable" version on the arcade, and a local version available for download if you want to play longer.
Why not add a password system? Though that may take a while
The amount of data and lack of an embedded copy-paste system makes this unfeasible.
What about a password system like some games on the NES? 6,7 characters, selected in-game?

I'm sure data would still be an issue, though.
He just said he wouldn't be able to do it
Basically there are way more possible save states than passwords of reasonable length, and you can't copy paste the password either.
e-bag said:
What about a password system like some games on the NES? 6,7 characters, selected in-game?

Those work because the games are linear with set development. Each section has a set save and set progression. You only need six or seven states to be restored in that case. This is a nonlinear game with many more variables than your average NES game.

Here's some basic data science to help you understand :

Assuming the city has at least a 10x10 grid, with four possible factories per square, that's a minimum of 2 bits per square for a total of 200 bits, which is 25 bytes. Or ~100 characters long, using standard ascii characters.

That's the minimum. Not including things like richness, status, population, more factories, or logistic networks.

Password is an unfeasible system without the implementation of copy+paste.
Do you not have copy paste or what
Not in Crayon, no.
Copy and paste does not work on JS canvas, which is what Crayon uses, since any text displayed is a bitmap image and not actual text.
Forum > Technical Corner > Kylljoy's Devblog : Efficiencity