Git Product home page Git Product logo

tobspr-games / shapez.io Goto Github PK

View Code? Open in Web Editor NEW
6.1K 78.0 1.2K 644.18 MB

shapez is an open source base building game on Steam inspired by factorio!

Home Page: https://get.shapez.io/gh

License: GNU General Public License v3.0

JavaScript 88.83% HTML 0.55% Python 0.13% SCSS 10.20% Batchfile 0.02% Dockerfile 0.03% Shell 0.01% CSS 0.23%
game game-2d javascript-game game-development gamedev games

shapez.io's Introduction

NEW: Shapez 2!

We are currently working on a successor to shapez, with 3D Graphics, Exploration, Layers, Mass transport, New Shape Mechanics, Research and a lot more! Be sure to check it out:

shapez 2 Announcement

shapez

shapez Logo
This is the source code for shapez, an open source base building game inspired by Factorio. Your goal is to produce shapes by cutting, rotating, merging and painting parts of shapes.

Reporting issues, suggestions, feedback, bugs

  1. Ask in #bugs / #feedback / #questions on the Official Discord if you are not entirely sure if it's a bug
  2. Check out the trello board: https://trello.com/b/ISQncpJP/shapezio
  3. See if it's already there - If so, vote for it, done. I will see it. (You have to be signed in on trello)
  4. If not, check if it's already reported here: https://github.com/tobspr-games/shapez.io/issues
  5. If not, file a new issue here: https://github.com/tobspr-games/shapez.io/issues/new
  6. I will then have a look (This can take days or weeks) and convert it to trello, and comment with the link. You can then vote there ;)

Building

  • Make sure ffmpeg is on your path
  • Install Node.js 16 and Yarn
  • Install Java (required for texture packer)
  • Run yarn in the root folder
  • cd into gulp folder
  • Run yarn and then yarn gulp - it should now open in your browser

Notice: This will produce a debug build with several debugging flags enabled. If you want to disable them, modify src/js/core/config.js.

Creating Mods

Mods can be found here. The documentation for creating mods can be found here, including a bunch of sample mods.

Build Online with one-click setup

You can use Gitpod (an Online Open Source VS Code-like IDE which is free for Open Source) for working on issues and making PRs to this project. With a single click it will start a workspace and automatically:

  • clone the shapez.io repo.
  • install all of the dependencies.
  • start gulp in gulp/ directory.

Open in Gitpod

Helping translate

Please checkout the Translations readme.

Contributing

I will only accept pull requests which add a benefit to a large portion of the player base. If the feature is useful but only to a fraction of players, or is controversial, I recommend making a mod instead.

If you want to add a new feature or in generally contribute I recommend to get in touch on Discord in advance, which largely increases the chance of the PR to get merged:

discord logo

Code

The game is based on a custom engine which itself is based on the YORG.io 3 game engine (Actually it shares almost the same core). The code within the engine is relatively clean with some code for the actual game on top being hacky.

This project is based on ES5 (If I would develop it again, I would definitely use TypeScript). Some ES2015 features are used but most of them are too slow, especially when polyfilled. For example, Array.prototype.forEach is only used within non-critical loops since its slower than a plain for loop.

Assets

You can find most assets here.

All assets will be automatically rebuilt into the atlas once changed (Thanks to dengr1065!)

shapez Screenshot


Check out our other games!

tobspr Games

shapez.io's People

Contributors

astavie avatar baxxster avatar bjornstar avatar demivan avatar denapo avatar dengr1065 avatar derfeldspatz avatar dimava avatar dj1tjoo avatar emeraldblock avatar enderdoom77 avatar gumball73 avatar hexagonhexagon avatar isaisstillalive avatar jaysc avatar killgaru avatar leopoldtal avatar magos avatar mattgibney avatar mini-bomba avatar omemi-test avatar pedrorajao avatar pepperoach avatar pequenolyo avatar phlosioneer avatar revoscz avatar ryoncai avatar sense101 avatar tobspr avatar xsparfuchs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shapez.io's Issues

I'm banned

Also, add a label for Discord server issue and set it to this!

Bug: Shapes increasing in size after a stack and cut

Bug

I have listed two problems here about shapes changing size

Stacker

When you stack a shape that includes a small shape it forces the shape to resize back into the bigger version as seen in this example. This impacts being able to finished level 18.

Example

The result:

image

The expected result (with some help from paint):
image

Cutter

I don't know if this is related or a new bug but I came across first and thought might have been a feature.

When you cut a small shape so it is on it's own it returns to the original size.

Second Examples

image

image

Waypoints: zoom level is reset or ignored

There's two bugs here:

  1. waypoints aren't restoring the correct zoom
  2. when creating a waypoint, the game zooms in all the way

Issue

  1. Set the camera's zoom level to something that isn't completely zoomed in
  2. Create a waypoint with M
  3. Observe that the camera zoom level has changed to the most zoomed-in when creating a waypoint
  4. Zoom out
  5. Activate a marker by clicking on it
  6. Observe that it goes to the waypoint but is fully zoomed in again, ignoring the zoom level set for the waypoint

Possible solution

I think restoring the zoom problem is probably because of the Math_max, seems like that should be Math_min? It works for me with Math_min, anyway.

diff --git a/src/js/game/hud/parts/waypoints.js b/src/js/game/hud/parts/waypoints.js
index 746145b..485a53c 100644
--- a/src/js/game/hud/parts/waypoints.js
+++ b/src/js/game/hud/parts/waypoints.js
@@ -158,7 +158,7 @@ export class HUDWaypoints extends BaseHUDPart {
             this.waypoints.push({
                 label: markerNameInput.getValue(),
                 center: { x: center.x, y: center.y },
-                zoomLevel: Math_max(this.root.camera.zoomLevel, globalConfig.mapChunkOverviewMinZoom + 0.05),
+                zoomLevel: Math_min(this.root.camera.zoomLevel, globalConfig.mapChunkOverviewMinZoom + 0.05),
                 deletable: true,
             });
             this.waypoints.sort((a, b) => a.label.padStart(20, "0").localeCompare(b.label.padStart(20, "0")));

Chinese Localization

Hello! Lovely game indeed! Bought at itch.io, but miss the steam key you send out yesterday. I'm more than happy to provide Chinese Localization if you are interested.

Enhancement: "Eyedropper" tool

In Factorio, if I mouse over an existing entity, and press the "Q" key, my cursor now changes to allow me to place a copy of the existing entity.

I see that you already use "Q" to de-select an active "tool" (I have the multi-select option set). I suggest that if no tool is selected, "Q" will automatically select the tool the mouse cursor is over.

Feature request: Upgrade mechanic that consumes shapes

I like the mechanic whereby blueprints consume shapes. This mechanic could also be used to upgrade buildings to their next available level (e.g. short bridges to long bridges), possibly consuming a quantity of shapes automatically to upgrade the factory and/or using the selection mechanic to manually upgrade. Perhaps it could also be used to apply tier upgrades to existing structures - which would encourage the player to provide a lot of upgrade shapes to keep all structures at maximum efficiency.

Improvement: Clicking an activated pin in the "upgrades" dialog should unpin the shape

Improvement: Clicking an activated pin in the "upgrades" dialog should unpin the shape.
Right now, you can only unpin by clicking on the shape where it is now displayed in the in the main UI.

Also that little pin could use a tool tip explaining what it does. It took me a moment to figure out.
If I didn't read a help text carefully that already explained it, sorry :) - still think tool tip would help.

Suggestion: Allow zoom for the "goal" items

On the left side of the screen where the "goal" items are... Sometimes, it's hard to make out the details to see exactly what the parts the item is constructed from.

Please allow a way to zoom in to see the items in more detail.

Quick hub centering

Using space was nice to center on hub, removing this is intentional or is it temporary?

Colorblind issues

The color mixing is extremely difficult if you (like me) are very colorblind. Might I suggest a colorblind mode or a color mixing legend for comparison and evaluation?

Blueprints: pasting doesn't preserve belt shape

First of all, blueprints are nice ๐Ÿ‘.

When pasting them, though, it looks like the system is still trying to smart-merge the belts. Here's a picture, left is the copy, middle is the blueprint, right is what happens when it's pasted. The arrow points to where the belt was automatically changed for the smart directions.

Pasted_Image_5_29_20__6_32_AM

Suggestion: Change LMB to middle mouse button

You can't move screen with mouse when holding an item because it is placed instead.
Changing LMB to clicking and draging mousewheel would solve this problem
(like on draw.io / diagrams.net)

Move camera when pushing cursor to edges of the screen.

Like in any RTS games moving cursor to an edge of the window could move the screen. It would also make selecting items easier (for reference selecting units in Warcraft III or some Age of Empires). I understand that this would require changing whole selection system because now it's tied to screen coordinates but I think that this would improve overall experience.

Atlas is not on repository - unable to build

Running gulp task fails, because there's no "atlas" folder. Creating that folder makes build work properly, but the game has almost no textures. As I understand, ready atlas is supposed to be committed to this repository, but it isn't.

Feature Request: Fixed axis for belts

When zooming out I would like to be able to draw the belts in a straight line over a huge distance. Maybe Holding down a key when dragging so that it stays on the same axis to Prevent "curvy lines".

TSconfig?

Why have tsconfig if it's all in js?

Bug: Changing Interface Scale option resets "pinned" "goals"

Steps to replicate:

  • Enter the "Upgrades" menu
  • Press the "pin" icon next to a couple of "goals"
  • Note that the pinned goals are now present on the left side of the game
  • Change the interface scale
  • Game refreshes, all goals (except the level-specific one) are now unpinned.

Bug: play.sh script doesn't work correctly on Linux

This is because the wrong line endings are used on Linux. Line endings on Linux are '\n' rather than '\r\n', causing the following error when I run it normally on Ubuntu:
image
I manually changed the line ending type from '\r\n' to just '\n' and it worked just fine.

Feature Request: Blueprints

I would like to copy and paste a small part of the factory several times. I would like to select an area with multiple Buildings in it and then duplicate this to a new location

Issue: Can't distinguish between colors

For color-blind people, it is very hard to separate yellow and green in the game. Select a more diverse color palette so people with various types of color blindness will be able to play

Feature request: Map image export

I really like to see the designs my buildings make when I zoom out, and I'd like to be able to share that with others too. Taking a screenshot while zoomed out works, but only for an area small enough to fit completely in the window. So it would be nice to have some way to export the entire area that the user has built on as an image (PNG, etc.) like it appears in the zoomed out view except without all of the interface elements.

Production waves, causing visible gaps on a fully saturated belt

I'm playing the web version. Here is my savefile (it's zipped because GitHub otherwise doesn't allow uploading it): bug.zip
It happens around 6 chunks north-north-east from the hub (I haven't bought the game yet so I can't place marker).

My series of stackers produces in kind of waves - the number of items in the storage on output of the stacker array increases for some time, and then a gap in belt appears, and the storage returns back to the number of items it started at. But it originally made me think that it wasn't producing a full belt of shapez.

Screenshot with the gap:
Screenshot from 2020-06-02 17-28-55

The storage on input is stable on 167 items.

Linux build for Steam

I grabbed the Steam version of the game but was slightly disappointed to see that you don't distribute a native Electron binary for Linux. For some reason the game doesn't want to run through wine/proton (it starts but no window appears) and having native support for Linux hopefully shouldn't be too difficult.

While here I'd also like to mention that I love the simple yet highly addictive nature of the game and it being open source makes it even better.

Steam Cloud Win/Linux

Steam Cloud seems to be not working between Windows and Linux.
(So saves from Windows won't show in Linux and otherwise)

Possible improvements to layout on odd aspect ratios

Hi, love the game.

I use 1:1 monitor (Eizo EV2730Q), and noticed this when playing the demo:

Screenshot at 2020-06-13 15-40-25

As you can see there is some overlap in few UI elements, and I feel the bottom toolbar is too big.

Small priority, but I am sure this can be fixes somehow :) People with 4:3 and 3:2 aspect ratio screen probably might experience similar issue to me.

Most of the other screens are fine, albeit on my screen the look comically big:

Screenshot at 2020-06-13 15-40-37
Screenshot at 2020-06-13 15-40-33
Screenshot at 2020-06-13 15-52-20
Screenshot at 2020-06-13 15-52-26
Screenshot at 2020-06-13 15-52-32
Screenshot at 2020-06-13 15-53-40
Screenshot at 2020-06-13 15-53-48

Button to advance to next level is cut off

Sometimes, the button to advance to the next level is cut off. I was not able to advance from level 1 to level 2 without refreshing the page (that bypassed the 'next level' screen). I didn't get a screenshot of that one, but here's another one showing the issue....

image

I do have the interface scale to "Huge" (so I can see the "goal" items on the left side of the screen better.)

Level Complete message is skipped if you pass multiple levels

If you fulfill the goals for multiple levels at the same time, only the Level Complete dialog for the last goal you fulfilled will be shown. For example if you collect enough squares to complete level 3 before you have enough semicircles to complete level 2, it will completely skip the level two complete message and and the message describing upgrades. As you can imagine, this can cause issues particularly when this happen in the lower levels where these messages are the only way you inform users about new buildings or mechanics.

Tested on version 1.1.11

Waypoints allows for duplicate names

I accidentally named something "blue side" twice, which is possible in the game. Seems like it could do a uniqueness check. Something like this, though the lack of validation feedback on the forms could be improved to display what the actual validation failure is.

diff --git a/src/js/game/hud/parts/waypoints.js b/src/js/game/hud/parts/waypoints.js
index 746145b..ffcc8bf 100644
--- a/src/js/game/hud/parts/waypoints.js
+++ b/src/js/game/hud/parts/waypoints.js
@@ -140,7 +140,7 @@ export class HUDWaypoints extends BaseHUDPart {
             id: "markerName",
             label: null,
             placeholder: "",
-            validator: val => val.length > 0 && val.length < 15,
+            validator: val => val.length > 0 && val.length < 15 && this.waypoints.every((wp) => wp.label !== val),
         });
 
         const dialog = new DialogWithForm({

Request: clickable variants selection

At the moment you can only cycle variants by pressing "T".
It would be great if you could also just click on them to activate the clicked variant.
(Right now, they are click-through and you place the currently selected variant under the button)

Better icon

At the moment the game's icon is hard to see on Win10 taskbar:
image

Having slightly colored icon (pastel colors?) or some border set could help

Tunnel Connection Graphics

When replacing a tunnel entrance for a preexisting tunnel exit, the green line indicating a connection between them will not appear.

Feature request: Logic gate

I'd like a component that could swap two lanes if an input matches.

I think it should be a 2 input, 3 output shape. On the input lanes A and B:

  • A - item template
  • B - test lane

Outputs:

  • A - item template discard
  • B - match lane
  • C - no match lane

I think there should be 4 variants:

  1. color matcher: accepts colors on both input lanes; outputs to match lane if colors match
  2. shape matcher: color only; if input is a color, match if shape has that color; otherwise match all available quads on the template
  3. shape matcher: shape only; shape input only; match all available quads on template
  4. shape matcher: color and shape; shape input only; match all available quads on template

It would hold both inputs until there was one in each and room on all output lanes, perform the match and then output.


Reasoning: endgame right now is pretty weak. After you supply the last designed shape it gives you a random one. I think it would be nice if you built towards a programmable machine that you input a small loop of item templates that are production prototypes for a much larger build line thing.

Mac support

Hi Tobias,
First off, really cool stuff!

Secondly, I saw the Linux thread, but didn't want to re-open that one for this (I don't know which you prefer but this seams more clean)

Is it difficult to create a mac version for steam? I can help out potentially (Frontend and iOS developer)
I checked in on discord and saw that there is also other demand for this. So maybe we can put our head together to setup the pipe to generate mac builds too. So I can actually play it :D

Allow clicking to clear selection

When you have buildings selected with ctrl+drag, you should be able to unselect by single clicking somewhere in addition to pressing escape. Of course click+dragging should still move the map though.

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.