Coder Social home page Coder Social logo

endymc / city-simulator Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 365 KB

My thought is to make something like Stonehearth, even though I've never played the game at all

Home Page: https://endymc.github.io/City-Simulator/

HTML 0.93% CSS 0.42% JavaScript 98.66%
city-builder-game game

city-simulator's People

Contributors

endymc avatar

Watchers

 avatar

city-simulator's Issues

UI

  • Shop
  • Show amount of residents.
  • Show some sort of currency and other important resources. Probably show these and the amount of residents at the top of the screen, with a different color for each material to differentiate more easily. The design should include the amount of that resource you have stockpiled, then a colored background with a lighter version of that color as a thick border, there should also be a picture showing what kind of resource it is.

Something like this:
bild

Create chunks

Assign blocks to chunks so that it isn't needed to loop over every single block and just chunks, if the chunk matches, then it can loop over it too. The chunksize can be either 2^n blocks and n is everything between log(64)/log(2) and 1. Or it can be a static size of something like 8.

FPS inconsistent

There's something weird going on when updating the frames. Even though the whole requestAnimationFrame callback takes 7ms - 8ms the game is sometimes only updated 30 or 40 times per second. This is mainly on Firefox, Chrome seems to be more stable and holds 60fps with the same frametime.

Firefox issues...

No idea why, but whenever I have this website open in firefox, it starts messing with and corrupting all of the other pages I have open.

  • There are white/black squares in the middle of pages, mostly on stackoverflow
  • The search bar and all the suggestions are blank
  • On MDN it changed the opacity of the upper container so that the text behind was visible.

The usage of CPU, RAM and GPU were below normal and it worked fine in Chrome.

Monsters

  • Goblins; Small but agile
  • Orcs; Large and tanky
  • Bandits; Stronger than goblins, some are as strong as orcs
  • Loch ness; Strong monster which roams out at sea, if you're unlucky enough, one of the fishing boats can fish this up and anger it.
  • Stronger monsters

Buildings

  • Docks; Used to deploy/receive merchant/fishing boats
  • Bridges; Used to travel across water
  • Houses; Used as sleeping quarters
  • Forges; Used by the blacksmiths to forge weapons and armour
  • Watchtowers; Used to spot monsters/bandits from further away. Could also be used which bows/crossbows to gain an advantage against the enemy
  • Walls; Used to defend from monsters and bandits
  • Pathways; Used for faster travel
  • Merchant stands; Places from which the player can purchase and sell resources to/from the outside

Loading screen

When to world is loading, there's currently only some plain text in the middle of the screen. It would be cool if this text was moved to the bottom right corner and instead of x/10 there should be an arc (a circle, maybe a donut) which is filled when the content is loaded. Taking up most of the screen, there should either be some cool image or a render of the world as it is currently, since it probably looks pretty cool when in the process of creating the world.

The design should be something like this:
bild

Resources

  • Wood; Used for houses, bows and crossbows
  • Wheat: Used in a mill to get flour
  • Flour: Used to create bread in a furnace
  • Carrot: Food
  • Potato: Used in a furnace to create baked potatoes
  • Stone; Used for buildings
  • Iron; Used for tools, weapons, shields and armour
  • Gold; Used for trading and monuments
  • Mithril; Used for the same things as iron, just stronger
  • Dragoncloth; Shockabsorbant but flexible material, mainly used for clothes
  • Elderwood; Hardened wood, used for bow and crossbows.

Weapons

  • Blacksmith

    • Swords
    • Knives
    • Spears
    • Battleaxes
  • Fletcher

    • Bows
    • Crossbows
    • Arrows

The current way to store the world only works in firefox

The current way to save the world only seems to work in Firefox, the IndexedDB just doesn't load at all in Chrome. According to the devtools it doesn't exist. Which should result in a fresh database getting created. But nothing happens...

Edge has similar issues to chrome.

Houses

  • GUI for buildings
  • Resources
  • Textures

Boats

Since there's quite alot of water on the map, it should be appropriate to introduce boats in all their forms. Maybe make the terrain generation so that it favors long rivers even more.

  • Longboat | Used by raiders, maybe vikings, to pillage
  • Fishing boat | Used to gain food. Based on the concentration of boats, the number of fish this catches should be lower.
  • Bigger fishing boat | Used to gain even more food.
  • Merchant ships | Needs wider canals to be able to move, same with the larger fishing boat. This boat is used to trade with the outside world.
  • Ships can only connect to the outside if there's a path connecting their current tile and the edge of the map. This path needs to consist only of water. To make this easier, there needs to be some way to terraform the environment. Either through making canals or by blowing holes in mountains.

Alternate way to create the terrain

  1. Create a matrix with 16 nodes, each having a value between 0 and 1.
  2. Stretch this matrix so that there's a gap between each of the absolute values.
  3. Interpolate the gap so that there's a smooth transition

Not sure if this way is better than the current way, but there's a chance that it's faster. If anything, it should make a more diverse terrain, much more mountainous than now.

Ideas

  • Medieval
  • Isometric
  • Houses
  • Pathways
  • Human villagers
  • Trees/Rocks to build houses
  • Professions, different villagers are good at different things (Blacksmith, Guard, Woodcutter, Miner, Trader)
  • Monster attacks
  • Swords/Bows/Spears/Axes and Armour
  • Trade with cities outside the map to get some resources
  • Wagons to transport resources
  • Different kinds of warehouses to store resources

Game won't load

The game won't load, I think this is because the chunk images are so large that it takes up the whole amount of memory available. The fix for this would be to make the images smaller or making the chunks smaller so that there's more amount of chunks which are the same as each other.

Zoom

The game doesn't zoom towards the middle of the screen, it instead zooms towards the top-left corner, as that is it's origin. This isn't intuitive.

Carriage

Similar to boats, this could be used to transport goods and population to and from the map. This type of vehicle should be able to move on land tiles, but should get a speed/security boost when traveling on path tiles. To pass over water, there is a need to build a bridge.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.