Code Monkey home page Code Monkey logo

unearthed's Introduction

Unearthed - a simple 2D block digging game

Play It

https://unearthedgame.net/

Getting Started

  • Check out code
  • Run npm i
  • Copy local.properties.json.template to local.properties.json
  • Update local.properties.json to either add your password or set it to a blank value (to disable network)
  • Run npm start
  • Connect to http://localhost:20000

More Info

Contacts

Development Guidelines

  • Keep it Simple Smartie
  • Make the change you need to make, don't refactor the world
  • Assume its that way for a reason. No one that works on this project is stupid :)
  • Ask, and ask again!

Screenshots

image

Thanks

unearthed's People

Contributors

aglitchman avatar curtastic avatar dmecke avatar kenneynl avatar kevglass avatar laurawebdev 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

Watchers

 avatar  avatar  avatar  avatar

unearthed's Issues

Improve ladder controls

It would be great if the player didn't fall when on a ladder but could move up or down, and when not pressing any controls would remain at the same position. This would make it easier to build structures while on a ladder in the air.

Requirements:
This would require changing the left/right controls to an actual d-pad or joystick on mobile.

The game is unplayable in a non-English layout

If the player starts the game for the first time with a non-English layout enabled (chinese, russian etc), the character will not be controlled with WASD at all, because the key field will come with non-English character codes: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key

The KeyboardEvent interface's key read-only property returns the value of the key pressed by the user, taking into consideration the state of modifier keys such as Shift -->as well as the keyboard locale and layout<--.

So, instead of the key field, the game should read the code field.

P.S. I know it's possible to reassign the keys, but it's too hardcore for web games. The game should work immediately and for everyone, without the need to reassign keys.

(For this reason I mentioned KeyboardLayout in a previous issue with which you can get the physical location of the W, so even AZERTY players don't have to reassign keys.)

** Environment Details **

Browser: Chrome 114
Platform/OS: Windows 10/11
Game Version: Version 84

Server-Portals

Not sure yet if / how this could be implemented technically. But I imagine being able to place a portal into the world that is connected to another player's server. The portal should only be active if the other server is online. If it is, using it will load the target server.

(I intentionally named it "Server-Portals" as portals on a single server in some way might be nice, too).

Mobile: opening the inventory leads to a pressed tap

Steps to reproduce:

  • Tap on a free slot
  • Tap on any nearby block
  • Open the inventory
  • Player will dig in the background
Screen_Recording_20230716_130905_Chrome.mp4

For example, if you tap on the block under your feet, you can dig to the bottom in idle mode.

** Environment Details **

Browser: Chrome 114
Platform/OS: Android 13
Game Version: latest

Improve platform controls

When pressing down the platform would fall through the platform they're currently standing on, allowing them to move down while on platforms.

Requirements:
This would require changing the left/right controls to an actual d-pad or joystick on mobile.

Wiring Nodes

Suggested in the Discord, but raising here for clarity and sake of feature tracking!

Wiring!

Being able to add input/output "signals" to various blocks and/or entities, such that they could be connected and used to make an in-game logic system would be a very welcome addition for modders and in-game creations.

The idea is that you would have a "wiring mode" of some sort, that when enabled displays connection nodes on certain blocks (and some entities, e.g. moving platforms at some point?) as configured according to the mod that added that item.

There'd be three types of connection node that you, as the player, can then connect up on different blocks and/or entities to create pseudo-circuits and form a logic system with;

  • OUTPUT NODES which the block controls, each transmits a signal to any input nodes connected by wires,
  • INPUT NODES which outputs can be wired to, that when sent a signal will trigger the block/entity to "update" its state based on all of its inputs,
  • ROUTE NODES which simply allow the player to direct the wires they place more precisely, though these could in theory be placed anywhere so would not be "attached" to a block per se, more just act like a stored position in the world space that wires may be visually "routed" through

The following examples, courtesy of Starbound, showcase a similar system whereby the player has a "wire tool" that they can equip to show and connect wires with, from objects in the world that have inputs and outputs;
image-1 image-2
In the image on the left - the player does not have their wire tool equipped, and so can only see the two buttons, the flip-flop logic gate object, and the red/green on-off indicator light at the top.
In the image on the right - the player equips their wire tool, therefore being able to see the output nodes on the two buttons, the wires connecting each one to the flip-flop switch's input nodes, the output node of the flip-flop and the wire connecting that in turn to the input node on the red/green indicator light.

Another set of examples, courtesy of Sebastian Lague's "Digital Logic Sim" application further show how the idea of a node-based graph type system can be expanded to form logic gates and advanced "chips" to make all kinds of virtual digital systems in this YouTube series;
https://youtube.com/playlist?list=PLFt_AvWsXl0dPhqVsKt1Ni_46ARyiCGSq
This example also shows the wires themselves visually indicating the value of the signal they last transmitted, turning a bright colour for an "on" state and returning to a dark colour for the "off" state.

Whether this system is implemented overall as a mod that other mods may require as a dependency, or if this is implemented as a key feature of the game's "engine" would be up for debate, but I think this could easily be a very useful addition to a community-driven creative game.

If implemented as a mod, it could be the case that when not included, other mods that rely on it will just fail to create wires and nodes to use - this could also allow the system to be replaced by another mod that, making use of the same connection logic, could expand upon the wire logic and transmit virtual power information (voltage, current, etc.) via the wires as well, allowing for more complex and "realistic" systems.

Equally, if the concepts of these types of "nodes" and "wires" are added to the engine itself, that could then be utilised by mods to set functionality of nodes and wires independently of one another; blocks & entities they or other mods add could send and recieve virtual "data packets" via wires, whether the internal logic of a given object specifically handles or interacts with said data packet would be irrelevant.

WebGL Renderer

Getting like 10fps on my laptop. I'll write a renderer optimized for this project.

Versioning of the modding API

As the API might (will!) change over time, it might be a good idea to version it. This will make it easier for us to output deprecations or completely disable mods when they use an outdated API.

Don't allow to put blocks near the head

In short, it would be great to not allow players to put a block that causes the mob to get stuck.

It's pretty frustrating because most of the time you do it by accident since the game allows you to do it.

Screen_Recording_20230716_160216_Chrome.mp4

New character sprites

I've created 4 new character sprites, however since the sprite sizes changed (and more characters were added) it's a bit hard for me to integrate these myself. Would be great if someone can help out and integrate them into the project!

unearthed-characters-v2.zip

No Edit Server

I'd like the option to make a server where nobody else can dig or place blocks. (unless I make them a mod?) Then I could set up a platformer level where everyone else has to try to jump to the end without falling into lava. I could share a link to randos on twitter who can't mess up my level. Like Mario Maker. Also, springs.

Lighting

Simple vertex based overlay lighting generated as a half size light map. This could also replace the discovery art though I like the current look - so maybe not.

Add torches at the same time - not sure how we'll add a new layer for the torches - might want to evaluate an item array with position rather than another full array.

Positional sound

If you play with a friend, you can hear him doing something from anywhere in the game world.

It would be great if the game had positional sound support, i.e. sounds fade out depending on the distance to the listener (current player).

TNT block timers still ticking when block destroyed

** Environment Details **

Browser: all
Platform/OS: all
Game Version: 48

When a TNT block is destroyed by another TNT block (most likely also when mined manually) before the timer triggers, it is removed, but the timer is still there.
Instead the timer has to be removed together with the block or the timer needs to be triggered immediately.

Adjusting "generateWorld(...)" for Mods

Having every mod only be able to override the entire world generation seems very limiting, plus it would make sense if the engine supported the use of "seeds" for world generation in case you want to introduce deterministic randomness to what gets generated.

If you want to have mods add things to the world (e.g. new ore veins underground, special structures, etc.) but don't want them to override the entire world generation to do so, they should be able to either "additively" modify the map at world generation time or at the very least post some kind of message to the default world generation that adds what they need to the world organically.

Making the generateWorld(...) function be an additive process, say by passing the existing GameContext object to each Mod in turn that has an implementation of the function, would facilitate this as you could then - for example - replace specific blocks at given locations, edit the existing world structure, etc.

Alternatively, adding a new function called something like afterWorldGenerated(...) that could be used in this way would allow for both behaviours, so that one Mod could override the default world generation and other mods could add to it after the fact, before the world is declared "ready" by the server.

I would also suggest that for both (or either) of these solutions, a "seed" parameter be added to the function which takes an integer, set by the server either at random or as specified by the host before world creation, that can then be used as a basis for random generation. If this already exists, I couldn't find it in the modding API but please let me know how I could access this if it does! ๐Ÿ˜„

Stretched background

Currently the background image (clouds.png) is stretched across the screen, would it be possible to tile this or atleast make sure the aspect ratio is retained from the original image? Possibly (as a new feature) would also be great to support some parallax scrolling by combining two background images.

Network players use their resources too fast

If you play the game as a client (not as a server), there is a bug with decreasing items from the inventory. In the video you can see that I had 7 blocks of dirt, and I managed to put only 2 ->

Screen_Recording_20230712_154904_Chrome.mp4

** Environment Details **

Browser: Chrome 114
Platform/OS: Windows 11
Game Version: 89

Servers should have a name

In addition to the code a server should have a name that is shown to the users above the portal block.

Composite Mod Packages

The possibility to package multiple mods into a single zip file with a manifest describing the contents. This way it would be easier to package multiple small mods that work together well. For example a "platformer composite mod package" with mods like bounce blocks, wall climbing mod etc.

Sort out the settings menus

Need to sort out:

  • Fonts - replace with Kenney font
  • Sounds - buttons should click
  • Input boxes, style to match
  • Art generally?

Should be able to collect items from whats mined.

Do we go full on non-creative mode, you have to harvest everything you use? If so, we need a way to regenerate wood - add seeds as a drop from the leaves. Plant the seed and grow new trees (can only plant in dirt)

Recipes

Recipes would be a tab in the inventory panel. It would have a list of recipes on the left that can be selected. On the right hand side the selected recipe details would be shown:

Name
Description
Ingredients - The other items required and their counts needed to complete the recipe
Required World Block - if a block is required to create the recipe (i.e. furnace)

Recipes must be addable and removeable from mods. Probably also need a "onRecipeCreated" callback on the Mod interface.

Mob Health

Mobs should have health. Probably just a current and a max.

Mods should be able to cause damage or heal through a GameContext interface call - changeMobHealth(mob, amount);

Mods should be notified when a mob is damage - onMobDamaaged(game, mob, amount, attacker?)

Mods should be notified when mobs intersect - onMobsTouched(game, mobA, mobB);

Need to think what happens with death?

Resetting map in the game hangs the game for some time

It seems that resetting the world and generating it while playing the game sends all changes to the network, even if you're playing alone, and it hangs the game for 2-5 seconds depending on the speed of your broadband.

BTW Resetting the map in the main menu is instant.

** Environment Details **

Browser: Chrome 114
Platform/OS: Any
Game Version: latest

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.