You are browsing as a guest. Sign up (or log in) to start making projects!

sol4r_on_hackclub

@sol4r_on_hackclub

Joined June 6th, 2026

  • 14Devlogs
  • 1Projects
  • 0Ships
  • 0Votes
17 yo aspirational Computer Science student, currently working on my A level NEA, Pocket City which you can see below, as well as a social media platform to replace all other social medias.
Open comments for this post
Reposted by @sol4r_on_hackclub

4h 15m 48s logged

WORKING PATHFINDING ON THE GRID!

Created new assets so the game looks complete now!

You can see the firetruck going from the Fire station all the way to the burning building where it will extinguish it. Yes, it follows the roads as intended and uses the A* algorithm to figure out the best path. And they shoot water out, so visual feedback for everything.

This was super fun as it was the first time I’ve implemented the A* in a video game on a grid that procedurally generated.

The coal power generator, fire station and fire trucks have models now, I think I made them good enough to fit with the game. Police station and healthcare to still be implemented but it’s looking good so far.

This required creating a new services manager, creating a pathfinding script, updating global services and how everything interacts with the fire, and creating reverse pathfinding and small details.

It’s coming together really cleanly now.

WORKING PATHFINDING ON THE GRID!

Created new assets so the game looks complete now!

You can see the firetruck going from the Fire station all the way to the burning building where it will extinguish it. Yes, it follows the roads as intended and uses the A* algorithm to figure out the best path. And they shoot water out, so visual feedback for everything.

This was super fun as it was the first time I’ve implemented the A* in a video game on a grid that procedurally generated.

The coal power generator, fire station and fire trucks have models now, I think I made them good enough to fit with the game. Police station and healthcare to still be implemented but it’s looking good so far.

This required creating a new services manager, creating a pathfinding script, updating global services and how everything interacts with the fire, and creating reverse pathfinding and small details.

It’s coming together really cleanly now.

Replying to @sol4r_on_hackclub

1
61
Open comments for this post

4h 15m 48s logged

WORKING PATHFINDING ON THE GRID!

Created new assets so the game looks complete now!

You can see the firetruck going from the Fire station all the way to the burning building where it will extinguish it. Yes, it follows the roads as intended and uses the A* algorithm to figure out the best path. And they shoot water out, so visual feedback for everything.

This was super fun as it was the first time I’ve implemented the A* in a video game on a grid that procedurally generated.

The coal power generator, fire station and fire trucks have models now, I think I made them good enough to fit with the game. Police station and healthcare to still be implemented but it’s looking good so far.

This required creating a new services manager, creating a pathfinding script, updating global services and how everything interacts with the fire, and creating reverse pathfinding and small details.

It’s coming together really cleanly now.

WORKING PATHFINDING ON THE GRID!

Created new assets so the game looks complete now!

You can see the firetruck going from the Fire station all the way to the burning building where it will extinguish it. Yes, it follows the roads as intended and uses the A* algorithm to figure out the best path. And they shoot water out, so visual feedback for everything.

This was super fun as it was the first time I’ve implemented the A* in a video game on a grid that procedurally generated.

The coal power generator, fire station and fire trucks have models now, I think I made them good enough to fit with the game. Police station and healthcare to still be implemented but it’s looking good so far.

This required creating a new services manager, creating a pathfinding script, updating global services and how everything interacts with the fire, and creating reverse pathfinding and small details.

It’s coming together really cleanly now.

Replying to @sol4r_on_hackclub

1
61
Open comments for this post
Reposted by @sol4r_on_hackclub

6h 56m 13s logged

Debugging HELL

I added fires, which you can see in the corner. Unity Particle system actually really cool for that by the way.
This forced me to rewrite how fires work and add new bits to the Building parent class. That was fine.

Had to update the UI to show you that an earthquake was happening, which works more reliably than last time and I figured the ghost error out.

I decided to implement water & energy requirements. Overhauled ChunkManager to allow for this, as each chunk needs enough. If it doesn’t produce enough, it imports from other chunks. If it can’t do that, everyone starts packing it up and leaving. Added this to city stats. Then modelled a cute little water tower as you can see below. Then I added energy, lots of chaos. Trying really hard to avoid circular loops to avoid a stack overflow, but it’s looking pretty good.

User warnings now show up, like when an earthquake happens, or if a building burns down or if you can’t do something or don’t have money for something.

Now I think I have time to do the fun part - creating chaotic fun stuff to make the city feel even more alive. But it’s looking pretty good right now.

It’s getting close to being shipped, almost 40 hours in. Like & follow for the link ;)

Now I really need to sleep. OH NO AND REVISE FOR THE PHYSICS TEST ON TUESDAY

Debugging HELL

I added fires, which you can see in the corner. Unity Particle system actually really cool for that by the way.
This forced me to rewrite how fires work and add new bits to the Building parent class. That was fine.

Had to update the UI to show you that an earthquake was happening, which works more reliably than last time and I figured the ghost error out.

I decided to implement water & energy requirements. Overhauled ChunkManager to allow for this, as each chunk needs enough. If it doesn’t produce enough, it imports from other chunks. If it can’t do that, everyone starts packing it up and leaving. Added this to city stats. Then modelled a cute little water tower as you can see below. Then I added energy, lots of chaos. Trying really hard to avoid circular loops to avoid a stack overflow, but it’s looking pretty good.

User warnings now show up, like when an earthquake happens, or if a building burns down or if you can’t do something or don’t have money for something.

Now I think I have time to do the fun part - creating chaotic fun stuff to make the city feel even more alive. But it’s looking pretty good right now.

It’s getting close to being shipped, almost 40 hours in. Like & follow for the link ;)

Now I really need to sleep. OH NO AND REVISE FOR THE PHYSICS TEST ON TUESDAY

Replying to @sol4r_on_hackclub

1
74
Open comments for this post

6h 56m 13s logged

Debugging HELL

I added fires, which you can see in the corner. Unity Particle system actually really cool for that by the way.
This forced me to rewrite how fires work and add new bits to the Building parent class. That was fine.

Had to update the UI to show you that an earthquake was happening, which works more reliably than last time and I figured the ghost error out.

I decided to implement water & energy requirements. Overhauled ChunkManager to allow for this, as each chunk needs enough. If it doesn’t produce enough, it imports from other chunks. If it can’t do that, everyone starts packing it up and leaving. Added this to city stats. Then modelled a cute little water tower as you can see below. Then I added energy, lots of chaos. Trying really hard to avoid circular loops to avoid a stack overflow, but it’s looking pretty good.

User warnings now show up, like when an earthquake happens, or if a building burns down or if you can’t do something or don’t have money for something.

Now I think I have time to do the fun part - creating chaotic fun stuff to make the city feel even more alive. But it’s looking pretty good right now.

It’s getting close to being shipped, almost 40 hours in. Like & follow for the link ;)

Now I really need to sleep. OH NO AND REVISE FOR THE PHYSICS TEST ON TUESDAY

Debugging HELL

I added fires, which you can see in the corner. Unity Particle system actually really cool for that by the way.
This forced me to rewrite how fires work and add new bits to the Building parent class. That was fine.

Had to update the UI to show you that an earthquake was happening, which works more reliably than last time and I figured the ghost error out.

I decided to implement water & energy requirements. Overhauled ChunkManager to allow for this, as each chunk needs enough. If it doesn’t produce enough, it imports from other chunks. If it can’t do that, everyone starts packing it up and leaving. Added this to city stats. Then modelled a cute little water tower as you can see below. Then I added energy, lots of chaos. Trying really hard to avoid circular loops to avoid a stack overflow, but it’s looking pretty good.

User warnings now show up, like when an earthquake happens, or if a building burns down or if you can’t do something or don’t have money for something.

Now I think I have time to do the fun part - creating chaotic fun stuff to make the city feel even more alive. But it’s looking pretty good right now.

It’s getting close to being shipped, almost 40 hours in. Like & follow for the link ;)

Now I really need to sleep. OH NO AND REVISE FOR THE PHYSICS TEST ON TUESDAY

Replying to @sol4r_on_hackclub

1
74
Open comments for this post
Reposted by @sol4r_on_hackclub

2h 5m 40s logged

It’s been a really long time since I’ve posted.

Some progress going on here.

Little sneak peak of the fires… yep. You thought the game was gonna be peaceful?

On another 7+ hour sprint today

It’s been a really long time since I’ve posted.

Some progress going on here.

Little sneak peak of the fires… yep. You thought the game was gonna be peaceful?

On another 7+ hour sprint today

Replying to @sol4r_on_hackclub

1
35
Open comments for this post

2h 5m 40s logged

It’s been a really long time since I’ve posted.

Some progress going on here.

Little sneak peak of the fires… yep. You thought the game was gonna be peaceful?

On another 7+ hour sprint today

It’s been a really long time since I’ve posted.

Some progress going on here.

Little sneak peak of the fires… yep. You thought the game was gonna be peaceful?

On another 7+ hour sprint today

Replying to @sol4r_on_hackclub

1
35
Open comments for this post
Reposted by @sol4r_on_hackclub

4h 22m logged

Clean codebase always pays off (unless you want to keep your job apparently?)

Fixed the vacancies counter, as before I was using = instead of +=. Told you it’s the little things that catch you out.

Created a safer version of the draft forceRemoveElement() that accounts for jobs and residents when destroying a building (houses/shops/industry). This now updates the game realistically, e.g. if you destroy a house, then you reduce from the population. If the residents were employed, then it removes positions from buildings. If they were unemployed, then we remove it from the stats.

Since I am not storing direct references between buildings but creating a game pool for performance, this makes the operations require lots of calling. This could probably be optimised in the future but I will do that near the first release due to the ever-changing code base.

This required updating GameManager.cs to have LosePopulation(), LoseJobs() with a helper RemoveWorkersFromBuildings() function. Luckily the lists in GridMananger that I made like 20 hours ago for “future proofing” came in useful.

Finally, you can press F to show city statistics and it updates in real time.

Clean codebase always pays off (unless you want to keep your job apparently?)

Fixed the vacancies counter, as before I was using = instead of +=. Told you it’s the little things that catch you out.

Created a safer version of the draft forceRemoveElement() that accounts for jobs and residents when destroying a building (houses/shops/industry). This now updates the game realistically, e.g. if you destroy a house, then you reduce from the population. If the residents were employed, then it removes positions from buildings. If they were unemployed, then we remove it from the stats.

Since I am not storing direct references between buildings but creating a game pool for performance, this makes the operations require lots of calling. This could probably be optimised in the future but I will do that near the first release due to the ever-changing code base.

This required updating GameManager.cs to have LosePopulation(), LoseJobs() with a helper RemoveWorkersFromBuildings() function. Luckily the lists in GridMananger that I made like 20 hours ago for “future proofing” came in useful.

Finally, you can press F to show city statistics and it updates in real time.

Replying to @sol4r_on_hackclub

1
190
Open comments for this post

4h 22m logged

Clean codebase always pays off (unless you want to keep your job apparently?)

Fixed the vacancies counter, as before I was using = instead of +=. Told you it’s the little things that catch you out.

Created a safer version of the draft forceRemoveElement() that accounts for jobs and residents when destroying a building (houses/shops/industry). This now updates the game realistically, e.g. if you destroy a house, then you reduce from the population. If the residents were employed, then it removes positions from buildings. If they were unemployed, then we remove it from the stats.

Since I am not storing direct references between buildings but creating a game pool for performance, this makes the operations require lots of calling. This could probably be optimised in the future but I will do that near the first release due to the ever-changing code base.

This required updating GameManager.cs to have LosePopulation(), LoseJobs() with a helper RemoveWorkersFromBuildings() function. Luckily the lists in GridMananger that I made like 20 hours ago for “future proofing” came in useful.

Finally, you can press F to show city statistics and it updates in real time.

Clean codebase always pays off (unless you want to keep your job apparently?)

Fixed the vacancies counter, as before I was using = instead of +=. Told you it’s the little things that catch you out.

Created a safer version of the draft forceRemoveElement() that accounts for jobs and residents when destroying a building (houses/shops/industry). This now updates the game realistically, e.g. if you destroy a house, then you reduce from the population. If the residents were employed, then it removes positions from buildings. If they were unemployed, then we remove it from the stats.

Since I am not storing direct references between buildings but creating a game pool for performance, this makes the operations require lots of calling. This could probably be optimised in the future but I will do that near the first release due to the ever-changing code base.

This required updating GameManager.cs to have LosePopulation(), LoseJobs() with a helper RemoveWorkersFromBuildings() function. Luckily the lists in GridMananger that I made like 20 hours ago for “future proofing” came in useful.

Finally, you can press F to show city statistics and it updates in real time.

Replying to @sol4r_on_hackclub

1
190
Open comments for this post
Reposted by @sol4r_on_hackclub

1h 0m 58s logged

What’s the difference between these two:

int maxEmployees = 50;
int employees = 25;
float taxRevenue = 1500.0f;

ONE : float revenue = (employees / maxEmployees) * taxRevenue;
TWO: float revenue = (employees * taxRevenue) / maxEmployees;

Mathematically, they’re the same. a/b * c = c/b * a

However, I missed one thing while coding (a lot harder to see when it’s not just this). They’re both integers. now what C# does is it divides 25/50. we get 0.5. but they’re both integers, so it tries to store it as an integer, which floors it to a 0. Therefore, it’ll suddenly jump to max revenue when the company is full. obviously not what was intended.

Option 2 makes you multiply the integer with a float, and stores 25 * 1500 as a float, which can now be nicely divided by 50 to get the value that we inteded.

Sometimes… actually, no MOST of the time it’s the little things that catch you out.

Anyways, this has very much balanced the game. The companies get as many employees as they can, then grow by 1 employee each day. Their revenue scales with the employee count, so now residential houses are useful for once. If anything, essential.

Next up: Road tax, Land tax. This might be the one time you want tax… or maybe it’s too much?

What’s the difference between these two:

int maxEmployees = 50;
int employees = 25;
float taxRevenue = 1500.0f;

ONE : float revenue = (employees / maxEmployees) * taxRevenue;
TWO: float revenue = (employees * taxRevenue) / maxEmployees;

Mathematically, they’re the same. a/b * c = c/b * a

However, I missed one thing while coding (a lot harder to see when it’s not just this). They’re both integers. now what C# does is it divides 25/50. we get 0.5. but they’re both integers, so it tries to store it as an integer, which floors it to a 0. Therefore, it’ll suddenly jump to max revenue when the company is full. obviously not what was intended.

Option 2 makes you multiply the integer with a float, and stores 25 * 1500 as a float, which can now be nicely divided by 50 to get the value that we inteded.

Sometimes… actually, no MOST of the time it’s the little things that catch you out.

Anyways, this has very much balanced the game. The companies get as many employees as they can, then grow by 1 employee each day. Their revenue scales with the employee count, so now residential houses are useful for once. If anything, essential.

Next up: Road tax, Land tax. This might be the one time you want tax… or maybe it’s too much?

Replying to @sol4r_on_hackclub

1
37
Open comments for this post

1h 0m 58s logged

What’s the difference between these two:

int maxEmployees = 50;
int employees = 25;
float taxRevenue = 1500.0f;

ONE : float revenue = (employees / maxEmployees) * taxRevenue;
TWO: float revenue = (employees * taxRevenue) / maxEmployees;

Mathematically, they’re the same. a/b * c = c/b * a

However, I missed one thing while coding (a lot harder to see when it’s not just this). They’re both integers. now what C# does is it divides 25/50. we get 0.5. but they’re both integers, so it tries to store it as an integer, which floors it to a 0. Therefore, it’ll suddenly jump to max revenue when the company is full. obviously not what was intended.

Option 2 makes you multiply the integer with a float, and stores 25 * 1500 as a float, which can now be nicely divided by 50 to get the value that we inteded.

Sometimes… actually, no MOST of the time it’s the little things that catch you out.

Anyways, this has very much balanced the game. The companies get as many employees as they can, then grow by 1 employee each day. Their revenue scales with the employee count, so now residential houses are useful for once. If anything, essential.

Next up: Road tax, Land tax. This might be the one time you want tax… or maybe it’s too much?

What’s the difference between these two:

int maxEmployees = 50;
int employees = 25;
float taxRevenue = 1500.0f;

ONE : float revenue = (employees / maxEmployees) * taxRevenue;
TWO: float revenue = (employees * taxRevenue) / maxEmployees;

Mathematically, they’re the same. a/b * c = c/b * a

However, I missed one thing while coding (a lot harder to see when it’s not just this). They’re both integers. now what C# does is it divides 25/50. we get 0.5. but they’re both integers, so it tries to store it as an integer, which floors it to a 0. Therefore, it’ll suddenly jump to max revenue when the company is full. obviously not what was intended.

Option 2 makes you multiply the integer with a float, and stores 25 * 1500 as a float, which can now be nicely divided by 50 to get the value that we inteded.

Sometimes… actually, no MOST of the time it’s the little things that catch you out.

Anyways, this has very much balanced the game. The companies get as many employees as they can, then grow by 1 employee each day. Their revenue scales with the employee count, so now residential houses are useful for once. If anything, essential.

Next up: Road tax, Land tax. This might be the one time you want tax… or maybe it’s too much?

Replying to @sol4r_on_hackclub

1
37
Open comments for this post
Reposted by @sol4r_on_hackclub

1h 8m 47s logged

Sometimes, the most productive thing you can do is destroying everything for a clean slate.

So that’s what I did and refactored my codebase, painting my GitHub red. The old city generation code ended up becoming messy spaghetti code that made it difficult to debug and work on it. And that sort of legacy code when I look back in a month is what ends up shelving projects for years on end. This half an hour will save me many in the future.

I also removed the cluster expansion method of building expansion completely as it created annoying expansions that didn’t make sense of everything being 1 square off a road.

Also created a GameManager and moved aspects of GridManager and FinanceManager to the new script, to try and centralise the logic and stop having random bits such as the day manager in the FinanceMananger, which didn’t make an sense.

Also yes, I wasted 20 minutes trying to figure out what was going wrong when I forgot to add GameManager.cs to the scene 💔

Sometimes, the most productive thing you can do is destroying everything for a clean slate.

So that’s what I did and refactored my codebase, painting my GitHub red. The old city generation code ended up becoming messy spaghetti code that made it difficult to debug and work on it. And that sort of legacy code when I look back in a month is what ends up shelving projects for years on end. This half an hour will save me many in the future.

I also removed the cluster expansion method of building expansion completely as it created annoying expansions that didn’t make sense of everything being 1 square off a road.

Also created a GameManager and moved aspects of GridManager and FinanceManager to the new script, to try and centralise the logic and stop having random bits such as the day manager in the FinanceMananger, which didn’t make an sense.

Also yes, I wasted 20 minutes trying to figure out what was going wrong when I forgot to add GameManager.cs to the scene 💔

Replying to @sol4r_on_hackclub

1
23
Open comments for this post

1h 8m 47s logged

Sometimes, the most productive thing you can do is destroying everything for a clean slate.

So that’s what I did and refactored my codebase, painting my GitHub red. The old city generation code ended up becoming messy spaghetti code that made it difficult to debug and work on it. And that sort of legacy code when I look back in a month is what ends up shelving projects for years on end. This half an hour will save me many in the future.

I also removed the cluster expansion method of building expansion completely as it created annoying expansions that didn’t make sense of everything being 1 square off a road.

Also created a GameManager and moved aspects of GridManager and FinanceManager to the new script, to try and centralise the logic and stop having random bits such as the day manager in the FinanceMananger, which didn’t make an sense.

Also yes, I wasted 20 minutes trying to figure out what was going wrong when I forgot to add GameManager.cs to the scene 💔

Sometimes, the most productive thing you can do is destroying everything for a clean slate.

So that’s what I did and refactored my codebase, painting my GitHub red. The old city generation code ended up becoming messy spaghetti code that made it difficult to debug and work on it. And that sort of legacy code when I look back in a month is what ends up shelving projects for years on end. This half an hour will save me many in the future.

I also removed the cluster expansion method of building expansion completely as it created annoying expansions that didn’t make sense of everything being 1 square off a road.

Also created a GameManager and moved aspects of GridManager and FinanceManager to the new script, to try and centralise the logic and stop having random bits such as the day manager in the FinanceMananger, which didn’t make an sense.

Also yes, I wasted 20 minutes trying to figure out what was going wrong when I forgot to add GameManager.cs to the scene 💔

Replying to @sol4r_on_hackclub

1
23
Open comments for this post
Reposted by @sol4r_on_hackclub

3h 4m 42s logged

It can’t POSSIBLY BE THAT HARD CAN IT?

No but you have to mix up TAGS AND LAYERS. There’s some error you got 5 builds ago but NEVER APPEARED AGAIN. EVEN HOURS INTO TESTING. HOW DID IT FIX ITSELF?!

The UI now updates how much you gained in the past day!

But anyways, you can finally toggle between the layers… after too much debugging (and realising it was just me being stupid).

But it’s okay I’ll hopefully get that laptop from this blood sweat and tears.

Look how gorgeous it looks now!

It can’t POSSIBLY BE THAT HARD CAN IT?

No but you have to mix up TAGS AND LAYERS. There’s some error you got 5 builds ago but NEVER APPEARED AGAIN. EVEN HOURS INTO TESTING. HOW DID IT FIX ITSELF?!

The UI now updates how much you gained in the past day!

But anyways, you can finally toggle between the layers… after too much debugging (and realising it was just me being stupid).

But it’s okay I’ll hopefully get that laptop from this blood sweat and tears.

Look how gorgeous it looks now!

Replying to @sol4r_on_hackclub

2
390
Open comments for this post

3h 4m 42s logged

It can’t POSSIBLY BE THAT HARD CAN IT?

No but you have to mix up TAGS AND LAYERS. There’s some error you got 5 builds ago but NEVER APPEARED AGAIN. EVEN HOURS INTO TESTING. HOW DID IT FIX ITSELF?!

The UI now updates how much you gained in the past day!

But anyways, you can finally toggle between the layers… after too much debugging (and realising it was just me being stupid).

But it’s okay I’ll hopefully get that laptop from this blood sweat and tears.

Look how gorgeous it looks now!

It can’t POSSIBLY BE THAT HARD CAN IT?

No but you have to mix up TAGS AND LAYERS. There’s some error you got 5 builds ago but NEVER APPEARED AGAIN. EVEN HOURS INTO TESTING. HOW DID IT FIX ITSELF?!

The UI now updates how much you gained in the past day!

But anyways, you can finally toggle between the layers… after too much debugging (and realising it was just me being stupid).

But it’s okay I’ll hopefully get that laptop from this blood sweat and tears.

Look how gorgeous it looks now!

Replying to @sol4r_on_hackclub

2
390
Open comments for this post
Reposted by @sol4r_on_hackclub

5h 3m 22s logged

Did you know it costs more to remove a road than create one?! Strange…

Finally have a working economy in the game now!

It’s VERY unbalanced. You WILL become very rich. And residential is currently useless, and everything just has a set employee count for now. But that will change soon, and we’ll make the game intelligent. Also the game clock is currently in the Finance Manager which is a little odd so maybe I’ll fix that later.

But, I have used actions & delegates to optimise the game handling of the ridiculous amount of scripts for each building that will be running once the cities become larger and larger. Created a UI manager to update the script, which uses the above actions & delegates from the script manager. Created a Finance Manager which led me to have to recode GridManager for monetary support, but that was honestly less painful than it sounds.

I also spent a considerable amount of time debugging last post’s Zoning. The code has multiple ways of producing a building and this caused me to have to go back and go through all of the code line by line to figure all the pathways out and debug it eventually.

And yes, as promised I made it cost money to zone. Every action, such as creating a road and destroying them cost money and using my amazing research skills of using the first google result, destroying a road costs double placing a road!

I think I should sleep. See you soon!

Did you know it costs more to remove a road than create one?! Strange…

Finally have a working economy in the game now!

It’s VERY unbalanced. You WILL become very rich. And residential is currently useless, and everything just has a set employee count for now. But that will change soon, and we’ll make the game intelligent. Also the game clock is currently in the Finance Manager which is a little odd so maybe I’ll fix that later.

But, I have used actions & delegates to optimise the game handling of the ridiculous amount of scripts for each building that will be running once the cities become larger and larger. Created a UI manager to update the script, which uses the above actions & delegates from the script manager. Created a Finance Manager which led me to have to recode GridManager for monetary support, but that was honestly less painful than it sounds.

I also spent a considerable amount of time debugging last post’s Zoning. The code has multiple ways of producing a building and this caused me to have to go back and go through all of the code line by line to figure all the pathways out and debug it eventually.

And yes, as promised I made it cost money to zone. Every action, such as creating a road and destroying them cost money and using my amazing research skills of using the first google result, destroying a road costs double placing a road!

I think I should sleep. See you soon!

Replying to @sol4r_on_hackclub

1
353
Open comments for this post
Reposted by @sol4r_on_hackclub

2h 24m 51s logged

CITY ZONING!

Annoyed that a massive skyscraper decided to spawn right next to a nice cozy cottage? Not anymore!

You can zone areas by residential, commercial and industrial. There is also a “No Build” zone for areas that you just want to keep clear for now.

This will eventually cost you money, because paperwork is really expensive apparently. (And to keep the game balanced of course).

But there’s no money yet. I think you should like & follow to see how the game’s economy works.

CITY ZONING!

Annoyed that a massive skyscraper decided to spawn right next to a nice cozy cottage? Not anymore!

You can zone areas by residential, commercial and industrial. There is also a “No Build” zone for areas that you just want to keep clear for now.

This will eventually cost you money, because paperwork is really expensive apparently. (And to keep the game balanced of course).

But there’s no money yet. I think you should like & follow to see how the game’s economy works.

Replying to @sol4r_on_hackclub

1
188
Open comments for this post

5h 3m 22s logged

Did you know it costs more to remove a road than create one?! Strange…

Finally have a working economy in the game now!

It’s VERY unbalanced. You WILL become very rich. And residential is currently useless, and everything just has a set employee count for now. But that will change soon, and we’ll make the game intelligent. Also the game clock is currently in the Finance Manager which is a little odd so maybe I’ll fix that later.

But, I have used actions & delegates to optimise the game handling of the ridiculous amount of scripts for each building that will be running once the cities become larger and larger. Created a UI manager to update the script, which uses the above actions & delegates from the script manager. Created a Finance Manager which led me to have to recode GridManager for monetary support, but that was honestly less painful than it sounds.

I also spent a considerable amount of time debugging last post’s Zoning. The code has multiple ways of producing a building and this caused me to have to go back and go through all of the code line by line to figure all the pathways out and debug it eventually.

And yes, as promised I made it cost money to zone. Every action, such as creating a road and destroying them cost money and using my amazing research skills of using the first google result, destroying a road costs double placing a road!

I think I should sleep. See you soon!

Did you know it costs more to remove a road than create one?! Strange…

Finally have a working economy in the game now!

It’s VERY unbalanced. You WILL become very rich. And residential is currently useless, and everything just has a set employee count for now. But that will change soon, and we’ll make the game intelligent. Also the game clock is currently in the Finance Manager which is a little odd so maybe I’ll fix that later.

But, I have used actions & delegates to optimise the game handling of the ridiculous amount of scripts for each building that will be running once the cities become larger and larger. Created a UI manager to update the script, which uses the above actions & delegates from the script manager. Created a Finance Manager which led me to have to recode GridManager for monetary support, but that was honestly less painful than it sounds.

I also spent a considerable amount of time debugging last post’s Zoning. The code has multiple ways of producing a building and this caused me to have to go back and go through all of the code line by line to figure all the pathways out and debug it eventually.

And yes, as promised I made it cost money to zone. Every action, such as creating a road and destroying them cost money and using my amazing research skills of using the first google result, destroying a road costs double placing a road!

I think I should sleep. See you soon!

Replying to @sol4r_on_hackclub

1
353
Open comments for this post

2h 24m 51s logged

CITY ZONING!

Annoyed that a massive skyscraper decided to spawn right next to a nice cozy cottage? Not anymore!

You can zone areas by residential, commercial and industrial. There is also a “No Build” zone for areas that you just want to keep clear for now.

This will eventually cost you money, because paperwork is really expensive apparently. (And to keep the game balanced of course).

But there’s no money yet. I think you should like & follow to see how the game’s economy works.

CITY ZONING!

Annoyed that a massive skyscraper decided to spawn right next to a nice cozy cottage? Not anymore!

You can zone areas by residential, commercial and industrial. There is also a “No Build” zone for areas that you just want to keep clear for now.

This will eventually cost you money, because paperwork is really expensive apparently. (And to keep the game balanced of course).

But there’s no money yet. I think you should like & follow to see how the game’s economy works.

Replying to @sol4r_on_hackclub

1
188
Open comments for this post
Reposted by @sol4r_on_hackclub

2h 31m 36s logged

Pocket City Dev 5

The terrain was a little bland, so I decided to spice it up with nature.

To fill the grid up, I decided to implement trees. Created a few basic tree grid varieties and implemented it into GridManager.cs. However, this forced me to spawn all of the trees in the Start() function which causes a longer loading time, CPU spike and worst of all it makes it so that after the initial radius no more trees spawn. Increasing the radius exponentially increases the amount of trees being added (because each ring has more grid sections to cover). So i had to pivot.

I created a new Chunk Manager, split the main grid up into 16x16 chunks, and checked the player camera and only loaded the surrounding chunks. This makes trees spawn around the player continuously. However, this would become laggy as it would happen every frame.

Two ways I decided to prevent this:

  1. Check if the player had changed chunks. If it’s still the same chunk, early return to skip the entire code process.
  2. Check if the nature has already been loaded. Only load if not loaded. This obviously saves on time complexity, and allows me to have the freedom of creating varying tree density. It also makes it so that the trees do not regenerate constantly.

And that completes the visuals for now. Probably will add more foliage and other variety in the future, but for now this will suffice.

Finally, this has a severe performance penalty. To cater for lower-end devices, I added a toggle which will later come to a settings menu for ~4x the performance without impacting gameplay. Optimisations, such as chunkloading and LODs will be added later to increase the performance with trees, but that will come after the core game is finalised.

Pocket City Dev 5

The terrain was a little bland, so I decided to spice it up with nature.

To fill the grid up, I decided to implement trees. Created a few basic tree grid varieties and implemented it into GridManager.cs. However, this forced me to spawn all of the trees in the Start() function which causes a longer loading time, CPU spike and worst of all it makes it so that after the initial radius no more trees spawn. Increasing the radius exponentially increases the amount of trees being added (because each ring has more grid sections to cover). So i had to pivot.

I created a new Chunk Manager, split the main grid up into 16x16 chunks, and checked the player camera and only loaded the surrounding chunks. This makes trees spawn around the player continuously. However, this would become laggy as it would happen every frame.

Two ways I decided to prevent this:

  1. Check if the player had changed chunks. If it’s still the same chunk, early return to skip the entire code process.
  2. Check if the nature has already been loaded. Only load if not loaded. This obviously saves on time complexity, and allows me to have the freedom of creating varying tree density. It also makes it so that the trees do not regenerate constantly.

And that completes the visuals for now. Probably will add more foliage and other variety in the future, but for now this will suffice.

Finally, this has a severe performance penalty. To cater for lower-end devices, I added a toggle which will later come to a settings menu for ~4x the performance without impacting gameplay. Optimisations, such as chunkloading and LODs will be added later to increase the performance with trees, but that will come after the core game is finalised.

Replying to @sol4r_on_hackclub

1
31
Open comments for this post

2h 31m 36s logged

Pocket City Dev 5

The terrain was a little bland, so I decided to spice it up with nature.

To fill the grid up, I decided to implement trees. Created a few basic tree grid varieties and implemented it into GridManager.cs. However, this forced me to spawn all of the trees in the Start() function which causes a longer loading time, CPU spike and worst of all it makes it so that after the initial radius no more trees spawn. Increasing the radius exponentially increases the amount of trees being added (because each ring has more grid sections to cover). So i had to pivot.

I created a new Chunk Manager, split the main grid up into 16x16 chunks, and checked the player camera and only loaded the surrounding chunks. This makes trees spawn around the player continuously. However, this would become laggy as it would happen every frame.

Two ways I decided to prevent this:

  1. Check if the player had changed chunks. If it’s still the same chunk, early return to skip the entire code process.
  2. Check if the nature has already been loaded. Only load if not loaded. This obviously saves on time complexity, and allows me to have the freedom of creating varying tree density. It also makes it so that the trees do not regenerate constantly.

And that completes the visuals for now. Probably will add more foliage and other variety in the future, but for now this will suffice.

Finally, this has a severe performance penalty. To cater for lower-end devices, I added a toggle which will later come to a settings menu for ~4x the performance without impacting gameplay. Optimisations, such as chunkloading and LODs will be added later to increase the performance with trees, but that will come after the core game is finalised.

Pocket City Dev 5

The terrain was a little bland, so I decided to spice it up with nature.

To fill the grid up, I decided to implement trees. Created a few basic tree grid varieties and implemented it into GridManager.cs. However, this forced me to spawn all of the trees in the Start() function which causes a longer loading time, CPU spike and worst of all it makes it so that after the initial radius no more trees spawn. Increasing the radius exponentially increases the amount of trees being added (because each ring has more grid sections to cover). So i had to pivot.

I created a new Chunk Manager, split the main grid up into 16x16 chunks, and checked the player camera and only loaded the surrounding chunks. This makes trees spawn around the player continuously. However, this would become laggy as it would happen every frame.

Two ways I decided to prevent this:

  1. Check if the player had changed chunks. If it’s still the same chunk, early return to skip the entire code process.
  2. Check if the nature has already been loaded. Only load if not loaded. This obviously saves on time complexity, and allows me to have the freedom of creating varying tree density. It also makes it so that the trees do not regenerate constantly.

And that completes the visuals for now. Probably will add more foliage and other variety in the future, but for now this will suffice.

Finally, this has a severe performance penalty. To cater for lower-end devices, I added a toggle which will later come to a settings menu for ~4x the performance without impacting gameplay. Optimisations, such as chunkloading and LODs will be added later to increase the performance with trees, but that will come after the core game is finalised.

Replying to @sol4r_on_hackclub

1
31
Loading more…

Followers

Loading…