Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Global Idle - A Web based Idle Game with AI Driven Artwork (DevLog)

A topic by kernal_the created Oct 18, 2023 Views: 722 Replies: 9
Viewing posts 1 to 10
(3 edits)

Global Idle

I really enjoy playing Idle games.  This is my first somewhat successful attempt at creating one.
My game is not quite ready to release however here is the alpha game: Global Idle by kernal_the (itch.io)

Global Idle
In this game you are the CEO of Global Idle Inc. As CEO you start with access to modest resources and production facilities. Over a series of multiple playthroughs you will slowly unlock new and more complex resources, more production facilities, and perfect the creation of resources on the way to a complete Global Monopoly.

Basic Gameplay

You start with three random resources that you can build and only one production facility.  For each resource per playthrough you can reach production milestones. Bronze(10 resources), Silver (100 resources), Gold (1000 resources). After reaching every milestone you have the ability to upgrade each resource either the speed of production, quantity produced, or the ability to skip counting this resource as one of your three random resources. Once your skip percent reaches 100% that resource becomes permanently unlocked denoted by the  icon.

Prestige
Unlike most idle games there are no prerequisites for Prestige you may Prestige at any time or refresh the page to receive a new random selection of resources based on your ability to produce the resource. This allows you to test your luck at getting a particular resource, however, note that some resources are rarer than others.

I started the devlog after I have developed the game for a few weeks. In order to document my progress to this point the first few posts will be a retelling of the steps that got me to this point.

The basic premise of this game is to have an absolute ton of resources slowly building complexity from a basic piece of wood all the way to a complex automotive. To this end I started with a basic resource. 

My goal with a resource was to make one class handle the economy of the game. Each resource had a name, a description, an image, buy price, sell price, production time, production quantity, skip percentage, rarity, and resource dependencies and the associated functions to display and modify those values. Version 0.1.0 of the code started by displaying all the resources in a list it had about 8 resources and all resources were being produced simultaneously no dependencies were being check. 

The next major goal(v 0.1.1) was to upgrade resources. This resulted in the addition of an info panel. The number or resources were reduced to three and randomly shown based on the rarity of the resource. Additional resources were added if the skip percentage for a resource was rolled during selection. 

The goal of this game design is to make a game with an enormous amount of resources to collect and perfect.  I am a programmer not a visual artist so at this point I wanted to add content but did not have the drawing skills I tried to find an ai image generator but was not satisfied with my initial results, so I started using openclipart.org to find image assets for the game. At this point I had about 14 resources primarily wood and planks and i found 14 unique clipart assets for wood and planks.  Since I was only seeing 3-5 resources at a time, I wanted to create a library so all resources would be displayed even the rare ones.   Here is the current version of the library:

 

Please Note that I have changed my source of image assets to craiyon.com all of my images are now ai generated. 

With the creation of the library feature the number of resources skyrocketed to about 40.  The intention of the project was to limit the number of concurrent resources being produced to some finite number with the ability to produce more being unlockable based on number of milestones completed. Once this was implemented game play slowed down and became more strategic the only issue was when the game restarted / crashed all progress was lost. This made the need for the ability to save a priority. The best solution I have found was LocalStorage for javascript which has a limit of 10MB which I hope will last for the abundant number of resources necessary. After several mistakes updating the library during this time the need for an erase was also apparent.

At this point the game was playable, and I am trying to get all of the base elements into the game.  Four major decisions are implemented at this point:

1. Resource requirements which I had set empty while creating resources are now implemented and enforced.


2.   When resources are selected only resources that can be produced are selected.

3.  A resource of a skip of 100% is not auto unlocked.

4. Money was taken out of the game. By requiring resource dependency to produce another resource it requires planning and strategy to unlock the next resource. If any resource could be purchased or sold. It could be possible that someone could upgrade one resource and use that to produce everything else. Also the removal of money removes the need to balance prices for resources.

Halloween is shortly approaching.  I decided to start adding event specific code. I am currently up to 124 different resources now including Jack-o-lanterns and skeleton.  My first pass of the code is to add the limited-time resources directly to the game and mark them as Halloween.  My future plan is to have a separate library for event specific resources also I plan on locking out events from gameplay when flags are not set.

My posts are now relatively current. I have documented or journaled my process to get to this point adding the code to itch.io.

Trying to get my code up on this site has been quite illuminating some of the deficiencies I have in my code:

1. An overall lack of documentation.  I know how my game works why wouldn't you. 

2. I didn't realize just how large my codebase is. My first upload was 87MB that is Huge for what I am doing. Since then, I have scaled images from the raw AI output to appropriate dimensions and converted them to jpg my codebase is now about 2MB a saving of about 40x. I wrote a quick little perl script to process a directory and used the command line tools image-magik to convert the files.

3. When I was testing my code through Visual Studio it kept the game in the foreground all the time. Testing it from the itch.io I noticed that my game was not spawning events regularly when not in focus. This means that I need to rewrite the code that processes a time tick to handle skipped time.

Once these three issues are fully addressed. My plan is to add the prototype to the top of this post, hopefully before Halloween.

November 17 v0.3.1

Bug Fixes are a pain in the butt. 

I had a bug in my game where in a rare circumstance my code would go into an infinite loop and crash the browser. It was happening infrequently so I would refresh the browser and start the game and it would work for another hour or more without problems.  I finally figured out that I had one resource out of the current 124 that was missing one variable that caused this bug. This is a problem when using JavaScript that doesn't have strict typing and functions calls. The result finding the error: 3+ hours the fix 3 characters:  "",

Improving Achievements.

I have been play testing the code for a while now. I always wanted to add multiple workers. Initially I thought i would create infrastructure projects which are essentially very tough resources with multiple requirements that would unlock them. After playing the game for a while I found once I Maxed a resource there was no need to use it and I needed a mechanic to keep the content active.  What I have come up with is tracking the number of achievements in a given session unlocks extra features. 1. Additional Workers after 10, and every 50 achievements. 2. Adding an additional resource after 6 achievements (essentially Silver in 3 resources, or gold in 2). My goal is to make a game last a little longer and to reuse content.

(+1)

Infrastructure Projects

My goal with adding this feature is to create some replayable content which takes a lot of time to complete. I have created something I called Infrastructure something bigger and more complex.  Previously my code stores just upgrade to materials. Now I have to track how many resources are used per step these values also need to be persistent between prestiges. 

I have adjusted achievements and trying to make unlocks workers, materials, and resources slightly faster and integrating with Infrastructure projects.

I have increased the number of resources 249 we are now getting to a point where I might need some extra display mechanisms to make it more logical.

Playing the game and trying to find things that I would like to improve has been very effective at this point and I hope the game in improving for the better.

Project Got Bloated

Its been a long while since my last update. I increased the number of resources to 433 resources and 11 projects so far so good. However this drastically slowed down the game and had a memory leak. This resulted in a complete rewrite on how the code behaves and now the game is finally working again.

Previously,

1. When I switched pages i cleared and regenerated the html code.

2. When I added a resource i regenerated the html.

3. Also i regularly retrieved elements to do this.

Now,

1. I generate all pages and resources once at the start.

2. I cache most elements which allows for faster updates.

3.The prestige mechanism performs a page reload helping prevent memory leaks.


The current state of the game is nearly feature complete.  I need to add a better Help document, some more projects, and more resources getting closer to my 900 maximum.